summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST3
-rw-r--r--Makefile.in6
-rw-r--r--README.txt2
-rw-r--r--c++/Makefile.in6
-rw-r--r--c++/examples/Makefile.in6
-rw-r--r--c++/src/Makefile.in6
-rw-r--r--c++/test/Makefile.in6
-rw-r--r--config/commence.am1
-rw-r--r--config/lt_vers.am2
-rwxr-xr-xconfigure53
-rw-r--r--configure.in35
-rw-r--r--examples/Makefile.in6
-rw-r--r--examples/h5_extlink.c12
-rw-r--r--examples/h5_ref2reg.c2
-rw-r--r--examples/h5_select.c2
-rw-r--r--fortran/Makefile.in6
-rw-r--r--fortran/examples/Makefile.in6
-rw-r--r--fortran/src/Makefile.in6
-rw-r--r--fortran/test/Makefile.in6
-rw-r--r--fortran/testpar/Makefile.in6
-rwxr-xr-xhl/Makefile.in6
-rw-r--r--hl/c++/Makefile.in6
-rw-r--r--hl/c++/examples/Makefile.in6
-rw-r--r--hl/c++/src/Makefile.in6
-rw-r--r--hl/c++/test/Makefile.in6
-rw-r--r--hl/examples/Makefile.in6
-rw-r--r--hl/fortran/Makefile.in6
-rw-r--r--hl/fortran/examples/Makefile.in6
-rwxr-xr-xhl/fortran/src/H5LTfc.c31
-rw-r--r--hl/fortran/src/Makefile.in6
-rw-r--r--hl/fortran/test/Makefile.in6
-rw-r--r--hl/fortran/test/tstlite.f9076
-rw-r--r--hl/src/H5DS.c3876
-rw-r--r--hl/src/H5IM.c9
-rw-r--r--hl/src/H5PT.c20
-rw-r--r--hl/src/Makefile.in6
-rw-r--r--hl/test/Makefile.in6
-rw-r--r--hl/test/test_ds.c4942
-rw-r--r--hl/tools/Makefile.in6
-rw-r--r--hl/tools/gif2h5/Makefile.in6
-rw-r--r--perform/Makefile.in6
-rw-r--r--perform/mpi-perf.c502
-rw-r--r--perform/perf.c322
-rw-r--r--perform/pio_perf.c1
-rw-r--r--perform/sio_engine.c19
-rw-r--r--perform/sio_perf.c9
-rw-r--r--release_docs/RELEASE.txt28
-rw-r--r--src/H5AC.c4
-rw-r--r--src/H5Aint.c2
-rw-r--r--src/H5B.c44
-rw-r--r--src/H5Bprivate.h4
-rw-r--r--src/H5C.c1384
-rw-r--r--src/H5Cprivate.h22
-rw-r--r--src/H5D.c3
-rw-r--r--src/H5Dio.c10
-rw-r--r--src/H5Dmpio.c29
-rw-r--r--src/H5Edefin.h2
-rw-r--r--src/H5Einit.h10
-rw-r--r--src/H5Epubgen.h4
-rw-r--r--src/H5Eterm.h4
-rw-r--r--src/H5F.c3
-rw-r--r--src/H5FDdirect.c5
-rw-r--r--src/H5FDmpio.c2
-rw-r--r--src/H5FDmpiposix.c2
-rw-r--r--src/H5FDstdio.c2
-rw-r--r--src/H5FDwindows.c2
-rw-r--r--src/H5FLprivate.h16
-rw-r--r--src/H5Fdbg.c35
-rw-r--r--src/H5Fpkg.h3
-rw-r--r--src/H5Fsuper.c3
-rw-r--r--src/H5G.c18
-rw-r--r--src/H5Gdense.c3
-rw-r--r--src/H5Gloc.c12
-rw-r--r--src/H5Gname.c2
-rw-r--r--src/H5Gnode.c4
-rw-r--r--src/H5Gobj.c40
-rw-r--r--src/H5Gpkg.h8
-rw-r--r--src/H5Gprivate.h3
-rw-r--r--src/H5Gstab.c75
-rw-r--r--src/H5HFbtree2.c9
-rw-r--r--src/H5HFhuge.c14
-rw-r--r--src/H5HFsection.c17
-rw-r--r--src/H5HGdbg.c2
-rw-r--r--src/H5Oainfo.c4
-rw-r--r--src/H5Odtype.c63
-rw-r--r--src/H5Omessage.c2
-rw-r--r--src/H5Oprivate.h1
-rw-r--r--src/H5RC.c16
-rw-r--r--src/H5RS.c106
-rw-r--r--src/H5ST.c169
-rw-r--r--src/H5Smpio.c336
-rw-r--r--src/H5Z.c14
-rw-r--r--src/H5err.txt2
-rw-r--r--src/H5private.h5
-rw-r--r--src/H5public.h4
-rw-r--r--src/Makefile.in8
-rw-r--r--test/Makefile.in6
-rw-r--r--test/cache.c6524
-rw-r--r--test/cache_common.c656
-rw-r--r--test/cache_common.h61
-rwxr-xr-xtest/corrupt_stab_msg.h5bin0 -> 2928 bytes
-rw-r--r--test/dsets.c76
-rw-r--r--test/dt_arith.c20
-rw-r--r--test/dtransform.c30
-rw-r--r--test/dtypes.c27
-rw-r--r--test/enum.c25
-rw-r--r--test/error_test.c4
-rw-r--r--test/fillval.c4
-rw-r--r--test/freespace.c13
-rw-r--r--test/getname.c35
-rw-r--r--test/h5test.c27
-rw-r--r--test/links.c69
-rw-r--r--test/mf.c122
-rw-r--r--test/mount.c11
-rw-r--r--test/stab.c123
-rw-r--r--test/tarray.c16
-rw-r--r--test/tmisc.c2
-rw-r--r--test/trefstr.c1
-rw-r--r--test/tselect.c28
-rw-r--r--test/tsohm.c29
-rw-r--r--testpar/Makefile.in6
-rw-r--r--testpar/t_cache.c85
-rw-r--r--testpar/t_chunk_alloc.c17
-rw-r--r--testpar/t_coll_chunk.c101
-rw-r--r--testpar/t_filter_read.c2
-rw-r--r--testpar/t_mdset.c69
-rw-r--r--testpar/t_mpi.c14
-rw-r--r--testpar/t_pflush1.c6
-rw-r--r--testpar/t_pflush2.c3
-rw-r--r--testpar/t_posix_compliant.c7
-rw-r--r--testpar/t_span_tree.c8
-rw-r--r--tools/Makefile.in6
-rw-r--r--tools/h5copy/Makefile.in6
-rw-r--r--tools/h5diff/Makefile.in6
-rw-r--r--tools/h5diff/h5diff_common.c15
-rw-r--r--tools/h5diff/h5diffgentest.c14
-rw-r--r--tools/h5diff/ph5diff_main.c10
-rw-r--r--tools/h5dump/Makefile.in6
-rw-r--r--tools/h5dump/h5dumpgentest.c3
-rwxr-xr-xtools/h5import/Makefile.in6
-rwxr-xr-xtools/h5import/h5import.c4
-rwxr-xr-xtools/h5import/h5importtest.c25
-rwxr-xr-xtools/h5import/h5importtestutil.sh15
-rwxr-xr-xtools/h5import/testfiles/txtin8.conf2
-rw-r--r--tools/h5jam/Makefile.in6
-rw-r--r--tools/h5ls/Makefile.in6
-rw-r--r--tools/h5repack/Makefile.in6
-rw-r--r--tools/h5repack/h5repacktst.c8
-rw-r--r--tools/h5stat/Makefile.in6
-rw-r--r--tools/h5stat/h5stat.c5
-rw-r--r--tools/h5stat/h5stat_gentest.c7
-rw-r--r--tools/lib/Makefile.in6
-rw-r--r--tools/misc/Makefile.in6
-rw-r--r--vms/src/h5pubconf.h6
-rw-r--r--vms/tools/h5stat/make.com39
-rw-r--r--vms/tools/misc/make.com54
-rwxr-xr-xwindows/src/H5pubconf.h6
157 files changed, 13248 insertions, 7893 deletions
diff --git a/MANIFEST b/MANIFEST
index c1c0391..8175269 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -791,6 +791,7 @@
./test/cache_common.c
./test/cache_common.h
./test/cmpd_dset.c
+./test/corrupt_stab_msg.h5
./test/cross_read.c
./test/dangle.c
./test/deflate.h5
@@ -1739,7 +1740,9 @@
./vms/tools/h5jam/make.com
./vms/tools/h5repack/check_h5repack.com
./vms/tools/h5repack/make.com
+./vms/tools/h5stat/make.com
./vms/tools/lib/make.com
+./vms/tools/misc/make.com
./vms/tools/testfiles/tattr-3.ddl
./vms/tools/testfiles/tdset-2.ddl
./vms/tools/testfiles/tgroup-2.ddl
diff --git a/Makefile.in b/Makefile.in
index fd4ed36..9ab76bd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -274,6 +274,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -285,9 +287,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/README.txt b/README.txt
index 6c59bf3..200c970 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.34 currently under development
+HDF5 version 1.9.36 currently under development
==> README.txt <==
Messages to be sent to the list should be sent to "<list>@hdfgroup.org".
diff --git a/c++/Makefile.in b/c++/Makefile.in
index 710f178..8796ca7 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -245,6 +245,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -256,9 +258,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in
index 7b29ccf..63cce0a 100644
--- a/c++/examples/Makefile.in
+++ b/c++/examples/Makefile.in
@@ -239,6 +239,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -250,9 +252,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in
index 377dad7..9d50223 100644
--- a/c++/src/Makefile.in
+++ b/c++/src/Makefile.in
@@ -275,6 +275,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -286,9 +288,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index d852e87..9bbb475 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -261,6 +261,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -272,9 +274,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/config/commence.am b/config/commence.am
index e1cd2bb..e5e4de9 100644
--- a/config/commence.am
+++ b/config/commence.am
@@ -43,7 +43,6 @@ LIBH5F_HL=$(top_builddir)/hl/fortran/src/libhdf5hl_fortran.la
LIBH5CPP_HL=$(top_builddir)/hl/c++/src/libhdf5_hl_cpp.la
# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
docdir = $(exec_prefix)/doc
# Scripts used to build examples
diff --git a/config/lt_vers.am b/config/lt_vers.am
index 1298c07..c5af888 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 = 24
+LT_VERS_REVISION = 26
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and
diff --git a/configure b/configure
index dce4da5..3bd216d 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
-# From configure.in Id: configure.in 16518 2009-02-26 21:21:50Z pvn .
+# From configure.in Id: configure.in 16554 2009-03-09 17:50:53Z mamcgree .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for HDF5 1.9.34.
+# Generated by GNU Autoconf 2.61 for HDF5 1.9.36.
#
# Report bugs to <help@hdfgroup.org>.
#
@@ -724,8 +724,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='HDF5'
PACKAGE_TARNAME='hdf5'
-PACKAGE_VERSION='1.9.34'
-PACKAGE_STRING='HDF5 1.9.34'
+PACKAGE_VERSION='1.9.36'
+PACKAGE_STRING='HDF5 1.9.36'
PACKAGE_BUGREPORT='help@hdfgroup.org'
ac_unique_file="src/H5.c"
@@ -1502,7 +1502,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.34 to adapt to many kinds of systems.
+\`configure' configures HDF5 1.9.36 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1572,7 +1572,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of HDF5 1.9.34:";;
+ short | recursive ) echo "Configuration of HDF5 1.9.36:";;
esac
cat <<\_ACEOF
@@ -1754,7 +1754,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-HDF5 configure 1.9.34
+HDF5 configure 1.9.36
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1768,7 +1768,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.34, which was
+It was created by HDF5 $as_me 1.9.36, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2463,7 +2463,7 @@ fi
# Define the identity of the package.
PACKAGE='hdf5'
- VERSION='1.9.34'
+ VERSION='1.9.36'
cat >>confdefs.h <<_ACEOF
@@ -21620,37 +21620,6 @@ case "X-$enable_production" in
enable_production="yes"
{ echo "$as_me:$LINENO: result: production" >&5
echo "${ECHO_T}production" >&6; }
-
- CFLAGS_temp=""
- if test -n "$CFLAGS"; then
- for d in $CFLAGS ; do
- if test "X$d" != "X-g"; then
- CFLAGS_temp="$CFLAGS_temp $d"
- fi
- done
- CFLAGS=$CFLAGS_temp
- fi
-
- CXXFLAGS_temp=""
- if test -n "$CXXFLAGS"; then
- for d in $CXXFLAGS ; do
- if test "X$d" != "X-g"; then
- CXXFLAGS_temp="$CXXFLAGS_temp $d"
- fi
- done
- CXXFLAGS=$CXXFLAGS_temp
- fi
-
- FCFLAGS_temp=""
- if test -n "$FCFLAGS"; then
- for d in $FCFLAGS ; do
- if test "X$d" != "X-g"; then
- FCFLAGS_temp="$FCFLAGS_temp $d"
- fi
- done
- FCFLAGS=$FCFLAGS_temp
- fi
-
CONFIG_MODE=production
H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS"
H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS"
@@ -51957,7 +51926,7 @@ exec 6>&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.34, which was
+This file was extended by HDF5 $as_me 1.9.36, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -52010,7 +51979,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-HDF5 config.status 1.9.34
+HDF5 config.status 1.9.36
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.in b/configure.in
index c5176a5..0fa7a1a 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.34], [help@hdfgroup.org])
+AC_INIT([HDF5], [1.9.36], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AM_CONFIG_HEADER([src/H5config.h])
@@ -1142,39 +1142,6 @@ case "X-$enable_production" in
X-yes)
enable_production="yes"
AC_MSG_RESULT([production])
-
- dnl Remove the "-g" flag from CFLAGS if it's in there.
- dnl
- CFLAGS_temp=""
- if test -n "$CFLAGS"; then
- for d in $CFLAGS ; do
- if test "X$d" != "X-g"; then
- CFLAGS_temp="$CFLAGS_temp $d"
- fi
- done
- CFLAGS=$CFLAGS_temp
- fi
-
- CXXFLAGS_temp=""
- if test -n "$CXXFLAGS"; then
- for d in $CXXFLAGS ; do
- if test "X$d" != "X-g"; then
- CXXFLAGS_temp="$CXXFLAGS_temp $d"
- fi
- done
- CXXFLAGS=$CXXFLAGS_temp
- fi
-
- FCFLAGS_temp=""
- if test -n "$FCFLAGS"; then
- for d in $FCFLAGS ; do
- if test "X$d" != "X-g"; then
- FCFLAGS_temp="$FCFLAGS_temp $d"
- fi
- done
- FCFLAGS=$FCFLAGS_temp
- fi
-
CONFIG_MODE=production
H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS"
H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS"
diff --git a/examples/Makefile.in b/examples/Makefile.in
index ff818b6..fa4bf0e 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -239,6 +239,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -250,9 +252,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c
index 7886aeb..e8a24b8 100644
--- a/examples/h5_extlink.c
+++ b/examples/h5_extlink.c
@@ -224,7 +224,7 @@ static void soft_link_example(void)
const H5L_class_t UD_soft_class[1] = {{
H5L_LINK_CLASS_T_VERS, /* Version number for this struct.
* This field is always H5L_LINK_CLASS_T_VERS */
- UD_SOFT_CLASS, /* Link class id number. This can be any
+ (H5L_type_t)UD_SOFT_CLASS, /* Link class id number. This can be any
* value between H5L_TYPE_UD_MIN (64) and
* H5L_TYPE_MAX (255). It should be a
* value that isn't already being used by
@@ -258,7 +258,7 @@ static void soft_link_example(void)
/* Now create a user-defined link. We give it the path to the group
* as its udata.1
*/
- H5Lcreate_ud(file_id, UD_SOFT_LINK_NAME, UD_SOFT_CLASS, TARGET_GROUP,
+ H5Lcreate_ud(file_id, UD_SOFT_LINK_NAME, (H5L_type_t)UD_SOFT_CLASS, TARGET_GROUP,
strlen(TARGET_GROUP) + 1, H5P_DEFAULT, H5P_DEFAULT);
/* We can access the group through the UD soft link like we would through
@@ -327,7 +327,7 @@ static void hard_link_example(void)
const H5L_class_t UD_hard_class[1] = {{
H5L_LINK_CLASS_T_VERS, /* Version number for this struct.
* This field is always H5L_LINK_CLASS_T_VERS */
- UD_HARD_CLASS, /* Link class id number. This can be any
+ (H5L_type_t)UD_HARD_CLASS, /* Link class id number. This can be any
* value between H5L_TYPE_UD_MIN (64) and
* H5L_TYPE_MAX (255). It should be a
* value that isn't already being used by
@@ -368,7 +368,7 @@ static void hard_link_example(void)
/* Now create a user-defined link. We give it the group's address
* as its udata.
*/
- H5Lcreate_ud(file_id, UD_HARD_LINK_NAME, UD_HARD_CLASS, &(li.u.address),
+ H5Lcreate_ud(file_id, UD_HARD_LINK_NAME, (H5L_type_t)UD_HARD_CLASS, &(li.u.address),
sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT);
/* The UD hard link has now incremented the group's reference count
@@ -546,7 +546,7 @@ static void plist_link_example(void)
const H5L_class_t UD_plist_class[1] = {{
H5L_LINK_CLASS_T_VERS, /* Version number for this struct.
* This field is always H5L_LINK_CLASS_T_VERS */
- UD_PLIST_CLASS, /* Link class id number. This can be any
+ (H5L_type_t)UD_PLIST_CLASS, /* Link class id number. This can be any
* value between H5L_TYPE_UD_MIN (64) and
* H5L_TYPE_MAX (255). It should be a
* value that isn't already being used by
@@ -572,7 +572,7 @@ static void plist_link_example(void)
/* Register "plist links" and create one. It has no udata at all. */
H5Lregister(UD_plist_class);
- H5Lcreate_ud(file_id, "plist_link", UD_PLIST_CLASS, NULL, 0,
+ H5Lcreate_ud(file_id, "plist_link", (H5L_type_t)UD_PLIST_CLASS, NULL, 0,
H5P_DEFAULT, H5P_DEFAULT);
/* Create a group access property list to pass in the target for the
diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c
index d6df438..17ec724 100644
--- a/examples/h5_ref2reg.c
+++ b/examples/h5_ref2reg.c
@@ -97,7 +97,7 @@ int main(void)
* Create a reference to elements selection.
*/
status = H5Sselect_none(space_id);
- status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, coord);
+ status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord);
status = H5Rcreate(&ref[1], file_id, dsetnamev, H5R_DATASET_REGION, space_id);
/*
diff --git a/examples/h5_select.c b/examples/h5_select.c
index 595a1b3..ceb9c2c 100644
--- a/examples/h5_select.c
+++ b/examples/h5_select.c
@@ -171,7 +171,7 @@ main (void)
coord[2][0] = 3; coord[2][1] = 5;
coord[3][0] = 5; coord[3][1] = 6;
- ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, coord);
+ ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord);
/*
* Write new selection of points to the dataset.
diff --git a/fortran/Makefile.in b/fortran/Makefile.in
index cf5740f..b9678f5 100644
--- a/fortran/Makefile.in
+++ b/fortran/Makefile.in
@@ -249,6 +249,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -260,9 +262,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in
index 9cec95a..8702ab3 100644
--- a/fortran/examples/Makefile.in
+++ b/fortran/examples/Makefile.in
@@ -239,6 +239,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -250,9 +252,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 05cb0cf..a61d929 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -304,6 +304,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -315,9 +317,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index c5c5fb7..185db9b 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -301,6 +301,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -312,9 +314,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in
index ea886c8..14f4e7b 100644
--- a/fortran/testpar/Makefile.in
+++ b/fortran/testpar/Makefile.in
@@ -252,6 +252,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -263,9 +265,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/Makefile.in b/hl/Makefile.in
index d642c83..16a4a64 100755
--- a/hl/Makefile.in
+++ b/hl/Makefile.in
@@ -249,6 +249,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -260,9 +262,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in
index 859757a..9ce31d4 100644
--- a/hl/c++/Makefile.in
+++ b/hl/c++/Makefile.in
@@ -245,6 +245,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -256,9 +258,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in
index 6977f10..fa94108 100644
--- a/hl/c++/examples/Makefile.in
+++ b/hl/c++/examples/Makefile.in
@@ -239,6 +239,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -250,9 +252,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in
index 71c7f85..4e168ad 100644
--- a/hl/c++/src/Makefile.in
+++ b/hl/c++/src/Makefile.in
@@ -264,6 +264,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -275,9 +277,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in
index d1c689e..285d2e0 100644
--- a/hl/c++/test/Makefile.in
+++ b/hl/c++/test/Makefile.in
@@ -255,6 +255,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -266,9 +268,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in
index 714d8da..3c90dd8 100644
--- a/hl/examples/Makefile.in
+++ b/hl/examples/Makefile.in
@@ -239,6 +239,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -250,9 +252,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in
index 3923b06..af080bb 100644
--- a/hl/fortran/Makefile.in
+++ b/hl/fortran/Makefile.in
@@ -249,6 +249,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -260,9 +262,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in
index 7cc30e4..1de9302 100644
--- a/hl/fortran/examples/Makefile.in
+++ b/hl/fortran/examples/Makefile.in
@@ -239,6 +239,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -250,9 +252,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c
index 93d65ef..61c7547 100755
--- a/hl/fortran/src/H5LTfc.c
+++ b/hl/fortran/src/H5LTfc.c
@@ -1247,6 +1247,7 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id,
size_t c_type_size;
hsize_t c_dims[32];
int i;
+ int c_rank;
/*
* Convert FORTRAN name to C name
@@ -1261,15 +1262,23 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id,
c_loc_id = (hid_t)*loc_id;
ret = H5LTget_dataset_info(c_loc_id, c_name, c_dims, &c_classtype, &c_type_size);
+ if (ret < 0) return ret_value;
*type_class = c_classtype;
*type_size = (size_t_f)c_type_size;
- for (i = 0; i < 32 ; i++) {
- dims[i] = (hsize_t_f) c_dims[i];
- }
+ /*
+ * Transpose dimension arrays because of C-FORTRAN storage order
+ */
+ ret = H5LTget_dataset_ndims(c_loc_id, c_name, &c_rank);
if (ret < 0) return ret_value;
+
+ for (i = 0; i < c_rank ; i++) {
+ dims[i] = (hsize_t_f) c_dims[c_rank - i - 1];
+ }
+
+
ret_value = 0;
return ret_value;
}
@@ -1375,6 +1384,7 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id,
size_t c_type_size;
hsize_t c_dims[32];
int i;
+ int c_rank;
/*
* Convert FORTRAN name to C name
@@ -1388,20 +1398,27 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id,
if (c_attrname == NULL) return ret_value;
/*
- * Call H5LTget_dataset_ndims function.
+ * Call H5LTget_attribute_info function.
*/
c_loc_id = (hid_t)*loc_id;
ret = H5LTget_attribute_info(c_loc_id,c_name,c_attrname,c_dims,&c_classtype,&c_type_size);
+ if (ret < 0) return ret_value;
*type_class = c_classtype;
*type_size = (size_t_f)c_type_size;
- for (i = 0; i < 32 ; i++) {
- dims[i] = (hsize_t_f) c_dims[i];
- }
+/*
+ * Transpose dimension arrays because of C-FORTRAN storage order
+ */
+ ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,&c_rank);
if (ret < 0) return ret_value;
+
+ for (i = 0; i < c_rank ; i++) {
+ dims[i] = (hsize_t_f) c_dims[c_rank - i - 1];
+ }
+
ret_value = 0;
return ret_value;
}
diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in
index 0b269a4..4d4b6fc 100644
--- a/hl/fortran/src/Makefile.in
+++ b/hl/fortran/src/Makefile.in
@@ -269,6 +269,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -280,9 +282,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in
index e43ab95..6958f34 100644
--- a/hl/fortran/test/Makefile.in
+++ b/hl/fortran/test/Makefile.in
@@ -259,6 +259,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -270,9 +272,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90
index c261ad8..9332c10 100644
--- a/hl/fortran/test/tstlite.f90
+++ b/hl/fortran/test/tstlite.f90
@@ -379,6 +379,7 @@ character(LEN=5), parameter :: dsetname3 = "dset3" ! Dataset name
character(LEN=5), parameter :: dsetname4 = "dset4" ! Dataset name
integer(HID_T) :: file_id ! File identifier
integer(HSIZE_T), dimension(3) :: dims = (/DIM1,DIM2,DIM3/) ! Dataset dimensions
+integer(HSIZE_T), dimension(3) :: dimsr ! Dataset dimensions
integer, dimension(DIM1*DIM2*DIM3) :: buf ! Data buffer
integer, dimension(DIM1*DIM2*DIM3) :: bufr ! Data buffer
integer, dimension(DIM1,DIM2,DIM3) :: buf2 ! Data buffer
@@ -390,6 +391,8 @@ double precision, dimension(DIM1,DIM2,DIM3) :: buf4r ! Data buffer
integer :: rank = 3 ! Dataset rank
integer :: errcode ! Error flag
integer :: i, j, k, n ! general purpose integers
+integer :: type_class
+integer(SIZE_T) :: type_size
call test_begin(' Make/Read datasets (3D) ')
@@ -537,6 +540,18 @@ do i = 1, dims(1)
end do
end do
+call h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode )
+
+!
+! compare dimensions
+!
+do i = 1, rank
+ if ( dimsr(i) .ne. dims(i) ) then
+ print *, 'dimensions differ '
+ stop
+ endif
+end do
+
!
! Close the file.
!
@@ -574,6 +589,7 @@ character(LEN=5), parameter :: dsetname1 = "dset1" ! Dataset name
character(LEN=5), parameter :: dsetname2 = "dset2" ! Dataset name
character(LEN=5), parameter :: dsetname3 = "dset3" ! Dataset name
character(LEN=5), parameter :: dsetname4 = "dset4" ! Dataset name
+character(LEN=5), parameter :: dsetname5 = "dset5" ! Dataset name
integer(HSIZE_T), dimension(1) :: dims = (/DIM1/) ! Dataset dimensions
integer(HSIZE_T), dimension(1) :: dimsr ! Dataset dimensions
integer :: rank = 1 ! Dataset rank
@@ -701,7 +717,7 @@ end do
call passed()
-call test_begin(' Get dataset dimensions ')
+call test_begin(' Get dataset dimensions/info ')
!-------------------------------------------------------------------------
! h5ltget_dataset_ndims_f
@@ -713,20 +729,39 @@ if ( rankr .ne. rank ) then
stop
endif
-call passed()
!-------------------------------------------------------------------------
-! test find dataset function
+! test h5ltfind_dataset_f function
!-------------------------------------------------------------------------
-call test_begin(' Find dataset ')
+has = h5ltfind_dataset_f(file_id,dsetname4)
+if ( has .ne. 1 ) then
+ print *, 'h5ltfind_dataset_f return error'
+ stop
+endif
+
+!-------------------------------------------------------------------------
+! test h5ltget_dataset_info_f function
+!-------------------------------------------------------------------------
+
+
+call h5ltget_dataset_info_f(file_id,dsetname4,dimsr,type_class,type_size,errcode )
+
+!
+! compare dimensions
+!
+do i = 1, rank
+ if ( dimsr(i) .ne. dims(i) ) then
+ print *, 'dimensions differ '
+ stop
+ endif
+end do
-!has = h5ltfind_dataset_f(file_id,dsetname4)
-!if ( has .ne. 1 ) then
-! print *, 'h5ltfind_dataset_f return error'
-! stop
-!endif
+if ( type_class .ne. 1 ) then ! H5T_FLOAT
+ print *, 'wrong type class '
+ stop
+endif
!
! Close the file.
@@ -756,15 +791,16 @@ use HDF5 ! module of HDF5 library
implicit none
-character(len=9), parameter :: filename = "dsetf4.h5"! File name
+character(len=9), parameter :: filename = "dsetf5.h5"! File name
integer(HID_T) :: file_id ! File identifier
integer, parameter :: DIM1 = 10; ! Dimension of array
character(LEN=5), parameter :: attrname1 = "attr1" ! Attribute name
character(LEN=5), parameter :: attrname2 = "attr2" ! Attribute name
character(LEN=5), parameter :: attrname3 = "attr3" ! Attribute name
character(LEN=5), parameter :: attrname4 = "attr4" ! Attribute name
-character(LEN=8), parameter :: buf1 = "mystring" ! Data buffer
-character(LEN=8) :: bufr1 ! Data buffer
+character(LEN=5), parameter :: attrname5 = "attr5" ! Attribute name
+character(LEN=9), parameter :: buf1 = "mystring" ! Data buffer
+character(LEN=9) :: bufr1 ! Data buffer
integer, dimension(DIM1) :: buf2 ! Data buffer
integer, dimension(DIM1) :: bufr2 ! Data buffer
real, dimension(DIM1) :: buf3 ! Data buffer
@@ -900,12 +936,11 @@ end do
call passed()
-
!-------------------------------------------------------------------------
! get attribute rank
!-------------------------------------------------------------------------
-call test_begin(' Get attribute rank ')
+call test_begin(' Get attribute rank/info ')
call h5ltget_attribute_ndims_f(file_id,dsetname1,attrname2,rankr,errcode)
@@ -916,6 +951,19 @@ if ( rankr .ne. 1 ) then
endif
+call h5ltget_attribute_info_f(file_id,dsetname1,attrname2,dimsr,type_class,type_size,errcode)
+
+!
+! compare dimensions
+!
+do i = 1, rank
+ if ( dimsr(i) .ne. dims(i) ) then
+ print *, 'dimensions differ '
+ stop
+ endif
+end do
+
+
!
! Close the file.
!
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 46eedc4..83bb1ed 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -1,17 +1,17 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+* Copyright by The HDF Group. *
+* Copyright by the Board of Trustees of the University of Illinois. *
+* All rights reserved. *
+* *
+* This file is part of HDF5. The full HDF5 copyright notice, including *
+* terms governing use, modification, and redistribution, is contained in *
+* the files COPYING and Copyright.html. COPYING can be found at the root *
+* of the source code distribution tree; Copyright.html can be found at the *
+* root level of an installed copy of the electronic HDF5 document set and *
+* is linked from the top-level documents page. It can also be found at *
+* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+* access to either file, you may request a copy from help@hdfgroup.org. *
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <assert.h>
#include <stdlib.h>
@@ -24,1203 +24,1277 @@
/*-------------------------------------------------------------------------
- * Function: H5DSset_scale
- *
- * Purpose: The dataset DSID is converted to a Dimension Scale dataset.
- * Creates the CLASS attribute, set to the value "DIMENSION_SCALE"
- * and an empty REFERENCE_LIST attribute.
- * If DIMNAME is specified, then an attribute called NAME is created,
- * with the value DIMNAME.
- *
- * Return: Success: SUCCEED, Failure: FAIL
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: January 04, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSset_scale
+*
+* Purpose: The dataset DSID is converted to a Dimension Scale dataset.
+* Creates the CLASS attribute, set to the value "DIMENSION_SCALE"
+* and an empty REFERENCE_LIST attribute.
+* If DIMNAME is specified, then an attribute called NAME is created,
+* with the value DIMNAME.
+*
+* Return: Success: SUCCEED, Failure: FAIL
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: January 04, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
herr_t H5DSset_scale(hid_t dsid,
const char *dimname)
{
- int has_dimlist;
- H5I_type_t it;
+ int has_dimlist;
+ H5I_type_t it;
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* get ID type */
- if ((it = H5Iget_type(dsid)) < 0)
- return FAIL;
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* get ID type */
+ if ((it = H5Iget_type(dsid)) < 0)
+ return FAIL;
- if (H5I_DATASET!=it)
- return FAIL;
+ if (H5I_DATASET!=it)
+ return FAIL;
-/*-------------------------------------------------------------------------
- * check if the dataset is a dataset wich has references to dimension scales
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * check if the dataset is a dataset wich has references to dimension scales
+ *-------------------------------------------------------------------------
+ */
- /* try to find the attribute "DIMENSION_LIST" */
- if ((has_dimlist = H5LT_find_attribute(dsid,DIMENSION_LIST)) < 0)
- return FAIL;
+ /* try to find the attribute "DIMENSION_LIST" */
+ if ((has_dimlist = H5LT_find_attribute(dsid,DIMENSION_LIST)) < 0)
+ return FAIL;
- if (has_dimlist == 1)
- return FAIL;
+ if (has_dimlist == 1)
+ return FAIL;
-/*-------------------------------------------------------------------------
- * write the standard attributes for a Dimension Scale dataset
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * write the standard attributes for a Dimension Scale dataset
+ *-------------------------------------------------------------------------
+ */
- if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS) < 0)
- return FAIL;
+ if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS) < 0)
+ return FAIL;
- if (dimname!=NULL)
- {
- if (H5LT_set_attribute_string(dsid,"NAME",dimname) < 0)
- return FAIL;
- }
+ if (dimname!=NULL)
+ {
+ if (H5LT_set_attribute_string(dsid,"NAME",dimname) < 0)
+ return FAIL;
+ }
- return SUCCEED;
+ return SUCCEED;
}
/*-------------------------------------------------------------------------
- * Function: H5DSattach_scale
- *
- * Purpose: Define Dimension Scale DSID to be associated with dimension IDX
- * of Dataset DID. Entries are created in the DIMENSION_LIST and
- * REFERENCE_LIST attributes.
- *
- * Return:
- * Success: SUCCEED
- * Failure: FAIL
- *
- * Fails if: Bad arguments
- * If DSID is not a Dimension Scale
- * If DID is a Dimension Scale (A Dimension Scale cannot have scales)
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: December 20, 2004
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSattach_scale
+*
+* Purpose: Define Dimension Scale DSID to be associated with dimension IDX
+* of Dataset DID. Entries are created in the DIMENSION_LIST and
+* REFERENCE_LIST attributes.
+*
+* Return:
+* Success: SUCCEED
+* Failure: FAIL
+*
+* Fails if: Bad arguments
+* If DSID is not a Dimension Scale
+* If DID is a Dimension Scale (A Dimension Scale cannot have scales)
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: December 20, 2004
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
herr_t H5DSattach_scale(hid_t did,
hid_t dsid,
unsigned int idx)
{
- int has_dimlist;
- int has_reflist;
- int is_ds;
- hssize_t nelmts;
- hid_t sid; /* space ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t aid = -1; /* attribute ID */
- int rank; /* rank of dataset */
- hsize_t *dims; /* dimension of the "REFERENCE_LIST" array */
- ds_list_t dsl; /* attribute data in the DS pointing to the dataset */
- ds_list_t *dsbuf; /* array of attribute data in the DS pointing to the dataset */
- hobj_ref_t ref_to_ds; /* reference to the DS */
- hobj_ref_t ref_j; /* iterator reference */
- hvl_t *buf; /* VL buffer to store in the attribute */
- hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
- H5O_info_t oi1, oi2;
- H5I_type_t it1, it2;
- int i, len;
- int found_ds=0;
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* the dataset cannot be a DS dataset */
- if ((H5DSis_scale(did))==1)
- return FAIL;
-
- /* get info for the dataset in the parameter list */
- if(H5Oget_info(did, &oi1) < 0)
- return FAIL;
-
- /* get info for the scale in the parameter list */
- if(H5Oget_info(dsid, &oi2) < 0)
- return FAIL;
-
- /* same object, not valid */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- return FAIL;
-
- /* get ID type */
- if ((it1 = H5Iget_type(did)) < 0)
- return FAIL;
- if ((it2 = H5Iget_type(dsid)) < 0)
- return FAIL;
-
- if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
- return FAIL;
-
- /* the DS dataset cannot have dimension scales */
- if (H5LT_find_attribute(dsid,DIMENSION_LIST)==1)
- return FAIL;
-
- /* check if the dataset is a "reserved" dataset (image, table) */
- if (H5DS_is_reserved(did)==1)
- return FAIL;
-
-
-/*-------------------------------------------------------------------------
- * The dataset may or may not have the associated DS attribute
- * First we try to open to see if it is already there; if not, it is created.
- * If it exists, the array of references is extended to hold the reference
- * to the new DS
- *-------------------------------------------------------------------------
- */
-
- /* get dataset space */
- if ((sid = H5Dget_space(did)) < 0)
- return FAIL;
-
- /* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* scalar rank */
- if (rank==0)
- rank=1;
-
- /* close dataset space */
- if (H5Sclose(sid) < 0)
- return FAIL;
-
- /* parameter range checking */
- if (idx>(unsigned)rank-1)
- return FAIL;
-
-/*-------------------------------------------------------------------------
- * two references are created: one to the DS, saved in "DIMENSION_LIST"
- * and one to the dataset, saved in "REFERENCE_LIST"
- *-------------------------------------------------------------------------
- */
- /* create a reference for the >>DS<< dataset */
- if (H5Rcreate(&ref_to_ds,dsid,".",H5R_OBJECT,-1) < 0)
- return FAIL;
-
- /* create a reference for the >>data<< dataset */
- if (H5Rcreate(&dsl.ref,did,".",H5R_OBJECT,-1) < 0)
- return FAIL;
-
- /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
- if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST)) < 0)
- return FAIL;
+ int has_dimlist;
+ int has_reflist;
+ int is_ds;
+ hssize_t nelmts;
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid = -1; /* attribute ID */
+ int rank; /* rank of dataset */
+ hsize_t *dims=NULL; /* dimension of the "REFERENCE_LIST" array */
+ ds_list_t dsl; /* attribute data in the DS pointing to the dataset */
+ ds_list_t *dsbuf=NULL; /* array of attribute data in the DS pointing to the dataset */
+ hobj_ref_t ref_to_ds; /* reference to the DS */
+ hobj_ref_t ref_j; /* iterator reference */
+ hvl_t *buf=NULL; /* VL buffer to store in the attribute */
+ hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
+ H5O_info_t oi1, oi2;
+ H5I_type_t it1, it2;
+ int i, len;
+ int found_ds=0;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* the dataset cannot be a DS dataset */
+ if ((H5DSis_scale(did))==1)
+ return FAIL;
+
+ /* get info for the dataset in the parameter list */
+ if(H5Oget_info(did, &oi1) < 0)
+ return FAIL;
+
+ /* get info for the scale in the parameter list */
+ if(H5Oget_info(dsid, &oi2) < 0)
+ return FAIL;
+
+ /* same object, not valid */
+ if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
+ return FAIL;
+
+ /* get ID type */
+ if ((it1 = H5Iget_type(did)) < 0)
+ return FAIL;
+ if ((it2 = H5Iget_type(dsid)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
+ return FAIL;
+
+ /* the DS dataset cannot have dimension scales */
+ if (H5LT_find_attribute(dsid,DIMENSION_LIST)==1)
+ return FAIL;
+
+ /* check if the dataset is a "reserved" dataset (image, table) */
+ if (H5DS_is_reserved(did)==1)
+ return FAIL;
+
+
+ /*-------------------------------------------------------------------------
+ * The dataset may or may not have the associated DS attribute
+ * First we try to open to see if it is already there; if not, it is created.
+ * If it exists, the array of references is extended to hold the reference
+ * to the new DS
+ *-------------------------------------------------------------------------
+ */
+
+ /* get dataset space */
+ if ((sid = H5Dget_space(did)) < 0)
+ return FAIL;
+
+ /* get rank */
+ if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* scalar rank */
+ if (rank==0)
+ rank=1;
+
+ /* close dataset space */
+ if (H5Sclose(sid) < 0)
+ return FAIL;
+
+ /* parameter range checking */
+ if (idx>(unsigned)rank-1)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * two references are created: one to the DS, saved in "DIMENSION_LIST"
+ * and one to the dataset, saved in "REFERENCE_LIST"
+ *-------------------------------------------------------------------------
+ */
+ /* create a reference for the >>DS<< dataset */
+ if (H5Rcreate(&ref_to_ds,dsid,".",H5R_OBJECT,-1) < 0)
+ return FAIL;
+
+ /* create a reference for the >>data<< dataset */
+ if (H5Rcreate(&dsl.ref,did,".",H5R_OBJECT,-1) < 0)
+ return FAIL;
+
+ /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
+ if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST)) < 0)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * it does not exist. we create the attribute and its reference data
+ *-------------------------------------------------------------------------
+ */
+ if (has_dimlist == 0)
+ {
+ /* create one entry array */
+ dims = (hsize_t*) malloc (1 * sizeof (hsize_t));
+
+ if(dims == NULL)
+ return FAIL;
+
+ dims[0] = rank;
+
+ /* space for the attribute */
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ return FAIL;
+
+ /* create the type for the attribute "DIMENSION_LIST" */
+ if((tid = H5Tvlen_create(H5T_STD_REF_OBJ)) < 0)
+ goto out;
+
+ /* create the attribute */
+ if((aid = H5Acreate2(did, DIMENSION_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* allocate and initialize the VL */
+ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+
+ if(buf == NULL)
+ goto out;
+
+ for(i = 0; i < rank; i++) {
+ buf[i].len = 0;
+ buf[i].p = NULL;
+ }
+
+ /* store the REF information in the index of the dataset that has the DS */
+ buf[idx].len = 1;
+ buf[idx].p = malloc( 1 * sizeof(hobj_ref_t));
+ ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
+
+ /* write the attribute with the reference */
+ if (H5Awrite(aid,tid,buf) < 0)
+ goto out;
+
+ /* close */
+ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
+ goto out;
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+
+ if (dims)
+ {
+ free(dims);
+ dims = NULL;
+ }
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
-/*-------------------------------------------------------------------------
- * it does not exist. we create the attribute and its reference data
- *-------------------------------------------------------------------------
- */
- if (has_dimlist == 0)
- {
- /* create one entry array */
- dims = (hsize_t*) malloc (1 * sizeof (hsize_t));
-
- if(dims == NULL)
- return FAIL;
-
- dims[0] = rank;
-
- /* space for the attribute */
- if((sid = H5Screate_simple(1, dims, NULL)) < 0)
- return FAIL;
-
- /* create the type for the attribute "DIMENSION_LIST" */
- if((tid = H5Tvlen_create(H5T_STD_REF_OBJ)) < 0)
- goto out;
-
- /* create the attribute */
- if((aid = H5Acreate2(did, DIMENSION_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
-
- /* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
-
- if(buf == NULL)
- goto out;
-
- for(i = 0; i < rank; i++) {
- buf[i].len = 0;
- buf[i].p = NULL;
- }
-
- /* store the REF information in the index of the dataset that has the DS */
- buf[idx].len = 1;
- buf[idx].p = malloc( 1 * sizeof(hobj_ref_t));
- ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
-
- /* write the attribute with the reference */
- if (H5Awrite(aid,tid,buf) < 0)
- goto out;
-
- /* close */
- if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
- goto out;
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
-
- if (dims)
- free(dims);
- if (buf)
- free(buf);
-
- }
+ }
-/*-------------------------------------------------------------------------
- * the attribute already exists, open it, extend the buffer,
- * and insert the new reference
- *-------------------------------------------------------------------------
- */
-
- else if ( has_dimlist == 1 )
- {
- if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
- goto out;
-
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
-
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- /* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
-
- if(buf == NULL)
- goto out;
-
- /* read */
- if(H5Aread(aid, tid, buf) < 0)
- goto out;
-
- /* check to avoid inserting duplicates. it is not FAIL, just do nothing */
- /* iterate all the REFs in this dimension IDX */
- for (i=0; i<(int)buf[idx].len; i++)
- {
- /* get the reference */
- ref_j = ((hobj_ref_t *)buf[idx].p)[i];
-
- /* get the scale id for this REF */
- if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref_j)) < 0)
- goto out;
-
- /* get info for DS in the parameter list */
- if(H5Oget_info(dsid, &oi1) < 0)
- goto out;
-
- /* get info for this DS */
- if(H5Oget_info(dsid_j, &oi2) < 0)
- goto out;
-
- /* same object, so this DS scale is already in this DIM IDX */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- found_ds = 1;
-
- /* close the dereferenced dataset */
- if (H5Dclose(dsid_j) < 0)
- goto out;
- }
-
- if (found_ds==0)
- {
- /* we are adding one more DS to this dimension */
- if ( buf[idx].len > 0 )
- {
- buf[idx].len++;
- len = buf[idx].len;
- buf[idx].p = realloc( buf[idx].p, len * sizeof(hobj_ref_t));
- ((hobj_ref_t *)buf[idx].p)[ len-1 ] = ref_to_ds;
- }
- else
- {
- /* store the REF information in the index of the dataset that has the DS */
- buf[idx].len = 1;
- buf[idx].p = malloc( 1 * sizeof(hobj_ref_t));
- ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
- }
- }
-
- /* write the attribute with the new references */
- if (H5Awrite(aid,tid,buf) < 0)
- goto out;
-
- /* close */
- if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
- goto out;
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (buf)
- free(buf);
-
- } /* has_dimlist */
+ /*-------------------------------------------------------------------------
+ * the attribute already exists, open it, extend the buffer,
+ * and insert the new reference
+ *-------------------------------------------------------------------------
+ */
-/*-------------------------------------------------------------------------
- * save DS info on the >>DS<< dataset
- *-------------------------------------------------------------------------
- */
+ else if ( has_dimlist == 1 )
+ {
+ if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
+ goto out;
+
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
+
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
+
+ /* allocate and initialize the VL */
+ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+
+ if(buf == NULL)
+ goto out;
+
+ /* read */
+ if(H5Aread(aid, tid, buf) < 0)
+ goto out;
+
+ /* check to avoid inserting duplicates. it is not FAIL, just do nothing */
+ /* iterate all the REFs in this dimension IDX */
+ for (i=0; i<(int)buf[idx].len; i++)
+ {
+ /* get the reference */
+ ref_j = ((hobj_ref_t *)buf[idx].p)[i];
+
+ /* get the scale id for this REF */
+ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref_j)) < 0)
+ goto out;
+
+ /* get info for DS in the parameter list */
+ if(H5Oget_info(dsid, &oi1) < 0)
+ goto out;
+
+ /* get info for this DS */
+ if(H5Oget_info(dsid_j, &oi2) < 0)
+ goto out;
+
+ /* same object, so this DS scale is already in this DIM IDX */
+ if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
+ found_ds = 1;
+
+ /* close the dereferenced dataset */
+ if (H5Dclose(dsid_j) < 0)
+ goto out;
+ }
+
+ if (found_ds==0)
+ {
+ /* we are adding one more DS to this dimension */
+ if ( buf[idx].len > 0 )
+ {
+ buf[idx].len++;
+ len = buf[idx].len;
+ buf[idx].p = realloc( buf[idx].p, len * sizeof(hobj_ref_t));
+ ((hobj_ref_t *)buf[idx].p)[ len-1 ] = ref_to_ds;
+ }
+ else
+ {
+ /* store the REF information in the index of the dataset that has the DS */
+ buf[idx].len = 1;
+ buf[idx].p = malloc( 1 * sizeof(hobj_ref_t));
+ ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
+ }
+ }
+
+ /* write the attribute with the new references */
+ if (H5Awrite(aid,tid,buf) < 0)
+ goto out;
+
+ /* close */
+ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
+ goto out;
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
+
+ } /* has_dimlist */
+
+ /*-------------------------------------------------------------------------
+ * save DS info on the >>DS<< dataset
+ *-------------------------------------------------------------------------
+ */
+
+ /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */
+ if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * it does not exist. we create the attribute and its reference data
+ *-------------------------------------------------------------------------
+ */
+ if (has_reflist == 0)
+ {
+ /* create one entry array */
+ dims = (hsize_t*) malloc (1 * sizeof (hsize_t));
+
+ if (dims == NULL)
+ goto out;
+
+ dims[0] = 1;
+
+ /* space for the attribute */
+ if ((sid = H5Screate_simple(1,dims,NULL)) < 0)
+ goto out;
+
+ /* create the compound datatype for the attribute "REFERENCE_LIST" */
+ if((tid = H5Tcreate(H5T_COMPOUND, sizeof(ds_list_t))) < 0)
+ goto out;
+
+ /* insert reference field */
+ if(H5Tinsert(tid, "dataset", HOFFSET(ds_list_t,ref), H5T_STD_REF_OBJ) < 0)
+ goto out;
+
+ /* insert dimension idx of the dataset field */
+ if(H5Tinsert(tid, "dimension", HOFFSET(ds_list_t, dim_idx), H5T_NATIVE_INT) < 0)
+ goto out;
+
+ /* create the attribute */
+ if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* store the IDX information */
+ dsl.dim_idx = idx;
+
+ /* write the attribute with the reference */
+ if(H5Awrite(aid, tid, &dsl) < 0)
+ goto out;
+
+ /* close */
+ if(H5Sclose(sid) < 0)
+ goto out;
+ if(H5Tclose(tid) < 0)
+ goto out;
+ if(H5Aclose(aid) < 0)
+ goto out;
+
+ if(dims)
+ {
+ free(dims);
+ dims = NULL;
+ }
+ }
- /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */
- if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST)) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * the "REFERENCE_LIST" array already exists, open it and extend it
+ *-------------------------------------------------------------------------
+ */
-/*-------------------------------------------------------------------------
- * it does not exist. we create the attribute and its reference data
- *-------------------------------------------------------------------------
- */
- if (has_reflist == 0)
- {
- /* create one entry array */
- dims = (hsize_t*) malloc (1 * sizeof (hsize_t));
-
- if (dims == NULL)
- goto out;
-
- dims[0] = 1;
-
- /* space for the attribute */
- if ((sid = H5Screate_simple(1,dims,NULL)) < 0)
- goto out;
-
- /* create the compound datatype for the attribute "REFERENCE_LIST" */
- if((tid = H5Tcreate(H5T_COMPOUND, sizeof(ds_list_t))) < 0)
- goto out;
-
- /* insert reference field */
- if(H5Tinsert(tid, "dataset", HOFFSET(ds_list_t,ref), H5T_STD_REF_OBJ) < 0)
- goto out;
-
- /* insert dimension idx of the dataset field */
- if(H5Tinsert(tid, "dimension", HOFFSET(ds_list_t, dim_idx), H5T_NATIVE_INT) < 0)
- goto out;
-
- /* create the attribute */
- if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
-
- /* store the IDX information */
- dsl.dim_idx = idx;
-
- /* write the attribute with the reference */
- if(H5Awrite(aid, tid, &dsl) < 0)
- goto out;
-
- /* close */
- if(H5Sclose(sid) < 0)
- goto out;
- if(H5Tclose(tid) < 0)
- goto out;
- if(H5Aclose(aid) < 0)
- goto out;
-
- if(dims)
- free(dims);
- }
+ else if(has_reflist == 1)
+ {
+ if((aid = H5Aopen(dsid, REFERENCE_LIST, H5P_DEFAULT)) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * the "REFERENCE_LIST" array already exists, open it and extend it
- *-------------------------------------------------------------------------
- */
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
- else if(has_reflist == 1)
- {
- if((aid = H5Aopen(dsid, REFERENCE_LIST, H5P_DEFAULT)) < 0)
- goto out;
+ /* get and save the old reference(s) */
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
+ goto out;
- /* get and save the old reference(s) */
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
+ nelmts++;
- if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
- goto out;
+ dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t));
- nelmts++;
+ if (dsbuf == NULL)
+ goto out;
- dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t));
+ if (H5Aread(aid,tid,dsbuf) < 0)
+ goto out;
- if (dsbuf == NULL)
- goto out;
+ /* close */
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
- if (H5Aread(aid,tid,dsbuf) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * create a new attribute
+ *-------------------------------------------------------------------------
+ */
- /* close */
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
+ /* the attribute must be deleted, in order to the new one can reflect the changes*/
+ if(H5Adelete(dsid, REFERENCE_LIST) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * create a new attribute
- *-------------------------------------------------------------------------
- */
+ /* store the IDX information (index of the dataset that has the DS) */
+ dsl.dim_idx = idx;
+ dsbuf[nelmts-1] = dsl;
- /* the attribute must be deleted, in order to the new one can reflect the changes*/
- if(H5Adelete(dsid, REFERENCE_LIST) < 0)
- goto out;
+ /* create a new data space for the new references array */
+ dims = (hsize_t *)malloc((size_t)nelmts * sizeof(hsize_t));
+ if(dims == NULL)
+ goto out;
+ dims[0] = nelmts;
- /* store the IDX information (index of the dataset that has the DS) */
- dsl.dim_idx = idx;
- dsbuf[nelmts-1] = dsl;
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ goto out;
- /* create a new data space for the new references array */
- dims = (hsize_t *)malloc((size_t)nelmts * sizeof(hsize_t));
- if(dims == NULL)
- goto out;
- dims[0] = nelmts;
+ if (dims)
+ {
+ free(dims);
+ dims = NULL;
+ }
- if((sid = H5Screate_simple(1, dims, NULL)) < 0)
- goto out;
+ /* create the attribute again with the changes of space */
+ if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
- if(dims)
- free(dims);
+ /* write the attribute with the new references */
+ if(H5Awrite(aid, tid, dsbuf) < 0)
+ goto out;
- /* create the attribute again with the changes of space */
- if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
+ /* close */
+ if(H5Sclose(sid) < 0)
+ goto out;
+ if(H5Tclose(tid) < 0)
+ goto out;
+ if(H5Aclose(aid) < 0)
+ goto out;
- /* write the attribute with the new references */
- if(H5Awrite(aid, tid, dsbuf) < 0)
- goto out;
+ if (dsbuf)
+ {
+ free(dsbuf);
+ dsbuf = NULL;
+ }
- /* close */
- if(H5Sclose(sid) < 0)
- goto out;
- if(H5Tclose(tid) < 0)
- goto out;
- if(H5Aclose(aid) < 0)
- goto out;
+ } /* has_reflist */
- if (dsbuf)
- free(dsbuf);
+ /*-------------------------------------------------------------------------
+ * write the standard attributes for a Dimension Scale dataset
+ *-------------------------------------------------------------------------
+ */
- } /* has_reflist */
+ if ((is_ds=H5DSis_scale(dsid)) < 0)
+ return FAIL;
-/*-------------------------------------------------------------------------
- * write the standard attributes for a Dimension Scale dataset
- *-------------------------------------------------------------------------
- */
+ if (is_ds == 0 )
+ {
+ if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS) < 0)
+ return FAIL;
+ }
- if ((is_ds=H5DSis_scale(dsid)) < 0)
- return FAIL;
+ return SUCCEED;
- if (is_ds == 0 )
- {
- if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS) < 0)
- return FAIL;
- }
+ /* error zone */
+out:
- return SUCCEED;
+ if (dims)
+ {
+ free(dims);
+ dims = NULL;
+ }
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
+ if (dsbuf)
+ {
+ free(dsbuf);
+ dsbuf = NULL;
+ }
-/* error zone, gracefully close */
-out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Aclose(aid);
- H5Tclose(tid);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSdetach_scale
- *
- * Purpose: If possible, deletes association of Dimension Scale DSID with
- * dimension IDX of Dataset DID. This deletes the entries in the
- * DIMENSION_LIST and REFERENCE_LIST attributes.
- *
- * Return:
- * Success: SUCCEED
- * Failure: FAIL
- *
- * Fails if: Bad arguments
- * The dataset DID or DSID do not exist.
- * The DSID is not a Dimension Scale
- * DSID is not attached to DID.
- * Note that a scale may be associated with more than dimension of the same dataset.
- * If so, the detach operation only deletes one of the associations, for DID.
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: December 20, 2004
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSdetach_scale
+*
+* Purpose: If possible, deletes association of Dimension Scale DSID with
+* dimension IDX of Dataset DID. This deletes the entries in the
+* DIMENSION_LIST and REFERENCE_LIST attributes.
+*
+* Return:
+* Success: SUCCEED
+* Failure: FAIL
+*
+* Fails if: Bad arguments
+* The dataset DID or DSID do not exist.
+* The DSID is not a Dimension Scale
+* DSID is not attached to DID.
+* Note that a scale may be associated with more than dimension of the same dataset.
+* If so, the detach operation only deletes one of the associations, for DID.
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: December 20, 2004
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
herr_t H5DSdetach_scale(hid_t did,
hid_t dsid,
unsigned int idx)
{
- int has_dimlist;
- int has_reflist;
- hssize_t nelmts;
- hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
+ int has_dimlist;
+ int has_reflist;
+ hssize_t nelmts;
+ hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
hid_t did_i; /* dataset ID in REFERENCE_LIST */
- hid_t sid; /* space ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t aid = -1; /* attribute ID */
- int rank; /* rank of dataset */
- ds_list_t *dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
- ds_list_t *dsbufn = NULL; /* array of attribute data in the DS pointing to the dataset */
- hsize_t *dims = NULL; /* dimension of the "REFERENCE_LIST" array */
- hobj_ref_t ref; /* reference to the DS */
- hvl_t *buf = NULL; /* VL buffer to store in the attribute */
- unsigned i, j, jj;
- H5O_info_t oi1, oi2, oi3, oi4;
- int found_dset = 0, found_ds = 0;
- H5I_type_t it1, it2;
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* the dataset cannot be a DS dataset */
- if ((H5DSis_scale(did))==1)
- return FAIL;
-
- /* get info for the dataset in the parameter list */
- if(H5Oget_info(did, &oi1) < 0)
- return FAIL;
-
- /* get info for the scale in the parameter list */
- if(H5Oget_info(dsid, &oi2) < 0)
- return FAIL;
-
- /* same object, not valid */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- return FAIL;
-
- /* get ID type */
- if ((it1 = H5Iget_type(did)) < 0)
- return FAIL;
- if ((it2 = H5Iget_type(dsid)) < 0)
- return FAIL;
-
- if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
- return FAIL;
-
-
-/*-------------------------------------------------------------------------
- * Find "DIMENSION_LIST"
- *-------------------------------------------------------------------------
- */
- /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
- if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST)) < 0)
- return FAIL;
-
- if (has_dimlist == 0)
- return FAIL;
-
- /* get dataset space */
- if ((sid = H5Dget_space(did)) < 0)
- return FAIL;
-
- /* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* close dataset space */
- if (H5Sclose(sid) < 0)
- return FAIL;
-
-
-/*-------------------------------------------------------------------------
- * find "REFERENCE_LIST"
- *-------------------------------------------------------------------------
- */
-
- /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */
- if((has_reflist = H5LT_find_attribute(dsid, REFERENCE_LIST)) < 0)
- return FAIL;
-
- if(has_reflist == 0)
- return FAIL;
-
-/*-------------------------------------------------------------------------
- * open "DIMENSION_LIST", and delete the reference
- *-------------------------------------------------------------------------
- */
-
- if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
- return FAIL;
-
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
-
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- /* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
-
- if(buf == NULL)
- goto out;
-
- /* read */
- if (H5Aread(aid,tid,buf) < 0)
- goto out;
-
- /* reset */
- if ( buf[idx].len > 0 )
- {
- for (j=0; j<buf[idx].len; j++)
- {
- /* get the reference */
- ref = ((hobj_ref_t *)buf[idx].p)[j];
-
- /* get the DS id */
- if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
- goto out;
-
- /* get info for DS in the parameter list */
- if(H5Oget_info(dsid, &oi1) < 0)
- goto out;
-
- /* get info for this DS */
- if(H5Oget_info(dsid_j, &oi2) < 0)
- goto out;
-
- /* same object, reset */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr) {
- for(jj=j; jj<buf[idx].len-1; jj++)
- ((hobj_ref_t *)buf[idx].p)[jj] = ((hobj_ref_t *)buf[idx].p)[jj+1];
- buf[idx].len--;
-
- found_ds = 1;
-
- /* close the dereferenced dataset and break */
- if (H5Dclose(dsid_j) < 0)
- goto out;
- break;
- }
-
- /* close the dereferenced dataset */
- if (H5Dclose(dsid_j) < 0)
- goto out;
- } /* j */
- } /* if */
-
- /* write the attribute */
- if (H5Awrite(aid,tid,buf) < 0)
- goto out;
-
- /* close */
- if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
- goto out;
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Tclose(tid) < 0)
- goto out;
- if(H5Aclose(aid) < 0)
- goto out;
- if(buf)
- free(buf);
-
- /* the scale must be present */
- if(found_ds == 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * the "REFERENCE_LIST" array exists, update
- *-------------------------------------------------------------------------
- */
-
- if((aid = H5Aopen(dsid, REFERENCE_LIST, H5P_DEFAULT)) < 0)
- goto out;
-
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
-
- /* get and save the old reference(s) */
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
- goto out;
-
- dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t));
- if(dsbuf == NULL)
- goto out;
-
- if (H5Aread(aid,tid,dsbuf) < 0)
- goto out;
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid = -1; /* attribute ID */
+ int rank; /* rank of dataset */
+ ds_list_t *dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
+ ds_list_t *dsbufn = NULL; /* array of attribute data in the DS pointing to the dataset */
+ hsize_t *dims = NULL; /* dimension of the "REFERENCE_LIST" array */
+ hobj_ref_t ref; /* reference to the DS */
+ hvl_t *buf = NULL; /* VL buffer to store in the attribute */
+ unsigned i, j, jj;
+ H5O_info_t oi1, oi2, oi3, oi4;
+ int found_dset = 0, found_ds = 0;
+ H5I_type_t it1, it2;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* the dataset cannot be a DS dataset */
+ if ((H5DSis_scale(did))==1)
+ return FAIL;
+
+ /* get info for the dataset in the parameter list */
+ if(H5Oget_info(did, &oi1) < 0)
+ return FAIL;
+
+ /* get info for the scale in the parameter list */
+ if(H5Oget_info(dsid, &oi2) < 0)
+ return FAIL;
+
+ /* same object, not valid */
+ if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
+ return FAIL;
+
+ /* get ID type */
+ if ((it1 = H5Iget_type(did)) < 0)
+ return FAIL;
+ if ((it2 = H5Iget_type(dsid)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
+ return FAIL;
+
+
+ /*-------------------------------------------------------------------------
+ * Find "DIMENSION_LIST"
+ *-------------------------------------------------------------------------
+ */
+ /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
+ if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST)) < 0)
+ return FAIL;
+
+ if (has_dimlist == 0)
+ return FAIL;
+
+ /* get dataset space */
+ if ((sid = H5Dget_space(did)) < 0)
+ return FAIL;
+
+ /* get rank */
+ if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* close dataset space */
+ if (H5Sclose(sid) < 0)
+ return FAIL;
+
+
+ /*-------------------------------------------------------------------------
+ * find "REFERENCE_LIST"
+ *-------------------------------------------------------------------------
+ */
+
+ /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */
+ if((has_reflist = H5LT_find_attribute(dsid, REFERENCE_LIST)) < 0)
+ return FAIL;
+
+ if(has_reflist == 0)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * open "DIMENSION_LIST", and delete the reference
+ *-------------------------------------------------------------------------
+ */
+
+ if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
+ return FAIL;
+
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
+
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
+
+ /* allocate and initialize the VL */
+ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+
+ if(buf == NULL)
+ goto out;
+
+ /* read */
+ if (H5Aread(aid,tid,buf) < 0)
+ goto out;
+
+ /* reset */
+ if ( buf[idx].len > 0 )
+ {
+ for (j=0; j<buf[idx].len; j++)
+ {
+ /* get the reference */
+ ref = ((hobj_ref_t *)buf[idx].p)[j];
+
+ /* get the DS id */
+ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
+ goto out;
+
+ /* get info for DS in the parameter list */
+ if(H5Oget_info(dsid, &oi1) < 0)
+ goto out;
+
+ /* get info for this DS */
+ if(H5Oget_info(dsid_j, &oi2) < 0)
+ goto out;
+
+ /* same object, reset */
+ if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr) {
+ for(jj=j; jj<buf[idx].len-1; jj++)
+ ((hobj_ref_t *)buf[idx].p)[jj] = ((hobj_ref_t *)buf[idx].p)[jj+1];
+ buf[idx].len--;
+
+ found_ds = 1;
+
+ /* close the dereferenced dataset and break */
+ if (H5Dclose(dsid_j) < 0)
+ goto out;
+ break;
+ }
+
+ /* close the dereferenced dataset */
+ if (H5Dclose(dsid_j) < 0)
+ goto out;
+ } /* j */
+ } /* if */
+
+ /* write the attribute */
+ if (H5Awrite(aid,tid,buf) < 0)
+ goto out;
+
+ /* close */
+ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
+ goto out;
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
- for(i=0; i<nelmts; i++)
- {
- /* get the reference to the dataset */
- ref = dsbuf[i].ref;
+ /* the scale must be present */
+ if(found_ds == 0)
+ goto out;
- /* get the dataset id */
- if ((did_i = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * the "REFERENCE_LIST" array exists, update
+ *-------------------------------------------------------------------------
+ */
- /* get info for dataset in the parameter list */
- if(H5Oget_info(did, &oi3) < 0)
- goto out;
+ if((aid = H5Aopen(dsid, REFERENCE_LIST, H5P_DEFAULT)) < 0)
+ goto out;
- /* get info for this dataset */
- if(H5Oget_info(did_i, &oi4) < 0)
- goto out;
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
- /* same object, reset. we want to detach only for this DIM */
- if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && (int)idx == dsbuf[i].dim_idx) {
- for(jj=i; jj<nelmts-1; jj++)
- dsbuf[jj] = dsbuf[jj+1];
- nelmts--;
- found_dset=1;
+ /* get and save the old reference(s) */
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
- /* close the dereferenced dataset and break */
- if (H5Dclose(did_i) < 0)
- goto out;
- break;
- } /* if */
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
+ goto out;
- /* close the dereferenced dataset */
- if (H5Dclose(did_i) < 0)
- goto out;
+ dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t));
+ if(dsbuf == NULL)
+ goto out;
- } /* i */
+ if (H5Aread(aid,tid,dsbuf) < 0)
+ goto out;
- /* close space and attribute */
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
+ for(i=0; i<nelmts; i++)
+ {
+ /* get the reference to the dataset */
+ ref = dsbuf[i].ref;
+
+ /* get the dataset id */
+ if ((did_i = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
+ goto out;
+
+ /* get info for dataset in the parameter list */
+ if(H5Oget_info(did, &oi3) < 0)
+ goto out;
+
+ /* get info for this dataset */
+ if(H5Oget_info(did_i, &oi4) < 0)
+ goto out;
+
+ /* same object, reset. we want to detach only for this DIM */
+ if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && (int)idx == dsbuf[i].dim_idx) {
+ for(jj=i; jj<nelmts-1; jj++)
+ dsbuf[jj] = dsbuf[jj+1];
+ nelmts--;
+ found_dset=1;
+
+ /* close the dereferenced dataset and break */
+ if (H5Dclose(did_i) < 0)
+ goto out;
+ break;
+ } /* if */
+
+ /* close the dereferenced dataset */
+ if (H5Dclose(did_i) < 0)
+ goto out;
+
+ } /* i */
+
+ /* close space and attribute */
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * check if we found the pointed dataset
+ *-------------------------------------------------------------------------
+ */
+
+ /* the pointed dataset must exist */
+ if (found_dset == 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * create a new attribute
+ *-------------------------------------------------------------------------
+ */
+
+ /* the attribute must be deleted, in order to the new one can reflect the changes*/
+ if (H5Adelete(dsid, REFERENCE_LIST) < 0)
+ goto out;
+
+ /* don't do anything for an empty array */
+ if(nelmts)
+ {
+ /* create a new data space for the new references array */
+ dims = (hsize_t*)malloc((size_t)nelmts * sizeof (hsize_t));
+ if(dims == NULL)
+ goto out;
+ dims[0] = nelmts;
+
+ dsbufn = malloc((size_t)nelmts * sizeof(ds_list_t));
+ if(dsbufn == NULL)
+ goto out;
+
+ /* store the new information */
+ for(i = 0; i < nelmts; i++)
+ dsbufn[i] = dsbuf[i];
+
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ goto out;
+
+ /* create the attribute again with the changes of space */
+ if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* write the new attribute with the new references */
+ if(H5Awrite(aid, tid, dsbufn) < 0)
+ goto out;
+
+ /* close space and attribute */
+ if(H5Sclose(sid) < 0)
+ goto out;
+ if(H5Aclose(aid) < 0)
+ goto out;
+ } /* nelmts */
+
+ /* close type */
+ if (H5Tclose(tid) < 0)
+ goto out;
+
+ if (dsbuf)
+ {
+ free(dsbuf);
+ dsbuf=NULL;
+ }
+ if (dsbufn)
+ {
+ free(dsbufn);
+ dsbufn=NULL;
+ }
+ if (dims)
+ {
+ free(dims);
+ dims=NULL;
+ }
-/*-------------------------------------------------------------------------
- * check if we found the pointed dataset
- *-------------------------------------------------------------------------
- */
- /* the pointed dataset must exist */
- if (found_dset == 0)
- goto out;
+ return SUCCEED;
-/*-------------------------------------------------------------------------
- * create a new attribute
- *-------------------------------------------------------------------------
- */
-
- /* the attribute must be deleted, in order to the new one can reflect the changes*/
- if(H5Adelete(dsid, REFERENCE_LIST) < 0)
- goto out;
-
- /* don't do anything for an empty array */
- if(nelmts)
- {
- /* create a new data space for the new references array */
- dims = (hsize_t*)malloc((size_t)nelmts * sizeof (hsize_t));
- if(dims == NULL)
- goto out;
- dims[0] = nelmts;
-
- dsbufn = malloc((size_t)nelmts * sizeof(ds_list_t));
- if(dsbufn == NULL)
- goto out;
-
- /* store the new information */
- for(i = 0; i < nelmts; i++)
- dsbufn[i] = dsbuf[i];
-
- if((sid = H5Screate_simple(1, dims, NULL)) < 0)
- goto out;
-
- /* create the attribute again with the changes of space */
- if((aid = H5Acreate2(dsid, REFERENCE_LIST, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
-
- /* write the new attribute with the new references */
- if(H5Awrite(aid, tid, dsbufn) < 0)
- goto out;
-
- /* close space and attribute */
- if(H5Sclose(sid) < 0)
- goto out;
- if(H5Aclose(aid) < 0)
- goto out;
- } /* nelmts */
-
- /* close type */
- if (H5Tclose(tid) < 0)
- goto out;
-
- if (dsbuf) {
- free(dsbuf);
- dsbuf=NULL;
- }
- if (dsbufn) {
- free(dsbufn);
- dsbufn=NULL;
- }
- if (dims) {
- free(dims);
- dims=NULL;
- }
-
-
- return SUCCEED;
-
-/* error zone, gracefully close */
+ /* error zone */
out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Aclose(aid);
- H5Tclose(tid);
- if (dsbuf)
- free(dsbuf);
- if (dsbufn)
- free(dsbufn);
- if (dims)
- free(dims);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Tclose(tid);
+
+ if (dsbuf)
+ {
+ free(dsbuf);
+ dsbuf=NULL;
+ }
+ if (dsbufn)
+ {
+ free(dsbufn);
+ dsbufn=NULL;
+ }
+ if (dims)
+ {
+ free(dims);
+ dims=NULL;
+ }
+ if (buf)
+ {
+ free(buf);
+ buf=NULL;
+ }
+ } H5E_END_TRY;
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSis_attached
- *
- * Purpose: Report if dimension scale DSID is currently attached to
- * dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST
- * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute
- *
- * Return:
- * 1: both the DS and the dataset pointers match
- * 0: one of them or both do not match
- * FAIL (-1): error
- *
- * Fails if: Bad arguments
- * If DSID is not a Dimension Scale
- * If DID is a Dimension Scale (A Dimension Scale cannot have scales)
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: February 18, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSis_attached
+*
+* Purpose: Report if dimension scale DSID is currently attached to
+* dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST
+* attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute
+*
+* Return:
+* 1: both the DS and the dataset pointers match
+* 0: one of them or both do not match
+* FAIL (-1): error
+*
+* Fails if: Bad arguments
+* If DSID is not a Dimension Scale
+* If DID is a Dimension Scale (A Dimension Scale cannot have scales)
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: February 18, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
htri_t H5DSis_attached(hid_t did,
hid_t dsid,
unsigned int idx)
{
- int has_dimlist;
- int has_reflist;
- hssize_t nelmts;
- hid_t sid; /* space ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t aid = -1; /* attribute ID */
- int rank; /* rank of dataset */
- ds_list_t *dsbuf; /* array of attribute data in the DS pointing to the dataset */
- hobj_ref_t ref; /* reference to the DS */
- hvl_t *buf; /* VL buffer to store in the attribute */
- hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
+ int has_dimlist;
+ int has_reflist;
+ hssize_t nelmts;
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid = -1; /* attribute ID */
+ int rank; /* rank of dataset */
+ ds_list_t *dsbuf; /* array of attribute data in the DS pointing to the dataset */
+ hobj_ref_t ref; /* reference to the DS */
+ hvl_t *buf; /* VL buffer to store in the attribute */
+ hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
hid_t did_i; /* dataset ID in REFERENCE_LIST */
- H5O_info_t oi1, oi2, oi3, oi4;
- H5I_type_t it1, it2;
- int i;
- int found_dset=0, found_ds=0;
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* the dataset cannot be a DS dataset */
- if ((H5DSis_scale(did))==1)
- return FAIL;
-
- /* get info for the dataset in the parameter list */
- if(H5Oget_info(did, &oi1) < 0)
- return FAIL;
-
- /* get info for the scale in the parameter list */
- if(H5Oget_info(dsid, &oi2) < 0)
- return FAIL;
-
- /* same object, not valid */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- return FAIL;
-
- /* get ID type */
- if ((it1 = H5Iget_type(did)) < 0)
- return FAIL;
- if ((it2 = H5Iget_type(dsid)) < 0)
- return FAIL;
-
- if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
- return FAIL;
-
-/*-------------------------------------------------------------------------
- * get space
- *-------------------------------------------------------------------------
- */
-
- /* get dataset space */
- if ((sid = H5Dget_space(did)) < 0)
- return FAIL;
-
- /* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* close dataset space */
- if (H5Sclose(sid) < 0)
- goto out;
-
- /* parameter range checking */
- if(idx > ((unsigned)rank - 1))
- goto out;
-
- /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
- if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0)
- return FAIL;
-
-/*-------------------------------------------------------------------------
- * open "DIMENSION_LIST"
- *-------------------------------------------------------------------------
- */
-
- if(has_dimlist == 1)
- {
- if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
- goto out;
-
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
-
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- /* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
-
- if(buf == NULL)
- goto out;
-
- /* read */
- if (H5Aread(aid,tid,buf) < 0)
- goto out;
-
- /* iterate all the REFs in this dimension IDX */
- for (i=0; i<(int)buf[idx].len; i++)
- {
- /* get the reference */
- ref = ((hobj_ref_t *)buf[idx].p)[i];
-
- /* get the scale id for this REF */
- if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
- goto out;
-
- /* get info for DS in the parameter list */
- if(H5Oget_info(dsid, &oi1) < 0)
- goto out;
-
- /* get info for this DS */
- if(H5Oget_info(dsid_j, &oi2) < 0)
- goto out;
-
- /* same object */
- if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
- found_ds = 1;
-
- /* close the dereferenced dataset */
- if (H5Dclose(dsid_j) < 0)
- goto out;
-
- }
-
-
- /* close */
- if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
- goto out;
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (buf)
- free(buf);
- } /* has_dimlist */
-
-/*-------------------------------------------------------------------------
- * info on the >>DS<< dataset
- *-------------------------------------------------------------------------
- */
-
- /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */
- if((has_reflist = H5LT_find_attribute(dsid, REFERENCE_LIST)) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * open "REFERENCE_LIST"
- *-------------------------------------------------------------------------
- */
-
- if(has_reflist == 1)
- {
- if((aid = H5Aopen(dsid, REFERENCE_LIST, H5P_DEFAULT)) < 0)
- goto out;
-
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
-
- /* get and save the old reference(s) */
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
- goto out;
-
- dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t));
-
- if (dsbuf == NULL)
- goto out;
-
- if (H5Aread(aid,tid,dsbuf) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * iterate
- *-------------------------------------------------------------------------
- */
-
- for(i=0; i<nelmts; i++)
- {
- /* get the reference */
- ref = dsbuf[i].ref;
-
- /* the reference was not deleted */
- if (ref)
- {
- /* get the dataset id */
- if ((did_i = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
- goto out;
-
- /* get info for dataset in the parameter list */
- if(H5Oget_info(did, &oi3) < 0)
- goto out;
-
- /* get info for this dataset */
- if(H5Oget_info(did_i, &oi4) < 0)
- goto out;
-
- /* same object */
- if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && (int)idx==dsbuf[i].dim_idx)
- found_dset=1;
-
- /* close the dereferenced dataset */
- if (H5Dclose(did_i) < 0)
- goto out;
- } /* if */
- } /* i */
-
-
- /* close */
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (dsbuf)
- free(dsbuf);
- } /* has_reflist */
-
- if (found_ds && found_dset)
- return 1;
- else
- return 0;
-
-/* error zone, gracefully close */
+ H5O_info_t oi1, oi2, oi3, oi4;
+ H5I_type_t it1, it2;
+ int i;
+ int found_dset=0, found_ds=0;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* the dataset cannot be a DS dataset */
+ if ((H5DSis_scale(did))==1)
+ return FAIL;
+
+ /* get info for the dataset in the parameter list */
+ if(H5Oget_info(did, &oi1) < 0)
+ return FAIL;
+
+ /* get info for the scale in the parameter list */
+ if(H5Oget_info(dsid, &oi2) < 0)
+ return FAIL;
+
+ /* same object, not valid */
+ if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
+ return FAIL;
+
+ /* get ID type */
+ if ((it1 = H5Iget_type(did)) < 0)
+ return FAIL;
+ if ((it2 = H5Iget_type(dsid)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET!=it1 || H5I_DATASET!=it2)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * get space
+ *-------------------------------------------------------------------------
+ */
+
+ /* get dataset space */
+ if ((sid = H5Dget_space(did)) < 0)
+ return FAIL;
+
+ /* get rank */
+ if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* close dataset space */
+ if (H5Sclose(sid) < 0)
+ goto out;
+
+ /* parameter range checking */
+ if(idx > ((unsigned)rank - 1))
+ goto out;
+
+ /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
+ if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * open "DIMENSION_LIST"
+ *-------------------------------------------------------------------------
+ */
+
+ if(has_dimlist == 1)
+ {
+ if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
+ goto out;
+
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
+
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
+
+ /* allocate and initialize the VL */
+ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+
+ if(buf == NULL)
+ goto out;
+
+ /* read */
+ if (H5Aread(aid,tid,buf) < 0)
+ goto out;
+
+ /* iterate all the REFs in this dimension IDX */
+ for (i=0; i<(int)buf[idx].len; i++)
+ {
+ /* get the reference */
+ ref = ((hobj_ref_t *)buf[idx].p)[i];
+
+ /* get the scale id for this REF */
+ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
+ goto out;
+
+ /* get info for DS in the parameter list */
+ if(H5Oget_info(dsid, &oi1) < 0)
+ goto out;
+
+ /* get info for this DS */
+ if(H5Oget_info(dsid_j, &oi2) < 0)
+ goto out;
+
+ /* same object */
+ if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
+ found_ds = 1;
+
+ /* close the dereferenced dataset */
+ if (H5Dclose(dsid_j) < 0)
+ goto out;
+
+ }
+
+
+ /* close */
+ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
+ goto out;
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
+ } /* has_dimlist */
+
+ /*-------------------------------------------------------------------------
+ * info on the >>DS<< dataset
+ *-------------------------------------------------------------------------
+ */
+
+ /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */
+ if((has_reflist = H5LT_find_attribute(dsid, REFERENCE_LIST)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * open "REFERENCE_LIST"
+ *-------------------------------------------------------------------------
+ */
+
+ if(has_reflist == 1)
+ {
+ if((aid = H5Aopen(dsid, REFERENCE_LIST, H5P_DEFAULT)) < 0)
+ goto out;
+
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
+
+ /* get and save the old reference(s) */
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
+
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
+ goto out;
+
+ dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t));
+
+ if (dsbuf == NULL)
+ goto out;
+
+ if (H5Aread(aid,tid,dsbuf) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * iterate
+ *-------------------------------------------------------------------------
+ */
+
+ for(i=0; i<nelmts; i++)
+ {
+ /* get the reference */
+ ref = dsbuf[i].ref;
+
+ /* the reference was not deleted */
+ if (ref)
+ {
+ /* get the dataset id */
+ if ((did_i = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
+ goto out;
+
+ /* get info for dataset in the parameter list */
+ if(H5Oget_info(did, &oi3) < 0)
+ goto out;
+
+ /* get info for this dataset */
+ if(H5Oget_info(did_i, &oi4) < 0)
+ goto out;
+
+ /* same object */
+ if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && (int)idx==dsbuf[i].dim_idx)
+ found_dset=1;
+
+ /* close the dereferenced dataset */
+ if (H5Dclose(did_i) < 0)
+ goto out;
+ } /* if */
+ } /* i */
+
+
+ /* close */
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (dsbuf)
+ {
+ free(dsbuf);
+ dsbuf = NULL;
+ }
+ } /* has_reflist */
+
+ if (found_ds && found_dset)
+ return 1;
+ else
+ return 0;
+
+ /* error zone */
out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Aclose(aid);
- H5Tclose(tid);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
+ if (dsbuf)
+ {
+ free(dsbuf);
+ dsbuf = NULL;
+ }
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSiterate_scales
- *
- * Purpose: H5DSiterate_scales iterates over the scales attached to dimension DIM
- * of dataset DID. For each scale in the list, the visitor_data and some
- * additional information, specified below, are passed to the visitor function.
- * The iteration begins with the IDX object in the group and the next element
- * to be processed by the operator is returned in IDX. If IDX is NULL, then the
- * iterator starts at zero.
- *
- * Parameters:
- *
- * hid_t DID; IN: the dataset
- * unsigned int dim; IN: the dimension of the dataset
- * int *idx; IN/OUT: input the index to start iterating, output the
- * next index to visit. If NULL, start at the first position.
- * H5DS_iterate_t visitor; IN: the visitor function
- * void *visitor_data; IN: arbitrary data to pass to the visitor function.
- *
- * Iterate over all scales of DIM, calling an application callback
- * with the item, key and any operator data.
- *
- * The operator callback receives a pointer to the item ,
- * and the pointer to the operator data passed
- * in to H5SL_iterate ('op_data'). The return values from an operator are:
- * A. Zero causes the iterator to continue, returning zero when all
- * nodes of that type have been processed.
- * B. Positive causes the iterator to immediately return that positive
- * value, indicating short-circuit success.
- * C. Negative causes the iterator to immediately return that value,
- * indicating failure.
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: January 31, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSiterate_scales
+*
+* Purpose: H5DSiterate_scales iterates over the scales attached to dimension DIM
+* of dataset DID. For each scale in the list, the visitor_data and some
+* additional information, specified below, are passed to the visitor function.
+* The iteration begins with the IDX object in the group and the next element
+* to be processed by the operator is returned in IDX. If IDX is NULL, then the
+* iterator starts at zero.
+*
+* Parameters:
+*
+* hid_t DID; IN: the dataset
+* unsigned int dim; IN: the dimension of the dataset
+* int *idx; IN/OUT: input the index to start iterating, output the
+* next index to visit. If NULL, start at the first position.
+* H5DS_iterate_t visitor; IN: the visitor function
+* void *visitor_data; IN: arbitrary data to pass to the visitor function.
+*
+* Iterate over all scales of DIM, calling an application callback
+* with the item, key and any operator data.
+*
+* The operator callback receives a pointer to the item ,
+* and the pointer to the operator data passed
+* in to H5SL_iterate ('op_data'). The return values from an operator are:
+* A. Zero causes the iterator to continue, returning zero when all
+* nodes of that type have been processed.
+* B. Positive causes the iterator to immediately return that positive
+* value, indicating short-circuit success.
+* C. Negative causes the iterator to immediately return that value,
+* indicating failure.
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: January 31, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
herr_t H5DSiterate_scales(hid_t did,
unsigned int dim,
@@ -1228,839 +1302,895 @@ herr_t H5DSiterate_scales(hid_t did,
H5DS_iterate_t visitor,
void *visitor_data )
{
- hid_t scale_id;
- int rank;
- hobj_ref_t ref; /* reference to the DS */
- hid_t sid; /* space ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t aid = -1; /* attribute ID */
- hvl_t *buf=NULL; /* VL buffer to store in the attribute */
- H5I_type_t it; /* ID type */
- herr_t ret_value=0;
- int j_idx;
- int nscales;
- int has_dimlist;
- int i;
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* get ID type */
- if ((it = H5Iget_type(did)) < 0)
- return FAIL;
-
- if (H5I_DATASET!=it)
- return FAIL;
-
- /* get the number of scales assotiated with this DIM */
- if ((nscales = H5DSget_num_scales(did,dim)) < 0)
- return FAIL;
-
- /* get dataset space */
- if ((sid = H5Dget_space(did)) < 0)
- return FAIL;
-
- /* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* close dataset space */
- if(H5Sclose(sid) < 0)
- goto out;
-
- /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
- if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0)
- return FAIL;
-
- if(has_dimlist == 0)
- return SUCCEED;
-
- else if(has_dimlist == 1)
- {
- if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
- goto out;
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- /* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
-
- if(buf == NULL)
- goto out;
-
- /* read */
- if(H5Aread(aid, tid, buf) < 0)
- goto out;
-
- if ( buf[dim].len > 0 )
- {
- if (idx!=NULL)
- j_idx = *idx;
- else
- j_idx=0;
-
- /* iterate */
- for(i=j_idx; i<nscales; i++)
- {
- /* get the reference */
- ref = ((hobj_ref_t *)buf[dim].p)[ i ];
-
- /* disable error reporting, the ID might refer to a deleted dataset */
- H5E_BEGIN_TRY {
- /* get the DS id */
- if ((scale_id = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
- goto out;
- } H5E_END_TRY;
-
- if((ret_value=(visitor)(did,dim,scale_id,visitor_data))!=0)
+ hid_t scale_id;
+ int rank;
+ hobj_ref_t ref; /* reference to the DS */
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid = -1; /* attribute ID */
+ hvl_t *buf=NULL; /* VL buffer to store in the attribute */
+ H5I_type_t it; /* ID type */
+ herr_t ret_value=0;
+ int j_idx;
+ int nscales;
+ int has_dimlist;
+ int i;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* get ID type */
+ if ((it = H5Iget_type(did)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET!=it)
+ return FAIL;
+
+ /* get the number of scales assotiated with this DIM */
+ if ((nscales = H5DSget_num_scales(did,dim)) < 0)
+ return FAIL;
+
+ /* get dataset space */
+ if ((sid = H5Dget_space(did)) < 0)
+ return FAIL;
+
+ /* get rank */
+ if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* close dataset space */
+ if(H5Sclose(sid) < 0)
+ goto out;
+
+ /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
+ if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0)
+ return FAIL;
+
+ if(has_dimlist == 0)
+ return SUCCEED;
+
+ else if(has_dimlist == 1)
{
- /* set the return IDX OUT value at current scale index and break */
- if (idx!=NULL)
- {
- *idx = i;
- }
-
- /* close the DS id */
- if (H5Dclose(scale_id) < 0)
- goto out;
-
- break;
- }
-
- /* close the DS id */
- if (H5Dclose(scale_id) < 0)
- goto out;
-
- } /* i */
- } /* if */
-
- /* close */
- if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
- goto out;
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (buf)
- free(buf);
-
- } /* if has_dimlist */
-
- return ret_value;
+ if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
+ goto out;
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
+
+ /* allocate and initialize the VL */
+ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+
+ if(buf == NULL)
+ goto out;
+
+ /* read */
+ if(H5Aread(aid, tid, buf) < 0)
+ goto out;
+
+ if ( buf[dim].len > 0 )
+ {
+ if (idx!=NULL)
+ j_idx = *idx;
+ else
+ j_idx=0;
+
+ /* iterate */
+ for(i=j_idx; i<nscales; i++)
+ {
+ /* get the reference */
+ ref = ((hobj_ref_t *)buf[dim].p)[ i ];
+
+ /* disable error reporting, the ID might refer to a deleted dataset */
+ H5E_BEGIN_TRY {
+ /* get the DS id */
+ if ((scale_id = H5Rdereference(did,H5R_OBJECT,&ref)) < 0)
+ goto out;
+ } H5E_END_TRY;
+
+ if((ret_value=(visitor)(did,dim,scale_id,visitor_data))!=0)
+ {
+ /* set the return IDX OUT value at current scale index and break */
+ if (idx!=NULL)
+ {
+ *idx = i;
+ }
+
+ /* close the DS id */
+ if (H5Dclose(scale_id) < 0)
+ goto out;
+
+ break;
+ }
+
+ /* close the DS id */
+ if (H5Dclose(scale_id) < 0)
+ goto out;
+
+ } /* i */
+ } /* if */
+
+ /* close */
+ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
+ goto out;
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
+
+ } /* if has_dimlist */
+
+ return ret_value;
out:
- H5E_BEGIN_TRY {
- if (buf)
- {
- H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf);
- free(buf);
- }
- H5Sclose(sid);
- H5Aclose(aid);
- H5Tclose(tid);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ if (buf)
+ {
+ H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf);
+ free(buf);
+ }
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSset_label
- *
- * Purpose: Set label for the dimension IDX of dataset DID to the value LABEL
- *
- * Return: Success: SUCCEED, Failure: FAIL
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: January 11, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-herr_t H5DSset_label(hid_t did,
- unsigned int idx,
- const char *label)
-{
- int has_labels;
- hid_t sid; /* space ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t aid = -1; /* attribute ID */
- int rank; /* rank of dataset */
- hsize_t dims[1]; /* dimensions of dataset */
- const char **buf=NULL; /* buffer to store in the attribute */
- H5I_type_t it; /* ID type */
- unsigned int i;
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* get ID type */
- if ((it = H5Iget_type(did)) < 0)
- return FAIL;
-
- if (H5I_DATASET!=it)
- return FAIL;
-
-/*-------------------------------------------------------------------------
- * attribute "DIMENSION_LABELS"
- *-------------------------------------------------------------------------
- */
-
- /* try to find the attribute "DIMENSION_LABELS" on the >>data<< dataset */
- if ((has_labels = H5LT_find_attribute(did,DIMENSION_LABELS)) < 0)
- return FAIL;
-
- /* get dataset space */
- if ((sid = H5Dget_space(did)) < 0)
- return FAIL;
-
- /* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* close dataset space */
- if (H5Sclose(sid) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * make the attribute and insert label
- *-------------------------------------------------------------------------
- */
-
- if (has_labels == 0)
- {
- dims[0] = rank;
-
- /* space for the attribute */
- if((sid = H5Screate_simple(1, dims, NULL)) < 0)
- goto out;
-
- /* create the datatype */
- if((tid = H5Tcopy(H5T_C_S1)) < 0)
- goto out;
- if(H5Tset_size(tid, H5T_VARIABLE) < 0)
- goto out;
-
- /* create the attribute */
- if((aid = H5Acreate2(did, DIMENSION_LABELS, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
-
- /* allocate and initialize */
- buf = (const char **)malloc((size_t)rank * sizeof(char *));
-
- if(buf == NULL)
- goto out;
-
- for(i = 0; i < (unsigned int)rank; i++)
- buf[i] = NULL;
-
- /* store the label information in the required index */
- buf[idx] = label;
-
- /* write the attribute with the label */
- if (H5Awrite(aid,tid,buf) < 0)
- goto out;
-
- /* close */
- if (H5Sclose(sid) < 0)
- goto out;
- if(H5Tclose(tid) < 0)
- goto out;
- if(H5Aclose(aid) < 0)
- goto out;
- if(buf)
- free((void *)buf);
- }
-
-/*-------------------------------------------------------------------------
- * just insert label
- *-------------------------------------------------------------------------
- */
-
- else
- {
- if((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0)
- goto out;
-
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
-
- /* allocate and initialize */
- buf = (const char **)malloc((size_t)rank * sizeof(char *));
-
- if(buf == NULL)
- goto out;
-
- /* read */
- if(H5Aread(aid, tid, (void *)buf) < 0)
- goto out;
-
- /* store the label information in the required index */
- buf[idx] = label;
-
- /* write the attribute with the new references */
- if (H5Awrite(aid,tid,buf) < 0)
- goto out;
-
- /* close */
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (buf)
- free((void *)buf);
- }
+* Function: H5DSset_label
+*
+* Purpose: Set label for the dimension IDX of dataset DID to the value LABEL
+*
+* Return: Success: SUCCEED, Failure: FAIL
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: January 11, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
+
+herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) {
+ int has_labels;
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid = -1; /* attribute ID */
+ int rank; /* rank of dataset */
+ hsize_t dims[1]; /* dimensions of dataset */
+ const char **buf = NULL; /* buffer to store in the attribute */
+ H5I_type_t it; /* ID type */
+ unsigned int i;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* get ID type */
+ if ((it = H5Iget_type(did)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET != it)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * attribute "DIMENSION_LABELS"
+ *-------------------------------------------------------------------------
+ */
+
+ /* try to find the attribute "DIMENSION_LABELS" on the >>data<< dataset */
+ if ((has_labels = H5LT_find_attribute(did, DIMENSION_LABELS)) < 0)
+ return FAIL;
+
+ /* get dataset space */
+ if ((sid = H5Dget_space(did)) < 0)
+ return FAIL;
+
+ /* get rank */
+ if ((rank = H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* close dataset space */
+ if (H5Sclose(sid) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * make the attribute and insert label
+ *-------------------------------------------------------------------------
+ */
+
+ if (has_labels == 0) {
+ dims[0] = rank;
+
+ /* space for the attribute */
+ if ((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ goto out;
+
+ /* create the datatype */
+ if ((tid = H5Tcopy(H5T_C_S1)) < 0)
+ goto out;
+ if (H5Tset_size(tid, H5T_VARIABLE) < 0)
+ goto out;
+
+ /* create the attribute */
+ if ((aid = H5Acreate2(did, DIMENSION_LABELS, tid, sid,
+ H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* allocate and initialize */
+ buf = (const char **) malloc((size_t) rank * sizeof(char *));
+
+ if (buf == NULL)
+ goto out;
+
+ for (i = 0; i < (unsigned int) rank; i++)
+ buf[i] = NULL;
+
+ /* store the label information in the required index */
+ buf[idx] = label;
+
+ /* write the attribute with the label */
+ if (H5Awrite(aid, tid, buf) < 0)
+ goto out;
+
+ /* close */
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (buf)
+ {
+ free((void *) buf);
+ buf = NULL;
+ }
+ }
- return SUCCEED;
+ /*-------------------------------------------------------------------------
+ * just insert label
+ *-------------------------------------------------------------------------
+ */
+
+ else {
+ if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0)
+ goto out;
+
+ if ((tid = H5Aget_type(aid)) < 0)
+ goto out;
+
+ /* allocate and initialize */
+ buf = (const char **) malloc((size_t) rank * sizeof(char *));
+
+ if (buf == NULL)
+ goto out;
+
+ /* read */
+ if (H5Aread(aid, tid, (void *) buf) < 0)
+ goto out;
+
+ /* free the ptr that will be replaced by label */
+ if (buf[idx])
+ free(buf[idx]);
+
+ /* store the label information in the required index */
+ buf[idx] = label;
+
+ /* write the attribute with the new references */
+ if (H5Awrite(aid, tid, buf) < 0)
+ goto out;
+
+ /* label was brought in, so don't free */
+ buf[idx] = NULL;
+
+ /* free all the ptr's from the H5Aread() */
+ for (i = 0; i < (unsigned int) rank; i++) {
+ if (buf[i])
+ free(buf[i]);
+ }
+
+ /* close */
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (buf)
+ {
+ free((void *) buf);
+ buf = NULL;
+ }
+ }
- /* error zone, gracefully close */
-out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Aclose(aid);
- H5Tclose(tid);
- } H5E_END_TRY;
- return FAIL;
+ return SUCCEED;
+
+ /* error zone */
+out:
+ if (buf) {
+ if (buf[idx]) /* check if we errored during H5Awrite */
+ buf[idx] = NULL; /* don't free label */
+ /* free all the ptr's from the H5Aread() */
+ for (i = 0; i < (unsigned int) rank; i++) {
+ if (buf[i])
+ free(buf[i]);
+ }
+ free(buf);
+ }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Tclose(tid);
+ }H5E_END_TRY;
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSget_label
- *
- * Purpose: Read the label LABEL for dimension IDX of dataset DID
- * Up to 'size' characters are stored in 'label' followed by a '\0' string
- * terminator. If the label is longer than 'size'-1,
- * the string terminator is stored in the last position of the buffer to
- * properly terminate the string.
- *
- * Return: 0 if no label found, size of label if found, Failure: FAIL
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: January 11, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-ssize_t H5DSget_label(hid_t did,
- unsigned int idx,
- char *label,
- size_t size)
-{
- int has_labels;
- hid_t sid; /* space ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t aid = -1; /* attribute ID */
- int rank; /* rank of dataset */
- char **buf=NULL; /* buffer to store in the attribute */
- H5I_type_t it; /* ID type */
- size_t nbytes;
- size_t copy_len;
+* Function: H5DSget_label
+*
+* Purpose: Read the label LABEL for dimension IDX of dataset DID
+* Up to 'size' characters are stored in 'label' followed by a '\0' string
+* terminator. If the label is longer than 'size'-1,
+* the string terminator is stored in the last position of the buffer to
+* properly terminate the string.
+*
+* Return: 0 if no label found, size of label if found, Failure: FAIL
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: January 11, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
+ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) {
+ int has_labels;
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid = -1; /* attribute ID */
+ int rank; /* rank of dataset */
+ char **buf = NULL; /* buffer to store in the attribute */
+ H5I_type_t it; /* ID type */
+ size_t nbytes;
+ size_t copy_len;
+ int i;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* get ID type */
+ if ((it = H5Iget_type(did)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET != it)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * attribute "DIMENSION_LABELS"
+ *-------------------------------------------------------------------------
+ */
+
+ /* try to find the attribute "DIMENSION_LABELS" on the >>data<< dataset */
+ if ((has_labels = H5LT_find_attribute(did, DIMENSION_LABELS)) < 0)
+ return FAIL;
+
+ /* return 0 and NULL for label if no label found */
+ if (has_labels == 0)
+ {
+ if (label)
+ label[0] = 0;
+ return 0;
+ }
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* get ID type */
- if ((it = H5Iget_type(did)) < 0)
- return FAIL;
+ /* get dataset space */
+ if ((sid = H5Dget_space(did)) < 0)
+ return FAIL;
- if (H5I_DATASET!=it)
- return FAIL;
+ /* get rank */
+ if ((rank = H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * attribute "DIMENSION_LABELS"
- *-------------------------------------------------------------------------
- */
-
- /* try to find the attribute "DIMENSION_LABELS" on the >>data<< dataset */
- if ((has_labels = H5LT_find_attribute(did,DIMENSION_LABELS)) < 0)
- return FAIL;
-
- /* return 0 and NULL for label if no label found */
- if (has_labels == 0)
- {
- if (label)
- label=NULL;
- return 0;
- }
-
- /* get dataset space */
- if ((sid = H5Dget_space(did)) < 0)
- return FAIL;
-
- /* get rank */
- if((rank = H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* close dataset space */
- if(H5Sclose(sid) < 0)
- goto out;
+ /* close dataset space */
+ if (H5Sclose(sid) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * open the attribute and read label
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * open the attribute and read label
+ *-------------------------------------------------------------------------
+ */
- assert (has_labels == 1);
- if((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0)
- goto out;
+ assert (has_labels == 1);
+ if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0)
+ goto out;
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
+ if ((tid = H5Aget_type(aid)) < 0)
+ goto out;
- /* allocate and initialize */
- buf = (char **)malloc((size_t)rank * sizeof(char *));
+ /* allocate and initialize */
+ buf = (char **) malloc((size_t) rank * sizeof(char *));
- if(buf == NULL)
- goto out;
+ if (buf == NULL)
+ goto out;
- /* read */
- if(H5Aread(aid, tid, buf) < 0)
- goto out;
+ /* read */
+ if (H5Aread(aid, tid, buf) < 0)
+ goto out;
- /* get the real string length */
- nbytes = strlen(buf[idx]);
+ /* get the real string length */
+ nbytes = strlen(buf[idx]);
- /* compute the string length which will fit into the user's buffer */
- copy_len = MIN(size-1, nbytes);
+ /* compute the string length which will fit into the user's buffer */
+ copy_len = MIN(size-1, nbytes);
- /* copy all/some of the name */
- if( label ) {
- memcpy(label, buf[idx], copy_len);
+ /* copy all/some of the name */
+ if (label) {
+ memcpy(label, buf[idx], copy_len);
- /* terminate the string */
- label[copy_len]='\0';
+ /* terminate the string */
+ label[copy_len] = '\0';
+ }
- /* close */
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (buf)
- free(buf);
- }
+ /* free all the ptr's from the H5Aread() */
+ for (i = 0; i < (unsigned int) rank; i++) {
+ if (buf[i])
+ free(buf[i]);
+ }
- return (ssize_t) nbytes;
+ /* close */
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
- /* error zone, gracefully close */
-out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Aclose(aid);
- H5Tclose(tid);
- } H5E_END_TRY;
- return FAIL;
+ return (ssize_t) nbytes;
+
+ /* error zone */
+out:
+ if (buf) {
+ /* free all the ptr's from the H5Aread() */
+ for (i = 0; i < (unsigned int) rank; i++) {
+ if (buf[i])
+ free(buf[i]);
+ }
+ free(buf);
+ }
+ H5E_BEGIN_TRY
+ {
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Tclose(tid);
+ }H5E_END_TRY;
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSget_scale_name
- *
- * Purpose: Read the name of dataset scale DID into buffer NAME
- * Up to 'size' characters are stored in 'name' followed by a '\0' string
- * terminator. If the name is longer than 'size'-1,
- * the string terminator is stored in the last position of the buffer to
- * properly terminate the string.
- *
- * Return: size of name if found, zero if not found, Failure: FAIL
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: January 04, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSget_scale_name
+*
+* Purpose: Read the name of dataset scale DID into buffer NAME
+* Up to 'size' characters are stored in 'name' followed by a '\0' string
+* terminator. If the name is longer than 'size'-1,
+* the string terminator is stored in the last position of the buffer to
+* properly terminate the string.
+*
+* Return: size of name if found, zero if not found, Failure: FAIL
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: January 04, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
ssize_t H5DSget_scale_name(hid_t did,
char *name,
size_t size)
{
- hid_t aid; /* attribute ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t sid; /* space ID */
- H5I_type_t it; /* ID type */
- size_t nbytes;
- size_t copy_len;
- int has_name;
- char *buf=NULL;
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* get ID type */
- if ((it = H5Iget_type(did)) < 0)
- return FAIL;
-
- if (H5I_DATASET!=it)
- return FAIL;
-
- if ((H5DSis_scale(did))<=0)
- return FAIL;
-
-/*-------------------------------------------------------------------------
- * check if the DS has a name
- *-------------------------------------------------------------------------
- */
+ hid_t aid; /* attribute ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t sid; /* space ID */
+ H5I_type_t it; /* ID type */
+ size_t nbytes;
+ size_t copy_len;
+ int has_name;
+ char *buf=NULL;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* get ID type */
+ if ((it = H5Iget_type(did)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET!=it)
+ return FAIL;
+
+ if ((H5DSis_scale(did))<=0)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * check if the DS has a name
+ *-------------------------------------------------------------------------
+ */
+
+ /* try to find the attribute "NAME" on the >>DS<< dataset */
+ if ((has_name = H5LT_find_attribute(did, "NAME")) < 0)
+ return FAIL;
+
+ if (has_name == 0)
+ return 0;
+
+ /*-------------------------------------------------------------------------
+ * open the attribute
+ *-------------------------------------------------------------------------
+ */
+
+ if((aid = H5Aopen(did, "NAME", H5P_DEFAULT)) < 0)
+ return FAIL;
+
+ /* get space */
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
+
+ /* get type */
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
+
+ /* get the size */
+ if((nbytes = H5Tget_size(tid)) == 0)
+ goto out;
+
+ /* allocate a temporary buffer */
+ buf = (char*)malloc(nbytes * sizeof(char));
+ if (buf == NULL)
+ goto out;
+
+ /* read */
+ if (H5Aread(aid,tid,buf) < 0)
+ goto out;
+
+ /* compute the string length which will fit into the user's buffer */
+ copy_len = MIN(size-1, nbytes);
+
+ /* copy all/some of the name */
+ if (name) {
+ memcpy(name, buf, copy_len);
+
+ /* terminate the string */
+ name[copy_len]='\0';
+ }
- /* try to find the attribute "NAME" on the >>DS<< dataset */
- if((has_name = H5LT_find_attribute(did, "NAME")) < 0)
- return FAIL;
+ /* close */
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (buf)
+ {
+ free(buf);
+ buf=NULL;
+ }
- if(has_name == 0)
- return 0;
+ return (ssize_t) nbytes;
-/*-------------------------------------------------------------------------
- * open the attribute
- *-------------------------------------------------------------------------
- */
-
- if((aid = H5Aopen(did, "NAME", H5P_DEFAULT)) < 0)
- return FAIL;
-
- /* get space */
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- /* get type */
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
-
- /* get the size */
- if((nbytes = H5Tget_size(tid)) == 0)
- goto out;
-
- /* allocate a temporary buffer */
- buf = (char*)malloc(nbytes * sizeof(char));
- if (buf == NULL)
- goto out;
-
- /* read */
- if (H5Aread(aid,tid,buf) < 0)
- goto out;
-
- /* compute the string length which will fit into the user's buffer */
- copy_len = MIN(size-1, nbytes);
-
- /* copy all/some of the name */
- if (name) {
- memcpy(name, buf, copy_len);
-
- /* terminate the string */
- name[copy_len]='\0';
- }
-
- /* close */
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (H5Sclose(sid) < 0)
- goto out;
- if (buf)
- {
- free(buf);
- buf=NULL;
- }
-
- return (ssize_t) nbytes;
-
- /* error zone, gracefully close */
+ /* error zone */
out:
- H5E_BEGIN_TRY {
- H5Aclose(aid);
- H5Tclose(tid);
- H5Sclose(sid);
- } H5E_END_TRY;
- if (buf)
- free(buf);
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Aclose(aid);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+ if (buf)
+ {
+ free(buf);
+ buf=NULL;
+ }
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSis_scale
- *
- * Purpose: check if the dataset DID is a dimension scale
- *
- * Return: 1, is, 0, not, FAIL, error
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: January 04, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSis_scale
+*
+* Purpose: check if the dataset DID is a dimension scale
+*
+* Return: 1, is, 0, not, FAIL, error
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: January 04, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
htri_t H5DSis_scale(hid_t did)
{
- hid_t tid = -1; /* attribute type ID */
- hid_t aid; /* attribute ID */
- herr_t has_class; /* has the "CLASS" attribute */
- htri_t is_ds; /* boolean return value */
- H5I_type_t it; /* ID type */
- char buf[20];
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* get ID type */
- if ((it = H5Iget_type(did)) < 0)
- return FAIL;
-
- if(H5I_DATASET != it)
- return FAIL;
-
- /* try to find the attribute "CLASS" on the dataset */
- if((has_class = H5LT_find_attribute(did, "CLASS")) < 0)
- return FAIL;
-
- if(has_class == 0)
- is_ds = 0;
-
- else
- {
- if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0)
- goto out;
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid; /* attribute ID */
+ herr_t has_class; /* has the "CLASS" attribute */
+ htri_t is_ds; /* boolean return value */
+ H5I_type_t it; /* ID type */
+ char buf[20];
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* get ID type */
+ if ((it = H5Iget_type(did)) < 0)
+ return FAIL;
+
+ if(H5I_DATASET != it)
+ return FAIL;
+
+ /* try to find the attribute "CLASS" on the dataset */
+ if((has_class = H5LT_find_attribute(did, "CLASS")) < 0)
+ return FAIL;
+
+ if(has_class == 0)
+ is_ds = 0;
+
+ else
+ {
+ if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0)
+ goto out;
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
- if(H5Aread(aid, tid, buf) < 0)
- goto out;
+ if(H5Aread(aid, tid, buf) < 0)
+ goto out;
- if(strcmp(buf, DIMENSION_SCALE_CLASS)==0)
- is_ds = 1;
- else
- is_ds = 0;
+ if(strcmp(buf, DIMENSION_SCALE_CLASS)==0)
+ is_ds = 1;
+ else
+ is_ds = 0;
- if(H5Tclose(tid) < 0)
- goto out;
+ if(H5Tclose(tid) < 0)
+ goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- }
+ if (H5Aclose(aid) < 0)
+ goto out;
+ }
- return is_ds;
+ return is_ds;
-/* error zone, gracefully close */
+ /* error zone */
out:
- H5E_BEGIN_TRY {
- H5Aclose(aid);
- H5Tclose(tid);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Aclose(aid);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DSget_num_scales
- *
- * Purpose: get the number of scales linked to the IDX dimension of dataset DID
- *
- * Return:
- * Success: number of scales
- * Failure: FAIL
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: January 13, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DSget_num_scales
+*
+* Purpose: get the number of scales linked to the IDX dimension of dataset DID
+*
+* Return:
+* Success: number of scales
+* Failure: FAIL
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: January 13, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
int H5DSget_num_scales(hid_t did,
unsigned int idx)
{
- int has_dimlist;
- hid_t sid; /* space ID */
- hid_t tid = -1; /* attribute type ID */
- hid_t aid = -1; /* attribute ID */
- int rank; /* rank of dataset */
- hvl_t *buf; /* VL buffer to store in the attribute */
- H5I_type_t it; /* ID type */
- int nscales;
-
-/*-------------------------------------------------------------------------
- * parameter checking
- *-------------------------------------------------------------------------
- */
- /* get ID type */
- if ((it = H5Iget_type(did)) < 0)
- return FAIL;
-
- if (H5I_DATASET!=it)
- return FAIL;
-
-/*-------------------------------------------------------------------------
- * the attribute "DIMENSION_LIST" on the >>data<< dataset must exist
- *-------------------------------------------------------------------------
- */
- /* get dataset space */
- if ((sid = H5Dget_space(did)) < 0)
- return FAIL;
-
- /* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* close dataset space */
- if (H5Sclose(sid) < 0)
- goto out;
-
- /* dimemsion index IDX range checking */
- if (idx>=(unsigned int )rank)
- return FAIL;
-
- /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
- if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0)
- return FAIL;
-
- /* it does not exist */
- if(has_dimlist == 0)
- return 0;
-
-/*-------------------------------------------------------------------------
- * the attribute exists, open it
- *-------------------------------------------------------------------------
- */
-
- else
- {
- if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
- goto out;
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
- if((sid = H5Aget_space(aid)) < 0)
- goto out;
-
- /* allocate and initialize the VL */
- buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
-
- if(buf == NULL)
- goto out;
-
- /* read */
- if(H5Aread(aid, tid, buf) < 0)
- goto out;
-
- nscales=(int)buf[idx].len;
-
- /* close */
- if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
- goto out;
- if (H5Sclose(sid) < 0)
- goto out;
- if (H5Tclose(tid) < 0)
- goto out;
- if (H5Aclose(aid) < 0)
- goto out;
- if (buf)
- free(buf);
-
- } /* has_dimlist */
-
- return nscales;
-
-/* error zone, gracefully close */
+ int has_dimlist;
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* attribute type ID */
+ hid_t aid = -1; /* attribute ID */
+ int rank; /* rank of dataset */
+ hvl_t *buf; /* VL buffer to store in the attribute */
+ H5I_type_t it; /* ID type */
+ int nscales;
+
+ /*-------------------------------------------------------------------------
+ * parameter checking
+ *-------------------------------------------------------------------------
+ */
+ /* get ID type */
+ if ((it = H5Iget_type(did)) < 0)
+ return FAIL;
+
+ if (H5I_DATASET!=it)
+ return FAIL;
+
+ /*-------------------------------------------------------------------------
+ * the attribute "DIMENSION_LIST" on the >>data<< dataset must exist
+ *-------------------------------------------------------------------------
+ */
+ /* get dataset space */
+ if ((sid = H5Dget_space(did)) < 0)
+ return FAIL;
+
+ /* get rank */
+ if ((rank=H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* close dataset space */
+ if (H5Sclose(sid) < 0)
+ goto out;
+
+ /* dimemsion index IDX range checking */
+ if (idx>=(unsigned int )rank)
+ return FAIL;
+
+ /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */
+ if((has_dimlist = H5LT_find_attribute(did, DIMENSION_LIST)) < 0)
+ return FAIL;
+
+ /* it does not exist */
+ if(has_dimlist == 0)
+ return 0;
+
+ /*-------------------------------------------------------------------------
+ * the attribute exists, open it
+ *-------------------------------------------------------------------------
+ */
+
+ else
+ {
+ if((aid = H5Aopen(did, DIMENSION_LIST, H5P_DEFAULT)) < 0)
+ goto out;
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
+ if((sid = H5Aget_space(aid)) < 0)
+ goto out;
+
+ /* allocate and initialize the VL */
+ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t));
+
+ if(buf == NULL)
+ goto out;
+
+ /* read */
+ if(H5Aread(aid, tid, buf) < 0)
+ goto out;
+
+ nscales=(int)buf[idx].len;
+
+ /* close */
+ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf) < 0)
+ goto out;
+ if (H5Sclose(sid) < 0)
+ goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
+
+ } /* has_dimlist */
+
+ return nscales;
+
+ /* error zone */
out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Aclose(aid);
- H5Tclose(tid);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+
+ if (buf)
+ {
+ free(buf);
+ buf = NULL;
+ }
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: H5DS_is_reserved
- *
- * Purpose: Verify that a dataset's CLASS is either an image, palette or table
- *
- * Return: true, false, fail
- *
- * Programmer: pvn@ncsa.uiuc.edu
- *
- * Date: March 19, 2005
- *
- * Comments:
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
+* Function: H5DS_is_reserved
+*
+* Purpose: Verify that a dataset's CLASS is either an image, palette or table
+*
+* Return: true, false, fail
+*
+* Programmer: pvn@ncsa.uiuc.edu
+*
+* Date: March 19, 2005
+*
+* Comments:
+*
+* Modifications:
+*
+*-------------------------------------------------------------------------
+*/
herr_t H5DS_is_reserved(hid_t did)
{
- int has_class;
- hid_t tid = -1;
- hid_t aid = -1;
- char buf[40];
- herr_t ret;
+ int has_class;
+ hid_t tid = -1;
+ hid_t aid = -1;
+ char buf[40];
+ herr_t ret;
- /* try to find the attribute "CLASS" on the dataset */
- if((has_class = H5LT_find_attribute(did, "CLASS")) < 0)
- return -1;
+ /* try to find the attribute "CLASS" on the dataset */
+ if((has_class = H5LT_find_attribute(did, "CLASS")) < 0)
+ return -1;
- if(has_class == 0)
- return 0;
+ if(has_class == 0)
+ return 0;
- assert(has_class == 1);
- if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0)
- goto out;
+ assert(has_class == 1);
+ if((aid = H5Aopen(did, "CLASS", H5P_DEFAULT)) < 0)
+ goto out;
- if((tid = H5Aget_type(aid)) < 0)
- goto out;
+ if((tid = H5Aget_type(aid)) < 0)
+ goto out;
- if(H5Aread(aid, tid, buf) < 0)
- goto out;
+ if(H5Aread(aid, tid, buf) < 0)
+ goto out;
- if(strcmp(buf, IMAGE_CLASS) == 0 ||
- strcmp(buf, PALETTE_CLASS) == 0 ||
- strcmp(buf, TABLE_CLASS) == 0 )
- ret = 1;
- else
- ret = 0;
+ if(strcmp(buf, IMAGE_CLASS) == 0 ||
+ strcmp(buf, PALETTE_CLASS) == 0 ||
+ strcmp(buf, TABLE_CLASS) == 0 )
+ ret = 1;
+ else
+ ret = 0;
- if (H5Tclose(tid) < 0)
- goto out;
+ if (H5Tclose(tid) < 0)
+ goto out;
- if (H5Aclose(aid) < 0)
- goto out;
+ if (H5Aclose(aid) < 0)
+ goto out;
- return ret;
+ return ret;
-/* error zone, gracefully close */
+ /* error zone */
out:
- H5E_BEGIN_TRY {
- H5Tclose(tid);
- H5Aclose(aid);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Tclose(tid);
+ H5Aclose(aid);
+ } H5E_END_TRY;
+ return FAIL;
}
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index 2fec7e0..479b572 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -512,7 +512,6 @@ herr_t H5IMlink_palette( hid_t loc_id,
hid_t attr_type=-1;
hid_t attr_id=-1;
hid_t attr_space_id=-1;
- hid_t attr_class=-1;
hobj_ref_t ref; /* write a new reference */
hobj_ref_t *refbuf; /* buffer to read references */
hssize_t n_refs;
@@ -579,7 +578,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if((attr_class = H5Tget_class(attr_type)) < 0)
+ if(H5Tget_class(attr_type) < 0)
goto out;
/* Get and save the old reference(s) */
@@ -862,7 +861,6 @@ herr_t H5IMget_palette_info( hid_t loc_id,
hid_t attr_type=-1;
hid_t attr_id;
hid_t attr_space_id=-1;
- hid_t attr_class;
hssize_t n_refs;
hsize_t dim_ref;
hobj_ref_t *refbuf; /* buffer to read references */
@@ -885,7 +883,7 @@ herr_t H5IMget_palette_info( hid_t loc_id,
if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if((attr_class = H5Tget_class(attr_type)) < 0)
+ if(H5Tget_class(attr_type) < 0)
goto out;
/* Get the reference(s) */
@@ -976,7 +974,6 @@ herr_t H5IMget_palette( hid_t loc_id,
hid_t attr_type=-1;
hid_t attr_id;
hid_t attr_space_id=-1;
- hid_t attr_class;
hssize_t n_refs;
hsize_t dim_ref;
hobj_ref_t *refbuf; /* buffer to read references */
@@ -997,7 +994,7 @@ herr_t H5IMget_palette( hid_t loc_id,
if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if((attr_class = H5Tget_class(attr_type)) < 0)
+ if(H5Tget_class(attr_type) < 0)
goto out;
/* Get the reference(s) */
diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c
index af6533e..10d2637 100644
--- a/hl/src/H5PT.c
+++ b/hl/src/H5PT.c
@@ -33,10 +33,10 @@ static H5I_type_t H5PT_ptable_id_type = H5I_UNINIT;
#define H5PT_HASH_TABLE_SIZE 64
/* Packet Table private functions */
-herr_t H5PT_close( htbl_t* table );
-herr_t H5PT_create_index(htbl_t *table_id);
-herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index);
-herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index);
+static herr_t H5PT_close( htbl_t* table );
+static herr_t H5PT_create_index(htbl_t *table_id);
+static herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index);
+static herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index);
/*-------------------------------------------------------------------------
*
@@ -306,7 +306,8 @@ out:
*
*-------------------------------------------------------------------------
*/
-herr_t H5PT_close( htbl_t* table)
+static herr_t
+H5PT_close( htbl_t* table)
{
if(table == NULL)
goto out;
@@ -559,7 +560,8 @@ out:
*
*-------------------------------------------------------------------------
*/
-herr_t H5PT_create_index(htbl_t *table)
+static herr_t
+H5PT_create_index(htbl_t *table)
{
if( table != NULL)
{
@@ -569,7 +571,8 @@ herr_t H5PT_create_index(htbl_t *table)
return -1;
}
-herr_t H5PT_set_index(htbl_t *table, hsize_t index)
+static herr_t
+H5PT_set_index(htbl_t *table, hsize_t index)
{
/* Ensure index is valid */
if( table != NULL )
@@ -583,7 +586,8 @@ herr_t H5PT_set_index(htbl_t *table, hsize_t index)
return -1;
}
-herr_t H5PT_get_index(htbl_t *table, hsize_t *index)
+static herr_t
+H5PT_get_index(htbl_t *table, hsize_t *index)
{
/* Ensure index is valid */
if( table != NULL )
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index 85a2cbf..bb5fd25 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -265,6 +265,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -276,9 +278,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in
index 7f01027..efe8a96 100644
--- a/hl/test/Makefile.in
+++ b/hl/test/Makefile.in
@@ -275,6 +275,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -286,9 +288,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 8fb8604..e4d4260 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -76,22 +76,22 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf )
*/
int main(void)
{
- int nerrors=0;
+ int nerrors=0;
- nerrors += test_simple() < 0 ?1:0;
- nerrors += test_errors() < 0 ?1:0;
- nerrors += test_rank() < 0 ?1:0;
- nerrors += test_iterators() < 0 ?1:0;
- nerrors += test_types() < 0 ?1:0;
- nerrors += test_data() < 0 ?1:0;
+ nerrors += test_simple() < 0 ?1:0;
+ nerrors += test_errors() < 0 ?1:0;
+ nerrors += test_rank() < 0 ?1:0;
+ nerrors += test_iterators() < 0 ?1:0;
+ nerrors += test_types() < 0 ?1:0;
+ nerrors += test_data() < 0 ?1:0;
- if(nerrors) goto error;
- printf("All dimension scales tests passed.\n");
- return 0;
+ if(nerrors) goto error;
+ printf("All dimension scales tests passed.\n");
+ return 0;
error:
- printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
- return 1;
+ printf("***** %d DIMENSION SCALES TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
+ return 1;
}
@@ -116,1332 +116,1332 @@ error:
static int test_simple(void)
{
- hid_t fid; /* file ID */
- hid_t did = -1; /* dataset ID */
- hid_t dsid; /* DS dataset ID */
- hid_t sid; /* space ID */
- hid_t gid; /* group ID */
- int rank = RANK; /* rank of data dataset */
- int rankds = 1; /* rank of DS dataset */
- hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
- int buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12}; /* data of data dataset */
- hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
- hsize_t s2_dim[1] = {DIM2_SIZE}; /* size of DS 2 dataset */
- char sname[30]; /* scale name buffer */
- char dname[30]; /* dataset name */
- int s1_wbuf[DIM1_SIZE] = {10,20,30}; /* data of DS 1 dataset */
- int s11_wbuf[DIM1_SIZE] = {10,100,300}; /* data of DS 1 dataset */
- int s2_wbuf[DIM2_SIZE] = {100,200,300,400}; /* data of DS 2 dataset */
- int s21_wbuf[DIM2_SIZE] = {10,20,30,40}; /* data of DS 2 dataset */
- int s22_wbuf[DIM2_SIZE] = {5,10,50,300}; /* data of DS 2 dataset */
- char dim0_label[16]; /* read label for DIM 0 */
- char dim1_label[16]; /* read label for DIM 1 */
- char *dim0_labeld; /* read label for DIM 0 */
- char *dim1_labeld; /* read label for DIM 1 */
- char dim0_labels[3]; /* read label for DIM 0 */
- char dim1_labels[3]; /* read label for DIM 1 */
- ssize_t dim0_label_size; /* lenght of label buffer */
- ssize_t dim1_label_size; /* lenght of label buffer */
- unsigned int dim; /* dataset dimension index */
- int scale_idx; /* scale index */
- int nscales; /* number of scales in DIM */
- ssize_t name_len; /* lenght of name buffer */
- char *name_out=NULL; /* scale name buffer */
- char snames[3]; /* scale name buffer */
- int i, j;
-
-
- printf("Testing API functions\n");
+ hid_t fid; /* file ID */
+ hid_t did = -1; /* dataset ID */
+ hid_t dsid; /* DS dataset ID */
+ hid_t sid; /* space ID */
+ hid_t gid; /* group ID */
+ int rank = RANK; /* rank of data dataset */
+ int rankds = 1; /* rank of DS dataset */
+ hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
+ int buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12}; /* data of data dataset */
+ hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
+ hsize_t s2_dim[1] = {DIM2_SIZE}; /* size of DS 2 dataset */
+ char sname[30]; /* scale name buffer */
+ char dname[30]; /* dataset name */
+ int s1_wbuf[DIM1_SIZE] = {10,20,30}; /* data of DS 1 dataset */
+ int s11_wbuf[DIM1_SIZE] = {10,100,300}; /* data of DS 1 dataset */
+ int s2_wbuf[DIM2_SIZE] = {100,200,300,400}; /* data of DS 2 dataset */
+ int s21_wbuf[DIM2_SIZE] = {10,20,30,40}; /* data of DS 2 dataset */
+ int s22_wbuf[DIM2_SIZE] = {5,10,50,300}; /* data of DS 2 dataset */
+ char dim0_label[16]; /* read label for DIM 0 */
+ char dim1_label[16]; /* read label for DIM 1 */
+ char *dim0_labeld; /* read label for DIM 0 */
+ char *dim1_labeld; /* read label for DIM 1 */
+ char dim0_labels[3]; /* read label for DIM 0 */
+ char dim1_labels[3]; /* read label for DIM 1 */
+ ssize_t dim0_label_size; /* lenght of label buffer */
+ ssize_t dim1_label_size; /* lenght of label buffer */
+ unsigned int dim; /* dataset dimension index */
+ int scale_idx; /* scale index */
+ int nscales; /* number of scales in DIM */
+ ssize_t name_len; /* lenght of name buffer */
+ char *name_out=NULL; /* scale name buffer */
+ char snames[3]; /* scale name buffer */
+ int i, j;
+
+
+ printf("Testing API functions\n");
+
+ /*-------------------------------------------------------------------------
+ * create a file for the test
+ *-------------------------------------------------------------------------
+ */
+
+ /* create a file using default properties */
+ if((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * create datasets: 1 "data" dataset and 4 dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* make a dataset */
+ if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf) < 0)
+ goto out;
+
+ /* make a DS dataset for the first dimension */
+ if(H5LTmake_dataset_int(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf) < 0)
+ goto out;
+
+ /* make a DS dataset with an alternate scale for the 2nd dimension */
+ if(H5LTmake_dataset_int(fid,DS_11_NAME,rankds,s1_dim,s11_wbuf) < 0)
+ goto out;
+
+ /* make a DS dataset for the second dimension */
+ if(H5LTmake_dataset_int(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf) < 0)
+ goto out;
+
+ /* make a DS dataset with an alternate scale for the 2nd dimension */
+ if(H5LTmake_dataset_int(fid,DS_21_NAME,rankds,s2_dim,s21_wbuf) < 0)
+ goto out;
+
+ /* make a DS dataset with an alternate scale for the 2nd dimension */
+ if(H5LTmake_dataset_int(fid,DS_22_NAME,rankds,s2_dim,s22_wbuf) < 0)
+ goto out;
+
+
+ /*-------------------------------------------------------------------------
+ * test 1: attach scale
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("attach scales");
+
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach the DS_1_NAME dimension scale to "dset_a"
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* attach the DS_1_NAME dimension scale to "dset_a" at dimension 0 */
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach the DS_11_NAME dimension scale to "dset_a"
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* attach the DS_11_NAME dimension scale to "dset_a" at dimension 0 */
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach the DS_2_NAME dimension scale to "dset_a"
+ *-------------------------------------------------------------------------
+ */
-/*-------------------------------------------------------------------------
- * create a file for the test
- *-------------------------------------------------------------------------
- */
-
- /* create a file using default properties */
- if((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * create datasets: 1 "data" dataset and 4 dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* make a dataset */
- if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf) < 0)
- goto out;
-
- /* make a DS dataset for the first dimension */
- if(H5LTmake_dataset_int(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf) < 0)
- goto out;
-
- /* make a DS dataset with an alternate scale for the 2nd dimension */
- if(H5LTmake_dataset_int(fid,DS_11_NAME,rankds,s1_dim,s11_wbuf) < 0)
- goto out;
-
- /* make a DS dataset for the second dimension */
- if(H5LTmake_dataset_int(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf) < 0)
- goto out;
-
- /* make a DS dataset with an alternate scale for the 2nd dimension */
- if(H5LTmake_dataset_int(fid,DS_21_NAME,rankds,s2_dim,s21_wbuf) < 0)
- goto out;
-
- /* make a DS dataset with an alternate scale for the 2nd dimension */
- if(H5LTmake_dataset_int(fid,DS_22_NAME,rankds,s2_dim,s22_wbuf) < 0)
- goto out;
-
-
-/*-------------------------------------------------------------------------
- * test 1: attach scale
- *-------------------------------------------------------------------------
- */
-
- TESTING2("attach scales");
-
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach the DS_1_NAME dimension scale to "dset_a"
- *-------------------------------------------------------------------------
- */
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
- goto out;
-
- /* attach the DS_1_NAME dimension scale to "dset_a" at dimension 0 */
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach the DS_11_NAME dimension scale to "dset_a"
- *-------------------------------------------------------------------------
- */
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT)) < 0)
- goto out;
-
- /* attach the DS_11_NAME dimension scale to "dset_a" at dimension 0 */
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach the DS_2_NAME dimension scale to "dset_a"
- *-------------------------------------------------------------------------
- */
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
- goto out;
-
- /* attach the "ds2" dimension scale to "dset_a" as the 2nd dimension */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach the DS_21_NAME dimension scale to "dset_a"
- *-------------------------------------------------------------------------
- */
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
- goto out;
-
- /* attach the DS_21_NAME dimension scale to "dset_a" as the 2nd dimension */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach the DS_22_NAME dimension scale to "dset_a"
- *-------------------------------------------------------------------------
- */
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
- goto out;
-
- /* attach the "ds22" dimension scale to "dset_a" as the 2nd dimension */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
-
-
-/*-------------------------------------------------------------------------
- * verify attachment
- *-------------------------------------------------------------------------
- */
-
- if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,DIM0)<=0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
- if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,DIM1)<=0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
- if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,DIM1)<=0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
- if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,DIM1)<=0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
-
- /* close dataset ID of "dset_a" */
- if(H5Dclose(did) < 0)
- goto out;
-
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * test 2: get number of scales
- *-------------------------------------------------------------------------
- */
-
- TESTING2("get number of scales");
-
-/*-------------------------------------------------------------------------
- * verify that "dset_a" has dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* verify that "dset_a" has 1 dimension scale at DIM 0 */
- if((nscales = H5DSget_num_scales(did,0)) < 0)
- goto out;
- if(nscales!=2)
- goto out;
-
- /* verify that "dset_a" has 3 dimension scales at DIM 1 */
- if((nscales = H5DSget_num_scales(did,1)) < 0)
- goto out;
- if(nscales!=3)
- goto out;
-
- /* close dataset ID of "dset_a" */
- if(H5Dclose(did) < 0)
- goto out;
-
-
-/*-------------------------------------------------------------------------
- * create datasets: 1 "data" dataset and 1 dimension scale
- *-------------------------------------------------------------------------
- */
-
- /* make a dataset */
- if(H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf) < 0)
- goto out;
-
- /* make a DS dataset for the first dimension */
- if(H5LTmake_dataset_int(fid,"ds_b_1",rankds,s1_dim,s1_wbuf) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach the scale to "dset_b"
- *-------------------------------------------------------------------------
- */
-
- if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
- goto out;
- if((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * verify if "dset_b" has dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_b" */
- if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
- goto out;
-
- /* verify that "dset_b" has 1 dimension scale at DIM 0 */
- if((nscales = H5DSget_num_scales(did,0)) < 0)
- goto out;
- if(nscales!=1)
- goto out;
-
- /* verify that "dset_b" has 0 dimension scales at DIM 1 */
- if((nscales = H5DSget_num_scales(did,1)) < 0)
- goto out;
- if(nscales!=0)
- goto out;
-
- /* close dataset ID of "dset_b" */
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * test 3: detach scales
- *-------------------------------------------------------------------------
- */
-
- TESTING2("detach scales ");
-
-
-/*-------------------------------------------------------------------------
- * create datasets: one "data" dataset and 4 dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* make a dataset */
- if(H5LTmake_dataset_int(fid,"dset_c",rank,dims,buf) < 0)
- goto out;
-
- /* make a DS dataset for the first dimension */
- if(H5LTmake_dataset_int(fid,"ds_c_1",rankds,s1_dim,s1_wbuf) < 0)
- goto out;
-
- /* make a DS dataset for the second dimension */
- if(H5LTmake_dataset_int(fid,"ds_c_2",rankds,s2_dim,s2_wbuf) < 0)
- goto out;
-
- /* make a DS dataset with an alternate scale for the 2nd dimension */
- if(H5LTmake_dataset_int(fid,"ds_c_21",rankds,s2_dim,s2_wbuf) < 0)
- goto out;
-
- /* make a DS dataset with an alternate scale for the 2nd dimension */
- if(H5LTmake_dataset_int(fid,"ds_c_22",rankds,s2_dim,s2_wbuf) < 0)
- goto out;
-
-
-/*-------------------------------------------------------------------------
- * attach the scales to "dset_c"
- *-------------------------------------------------------------------------
- */
-
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_c_1", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,1) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,1) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,1) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * verify if "dset_c" has dimension scales
- *-------------------------------------------------------------------------
- */
-
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
- /* verify that "dset_c" has 1 dimension scale at DIM 0 */
- if((nscales = H5DSget_num_scales(did,0)) < 0)
- goto out;
- if(nscales!=1)
- goto out;
- /* verify that "dset_c" has 3 dimension scales at DIM 1 */
- if((nscales = H5DSget_num_scales(did,1)) < 0)
- goto out;
- if(nscales!=3)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * detach the "ds_c_21" dimension scale to "dset_c"
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_c" */
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0)
- goto out;
-
- /* detach the "ds_c_21" dimension scale to "dset_c" in DIM 1 */
- if(H5DSdetach_scale(did,dsid,1) < 0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
- /* close dataset ID of "dset_c" */
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * "dset_c" must have now 2 dimension scales at DIM 1
- *-------------------------------------------------------------------------
- */
-
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
- /* verify that "dset_c" has 2 dimension scales at DIM 1 */
- if((nscales = H5DSget_num_scales(did,1)) < 0)
- goto out;
- if(nscales!=2)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * detach the "ds_c_22" dimension scale to "dset_c"
- *-------------------------------------------------------------------------
- */
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
+ goto out;
- /* get the dataset id for "dset_c" */
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
+ /* attach the "ds2" dimension scale to "dset_a" as the 2nd dimension */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0)
- goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
- /* detach the "ds_c_22" dimension scale to "dset_c" in DIM 1 */
- if(H5DSdetach_scale(did,dsid,1) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * attach the DS_21_NAME dimension scale to "dset_a"
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* attach the DS_21_NAME dimension scale to "dset_a" as the 2nd dimension */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
- /* close dataset ID of "dset_c" */
- if(H5Dclose(did) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * attach the DS_22_NAME dimension scale to "dset_a"
+ *-------------------------------------------------------------------------
+ */
-/*-------------------------------------------------------------------------
- * "dset_c" must have now 1 dimension scale at DIM 1
- *-------------------------------------------------------------------------
- */
-
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
- /* verify that "dset_c" has 1 dimension scale at DIM 1 */
- if((nscales = H5DSget_num_scales(did,1)) < 0)
- goto out;
- if(nscales!=1)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * detach the "ds_c_2" dimension scale to "dset_c"
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_c" */
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0)
- goto out;
-
- /* detach the "ds_c_2" dimension scale to "dset_c" in DIM 1 */
- if(H5DSdetach_scale(did,dsid,1) < 0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
- /* close dataset ID of "dset_c" */
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * "dset_c" must have now 0 dimension scales at DIM 1
- *-------------------------------------------------------------------------
- */
-
- if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
- goto out;
- /* verify that "dset_c" has 1 dimension scale at DIM 1 */
- if((nscales = H5DSget_num_scales(did,1)) < 0)
- goto out;
- if(nscales!=0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
-
-
-/*-------------------------------------------------------------------------
- * create 3 datasets: 1 "data" dataset and 2 dimension scales
- *-------------------------------------------------------------------------
- */
- if(H5LTmake_dataset_int(fid,"dset_d",rank,dims,NULL) < 0)
- goto out;
- if(H5LTmake_dataset_int(fid,"ds_d_1",rankds,s1_dim,NULL) < 0)
- goto out;
- if(H5LTmake_dataset_int(fid,"ds_d_2",rankds,s2_dim,NULL) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach them
- *-------------------------------------------------------------------------
- */
- if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,1) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * verify
- *-------------------------------------------------------------------------
- */
-
- if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,DIM0)<=0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,DIM1)<=0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if(H5Dclose(did) < 0)
- goto out;
-
-
-/*-------------------------------------------------------------------------
- * detach
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_d" */
- if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
- goto out;
-
- /* detach the dimension scale to "dset_d" in DIM 0 */
- if(H5DSdetach_scale(did,dsid,DIM0) < 0)
- goto out;
-
- /* verify attach, it must return 0 for no attach */
- if(H5DSis_attached(did,dsid,DIM0)!=0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
- /* close dataset ID of "dset_d" */
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach again
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_d" */
- if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
- goto out;
-
- /* attach "ds_d_1" again in DIM 0 */
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
-
- /* verify attach, it must return 1 for attach */
- if(H5DSis_attached(did,dsid,DIM0)!=1)
- goto out;
-
- /* verify that "ds_d_1" has only 1 scale at DIM0 */
- if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
- goto out;
- if(nscales!=1)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
- /* close dataset ID of "dset_d" */
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * detach/detach
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_d" */
- if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
- goto out;
-
- /* detach the "ds_d_2" dimension scale to "dset_d" in DIM 1 */
- if(H5DSdetach_scale(did,dsid,DIM1) < 0)
- goto out;
-
- /* detach again, it should fail */
- if(H5DSdetach_scale(did,dsid,DIM1)==SUCCEED)
- goto out;
-
- /* verify attach, it must return 0 for no attach */
- if(H5DSis_attached(did,dsid,DIM1)!=0)
- goto out;
-
- /* verify that "ds_d_1" has no scale at DIM1 */
- if((nscales = H5DSget_num_scales(did,DIM1)) < 0)
- goto out;
- if(nscales!=0)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
- /* close dataset ID of "dset_d" */
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach twice
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "dset_d" */
- if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
- goto out;
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
+ goto out;
- /* attach "ds_d_2" in DIM 1 */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
+ /* attach the "ds22" dimension scale to "dset_a" as the 2nd dimension */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
- /* verify attach, it must return 1 for attach */
- if(H5DSis_attached(did,dsid,DIM1)!=1)
- goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+
+
+ /*-------------------------------------------------------------------------
+ * verify attachment
+ *-------------------------------------------------------------------------
+ */
+
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,DIM0)<=0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
+
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
+
+ if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
+
+ if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
+
+
+ /* close dataset ID of "dset_a" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+
+ PASSED();
+
+
+ /*-------------------------------------------------------------------------
+ * test 2: get number of scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("get number of scales");
+
+ /*-------------------------------------------------------------------------
+ * verify that "dset_a" has dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* verify that "dset_a" has 1 dimension scale at DIM 0 */
+ if((nscales = H5DSget_num_scales(did,0)) < 0)
+ goto out;
+ if(nscales!=2)
+ goto out;
+
+ /* verify that "dset_a" has 3 dimension scales at DIM 1 */
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
+ goto out;
+ if(nscales!=3)
+ goto out;
+
+ /* close dataset ID of "dset_a" */
+ if(H5Dclose(did) < 0)
+ goto out;
- /* verify that "ds_d_2" has only 1 scale at DIM1 */
- if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
- goto out;
- if(nscales!=1)
- goto out;
- /* attach "ds_d_2" again in DIM 1 */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * create datasets: 1 "data" dataset and 1 dimension scale
+ *-------------------------------------------------------------------------
+ */
+
+ /* make a dataset */
+ if(H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf) < 0)
+ goto out;
+
+ /* make a DS dataset for the first dimension */
+ if(H5LTmake_dataset_int(fid,"ds_b_1",rankds,s1_dim,s1_wbuf) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach the scale to "dset_b"
+ *-------------------------------------------------------------------------
+ */
+
+ if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
+ goto out;
+ if((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * verify if "dset_b" has dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_b" */
+ if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* verify that "dset_b" has 1 dimension scale at DIM 0 */
+ if((nscales = H5DSget_num_scales(did,0)) < 0)
+ goto out;
+ if(nscales!=1)
+ goto out;
+
+ /* verify that "dset_b" has 0 dimension scales at DIM 1 */
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
+ goto out;
+ if(nscales!=0)
+ goto out;
+
+ /* close dataset ID of "dset_b" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+
+ /*-------------------------------------------------------------------------
+ * test 3: detach scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("detach scales ");
+
+
+ /*-------------------------------------------------------------------------
+ * create datasets: one "data" dataset and 4 dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* make a dataset */
+ if(H5LTmake_dataset_int(fid,"dset_c",rank,dims,buf) < 0)
+ goto out;
+
+ /* make a DS dataset for the first dimension */
+ if(H5LTmake_dataset_int(fid,"ds_c_1",rankds,s1_dim,s1_wbuf) < 0)
+ goto out;
+
+ /* make a DS dataset for the second dimension */
+ if(H5LTmake_dataset_int(fid,"ds_c_2",rankds,s2_dim,s2_wbuf) < 0)
+ goto out;
+
+ /* make a DS dataset with an alternate scale for the 2nd dimension */
+ if(H5LTmake_dataset_int(fid,"ds_c_21",rankds,s2_dim,s2_wbuf) < 0)
+ goto out;
+
+ /* make a DS dataset with an alternate scale for the 2nd dimension */
+ if(H5LTmake_dataset_int(fid,"ds_c_22",rankds,s2_dim,s2_wbuf) < 0)
+ goto out;
+
+
+ /*-------------------------------------------------------------------------
+ * attach the scales to "dset_c"
+ *-------------------------------------------------------------------------
+ */
+
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_c_1", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,1) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,1) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,1) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * verify if "dset_c" has dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+ /* verify that "dset_c" has 1 dimension scale at DIM 0 */
+ if((nscales = H5DSget_num_scales(did,0)) < 0)
+ goto out;
+ if(nscales!=1)
+ goto out;
+ /* verify that "dset_c" has 3 dimension scales at DIM 1 */
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
+ goto out;
+ if(nscales!=3)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * detach the "ds_c_21" dimension scale to "dset_c"
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_c" */
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* detach the "ds_c_21" dimension scale to "dset_c" in DIM 1 */
+ if(H5DSdetach_scale(did,dsid,1) < 0)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_c" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * "dset_c" must have now 2 dimension scales at DIM 1
+ *-------------------------------------------------------------------------
+ */
+
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+ /* verify that "dset_c" has 2 dimension scales at DIM 1 */
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
+ goto out;
+ if(nscales!=2)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * detach the "ds_c_22" dimension scale to "dset_c"
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_c" */
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* detach the "ds_c_22" dimension scale to "dset_c" in DIM 1 */
+ if(H5DSdetach_scale(did,dsid,1) < 0)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_c" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * "dset_c" must have now 1 dimension scale at DIM 1
+ *-------------------------------------------------------------------------
+ */
+
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+ /* verify that "dset_c" has 1 dimension scale at DIM 1 */
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
+ goto out;
+ if(nscales!=1)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * detach the "ds_c_2" dimension scale to "dset_c"
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_c" */
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* detach the "ds_c_2" dimension scale to "dset_c" in DIM 1 */
+ if(H5DSdetach_scale(did,dsid,1) < 0)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_c" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * "dset_c" must have now 0 dimension scales at DIM 1
+ *-------------------------------------------------------------------------
+ */
+
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
+ goto out;
+ /* verify that "dset_c" has 1 dimension scale at DIM 1 */
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
+ goto out;
+ if(nscales!=0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+
+
+ /*-------------------------------------------------------------------------
+ * create 3 datasets: 1 "data" dataset and 2 dimension scales
+ *-------------------------------------------------------------------------
+ */
+ if(H5LTmake_dataset_int(fid,"dset_d",rank,dims,NULL) < 0)
+ goto out;
+ if(H5LTmake_dataset_int(fid,"ds_d_1",rankds,s1_dim,NULL) < 0)
+ goto out;
+ if(H5LTmake_dataset_int(fid,"ds_d_2",rankds,s2_dim,NULL) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach them
+ *-------------------------------------------------------------------------
+ */
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,1) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * verify
+ *-------------------------------------------------------------------------
+ */
+
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,DIM0)<=0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if(H5Dclose(did) < 0)
+ goto out;
+
+
+ /*-------------------------------------------------------------------------
+ * detach
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_d" */
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* detach the dimension scale to "dset_d" in DIM 0 */
+ if(H5DSdetach_scale(did,dsid,DIM0) < 0)
+ goto out;
+
+ /* verify attach, it must return 0 for no attach */
+ if(H5DSis_attached(did,dsid,DIM0)!=0)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_d" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach again
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_d" */
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* attach "ds_d_1" again in DIM 0 */
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+
+ /* verify attach, it must return 1 for attach */
+ if(H5DSis_attached(did,dsid,DIM0)!=1)
+ goto out;
+
+ /* verify that "ds_d_1" has only 1 scale at DIM0 */
+ if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
+ goto out;
+ if(nscales!=1)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_d" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * detach/detach
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_d" */
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* detach the "ds_d_2" dimension scale to "dset_d" in DIM 1 */
+ if(H5DSdetach_scale(did,dsid,DIM1) < 0)
+ goto out;
+
+ /* detach again, it should fail */
+ if(H5DSdetach_scale(did,dsid,DIM1)==SUCCEED)
+ goto out;
+
+ /* verify attach, it must return 0 for no attach */
+ if(H5DSis_attached(did,dsid,DIM1)!=0)
+ goto out;
+
+ /* verify that "ds_d_1" has no scale at DIM1 */
+ if((nscales = H5DSget_num_scales(did,DIM1)) < 0)
+ goto out;
+ if(nscales!=0)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_d" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach twice
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "dset_d" */
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* attach "ds_d_2" in DIM 1 */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
+
+ /* verify attach, it must return 1 for attach */
+ if(H5DSis_attached(did,dsid,DIM1)!=1)
+ goto out;
+
+ /* verify that "ds_d_2" has only 1 scale at DIM1 */
+ if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
+ goto out;
+ if(nscales!=1)
+ goto out;
+
+ /* attach "ds_d_2" again in DIM 1 */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
+
+ /* verify attach, it must return 1 for attach */
+ if(H5DSis_attached(did,dsid,DIM1)!=1)
+ goto out;
+
+ /* verify that "ds_d_2" has only 1 scale at DIM1 */
+ if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
+ goto out;
+ if(nscales != 1)
+ goto out;
+
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_d" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * create 10 datasets: 5 "data" dataset and 5 dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* create a group */
+ if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* create the data space for the dataset */
+ if((sid = H5Screate_simple(rank,dims,NULL)) < 0)
+ goto out;
+
+ for(i = 0; i < 5; i++) {
+ sprintf(dname,"dset_%d",i);
+ if((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ sprintf(sname,"ds_%d",i);
+ if((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSset_scale(dsid,"scale") < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+ }
+
+ /*-------------------------------------------------------------------------
+ * attach for DIM 0
+ *-------------------------------------------------------------------------
+ */
+
+ for(i = 0; i < 5; i++) {
+ sprintf(dname, "dset_%d", i);
+ if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
+ goto out;
+ for(j = 0; j < 5; j++) {
+ sprintf(sname, "ds_%d", j);
+ if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did, dsid, DIM0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ }
+ if(H5Dclose(did) < 0)
+ goto out;
+ }
+
+ /*-------------------------------------------------------------------------
+ * dettach for DIM0
+ *-------------------------------------------------------------------------
+ */
+
+ for(i = 0; i < 5; i++) {
+ sprintf(dname, "dset_%d", i);
+ if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
+ goto out;
+ for(j = 0; j < 5; j++) {
+ sprintf(sname, "ds_%d", j);
+ if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSdetach_scale(did, dsid, DIM0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ }
+ if(H5Dclose(did) < 0)
+ goto out;
+ }
+
+
+ /*-------------------------------------------------------------------------
+ * attach again for DIM0
+ *-------------------------------------------------------------------------
+ */
+
+ for(i=0; i<5; i++)
+ {
+ sprintf(dname,"dset_%d",i);
+ if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
+ goto out;
+ for(j=0; j<5; j++)
+ {
+ sprintf(sname,"ds_%d",j);
+ if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ }
+ if(H5Dclose(did) < 0)
+ goto out;
+ }
+
+ /* close */
+ if(H5Sclose(sid) < 0)
+ goto out;
+ if(H5Gclose(gid) < 0)
+ goto out;
+
+
+ PASSED();
+
+
+ /*-------------------------------------------------------------------------
+ * create a dataset and attach only to 1 dimension
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("attach only to 1 dimension");
+
+ /* make a dataset */
+ if(H5LTmake_dataset_int(fid,"dset_e",rank,dims,NULL) < 0)
+ goto out;
+
+ /* make a scale */
+ if(H5LTmake_dataset_int(fid,"ds_e_1",rankds,s1_dim,NULL) < 0)
+ goto out;
+
+ /* attach the DS to dimension 1 */
+ if((did = H5Dopen2(fid,"dset_e", H5P_DEFAULT)) < 0)
+ goto out;
+ if((dsid = H5Dopen2(fid,"ds_e_1", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
+ goto out;
+
+
+ /* try to detach all dimensions. for dimensions 0 and 2, it is an error */
+ for(i=0; i<rank; i++)
+ {
+ if( i==1 )
+ {
+ if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
+ goto out;
+ }
+ else
+ {
+ if(H5DSdetach_scale(did,dsid,(unsigned)i)!=FAIL)
+ goto out;
+ }
+ }
+
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+
+ /*-------------------------------------------------------------------------
+ * test 4: set/get label
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("set/get label");
+
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * set label
+ *-------------------------------------------------------------------------
+ */
+
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
+ goto out;
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * get the scale name using a static buffer
+ *-------------------------------------------------------------------------
+ */
+
+ if(H5DSget_label(did,DIM0,dim0_label,sizeof(dim0_label)) < 0)
+ goto out;
+ if(H5DSget_label(did,DIM1,dim1_label,sizeof(dim1_label)) < 0)
+ goto out;
+
+ if(strcmp(DIM0_LABEL,dim0_label)!=0)
+ goto out;
+ if(strcmp(DIM1_LABEL,dim1_label)!=0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * get the scale name using a dynamic buffer
+ *-------------------------------------------------------------------------
+ */
+
+ if((dim0_label_size=H5DSget_label(did,DIM0,NULL,(size_t)0)) < 0)
+ goto out;
+ if((dim1_label_size=H5DSget_label(did,DIM1,NULL,(size_t)0)) < 0)
+ goto out;
+
+ /* allocate */
+ dim0_labeld = (char*)malloc(dim0_label_size * sizeof(char));
+ dim1_labeld = (char*)malloc(dim1_label_size * sizeof(char));
+ if( dim0_labeld==NULL || dim1_labeld==NULL)
+ goto out;
+
+ if(H5DSget_label(did,DIM0,dim0_labeld,(size_t)dim0_label_size) < 0)
+ goto out;
+ if(H5DSget_label(did,DIM1,dim1_labeld,(size_t)dim1_label_size) < 0)
+ goto out;
+
+ if(strncmp(DIM0_LABEL,dim0_labeld,(size_t)(dim0_label_size-1))!=0)
+ goto out;
+ if(strncmp(DIM1_LABEL,dim1_labeld,(size_t)(dim1_label_size-1))!=0)
+ goto out;
+
+ if(dim0_labeld)
+ {
+ free(dim0_labeld);
+ dim0_labeld=NULL;
+ }
+ if(dim1_labeld)
+ {
+ free(dim1_labeld);
+ dim1_labeld=NULL;
+ }
+
+
+ /*-------------------------------------------------------------------------
+ * get the label using a static buffer smaller than the string lenght
+ *-------------------------------------------------------------------------
+ */
+
+ if(H5DSget_label(did,DIM0,dim0_labels,sizeof(dim0_labels)) < 0)
+ goto out;
+ if(H5DSget_label(did,DIM1,dim1_labels,sizeof(dim1_labels)) < 0)
+ goto out;
+
+ if(strncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0)
+ goto out;
+ if(strncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0)
+ goto out;
+
+
+
+ if(H5Dclose(did))
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * test 5: set scale/get scale name
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("set scale/get scale name");
+
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
+ goto out;
+
+ /* verify that DS_1_NAME is a dimension scale dataset */
+ if((H5DSis_scale(dsid))==0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * get the scale name using a dynamic buffer
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the lenght of the scale name (pass NULL in name) */
+ if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) < 0)
+ goto out;
+
+ /* allocate a buffer */
+ name_out = (char*)malloc(name_len * sizeof(char));
+ if(name_out == NULL)
+ goto out;
+
+ /* get the scale name using this buffer */
+ if(H5DSget_scale_name(dsid,name_out,(size_t)name_len) < 0)
+ goto out;
+
+ if(strcmp(SCALE_1_NAME,name_out)!=0)
+ goto out;
+
+ if(name_out)
+ {
+ free(name_out);
+ name_out=NULL;
+ }
+
+ /*-------------------------------------------------------------------------
+ * get the scale name using a static buffer
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the scale name using this buffer */
+ if(H5DSget_scale_name(dsid,sname,sizeof(sname)) < 0)
+ goto out;
+
+ if(strcmp(SCALE_1_NAME,sname)!=0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * get the scale name using a static buffer smaller than the string lenght
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the scale name using this buffer */
+ if(H5DSget_scale_name(dsid,snames,sizeof(snames)) < 0)
+ goto out;
+
+ if(strncmp(SCALE_1_NAME,snames,sizeof(snames)-1)!=0)
+ goto out;
+
+ if(H5Dclose(dsid))
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * add scale names
+ *-------------------------------------------------------------------------
+ */
- /* verify attach, it must return 1 for attach */
- if(H5DSis_attached(did,dsid,DIM1)!=1)
- goto out;
-
- /* verify that "ds_d_2" has only 1 scale at DIM1 */
- if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
- goto out;
- if(nscales != 1)
- goto out;
-
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
-
- /* close dataset ID of "dset_d" */
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * create 10 datasets: 5 "data" dataset and 5 dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* create a group */
- if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
-
- /* create the data space for the dataset */
- if((sid = H5Screate_simple(rank,dims,NULL)) < 0)
- goto out;
-
- for(i = 0; i < 5; i++) {
- sprintf(dname,"dset_%d",i);
- if((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- sprintf(sname,"ds_%d",i);
- if((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSset_scale(dsid,"scale") < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
- }
-
-/*-------------------------------------------------------------------------
- * attach for DIM 0
- *-------------------------------------------------------------------------
- */
-
- for(i = 0; i < 5; i++) {
- sprintf(dname, "dset_%d", i);
- if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
- goto out;
- for(j = 0; j < 5; j++) {
- sprintf(sname, "ds_%d", j);
- if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did, dsid, DIM0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- }
- if(H5Dclose(did) < 0)
- goto out;
- }
-
-/*-------------------------------------------------------------------------
- * dettach for DIM0
- *-------------------------------------------------------------------------
- */
-
- for(i = 0; i < 5; i++) {
- sprintf(dname, "dset_%d", i);
- if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
- goto out;
- for(j = 0; j < 5; j++) {
- sprintf(sname, "ds_%d", j);
- if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSdetach_scale(did, dsid, DIM0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- }
- if(H5Dclose(did) < 0)
- goto out;
- }
-
-
-/*-------------------------------------------------------------------------
- * attach again for DIM0
- *-------------------------------------------------------------------------
- */
-
- for(i=0; i<5; i++)
- {
- sprintf(dname,"dset_%d",i);
- if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
- goto out;
- for(j=0; j<5; j++)
- {
- sprintf(sname,"ds_%d",j);
- if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- }
- if(H5Dclose(did) < 0)
- goto out;
- }
-
- /* close */
- if(H5Sclose(sid) < 0)
- goto out;
- if(H5Gclose(gid) < 0)
- goto out;
-
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * create a dataset and attach only to 1 dimension
- *-------------------------------------------------------------------------
- */
-
- TESTING2("attach only to 1 dimension");
-
- /* make a dataset */
- if(H5LTmake_dataset_int(fid,"dset_e",rank,dims,NULL) < 0)
- goto out;
-
- /* make a scale */
- if(H5LTmake_dataset_int(fid,"ds_e_1",rankds,s1_dim,NULL) < 0)
- goto out;
-
- /* attach the DS to dimension 1 */
- if((did = H5Dopen2(fid,"dset_e", H5P_DEFAULT)) < 0)
- goto out;
- if((dsid = H5Dopen2(fid,"ds_e_1", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,DIM1)<=0)
- goto out;
-
-
- /* try to detach all dimensions. for dimensions 0 and 2, it is an error */
- for(i=0; i<rank; i++)
- {
- if( i==1 )
- {
- if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
- goto out;
- }
- else
- {
- if(H5DSdetach_scale(did,dsid,(unsigned)i)!=FAIL)
- goto out;
- }
- }
-
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * test 4: set/get label
- *-------------------------------------------------------------------------
- */
-
- TESTING2("set/get label");
-
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * set label
- *-------------------------------------------------------------------------
- */
-
- if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
- goto out;
- if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * get the scale name using a static buffer
- *-------------------------------------------------------------------------
- */
-
- if(H5DSget_label(did,DIM0,dim0_label,sizeof(dim0_label)) < 0)
- goto out;
- if(H5DSget_label(did,DIM1,dim1_label,sizeof(dim1_label)) < 0)
- goto out;
-
- if(strcmp(DIM0_LABEL,dim0_label)!=0)
- goto out;
- if(strcmp(DIM1_LABEL,dim1_label)!=0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * get the scale name using a dynamic buffer
- *-------------------------------------------------------------------------
- */
-
- if((dim0_label_size=H5DSget_label(did,DIM0,NULL,(size_t)0)) < 0)
- goto out;
- if((dim1_label_size=H5DSget_label(did,DIM1,NULL,(size_t)0)) < 0)
- goto out;
-
- /* allocate */
- dim0_labeld = (char*)malloc(dim0_label_size * sizeof(char));
- dim1_labeld = (char*)malloc(dim1_label_size * sizeof(char));
- if( dim0_labeld==NULL || dim1_labeld==NULL)
- goto out;
-
- if(H5DSget_label(did,DIM0,dim0_labeld,(size_t)dim0_label_size) < 0)
- goto out;
- if(H5DSget_label(did,DIM1,dim1_labeld,(size_t)dim1_label_size) < 0)
- goto out;
-
- if(strncmp(DIM0_LABEL,dim0_labeld,(size_t)(dim0_label_size-1))!=0)
- goto out;
- if(strncmp(DIM1_LABEL,dim1_labeld,(size_t)(dim1_label_size-1))!=0)
- goto out;
-
- if(dim0_labeld)
- {
- free(dim0_labeld);
- dim0_labeld=NULL;
- }
- if(dim1_labeld)
- {
- free(dim1_labeld);
- dim1_labeld=NULL;
- }
-
-
-/*-------------------------------------------------------------------------
- * get the label using a static buffer smaller than the string lenght
- *-------------------------------------------------------------------------
- */
-
- if(H5DSget_label(did,DIM0,dim0_labels,sizeof(dim0_labels)) < 0)
- goto out;
- if(H5DSget_label(did,DIM1,dim1_labels,sizeof(dim1_labels)) < 0)
- goto out;
-
- if(strncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0)
- goto out;
- if(strncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0)
- goto out;
-
-
-
- if(H5Dclose(did))
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * test 5: set scale/get scale name
- *-------------------------------------------------------------------------
- */
- TESTING2("set scale/get scale name");
-
- if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
- goto out;
-
- if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
- goto out;
-
- /* verify that DS_1_NAME is a dimension scale dataset */
- if((H5DSis_scale(dsid))==0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * get the scale name using a dynamic buffer
- *-------------------------------------------------------------------------
- */
+ if((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSset_scale(dsid,SCALE_11_NAME) < 0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
- /* get the lenght of the scale name (pass NULL in name) */
- if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) < 0)
- goto out;
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
- /* allocate a buffer */
- name_out = (char*)malloc(name_len * sizeof(char));
- if(name_out == NULL)
- goto out;
-
- /* get the scale name using this buffer */
- if(H5DSget_scale_name(dsid,name_out,(size_t)name_len) < 0)
- goto out;
-
- if(strcmp(SCALE_1_NAME,name_out)!=0)
- goto out;
-
- if(name_out)
- {
- free(name_out);
- name_out=NULL;
- }
-
-/*-------------------------------------------------------------------------
- * get the scale name using a static buffer
- *-------------------------------------------------------------------------
- */
-
- /* get the scale name using this buffer */
- if(H5DSget_scale_name(dsid,sname,sizeof(sname)) < 0)
- goto out;
-
- if(strcmp(SCALE_1_NAME,sname)!=0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * get the scale name using a static buffer smaller than the string lenght
- *-------------------------------------------------------------------------
- */
-
- /* get the scale name using this buffer */
- if(H5DSget_scale_name(dsid,snames,sizeof(snames)) < 0)
- goto out;
-
- if(strncmp(SCALE_1_NAME,snames,sizeof(snames)-1)!=0)
- goto out;
-
- if(H5Dclose(dsid))
- goto out;
-
-/*-------------------------------------------------------------------------
- * add scale names
- *-------------------------------------------------------------------------
- */
-
- if((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSset_scale(dsid,SCALE_11_NAME) < 0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
- if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
- if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSset_scale(dsid,SCALE_21_NAME) < 0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
- if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSset_scale(dsid,SCALE_22_NAME) < 0)
- goto out;
- if(H5Dclose(dsid))
- goto out;
-
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * test 6: test iterate scales with a function verify_scale
- *-------------------------------------------------------------------------
- */
- TESTING2("iterate scales (verify scale)");
-
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- dim = 0;
-
- /* iterate trough the 1st dimension of "dset_a" and verify that its DS is valid */
- if(H5DSiterate_scales(did,dim,NULL,verify_scale,NULL) < 0)
- goto out;
-
- /* iterate trough the 2nd dimension of "dset_a" and verify that its DS is valid
+ if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSset_scale(dsid,SCALE_21_NAME) < 0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
+
+ if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSset_scale(dsid,SCALE_22_NAME) < 0)
+ goto out;
+ if(H5Dclose(dsid))
+ goto out;
+
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * test 6: test iterate scales with a function verify_scale
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("iterate scales (verify scale)");
+
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ dim = 0;
+
+ /* iterate trough the 1st dimension of "dset_a" and verify that its DS is valid */
+ if(H5DSiterate_scales(did,dim,NULL,verify_scale,NULL) < 0)
+ goto out;
+
+ /* iterate trough the 2nd dimension of "dset_a" and verify that its DS is valid
start at DS index 2 */
- dim = 1;
- scale_idx = 2;
+ dim = 1;
+ scale_idx = 2;
- if(H5DSiterate_scales(did,dim,&scale_idx,verify_scale,NULL) < 0)
- goto out;
+ if(H5DSiterate_scales(did,dim,&scale_idx,verify_scale,NULL) < 0)
+ goto out;
- /* close dataset ID of "dset_a" */
- if(H5Dclose(did) < 0)
- goto out;
+ /* close dataset ID of "dset_a" */
+ if(H5Dclose(did) < 0)
+ goto out;
- PASSED();
+ PASSED();
-/*-------------------------------------------------------------------------
- * test 7: test iterate scales with a function read_scale
- *-------------------------------------------------------------------------
- */
- TESTING2("iterate scales (read scale values)");
+ /*-------------------------------------------------------------------------
+ * test 7: test iterate scales with a function read_scale
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("iterate scales (read scale values)");
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
- dim = 0;
+ dim = 0;
- /* iterate trough the 1st dimension of "dset_a" and read the DS */
- if(H5DSiterate_scales(did,dim,NULL,read_scale,s1_wbuf) < 0)
- goto out;
+ /* iterate trough the 1st dimension of "dset_a" and read the DS */
+ if(H5DSiterate_scales(did,dim,NULL,read_scale,s1_wbuf) < 0)
+ goto out;
- /* iterate trough the 2nd dimension of "dset_a" and read the DS
+ /* iterate trough the 2nd dimension of "dset_a" and read the DS
start at DS index 2 */
- dim = 1;
- scale_idx = 2;
-
- if(H5DSiterate_scales(did,dim,&scale_idx,read_scale,s22_wbuf) < 0)
- goto out;
-
- /* close dataset ID of "dset_a" */
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * test 8: test iterate scales with a function match_dim_scale
- *-------------------------------------------------------------------------
- */
- TESTING2("iterate scales (verify the scale sizes match)");
-
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get dataset space */
- if((sid = H5Dget_space(did)) < 0)
- goto out;
-
- /* get rank */
- if((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* get dimensions of dataset */
- if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
- goto out;
-
- {
- int match_size; /* does this scale size matches the dataset DIM size */
- int idx=0; /* scale index to start iterating, on return, index where iterator stoped */
-
- /* iterate trough all the dimensions */
- for(dim=0; dim<(unsigned)rank; dim++)
- {
- if((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL)) < 0)
- goto out;
-
- /* "dset_a" was defined with all dimension scales size matching the size of its dimensions */
- if(match_size==0)
- goto out;
-
- /* both DS_1_NAME and DS_2_NAME are the on the first index */
- if(idx!=0)
- goto out;
- }
- }
-
-
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
- if(H5Sclose(sid) < 0)
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * test 9: test iterate scales with a function match_dim_scale
- *-------------------------------------------------------------------------
- */
- TESTING2("iterate scales (verify the scale sizes do not match)");
-
-/*-------------------------------------------------------------------------
- * create 3 datasets: 1 "data" dataset and dimension scales (some are empty)
- *-------------------------------------------------------------------------
- */
- if(H5LTmake_dataset_int(fid,"dset_f",rank,dims,buf) < 0)
- goto out;
- if(H5LTmake_dataset_int(fid,"ds_f_1",rankds,s1_dim,NULL) < 0)
- goto out;
- if(H5LTmake_dataset_int(fid,"ds_f_11",rankds,s1_dim,s1_wbuf) < 0)
- goto out;
- if(H5LTmake_dataset_int(fid,"ds_f_2",rankds,s2_dim,NULL) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach them
- *-------------------------------------------------------------------------
- */
- if((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT)) < 0)
- goto out;
-
- if((dsid = H5Dopen2(fid,"ds_f_1", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- if((dsid = H5Dopen2(fid,"ds_f_11", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- if((dsid = H5Dopen2(fid,"ds_f_2", H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- if(H5Dclose(did) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * verify match
- *-------------------------------------------------------------------------
- */
- /* get the dataset id for "dset_f" */
- if((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get dataset space */
- if((sid = H5Dget_space(did)) < 0)
- goto out;
-
- /* get rank */
- if((rank=H5Sget_simple_extent_ndims(sid)) < 0)
- goto out;
-
- /* get dimensions of dataset */
- if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
- goto out;
-
- {
- int match_size; /* does this scale size matches the dataset DIM size */
- int idx; /* scale index to start iterating, on return, index where iterator stoped */
-
- /* iterate trough all the dimensions */
- for(dim=0; dim<(unsigned)rank; dim++)
- {
- /* always start at 1st scale */
- idx=0;
-
- if((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL)) < 0)
- goto out;
-
- /* "dset_e" was defined with :
- dim 0: 2 scales, first is empty
- dim 1: 1 scale, empty */
- switch(dim)
- {
- case 0: /* for DIM 0, we get a valid scale at IDX 1 */
- if(match_size!=1 && idx!=1)
- goto out;
- break;
- case 1: /* for DIM 1, we get no valid scales */
- if(match_size!=0 && idx!=0)
- goto out;
- }/*switch*/
- }/*for*/
- }
-
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
- if(H5Sclose(sid) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * end
- *-------------------------------------------------------------------------
- */
-
- /* close */
- H5Fclose(fid);
-
- return 0;
-
- /* error zone, gracefully close */
+ dim = 1;
+ scale_idx = 2;
+
+ if(H5DSiterate_scales(did,dim,&scale_idx,read_scale,s22_wbuf) < 0)
+ goto out;
+
+ /* close dataset ID of "dset_a" */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * test 8: test iterate scales with a function match_dim_scale
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("iterate scales (verify the scale sizes match)");
+
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get dataset space */
+ if((sid = H5Dget_space(did)) < 0)
+ goto out;
+
+ /* get rank */
+ if((rank=H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* get dimensions of dataset */
+ if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
+ goto out;
+
+ {
+ int match_size; /* does this scale size matches the dataset DIM size */
+ int idx=0; /* scale index to start iterating, on return, index where iterator stoped */
+
+ /* iterate trough all the dimensions */
+ for(dim=0; dim<(unsigned)rank; dim++)
+ {
+ if((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL)) < 0)
+ goto out;
+
+ /* "dset_a" was defined with all dimension scales size matching the size of its dimensions */
+ if(match_size==0)
+ goto out;
+
+ /* both DS_1_NAME and DS_2_NAME are the on the first index */
+ if(idx!=0)
+ goto out;
+ }
+ }
+
+
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+ if(H5Sclose(sid) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * test 9: test iterate scales with a function match_dim_scale
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("iterate scales (verify the scale sizes do not match)");
+
+ /*-------------------------------------------------------------------------
+ * create 3 datasets: 1 "data" dataset and dimension scales (some are empty)
+ *-------------------------------------------------------------------------
+ */
+ if(H5LTmake_dataset_int(fid,"dset_f",rank,dims,buf) < 0)
+ goto out;
+ if(H5LTmake_dataset_int(fid,"ds_f_1",rankds,s1_dim,NULL) < 0)
+ goto out;
+ if(H5LTmake_dataset_int(fid,"ds_f_11",rankds,s1_dim,s1_wbuf) < 0)
+ goto out;
+ if(H5LTmake_dataset_int(fid,"ds_f_2",rankds,s2_dim,NULL) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach them
+ *-------------------------------------------------------------------------
+ */
+ if((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT)) < 0)
+ goto out;
+
+ if((dsid = H5Dopen2(fid,"ds_f_1", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if((dsid = H5Dopen2(fid,"ds_f_11", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if((dsid = H5Dopen2(fid,"ds_f_2", H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * verify match
+ *-------------------------------------------------------------------------
+ */
+ /* get the dataset id for "dset_f" */
+ if((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get dataset space */
+ if((sid = H5Dget_space(did)) < 0)
+ goto out;
+
+ /* get rank */
+ if((rank=H5Sget_simple_extent_ndims(sid)) < 0)
+ goto out;
+
+ /* get dimensions of dataset */
+ if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
+ goto out;
+
+ {
+ int match_size; /* does this scale size matches the dataset DIM size */
+ int idx; /* scale index to start iterating, on return, index where iterator stoped */
+
+ /* iterate trough all the dimensions */
+ for(dim=0; dim<(unsigned)rank; dim++)
+ {
+ /* always start at 1st scale */
+ idx=0;
+
+ if((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL)) < 0)
+ goto out;
+
+ /* "dset_e" was defined with :
+ dim 0: 2 scales, first is empty
+ dim 1: 1 scale, empty */
+ switch(dim)
+ {
+ case 0: /* for DIM 0, we get a valid scale at IDX 1 */
+ if(match_size!=1 && idx!=1)
+ goto out;
+ break;
+ case 1: /* for DIM 1, we get no valid scales */
+ if(match_size!=0 && idx!=0)
+ goto out;
+ }/*switch*/
+ }/*for*/
+ }
+
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+ if(H5Sclose(sid) < 0)
+ goto out;
+
+ PASSED();
+
+
+ /*-------------------------------------------------------------------------
+ * end
+ *-------------------------------------------------------------------------
+ */
+
+ /* close */
+ H5Fclose(fid);
+
+ return 0;
+
+ /* error zone, gracefully close */
out:
- H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Fclose(fid);
- } H5E_END_TRY;
- H5_FAILED();
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ H5_FAILED();
+ return FAIL;
}
@@ -1465,25 +1465,25 @@ out:
static herr_t verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
{
- /* define a default zero value for return. This will cause the iterator to continue */
- int ret = 0;
+ /* define a default zero value for return. This will cause the iterator to continue */
+ int ret = 0;
- /* unused */
- dset=dset;
- dim=dim;
- visitor_data=visitor_data;
+ /* unused */
+ dset=dset;
+ dim=dim;
+ visitor_data=visitor_data;
- /* define a positive value for return value. This will cause the iterator to
+ /* define a positive value for return value. This will cause the iterator to
immediately return that positive value, indicating short-circuit success
- */
+ */
- /* the parameter DS dataset must be a valid DS dataset */
- if((H5DSis_scale(scale_id))==1)
- {
- ret = 1;
- }
+ /* the parameter DS dataset must be a valid DS dataset */
+ if((H5DSis_scale(scale_id))==1)
+ {
+ ret = 1;
+ }
- return ret;
+ return ret;
}
@@ -1507,78 +1507,78 @@ static herr_t verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visit
static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_data)
{
- int ret = 0; /* define a default zero value for return. This will cause the iterator to continue */
- hid_t sid; /* space ID */
- hid_t tid = -1; /* file type ID */
- hid_t mtid = -1; /* memory type ID */
- hssize_t nelmts; /* number of data elements */
- char *buf=NULL; /* data buffer */
- size_t size;
- int i;
- char *data=visitor_data;
-
- /* unused */
- dset=dset;
- dim=dim;
-
- /* get space */
- if((sid = H5Dget_space(scale_id)) < 0)
- goto out;
- /* get type */
- if((tid = H5Dget_type(scale_id)) < 0)
- goto out;
- /* get size of the DS array */
- if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
- goto out;
- /* get type */
- if((mtid=H5Tget_native_type(tid,H5T_DIR_DEFAULT)) < 0)
- goto out;
- /* get type size */
- if((size=H5Tget_size(mtid))==0)
- goto out;
-
- if(nelmts)
- {
- buf=(char *) malloc((size_t)(nelmts*size));
- if( buf==NULL)
- goto out;
- if(H5Dread(scale_id,mtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
- goto out;
-
- for(i=0; i<nelmts; i++)
- {
- if(buf[i] != data[i])
- {
- printf("read and write buffers differ\n");
- goto out;
- }
- }
-
- } /* if */
-
- if(H5Sclose(sid) < 0)
- goto out;
- if(H5Tclose(tid) < 0)
- goto out;
- if(H5Tclose(mtid) < 0)
- goto out;
- if(buf)
- free(buf);
-
-
- return ret;
-
- /* error zone, gracefully close */
- out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Tclose(tid);
- H5Tclose(mtid);
- if(buf)
- free(buf);
- } H5E_END_TRY;
-
- return FAIL;
+ int ret = 0; /* define a default zero value for return. This will cause the iterator to continue */
+ hid_t sid; /* space ID */
+ hid_t tid = -1; /* file type ID */
+ hid_t mtid = -1; /* memory type ID */
+ hssize_t nelmts; /* number of data elements */
+ char *buf=NULL; /* data buffer */
+ size_t size;
+ int i;
+ char *data=visitor_data;
+
+ /* unused */
+ dset=dset;
+ dim=dim;
+
+ /* get space */
+ if((sid = H5Dget_space(scale_id)) < 0)
+ goto out;
+ /* get type */
+ if((tid = H5Dget_type(scale_id)) < 0)
+ goto out;
+ /* get size of the DS array */
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
+ goto out;
+ /* get type */
+ if((mtid=H5Tget_native_type(tid,H5T_DIR_DEFAULT)) < 0)
+ goto out;
+ /* get type size */
+ if((size=H5Tget_size(mtid))==0)
+ goto out;
+
+ if(nelmts)
+ {
+ buf=(char *) malloc((size_t)(nelmts*size));
+ if( buf==NULL)
+ goto out;
+ if(H5Dread(scale_id,mtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
+ goto out;
+
+ for(i=0; i<nelmts; i++)
+ {
+ if(buf[i] != data[i])
+ {
+ printf("read and write buffers differ\n");
+ goto out;
+ }
+ }
+
+ } /* if */
+
+ if(H5Sclose(sid) < 0)
+ goto out;
+ if(H5Tclose(tid) < 0)
+ goto out;
+ if(H5Tclose(mtid) < 0)
+ goto out;
+ if(buf)
+ free(buf);
+
+
+ return ret;
+
+ /* error zone, gracefully close */
+out:
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Tclose(tid);
+ H5Tclose(mtid);
+ if(buf)
+ free(buf);
+ } H5E_END_TRY;
+
+ return FAIL;
}
@@ -1601,66 +1601,66 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
static herr_t match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor_data)
{
- int ret = 0; /* define a default zero value for return. This will cause the iterator to continue */
- hid_t sid; /* space ID */
- hssize_t nelmts; /* size of a dimension scale array */
- hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */
- hsize_t storage_size;
+ int ret = 0; /* define a default zero value for return. This will cause the iterator to continue */
+ hid_t sid; /* space ID */
+ hssize_t nelmts; /* size of a dimension scale array */
+ hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */
+ hsize_t storage_size;
/* Stop compiler from whining about "unused parameters" */
visitor_data = visitor_data;
-/*-------------------------------------------------------------------------
- * get DID (dataset) space info
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * get DID (dataset) space info
+ *-------------------------------------------------------------------------
+ */
- /* get dataset space */
- if((sid = H5Dget_space(did)) < 0)
- goto out;
+ /* get dataset space */
+ if((sid = H5Dget_space(did)) < 0)
+ goto out;
- /* get dimensions of dataset */
- if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
- goto out;
+ /* get dimensions of dataset */
+ if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
+ goto out;
- /* close the dataspace id */
- if(H5Sclose(sid) < 0)
- goto out;
+ /* close the dataspace id */
+ if(H5Sclose(sid) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * get DSID (scale) space info
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * get DSID (scale) space info
+ *-------------------------------------------------------------------------
+ */
- /* get the space for the scale */
- if((sid = H5Dget_space(dsid)) < 0)
- goto out;
+ /* get the space for the scale */
+ if((sid = H5Dget_space(dsid)) < 0)
+ goto out;
- /* get size of the DS array */
- if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
- goto out;
+ /* get size of the DS array */
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
+ goto out;
- /* close */
- if(H5Sclose(sid) < 0)
- goto out;
+ /* close */
+ if(H5Sclose(sid) < 0)
+ goto out;
- /* the size of the DS array must match the dimension of the dataset */
- if(nelmts == (hssize_t)dims[dim])
- ret = 1;
+ /* the size of the DS array must match the dimension of the dataset */
+ if(nelmts == (hssize_t)dims[dim])
+ ret = 1;
- /* if the scale is empty assume it cannot be used */
- storage_size=H5Dget_storage_size(dsid);
+ /* if the scale is empty assume it cannot be used */
+ storage_size=H5Dget_storage_size(dsid);
- if(storage_size==0)
- ret = 0;
+ if(storage_size==0)
+ ret = 0;
- return ret;
+ return ret;
out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- } H5E_END_TRY;
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ } H5E_END_TRY;
+ return FAIL;
}
@@ -1688,16 +1688,12 @@ static herr_t op_bogus(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_d
scale_id = scale_id;
visitor_data = visitor_data;
- /* define a default zero value for return. This will cause the iterator to continue */
- return 0;
+ /* define a default zero value for return. This will cause the iterator to continue */
+ return 0;
}
-
-
-
-
/*-------------------------------------------------------------------------
* test error conditions
*-------------------------------------------------------------------------
@@ -1705,374 +1701,374 @@ static herr_t op_bogus(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_d
static int test_errors(void)
{
- hid_t fid; /* file ID */
- int rank = RANK; /* rank of data dataset */
- int rankds = 1; /* rank of DS dataset */
- hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
- hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
- hid_t did = -1; /* dataset ID */
- hid_t dsid = -1; /* scale ID */
- hid_t gid = -1; /* group ID */
- hid_t sid = -1; /* space ID */
- hid_t sidds = -1; /* space ID */
- hsize_t pal_dims[] = {9,3};
-
- printf("Testing error conditions\n");
+ hid_t fid; /* file ID */
+ int rank = RANK; /* rank of data dataset */
+ int rankds = 1; /* rank of DS dataset */
+ hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
+ hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
+ hid_t did = -1; /* dataset ID */
+ hid_t dsid = -1; /* scale ID */
+ hid_t gid = -1; /* group ID */
+ hid_t sid = -1; /* space ID */
+ hid_t sidds = -1; /* space ID */
+ hsize_t pal_dims[] = {9,3};
+
+ printf("Testing error conditions\n");
+
+ /*-------------------------------------------------------------------------
+ * create a file, spaces, dataset and group ids
+ *-------------------------------------------------------------------------
+ */
+
+ /* create a file using default properties */
+ if((fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ /* create a group */
+ if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ /* create the data space for the dataset */
+ if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
+ goto out;
+ /* create the data space for the scale */
+ if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
+ goto out;
+ /* create a dataset */
+ if((did = H5Dcreate2(fid, "dset_a", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ /* create a dataset for the scale */
+ if((dsid = H5Dcreate2(fid, "ds_a", H5T_NATIVE_INT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attempt to attach a dataset to itself, it should fail
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("attach a dataset to itself");
+
+ if(H5DSattach_scale(did, did, 0) == SUCCEED)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * attempt to attach a group with a dataset, it should fail
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("attach a group with a dataset");
+
+ if(H5DSattach_scale(gid,dsid,0)==SUCCEED)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * attempt to attach a dataset with a group, it should fail
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("attach a dataset with a group");
+
+ if(H5DSattach_scale(did,gid,0)==SUCCEED)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * attempt to set scale for a group, it should fail
+ *-------------------------------------------------------------------------
+ */
+ TESTING2("set scale for a group");
+
+ if(H5DSset_scale(gid,"scale 1")==SUCCEED)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * close IDs for this set
+ *-------------------------------------------------------------------------
+ */
+
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+ if(H5Sclose(sid) < 0)
+ goto out;
+ if(H5Sclose(sidds) < 0)
+ goto out;
+ if(H5Gclose(gid) < 0)
+ goto out;
+
+
+ /*-------------------------------------------------------------------------
+ * try to attach a scale that has scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("attach a scale that has scales");
+
+ /* create the data space for the scale */
+ if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
+ goto out;
+
+ /* create a dataset "ds_b" for the scale */
+ if((dsid = H5Dcreate2(fid, "ds_b", H5T_NATIVE_INT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* open the previous written "ds_a" */
+ if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* attach "ds_b" to "ds_a", valid */
+ if(H5DSattach_scale(did, dsid, 0) < 0)
+ goto out;
+
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+ if(H5Sclose(sidds) < 0)
+ goto out;
+
+ /* open the previous written "dset_a" */
+ if((did = H5Dopen2(fid, "dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* open the previous written "ds_a" */
+ if((dsid = H5Dopen2(fid, "ds_a", H5P_DEFAULT)) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * create a file, spaces, dataset and group ids
- *-------------------------------------------------------------------------
- */
+ /* try to attach "ds_a" to "dset_a", not valid */
+ if(H5DSattach_scale(did,dsid,0)==SUCCEED)
+ goto out;
- /* create a file using default properties */
- if((fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- /* create a group */
- if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- /* create the data space for the dataset */
- if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
- goto out;
- /* create the data space for the scale */
- if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
- goto out;
- /* create a dataset */
- if((did = H5Dcreate2(fid, "dset_a", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- /* create a dataset for the scale */
- if((dsid = H5Dcreate2(fid, "ds_a", H5T_NATIVE_INT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ /* open the previous written "ds_a" */
+ if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* open the previous written "ds_b" */
+ if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* detach "ds_b" to "ds_a" */
+ if(H5DSdetach_scale(did,dsid,0) < 0)
+ goto out;
+
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * attempt to attach a dataset to itself, it should fail
- *-------------------------------------------------------------------------
- */
+ PASSED();
- TESTING2("attach a dataset to itself");
+ /*-------------------------------------------------------------------------
+ * try to attach a dataset that is a scale
+ *-------------------------------------------------------------------------
+ */
- if(H5DSattach_scale(did, did, 0) == SUCCEED)
- goto out;
+ TESTING2("attach to a dataset that is a scale");
- PASSED();
+ /* open the previous written "ds_b", that is a scale */
+ if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * attempt to attach a group with a dataset, it should fail
- *-------------------------------------------------------------------------
- */
- TESTING2("attach a group with a dataset");
+ /* open the previous written "ds_a" */
+ if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
+ goto out;
- if(H5DSattach_scale(gid,dsid,0)==SUCCEED)
- goto out;
+ /* try to attach "ds_a" to "ds_b", not valid */
+ if(H5DSattach_scale(dsid,did,0)==SUCCEED)
+ goto out;
+
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
- PASSED();
+ PASSED();
-/*-------------------------------------------------------------------------
- * attempt to attach a dataset with a group, it should fail
- *-------------------------------------------------------------------------
- */
- TESTING2("attach a dataset with a group");
+ /*-------------------------------------------------------------------------
+ * try to attach a scale to an image, pallete or table
+ *-------------------------------------------------------------------------
+ */
- if(H5DSattach_scale(did,gid,0)==SUCCEED)
- goto out;
+ TESTING2("attach to a dataset that is a reserved class dataset");
- PASSED();
+ /* make an image */
+ if(H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * attempt to set scale for a group, it should fail
- *-------------------------------------------------------------------------
- */
- TESTING2("set scale for a group");
+ /* make a palette */
+ if(H5IMmake_palette(fid,"pallete",pal_dims,NULL) < 0)
+ goto out;
- if(H5DSset_scale(gid,"scale 1")==SUCCEED)
- goto out;
+ /* open the previous written "ds_b" */
+ if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
+ goto out;
- PASSED();
+ /* open the image dataset */
+ if((did = H5Dopen2(fid,"image", H5P_DEFAULT)) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * close IDs for this set
- *-------------------------------------------------------------------------
- */
+ /* try to attach "ds_a" to the image, not valid */
+ if(H5DSattach_scale(did,dsid,0)==SUCCEED)
+ goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
- if(H5Sclose(sid) < 0)
- goto out;
- if(H5Sclose(sidds) < 0)
- goto out;
- if(H5Gclose(gid) < 0)
- goto out;
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+ PASSED();
-/*-------------------------------------------------------------------------
- * try to attach a scale that has scales
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * is scale
+ *-------------------------------------------------------------------------
+ */
- TESTING2("attach a scale that has scales");
+ TESTING2("is scale");
- /* create the data space for the scale */
- if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
- goto out;
+ /* open a non scale dataset */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
- /* create a dataset "ds_b" for the scale */
- if((dsid = H5Dcreate2(fid, "ds_b", H5T_NATIVE_INT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
+ /* verify that it is not a dimension scale dataset */
+ if((H5DSis_scale(did))==1)
+ goto out;
- /* open the previous written "ds_a" */
- if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
- goto out;
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
- /* attach "ds_b" to "ds_a", valid */
- if(H5DSattach_scale(did, dsid, 0) < 0)
- goto out;
+ /* open the group. */
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
- if(H5Sclose(sidds) < 0)
- goto out;
+ /* verify that it is not a dimension scale dataset */
+ if((H5DSis_scale(gid))==1)
+ goto out;
- /* open the previous written "dset_a" */
- if((did = H5Dopen2(fid, "dset_a", H5P_DEFAULT)) < 0)
- goto out;
+ /* close */
+ if(H5Gclose(gid) < 0)
+ goto out;
- /* open the previous written "ds_a" */
- if((dsid = H5Dopen2(fid, "ds_a", H5P_DEFAULT)) < 0)
- goto out;
+ PASSED();
- /* try to attach "ds_a" to "dset_a", not valid */
- if(H5DSattach_scale(did,dsid,0)==SUCCEED)
- goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * detach
+ *-------------------------------------------------------------------------
+ */
- /* open the previous written "ds_a" */
- if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
- goto out;
+ TESTING2("detach scale from dataset it is not attached to");
- /* open the previous written "ds_b" */
- if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
- goto out;
+ /* open the previous written "ds_a" */
+ if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
+ goto out;
- /* detach "ds_b" to "ds_a" */
- if(H5DSdetach_scale(did,dsid,0) < 0)
- goto out;
+ /* open the previous written "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
+ /* try to detach "ds_a" from "dset_a" */
+ if(H5DSdetach_scale(did,dsid,0)==SUCCEED)
+ goto out;
- PASSED();
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * try to attach a dataset that is a scale
- *-------------------------------------------------------------------------
- */
+ PASSED();
- TESTING2("attach to a dataset that is a scale");
- /* open the previous written "ds_b", that is a scale */
- if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * detach
+ *-------------------------------------------------------------------------
+ */
- /* open the previous written "ds_a" */
- if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
- goto out;
+ TESTING2("detach scale from group");
- /* try to attach "ds_a" to "ds_b", not valid */
- if(H5DSattach_scale(dsid,did,0)==SUCCEED)
- goto out;
+ /* open the previous written "ds_a" */
+ if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
+ goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
+ /* open the group. */
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ goto out;
- PASSED();
+ /* try to detach "ds_a" from "grp" */
+ if(H5DSdetach_scale(gid,dsid,0)==SUCCEED)
+ goto out;
-/*-------------------------------------------------------------------------
- * try to attach a scale to an image, pallete or table
- *-------------------------------------------------------------------------
- */
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5Gclose(gid) < 0)
+ goto out;
- TESTING2("attach to a dataset that is a reserved class dataset");
+ PASSED();
- /* make an image */
- if(H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL) < 0)
- goto out;
- /* make a palette */
- if(H5IMmake_palette(fid,"pallete",pal_dims,NULL) < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * detach
+ *-------------------------------------------------------------------------
+ */
- /* open the previous written "ds_b" */
- if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
- goto out;
+ TESTING2("detach scale when scale is group");
- /* open the image dataset */
- if((did = H5Dopen2(fid,"image", H5P_DEFAULT)) < 0)
- goto out;
+ /* open the previous written "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
- /* try to attach "ds_a" to the image, not valid */
- if(H5DSattach_scale(did,dsid,0)==SUCCEED)
- goto out;
+ /* open the group. */
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
+ /* try to detach "grp" from "dset_a" */
+ if(H5DSdetach_scale(did,gid,0)==SUCCEED)
+ goto out;
- PASSED();
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+ if(H5Gclose(gid) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * is scale
- *-------------------------------------------------------------------------
- */
-
- TESTING2("is scale");
-
- /* open a non scale dataset */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* verify that it is not a dimension scale dataset */
- if((H5DSis_scale(did))==1)
- goto out;
-
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
-
- /* open the group. */
- if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
- goto out;
-
- /* verify that it is not a dimension scale dataset */
- if((H5DSis_scale(gid))==1)
- goto out;
-
- /* close */
- if(H5Gclose(gid) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * detach
- *-------------------------------------------------------------------------
- */
-
- TESTING2("detach scale from dataset it is not attached to");
-
- /* open the previous written "ds_a" */
- if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* open the previous written "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* try to detach "ds_a" from "dset_a" */
- if(H5DSdetach_scale(did,dsid,0)==SUCCEED)
- goto out;
-
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * detach
- *-------------------------------------------------------------------------
- */
-
- TESTING2("detach scale from group");
-
- /* open the previous written "ds_a" */
- if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* open the group. */
- if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
- goto out;
-
- /* try to detach "ds_a" from "grp" */
- if(H5DSdetach_scale(gid,dsid,0)==SUCCEED)
- goto out;
-
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5Gclose(gid) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * detach
- *-------------------------------------------------------------------------
- */
+ PASSED();
- TESTING2("detach scale when scale is group");
- /* open the previous written "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
+ /* close */
+ if(H5Fclose(fid) < 0)
+ goto out;
- /* open the group. */
- if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
- goto out;
+ return 0;
- /* try to detach "grp" from "dset_a" */
- if(H5DSdetach_scale(did,gid,0)==SUCCEED)
- goto out;
-
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
- if(H5Gclose(gid) < 0)
- goto out;
-
- PASSED();
-
-
- /* close */
- if(H5Fclose(fid) < 0)
- goto out;
-
- return 0;
-
- /* error zone, gracefully close */
+ /* error zone, gracefully close */
out:
- H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Sclose(sidds);
- H5Dclose(did);
- H5Dclose(dsid);
- H5Gclose(gid);
- H5Fclose(fid);
- } H5E_END_TRY;
- H5_FAILED();
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Sclose(sidds);
+ H5Dclose(did);
+ H5Dclose(dsid);
+ H5Gclose(gid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ H5_FAILED();
+ return FAIL;
}
@@ -2084,182 +2080,182 @@ out:
static int test_iterators(void)
{
- hid_t fid; /* file ID */
- int rank = RANK; /* rank of data dataset */
- int rankds = 1; /* rank of DS dataset */
- hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
- hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
- hid_t gid = -1; /* group ID */
- hid_t did; /* dataset ID */
- hid_t dsid; /* scale ID */
- char dname[30]; /* dataset name */
- int i;
-
- printf("Testing iterators\n");
-
-/*-------------------------------------------------------------------------
- * create a file, spaces, dataset and group ids
- *-------------------------------------------------------------------------
- */
-
- /* create a file using default properties */
- if((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
- goto out;
- /* create a group */
- if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- /* close */
- if(H5Gclose(gid) < 0)
- goto out;
- /* make a dataset */
- if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,NULL) < 0)
- goto out;
- /* make a DS dataset */
- if(H5LTmake_dataset_int(fid,"ds_a",rankds,s1_dim,NULL) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * iterate when the dataset has no scales
- *-------------------------------------------------------------------------
- */
-
- TESTING2("iterate when the dataset has no scales ");
-
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* try to iterate trough the 1st dimension of "dset_a", return error */
- if(H5DSiterate_scales(did,0,NULL,verify_scale,NULL) < 0)
- goto out;
-
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
+ hid_t fid; /* file ID */
+ int rank = RANK; /* rank of data dataset */
+ int rankds = 1; /* rank of DS dataset */
+ hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
+ hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
+ hid_t gid = -1; /* group ID */
+ hid_t did; /* dataset ID */
+ hid_t dsid; /* scale ID */
+ char dname[30]; /* dataset name */
+ int i;
+
+ printf("Testing iterators\n");
+
+ /*-------------------------------------------------------------------------
+ * create a file, spaces, dataset and group ids
+ *-------------------------------------------------------------------------
+ */
+
+ /* create a file using default properties */
+ if((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ goto out;
+ /* create a group */
+ if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ /* close */
+ if(H5Gclose(gid) < 0)
+ goto out;
+ /* make a dataset */
+ if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,NULL) < 0)
+ goto out;
+ /* make a DS dataset */
+ if(H5LTmake_dataset_int(fid,"ds_a",rankds,s1_dim,NULL) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * iterate when the dataset has no scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("iterate when the dataset has no scales ");
+
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* try to iterate trough the 1st dimension of "dset_a", return error */
+ if(H5DSiterate_scales(did,0,NULL,verify_scale,NULL) < 0)
+ goto out;
+
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+
+ /*-------------------------------------------------------------------------
+ * iterate on dimension that is outside the rank
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("iterate on dimension that is outside the rank ");
+
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* try to iterate trough the 3rd dimension of "dset_a", return error */
+ if(H5DSiterate_scales(did,3,NULL,verify_scale,NULL)==SUCCEED)
+ goto out;
+
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * iterate for dimension with many scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("iterate for dimension with many scales ");
+
+ /* open the previously written "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ for(i=0; i<100; i++)
+ {
+ /* make a DS */
+ sprintf(dname,"ds_%d",i);
+ if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
+ goto out;
+ /* open */
+ if((dsid = H5Dopen2(fid,dname, H5P_DEFAULT)) < 0)
+ goto out;
+ /* attach */
+ if(H5DSattach_scale(did,dsid,0) < 0)
+ goto out;
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ }
- PASSED();
+ /* iterate trough the 1st dimension of "dset_a" */
+ if(H5DSiterate_scales(did,0,NULL,op_bogus,NULL) < 0)
+ goto out;
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
-/*-------------------------------------------------------------------------
- * iterate on dimension that is outside the rank
- *-------------------------------------------------------------------------
- */
+ PASSED();
- TESTING2("iterate on dimension that is outside the rank ");
+ /*-------------------------------------------------------------------------
+ * iterate on group
+ *-------------------------------------------------------------------------
+ */
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
+ TESTING2("iterate on group ");
- /* try to iterate trough the 3rd dimension of "dset_a", return error */
- if(H5DSiterate_scales(did,3,NULL,verify_scale,NULL)==SUCCEED)
- goto out;
+ /* open */
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ goto out;
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
+ /* try to iterate, return error */
+ if(H5DSiterate_scales(gid,0,NULL,verify_scale,NULL)==SUCCEED)
+ goto out;
- PASSED();
-
-/*-------------------------------------------------------------------------
- * iterate for dimension with many scales
- *-------------------------------------------------------------------------
- */
+ /* close */
+ if(H5Gclose(gid) < 0)
+ goto out;
- TESTING2("iterate for dimension with many scales ");
-
- /* open the previously written "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- for(i=0; i<100; i++)
- {
- /* make a DS */
- sprintf(dname,"ds_%d",i);
- if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
- goto out;
- /* open */
- if((dsid = H5Dopen2(fid,dname, H5P_DEFAULT)) < 0)
- goto out;
- /* attach */
- if(H5DSattach_scale(did,dsid,0) < 0)
- goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- goto out;
- }
-
- /* iterate trough the 1st dimension of "dset_a" */
- if(H5DSiterate_scales(did,0,NULL,op_bogus,NULL) < 0)
- goto out;
-
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
+ PASSED();
-/*-------------------------------------------------------------------------
- * iterate on group
- *-------------------------------------------------------------------------
- */
- TESTING2("iterate on group ");
-
- /* open */
- if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
- goto out;
-
- /* try to iterate, return error */
- if(H5DSiterate_scales(gid,0,NULL,verify_scale,NULL)==SUCCEED)
- goto out;
-
- /* close */
- if(H5Gclose(gid) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * iterate in deleted scales
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * iterate in deleted scales
+ *-------------------------------------------------------------------------
+ */
- TESTING2("iterate in deleted scales ");
+ TESTING2("iterate in deleted scales ");
- if(H5Ldelete(fid, "ds_0", H5P_DEFAULT) < 0)
- goto out;
+ if(H5Ldelete(fid, "ds_0", H5P_DEFAULT) < 0)
+ goto out;
- /* open the previously written "dset_a" */
- if((did = H5Dopen2(fid, "dset_a", H5P_DEFAULT)) < 0)
- goto out;
+ /* open the previously written "dset_a" */
+ if((did = H5Dopen2(fid, "dset_a", H5P_DEFAULT)) < 0)
+ goto out;
- /* iterate */
- if(H5DSiterate_scales(did, 0, NULL, op_bogus, NULL) == SUCCEED)
- goto out;
+ /* iterate */
+ if(H5DSiterate_scales(did, 0, NULL, op_bogus, NULL) == SUCCEED)
+ goto out;
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
- PASSED();
+ PASSED();
- /* close */
- if(H5Fclose(fid) < 0)
- goto out;
+ /* close */
+ if(H5Fclose(fid) < 0)
+ goto out;
- return 0;
+ return 0;
- /* error zone, gracefully close */
+ /* error zone, gracefully close */
out:
- H5E_BEGIN_TRY {
- H5Gclose(gid);
- H5Fclose(fid);
- } H5E_END_TRY;
- H5_FAILED();
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Gclose(gid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ H5_FAILED();
+ return FAIL;
}
@@ -2270,204 +2266,204 @@ out:
static int test_rank(void)
{
- hid_t fid; /* file ID */
- hid_t did = -1; /* dataset ID */
- hid_t dsid = -1; /* scale ID */
- hid_t sid; /* space ID */
- hid_t sidds; /* space ID */
- hsize_t dims1[1] = {DIM1_SIZE}; /* size of data dataset */
- hsize_t dims2[2] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
- hsize_t dims3[3] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE}; /* size of data dataset */
- hsize_t dimss[2] = {1,1}; /* size of data dataset */
- char name[30]; /* dataset name buffer */
- char names[30]; /* dataset scale name buffer */
- char namel[30]; /* dataset label name buffer */
- int bufi[1]={2};
- float buff[1]={1};
- int i;
-
- printf("Testing ranks\n");
-
-/*-------------------------------------------------------------------------
- * create a file, a dataset, scales
- *-------------------------------------------------------------------------
- */
-
- /* create a file using default properties */
- if((fid=H5Fcreate(FILE4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
- goto out;
-
- /* make a dataset a 3D data dataset */
- if(H5LTmake_dataset_int(fid,"dset_a",3,dims3,NULL) < 0)
- goto out;
-
- /* make a 1D scale dataset */
- if(H5LTmake_dataset_int(fid,"ds_a_0",1,dims1,NULL) < 0)
- goto out;
-
- /* make a 2D scale dataset */
- if(H5LTmake_dataset_int(fid,"ds_a_1",2,dims2,NULL) < 0)
- goto out;
-
- /* make a 3D scale dataset */
- if(H5LTmake_dataset_int(fid,"ds_a_2",3,dims3,NULL) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach
- *-------------------------------------------------------------------------
- */
-
- TESTING2("attach");
-
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- for(i=0; i<3; i++)
- {
- sprintf(name,"ds_a_%d",i);
- if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,(unsigned)i)<=0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- }
-
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-
-/*-------------------------------------------------------------------------
- * detach
- *-------------------------------------------------------------------------
- */
-
- TESTING2("detach");
-
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- for(i=0; i<3; i++)
- {
- sprintf(name,"ds_a_%d",i);
- if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,(unsigned)i)!=0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- }
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * attach, set, get names, labels
- *-------------------------------------------------------------------------
- */
-
- TESTING2("attach, set, get names, labels");
-
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- for(i=0; i<3; i++)
- {
- sprintf(name,"ds_a_%d",i);
- if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
- goto out;
- if(H5DSset_scale(dsid,name) < 0)
- goto out;
- if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
- goto out;
- if(H5DSis_attached(did,dsid,(unsigned)i)<=0)
- goto out;
- if(H5DSget_scale_name(dsid,names,sizeof(names)) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
- if(H5DSset_label(did,(unsigned)i,name) < 0)
- goto out;
- if(H5DSget_label(did,(unsigned)i,namel,sizeof(namel)) < 0)
- goto out;
- if(strcmp(name,names)!=0)
- goto out;
- if(strcmp(name,namel)!=0)
- goto out;
- }
-
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * attach a scalar scale
- *-------------------------------------------------------------------------
- */
-
- TESTING2("attach a scalar scale");
-
- /* create the data space for the dataset */
- if((sid = H5Screate_simple(2, dimss, NULL)) < 0)
- goto out;
- /* create a dataset of rank 2 */
- if((did = H5Dcreate2(fid, "dset_b", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- /* create a scalar space */
- if((sidds = H5Screate(H5S_SCALAR)) < 0)
- goto out;
- /* create a dataset of scalar rank for the scale */
- if((dsid = H5Dcreate2(fid, "ds_b_1", H5T_NATIVE_FLOAT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto out;
- /* write */
- if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, bufi) < 0)
- goto out;
- if(H5Dwrite(dsid, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buff) < 0)
- goto out;
- /* attach */
- if(H5DSattach_scale(did, dsid, 0) < 0)
- goto out;
- if(H5DSattach_scale(did, dsid, 1) < 0)
- goto out;
- /* close */
- if(H5Sclose(sid) < 0)
- goto out;
- if(H5Sclose(sidds) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
- if(H5Dclose(dsid) < 0)
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
- if(H5Fclose(fid) < 0)
- goto out;
-
- return 0;
-
- /* error zone, gracefully close */
+ hid_t fid; /* file ID */
+ hid_t did = -1; /* dataset ID */
+ hid_t dsid = -1; /* scale ID */
+ hid_t sid; /* space ID */
+ hid_t sidds; /* space ID */
+ hsize_t dims1[1] = {DIM1_SIZE}; /* size of data dataset */
+ hsize_t dims2[2] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
+ hsize_t dims3[3] = {DIM1_SIZE,DIM2_SIZE,DIM3_SIZE}; /* size of data dataset */
+ hsize_t dimss[2] = {1,1}; /* size of data dataset */
+ char name[30]; /* dataset name buffer */
+ char names[30]; /* dataset scale name buffer */
+ char namel[30]; /* dataset label name buffer */
+ int bufi[1]={2};
+ float buff[1]={1};
+ int i;
+
+ printf("Testing ranks\n");
+
+ /*-------------------------------------------------------------------------
+ * create a file, a dataset, scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* create a file using default properties */
+ if((fid=H5Fcreate(FILE4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* make a dataset a 3D data dataset */
+ if(H5LTmake_dataset_int(fid,"dset_a",3,dims3,NULL) < 0)
+ goto out;
+
+ /* make a 1D scale dataset */
+ if(H5LTmake_dataset_int(fid,"ds_a_0",1,dims1,NULL) < 0)
+ goto out;
+
+ /* make a 2D scale dataset */
+ if(H5LTmake_dataset_int(fid,"ds_a_1",2,dims2,NULL) < 0)
+ goto out;
+
+ /* make a 3D scale dataset */
+ if(H5LTmake_dataset_int(fid,"ds_a_2",3,dims3,NULL) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("attach");
+
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ for(i=0; i<3; i++)
+ {
+ sprintf(name,"ds_a_%d",i);
+ if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,(unsigned)i)<=0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ }
+
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+
+ /*-------------------------------------------------------------------------
+ * detach
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("detach");
+
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ for(i=0; i<3; i++)
+ {
+ sprintf(name,"ds_a_%d",i);
+ if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,(unsigned)i)!=0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ }
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * attach, set, get names, labels
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("attach, set, get names, labels");
+
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ for(i=0; i<3; i++)
+ {
+ sprintf(name,"ds_a_%d",i);
+ if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5DSset_scale(dsid,name) < 0)
+ goto out;
+ if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
+ goto out;
+ if(H5DSis_attached(did,dsid,(unsigned)i)<=0)
+ goto out;
+ if(H5DSget_scale_name(dsid,names,sizeof(names)) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ if(H5DSset_label(did,(unsigned)i,name) < 0)
+ goto out;
+ if(H5DSget_label(did,(unsigned)i,namel,sizeof(namel)) < 0)
+ goto out;
+ if(strcmp(name,names)!=0)
+ goto out;
+ if(strcmp(name,namel)!=0)
+ goto out;
+ }
+
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * attach a scalar scale
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("attach a scalar scale");
+
+ /* create the data space for the dataset */
+ if((sid = H5Screate_simple(2, dimss, NULL)) < 0)
+ goto out;
+ /* create a dataset of rank 2 */
+ if((did = H5Dcreate2(fid, "dset_b", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ /* create a scalar space */
+ if((sidds = H5Screate(H5S_SCALAR)) < 0)
+ goto out;
+ /* create a dataset of scalar rank for the scale */
+ if((dsid = H5Dcreate2(fid, "ds_b_1", H5T_NATIVE_FLOAT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+ /* write */
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, bufi) < 0)
+ goto out;
+ if(H5Dwrite(dsid, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buff) < 0)
+ goto out;
+ /* attach */
+ if(H5DSattach_scale(did, dsid, 0) < 0)
+ goto out;
+ if(H5DSattach_scale(did, dsid, 1) < 0)
+ goto out;
+ /* close */
+ if(H5Sclose(sid) < 0)
+ goto out;
+ if(H5Sclose(sidds) < 0)
+ goto out;
+ if(H5Dclose(did) < 0)
+ goto out;
+ if(H5Dclose(dsid) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * close
+ *-------------------------------------------------------------------------
+ */
+ if(H5Fclose(fid) < 0)
+ goto out;
+
+ return 0;
+
+ /* error zone, gracefully close */
out:
- H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Dclose(dsid);
- H5Fclose(fid);
- } H5E_END_TRY;
- H5_FAILED();
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Dclose(dsid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ H5_FAILED();
+ return FAIL;
}
@@ -2478,173 +2474,173 @@ out:
static int test_types(void)
{
- hid_t fid; /* file ID */
- hid_t did = -1; /* dataset ID */
- hid_t dsid = -1; /* DS dataset ID */
- int rank = RANK; /* rank of data dataset */
- int rankds = 1; /* rank of DS dataset */
- hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
- int buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12}; /* data of data dataset */
- hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
- hsize_t s2_dim[1] = {DIM2_SIZE}; /* size of DS 2 dataset */
- float s1_float[DIM1_SIZE] = {10,20,30}; /* data of DS 1 dataset */
- unsigned short s2_ushort[DIM2_SIZE] = {10,20,30,40}; /* data of DS 2 dataset */
- const char *s1_str = "ABC";
- const char *s2_str = "ABCD";
-
- printf("Testing scales with several datatypes\n");
-
-/*-------------------------------------------------------------------------
- * create a file for the test
- *-------------------------------------------------------------------------
- */
- /* create a file using default properties */
- if((fid=H5Fcreate(FILE5,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * create datasets: 1 "data" dataset and 2 dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* make a dataset */
- if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf) < 0)
- goto out;
-
- /* make a DS dataset for the first dimension */
- if(H5LTmake_dataset_float(fid,DS_1_NAME,rankds,s1_dim,s1_float) < 0)
- goto out;
-
- /* make a DS dataset for the second dimension */
- if(H5LTmake_dataset(fid,DS_2_NAME,rankds,s2_dim,H5T_NATIVE_USHORT,s2_ushort) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * floating point and short scales
- *-------------------------------------------------------------------------
- */
-
- TESTING2("floating point and short scales");
-
- /* get the dataset id for "dset_a" */
- if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
- goto out;
- /* attach the DS_1_NAME dimension scale to "dset_a" at dimension 0 */
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
- /* set name */
- if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
- goto out;
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
- goto out;
- /* attach the DS_2_NAME dimension scale to "dset_a" at dimension 1 */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
- /* set name */
- if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
- goto out;
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
- /* set a label */
- if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
- goto out;
- if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
- goto out;
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * create datasets: 1 "data" dataset and 2 dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* make a dataset */
- if(H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf) < 0)
- goto out;
-
- /* make a DS dataset for the first dimension */
- if(H5LTmake_dataset_string(fid,"ds_b_1",s1_str) < 0)
- goto out;
-
- /* make a DS dataset for the second dimension */
- if(H5LTmake_dataset_string(fid,"ds_b_2",s2_str) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * floating point and short scales
- *-------------------------------------------------------------------------
- */
-
- TESTING2("string scales");
-
- /* get the dataset id for "dset_b" */
- if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
- goto out;
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT)) < 0)
- goto out;
- /* attach the DS_1_NAME dimension scale to "dset_b" at dimension 0 */
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
- /* set name */
- if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
- goto out;
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"ds_b_2", H5P_DEFAULT)) < 0)
- goto out;
- /* attach the DS_2_NAME dimension scale to "dset_b" at dimension 1 */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
- /* set name */
- if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
- goto out;
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
- /* set a label */
- if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
- goto out;
- if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
- goto out;
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-/*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
- if(H5Fclose(fid) < 0)
- goto out;
-
- return 0;
-
- /* error zone, gracefully close */
+ hid_t fid; /* file ID */
+ hid_t did = -1; /* dataset ID */
+ hid_t dsid = -1; /* DS dataset ID */
+ int rank = RANK; /* rank of data dataset */
+ int rankds = 1; /* rank of DS dataset */
+ hsize_t dims[RANK] = {DIM1_SIZE,DIM2_SIZE}; /* size of data dataset */
+ int buf[DIM_DATA] = {1,2,3,4,5,6,7,8,9,10,11,12}; /* data of data dataset */
+ hsize_t s1_dim[1] = {DIM1_SIZE}; /* size of DS 1 dataset */
+ hsize_t s2_dim[1] = {DIM2_SIZE}; /* size of DS 2 dataset */
+ float s1_float[DIM1_SIZE] = {10,20,30}; /* data of DS 1 dataset */
+ unsigned short s2_ushort[DIM2_SIZE] = {10,20,30,40}; /* data of DS 2 dataset */
+ const char *s1_str = "ABC";
+ const char *s2_str = "ABCD";
+
+ printf("Testing scales with several datatypes\n");
+
+ /*-------------------------------------------------------------------------
+ * create a file for the test
+ *-------------------------------------------------------------------------
+ */
+ /* create a file using default properties */
+ if((fid=H5Fcreate(FILE5,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * create datasets: 1 "data" dataset and 2 dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* make a dataset */
+ if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf) < 0)
+ goto out;
+
+ /* make a DS dataset for the first dimension */
+ if(H5LTmake_dataset_float(fid,DS_1_NAME,rankds,s1_dim,s1_float) < 0)
+ goto out;
+
+ /* make a DS dataset for the second dimension */
+ if(H5LTmake_dataset(fid,DS_2_NAME,rankds,s2_dim,H5T_NATIVE_USHORT,s2_ushort) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * floating point and short scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("floating point and short scales");
+
+ /* get the dataset id for "dset_a" */
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ /* attach the DS_1_NAME dimension scale to "dset_a" at dimension 0 */
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+ /* set name */
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
+ goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
+ goto out;
+ /* attach the DS_2_NAME dimension scale to "dset_a" at dimension 1 */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
+ /* set name */
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
+ goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ /* set a label */
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
+ goto out;
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
+ goto out;
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * create datasets: 1 "data" dataset and 2 dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* make a dataset */
+ if(H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf) < 0)
+ goto out;
+
+ /* make a DS dataset for the first dimension */
+ if(H5LTmake_dataset_string(fid,"ds_b_1",s1_str) < 0)
+ goto out;
+
+ /* make a DS dataset for the second dimension */
+ if(H5LTmake_dataset_string(fid,"ds_b_2",s2_str) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * floating point and short scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("string scales");
+
+ /* get the dataset id for "dset_b" */
+ if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
+ goto out;
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT)) < 0)
+ goto out;
+ /* attach the DS_1_NAME dimension scale to "dset_b" at dimension 0 */
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+ /* set name */
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
+ goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"ds_b_2", H5P_DEFAULT)) < 0)
+ goto out;
+ /* attach the DS_2_NAME dimension scale to "dset_b" at dimension 1 */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
+ /* set name */
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
+ goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ /* set a label */
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
+ goto out;
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
+ goto out;
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+ /*-------------------------------------------------------------------------
+ * close
+ *-------------------------------------------------------------------------
+ */
+ if(H5Fclose(fid) < 0)
+ goto out;
+
+ return 0;
+
+ /* error zone, gracefully close */
out:
- H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Dclose(dsid);
- H5Fclose(fid);
- } H5E_END_TRY;
- H5_FAILED();
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Dclose(dsid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ H5_FAILED();
+ return FAIL;
}
/*-------------------------------------------------------------------------
@@ -2654,149 +2650,162 @@ out:
static int test_data(void)
{
- hid_t fid; /* file ID */
- hid_t did = -1; /* dataset ID */
- hid_t dsid = -1; /* DS dataset ID */
- hid_t dcpl; /* dataset creation property list */
- hid_t sid; /* dataspace ID */
- float *vals=NULL; /* array to hold data values */
- float *latbuf=NULL; /* array to hold the latitude values */
- float *lonbuf=NULL; /* array to hold the longitude values */
- hsize_t dims[2]; /* array to hold dimensions */
- hsize_t latdims[1]; /* array to hold dimensions */
- hsize_t londims[1]; /* array to hold dimensions */
- float fill=-99; /* fill value */
-
-
- printf("Testing reading ASCII data and generate HDF5 data with scales\n");
-
-/*-------------------------------------------------------------------------
- * create a file for the test
- *-------------------------------------------------------------------------
- */
- /* create a file using default properties */
- if((fid=H5Fcreate(FILE6,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * read data
- *-------------------------------------------------------------------------
- */
-
- /* read ASCII bathymetry data */
- if(read_data("dsdata.txt",2,dims,&vals) < 0)
- goto out;
-
- /* read the latitude */
- if(read_data("dslat.txt",1,latdims,&latbuf) < 0)
- goto out;
-
- /* read the longitude */
- if(read_data("dslon.txt",1,londims,&lonbuf) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * generating scales
- *-------------------------------------------------------------------------
- */
-
- TESTING2("generating scales");
-
-/*-------------------------------------------------------------------------
- * create datasets: 1 "data" dataset and 2 dimension scales
- *-------------------------------------------------------------------------
- */
-
- /* make a DS dataset for the first dimension */
- if(H5LTmake_dataset_float(fid, "lat", 1, latdims, latbuf) < 0)
- goto out;
-
- /* make a DS dataset for the second dimension */
- if(H5LTmake_dataset_float(fid, "lon", 1, londims, lonbuf) < 0)
- goto out;
-
- /* make a dataset for the data. a fill value is set */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- goto out;
- if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fill) < 0)
- goto out;
- if((sid = H5Screate_simple(2, dims, NULL)) < 0)
- goto out;
- if((did = H5Dcreate2(fid, "data", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto out;
- if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, vals) < 0)
- goto out;
- if(H5Dclose(did) < 0)
- goto out;
- if(H5Pclose(dcpl) < 0)
- goto out;
- if(H5Sclose(sid) < 0)
- goto out;
-
-/*-------------------------------------------------------------------------
- * attach
- *-------------------------------------------------------------------------
- */
-
- /* get the dataset id for "data" */
- if((did = H5Dopen2(fid,"data", H5P_DEFAULT)) < 0)
- goto out;
-
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"lat", H5P_DEFAULT)) < 0)
- goto out;
- /* attach the DS_1_NAME dimension scale to "data" at dimension 0 */
- if(H5DSattach_scale(did,dsid,DIM0) < 0)
- goto out;
- /* set name */
- if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
- goto out;
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
- /* get the DS dataset id */
- if((dsid = H5Dopen2(fid,"lon", H5P_DEFAULT)) < 0)
- goto out;
- /* attach the DS_2_NAME dimension scale to "data" at dimension 1 */
- if(H5DSattach_scale(did,dsid,DIM1) < 0)
- goto out;
- /* set name */
- if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
- goto out;
- /* close DS id */
- if(H5Dclose(dsid) < 0)
- goto out;
- /* set a label */
- if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
- goto out;
- if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
- goto out;
- /* close */
- if(H5Dclose(did) < 0)
- goto out;
-
- PASSED();
-
-
-
-/*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
- if(H5Fclose(fid) < 0)
- goto out;
-
- return 0;
-
- /* error zone, gracefully close */
+ hid_t fid; /* file ID */
+ hid_t did = -1; /* dataset ID */
+ hid_t dsid = -1; /* DS dataset ID */
+ hid_t dcpl; /* dataset creation property list */
+ hid_t sid; /* dataspace ID */
+ float *vals=NULL; /* array to hold data values */
+ float *latbuf=NULL; /* array to hold the latitude values */
+ float *lonbuf=NULL; /* array to hold the longitude values */
+ hsize_t dims[2]; /* array to hold dimensions */
+ hsize_t latdims[1]; /* array to hold dimensions */
+ hsize_t londims[1]; /* array to hold dimensions */
+ float fill=-99; /* fill value */
+
+
+ printf("Testing reading ASCII data and generate HDF5 data with scales\n");
+
+ /*-------------------------------------------------------------------------
+ * create a file for the test
+ *-------------------------------------------------------------------------
+ */
+ /* create a file using default properties */
+ if((fid=H5Fcreate(FILE6,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * generating scales
+ *-------------------------------------------------------------------------
+ */
+
+ TESTING2("generating scales");
+
+ /*-------------------------------------------------------------------------
+ * create datasets: 1 "data" dataset and 2 dimension scales
+ *-------------------------------------------------------------------------
+ */
+
+ /* read the latitude */
+ if(read_data("dslat.txt",1,latdims,&latbuf) < 0)
+ goto out;
+
+ /* make a DS dataset for the first dimension */
+ if(H5LTmake_dataset_float(fid, "lat", 1, latdims, latbuf) < 0)
+ goto out;
+
+ free( latbuf );
+ latbuf = NULL;
+
+ /* read the longitude */
+ if(read_data("dslon.txt",1,londims,&lonbuf) < 0)
+ goto out;
+
+ /* make a DS dataset for the second dimension */
+ if(H5LTmake_dataset_float(fid, "lon", 1, londims, lonbuf) < 0)
+ goto out;
+
+ free( lonbuf );
+ lonbuf = NULL;
+
+ /* make a dataset for the data. a fill value is set */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto out;
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fill) < 0)
+ goto out;
+
+ /* read ASCII bathymetry data and dimensions to create dataset */
+ if(read_data("dsdata.txt",2,dims,&vals) < 0)
+ goto out;
+
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0)
+ goto out;
+ if((did = H5Dcreate2(fid, "data", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ goto out;
+ if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, vals) < 0)
+ goto out;
+
+ free ( vals );
+ vals = NULL;
+
+ if(H5Dclose(did) < 0)
+ goto out;
+ if(H5Pclose(dcpl) < 0)
+ goto out;
+ if(H5Sclose(sid) < 0)
+ goto out;
+
+ /*-------------------------------------------------------------------------
+ * attach
+ *-------------------------------------------------------------------------
+ */
+
+ /* get the dataset id for "data" */
+ if((did = H5Dopen2(fid,"data", H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"lat", H5P_DEFAULT)) < 0)
+ goto out;
+ /* attach the DS_1_NAME dimension scale to "data" at dimension 0 */
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
+ goto out;
+ /* set name */
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
+ goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ /* get the DS dataset id */
+ if((dsid = H5Dopen2(fid,"lon", H5P_DEFAULT)) < 0)
+ goto out;
+ /* attach the DS_2_NAME dimension scale to "data" at dimension 1 */
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
+ goto out;
+ /* set name */
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
+ goto out;
+ /* close DS id */
+ if(H5Dclose(dsid) < 0)
+ goto out;
+ /* set a label */
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
+ goto out;
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
+ goto out;
+ /* close */
+ if(H5Dclose(did) < 0)
+ goto out;
+
+ PASSED();
+
+
+
+ /*-------------------------------------------------------------------------
+ * close
+ *-------------------------------------------------------------------------
+ */
+ if(H5Fclose(fid) < 0)
+ goto out;
+
+ return 0;
+
+ /* error zone, gracefully close */
out:
- H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Dclose(dsid);
- H5Fclose(fid);
- } H5E_END_TRY;
- H5_FAILED();
- return FAIL;
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Dclose(dsid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ H5_FAILED();
+
+ if (latbuf)
+ free( latbuf );
+ if (lonbuf)
+ free( lonbuf );
+ if (vals)
+ free( vals );
+ return FAIL;
}
@@ -2814,52 +2823,61 @@ out:
*-------------------------------------------------------------------------
*/
-static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf )
+static int read_data( const char* fname,
+ int ndims,
+ hsize_t *dims,
+ float **buf )
{
- int i, n;
- unsigned j;
- char str[20];
- size_t nelms;
- FILE *f;
- float val;
- char *srcdir = getenv("srcdir"); /* the source directory */
- char data_file[512]; /* buffer to hold name of existing data file */
-
- strcpy(data_file, "");
- /* compose the name of the file to open, using the srcdir, if appropriate */
- if(srcdir)
- {
- strcpy(data_file, srcdir);
- strcat(data_file, "/");
- }
- /* read first data file */
- strcat(data_file,fname);
-
- f = fopen(data_file, "r");
- if( f == NULL )
- {
- printf( "Could not open file %s\n", data_file );
- return -1;
- }
-
- for(i=0, nelms=1; i < ndims; i++)
- {
- fscanf( f, "%s %u", str, &j);
- fscanf( f, "%d",&n );
- dims[i] = n;
- nelms *= n;
- }
-
- *buf = (float*) malloc (nelms * sizeof( float ));
-
- for(j = 0; j < nelms; j++)
- {
- fscanf( f, "%f",&val );
- (*buf)[j] = val;
- }
- fclose(f);
-
- return 1;
+ int i, n;
+ unsigned j;
+ char str[20];
+ size_t nelms;
+ FILE *f;
+ float val;
+ char *srcdir = getenv("srcdir"); /* the source directory */
+ char data_file[512]; /* buffer to hold name of existing data file */
+
+ strcpy(data_file, "");
+ /* compose the name of the file to open, using the srcdir, if appropriate */
+ if(srcdir)
+ {
+ strcpy(data_file, srcdir);
+ strcat(data_file, "/");
+ }
+ /* read first data file */
+ strcat(data_file,fname);
+
+ f = fopen(data_file, "r");
+ if( f == NULL )
+ {
+ printf( "Could not open file %s\n", data_file );
+ return -1;
+ }
+
+ for(i=0, nelms=1; i < ndims; i++)
+ {
+ fscanf( f, "%s %u", str, &j);
+ fscanf( f, "%d",&n );
+ dims[i] = n;
+ nelms *= n;
+ }
+
+ *buf = (float*) malloc (nelms * sizeof( float ));
+
+ if ( *buf == NULL )
+ {
+ printf( "memory allocation failed\n" );
+ return -1;
+ }
+
+ for(j = 0; j < nelms; j++)
+ {
+ fscanf( f, "%f",&val );
+ (*buf)[j] = val;
+ }
+ fclose(f);
+
+ return 1;
}
diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in
index 3801bc9..c336878 100644
--- a/hl/tools/Makefile.in
+++ b/hl/tools/Makefile.in
@@ -246,6 +246,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -257,9 +259,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in
index c330309..2feb079 100644
--- a/hl/tools/gif2h5/Makefile.in
+++ b/hl/tools/gif2h5/Makefile.in
@@ -268,6 +268,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -279,9 +281,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/perform/Makefile.in b/perform/Makefile.in
index 73ca09c..90b1be4 100644
--- a/perform/Makefile.in
+++ b/perform/Makefile.in
@@ -304,6 +304,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -315,9 +317,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/perform/mpi-perf.c b/perform/mpi-perf.c
index 1e0150e..c0fe794 100644
--- a/perform/mpi-perf.c
+++ b/perform/mpi-perf.c
@@ -77,282 +77,271 @@ char opt_pvfstab[256] = "notset\0";
int opt_pvfstab_set = 0;
/* function prototypes */
-int parse_args(int argc, char **argv);
-double Wtime(void);
+static int parse_args(int argc, char **argv);
extern int errno;
-extern int debug_on;
/* globals needed for getopt */
extern char *optarg;
-extern int optind, opterr;
int main(int argc, char **argv)
{
- char *buf, *tmp, *buf2, *tmp2, *check;
- int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
- double stim, etim;
- double write_tim = 0;
- double read_tim = 0;
- double read_bw, write_bw;
- double max_read_tim, max_write_tim;
- double min_read_tim, min_write_tim;
- double ave_read_tim, ave_write_tim;
- int64_t iter_jump = 0;
- int64_t seek_position = 0;
- MPI_File fh;
- MPI_Status status;
- int nchars;
-
- /* startup MPI and determine the rank of this process */
- MPI_Init(&argc,&argv);
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
-
- /* parse the command line arguments */
- parse_args(argc, argv);
-
- if (mynod == 0) printf("# Using mpi-io calls.\n");
-
-
- /* kindof a weird hack- if the location of the pvfstab file was
- * specified on the command line, then spit out this location into
- * the appropriate environment variable: */
+ char *buf, *tmp, *buf2, *tmp2, *check;
+ int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
+ double stim, etim;
+ double write_tim = 0;
+ double read_tim = 0;
+ double read_bw, write_bw;
+ double max_read_tim, max_write_tim;
+ double min_read_tim, min_write_tim;
+ double ave_read_tim, ave_write_tim;
+ int64_t iter_jump = 0;
+ int64_t seek_position = 0;
+ MPI_File fh;
+ MPI_Status status;
+ int nchars;
+
+ /* startup MPI and determine the rank of this process */
+ MPI_Init(&argc,&argv);
+ MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
+
+ /* parse the command line arguments */
+ parse_args(argc, argv);
+
+ if (mynod == 0) printf("# Using mpi-io calls.\n");
+
+
+ /* kindof a weird hack- if the location of the pvfstab file was
+ * specified on the command line, then spit out this location into
+ * the appropriate environment variable: */
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- if (opt_pvfstab_set) {
- if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
- perror("setenv");
- goto die_jar_jar_die;
- }
- }
+ if (opt_pvfstab_set) {
+ if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
+ perror("setenv");
+ goto die_jar_jar_die;
+ }
+ }
#endif
- /* this is how much of the file data is covered on each iteration of
- * the test. used to help determine the seek offset on each
- * iteration */
- iter_jump = nprocs * opt_block;
-
- /* setup a buffer of data to write */
- if (!(tmp = (char *) malloc(opt_block + 256))) {
- perror("malloc");
- goto die_jar_jar_die;
- }
- buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
-
- if (opt_correct) {
- /* do the same buffer setup for verifiable data */
- if (!(tmp2 = (char *) malloc(opt_block + 256))) {
- perror("malloc2");
- goto die_jar_jar_die;
- }
- buf2 = tmp + 128 - (((long)tmp) % 128);
- }
-
- /* open the file for writing */
- err = MPI_File_open(MPI_COMM_WORLD, opt_file,
- MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
- if (err < 0) {
- fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
- goto die_jar_jar_die;
- }
-
- /* now repeat the write operations the number of times
- * specified on the command line */
- for (j=0; j < opt_iter; j++) {
-
- /* calculate the appropriate position depending on the iteration
- * and rank of the current process */
- seek_position = (j*iter_jump)+(mynod*opt_block);
-
- if (opt_correct) /* fill in buffer for iteration */ {
- for (i=mynod+j, check=buf; i<opt_block; i++,check++) *check=(char)i;
- }
-
- /* discover the starting time of the operation */
- MPI_Barrier(MPI_COMM_WORLD);
- stim = MPI_Wtime();
-
- /* write out the data */
- nchars = opt_block/sizeof(char);
- err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
- if(err){
- fprintf(stderr, "node %d, write error: %s\n", mynod,
- strerror(errno));
- }
-
- /* discover the ending time of the operation */
- etim = MPI_Wtime();
-
- write_tim += (etim - stim);
-
- /* we are done with this "write" iteration */
- }
-
- err = MPI_File_close(&fh);
- if(err){
- fprintf(stderr, "node %d, close error after write\n", mynod);
- }
-
- /* wait for everyone to synchronize at this point */
- MPI_Barrier(MPI_COMM_WORLD);
-
- /* reopen the file to read the data back out */
- err = MPI_File_open(MPI_COMM_WORLD, opt_file,
- MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
- if (err < 0) {
- fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
- goto die_jar_jar_die;
- }
-
-
- /* we are going to repeat the read operation the number of iterations
- * specified */
- for (j=0; j < opt_iter; j++) {
- /* calculate the appropriate spot give the current iteration and
- * rank within the MPI processes */
- seek_position = (j*iter_jump)+(mynod*opt_block);
-
- /* discover the start time */
- MPI_Barrier(MPI_COMM_WORLD);
- stim = MPI_Wtime();
-
- /* read in the file data */
- if (!opt_correct){
- err = MPI_File_read_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
- }
- else{
- err = MPI_File_read_at(fh, seek_position, buf2, nchars, MPI_CHAR, &status);
- }
- myerrno = errno;
-
- /* discover the end time */
- etim = MPI_Wtime();
- read_tim += (etim - stim);
-
- if (err < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
- mynod, mynod*opt_block, strerror(myerrno));
-
- /* if the user wanted to check correctness, compare the write
- * buffer to the read buffer */
- if (opt_correct && memcmp(buf, buf2, opt_block)) {
- fprintf(stderr, "node %d, correctness test failed\n", mynod);
- my_correct = 0;
- MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
- MPI_COMM_WORLD);
- }
-
- /* we are done with this read iteration */
- }
-
- /* close the file */
- err = MPI_File_close(&fh);
- if(err){
- fprintf(stderr, "node %d, close error after write\n", mynod);
- }
-
- /* compute the read and write times */
- MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
-
- /* calculate the average from the sum */
- ave_read_tim = ave_read_tim / nprocs;
-
- MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
-
- /* calculate the average from the sum */
- ave_write_tim = ave_write_tim / nprocs;
-
- /* print out the results on one node */
- if (mynod == 0) {
- read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
- write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
-
- printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
- opt_iter, (long)opt_block);
-
- printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
-
- printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
- min_write_tim, max_write_tim, ave_write_tim);
- printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
- min_read_tim, max_read_tim, ave_read_tim);
-
- printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
- printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
-
- if (opt_correct) {
- printf("Correctness test %s.\n", correct ? "passed" : "failed");
- }
- }
+ /* this is how much of the file data is covered on each iteration of
+ * the test. used to help determine the seek offset on each
+ * iteration */
+ iter_jump = nprocs * opt_block;
+
+ /* setup a buffer of data to write */
+ if (!(tmp = (char *) malloc(opt_block + 256))) {
+ perror("malloc");
+ goto die_jar_jar_die;
+ }
+ buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
+
+ if (opt_correct) {
+ /* do the same buffer setup for verifiable data */
+ if (!(tmp2 = (char *) malloc(opt_block + 256))) {
+ perror("malloc2");
+ goto die_jar_jar_die;
+ }
+ buf2 = tmp + 128 - (((long)tmp) % 128);
+ }
+
+ /* open the file for writing */
+ err = MPI_File_open(MPI_COMM_WORLD, opt_file,
+ MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
+ if (err < 0) {
+ fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
+ goto die_jar_jar_die;
+ }
+
+ /* now repeat the write operations the number of times
+ * specified on the command line */
+ for (j=0; j < opt_iter; j++) {
+
+ /* calculate the appropriate position depending on the iteration
+ * and rank of the current process */
+ seek_position = (j*iter_jump)+(mynod*opt_block);
+
+ if (opt_correct) /* fill in buffer for iteration */ {
+ for (i=mynod+j, check=buf; i<opt_block; i++,check++) *check=(char)i;
+ }
+
+ /* discover the starting time of the operation */
+ MPI_Barrier(MPI_COMM_WORLD);
+ stim = MPI_Wtime();
+
+ /* write out the data */
+ nchars = opt_block/sizeof(char);
+ err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
+ if(err){
+ fprintf(stderr, "node %d, write error: %s\n", mynod,
+ strerror(errno));
+ }
+
+ /* discover the ending time of the operation */
+ etim = MPI_Wtime();
+
+ write_tim += (etim - stim);
+
+ /* we are done with this "write" iteration */
+ }
+
+ err = MPI_File_close(&fh);
+ if(err){
+ fprintf(stderr, "node %d, close error after write\n", mynod);
+ }
+
+ /* wait for everyone to synchronize at this point */
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* reopen the file to read the data back out */
+ err = MPI_File_open(MPI_COMM_WORLD, opt_file,
+ MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
+ if (err < 0) {
+ fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno));
+ goto die_jar_jar_die;
+ }
+
+
+ /* we are going to repeat the read operation the number of iterations
+ * specified */
+ for (j=0; j < opt_iter; j++) {
+ /* calculate the appropriate spot give the current iteration and
+ * rank within the MPI processes */
+ seek_position = (j*iter_jump)+(mynod*opt_block);
+
+ /* discover the start time */
+ MPI_Barrier(MPI_COMM_WORLD);
+ stim = MPI_Wtime();
+
+ /* read in the file data */
+ if (!opt_correct){
+ err = MPI_File_read_at(fh, seek_position, buf, nchars, MPI_CHAR, &status);
+ }
+ else{
+ err = MPI_File_read_at(fh, seek_position, buf2, nchars, MPI_CHAR, &status);
+ }
+ myerrno = errno;
+
+ /* discover the end time */
+ etim = MPI_Wtime();
+ read_tim += (etim - stim);
+
+ if (err < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
+ mynod, mynod*opt_block, strerror(myerrno));
+
+ /* if the user wanted to check correctness, compare the write
+ * buffer to the read buffer */
+ if (opt_correct && memcmp(buf, buf2, opt_block)) {
+ fprintf(stderr, "node %d, correctness test failed\n", mynod);
+ my_correct = 0;
+ MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
+ MPI_COMM_WORLD);
+ }
+
+ /* we are done with this read iteration */
+ }
+
+ /* close the file */
+ err = MPI_File_close(&fh);
+ if(err){
+ fprintf(stderr, "node %d, close error after write\n", mynod);
+ }
+
+ /* compute the read and write times */
+ MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
+
+ /* calculate the average from the sum */
+ ave_read_tim = ave_read_tim / nprocs;
+
+ MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
+
+ /* calculate the average from the sum */
+ ave_write_tim = ave_write_tim / nprocs;
+
+ /* print out the results on one node */
+ if (mynod == 0) {
+ read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
+ write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
+
+ printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
+ opt_iter, (long)opt_block);
+
+ printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
+
+ printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_write_tim, max_write_tim, ave_write_tim);
+ printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_read_tim, max_read_tim, ave_read_tim);
+
+ printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
+ printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
+
+ if (opt_correct) {
+ printf("Correctness test %s.\n", correct ? "passed" : "failed");
+ }
+ }
die_jar_jar_die:
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- /* clear the environment variable if it was set earlier */
- if (opt_pvfstab_set){
- unsetenv("PVFSTAB_FILE");
- }
+ /* clear the environment variable if it was set earlier */
+ if (opt_pvfstab_set){
+ unsetenv("PVFSTAB_FILE");
+ }
#endif
- free(tmp);
- if (opt_correct) free(tmp2);
- MPI_Finalize();
- return(0);
+ free(tmp);
+ if (opt_correct) free(tmp2);
+ MPI_Finalize();
+ return(0);
}
-int parse_args(int argc, char **argv)
+static int
+parse_args(int argc, char **argv)
{
- int c;
-
- while ((c = getopt(argc, argv, "s:b:i:f:p:c")) != EOF) {
- switch (c) {
- case 's': /* stripe */
- opt_stripe = atoi(optarg);
- break;
- case 'b': /* block size */
- opt_block = atoi(optarg);
- break;
- case 'i': /* iterations */
- opt_iter = atoi(optarg);
- break;
- case 'f': /* filename */
- strncpy(opt_file, optarg, 255);
- break;
- case 'p': /* pvfstab file */
- strncpy(opt_pvfstab, optarg, 255);
- opt_pvfstab_set = 1;
- break;
- case 'c': /* correctness */
- opt_correct = 1;
- break;
- case '?': /* unknown */
- default:
- break;
- }
- }
- return(0);
-}
-
-/* Wtime() - returns current time in sec., in a double */
-double Wtime()
-{
- struct timeval t;
-
- gettimeofday(&t, NULL);
- return((double)t.tv_sec + (double)t.tv_usec / 1000000);
+ int c;
+
+ while ((c = getopt(argc, argv, "s:b:i:f:p:c")) != EOF) {
+ switch (c) {
+ case 's': /* stripe */
+ opt_stripe = atoi(optarg);
+ break;
+ case 'b': /* block size */
+ opt_block = atoi(optarg);
+ break;
+ case 'i': /* iterations */
+ opt_iter = atoi(optarg);
+ break;
+ case 'f': /* filename */
+ strncpy(opt_file, optarg, 255);
+ break;
+ case 'p': /* pvfstab file */
+ strncpy(opt_pvfstab, optarg, 255);
+ opt_pvfstab_set = 1;
+ break;
+ case 'c': /* correctness */
+ opt_correct = 1;
+ break;
+ case '?': /* unknown */
+ default:
+ break;
+ }
+ }
+ return(0);
}
/*
@@ -364,11 +353,12 @@ double Wtime()
*/
#else /* H5_HAVE_PARALLEL */
-/* dummy program since H5_HAVE_PARALLE is not configured in */
+/* dummy program since H5_HAVE_PARALLEL is not configured in */
int
-main()
+main(int UNUSED argc, char UNUSED **argv)
{
-printf("No parallel performance because parallel is not configured in\n");
-return(0);
+ printf("No parallel performance because parallel is not configured in\n");
+ return(0);
}
#endif /* H5_HAVE_PARALLEL */
+
diff --git a/perform/perf.c b/perform/perf.c
index cebf50c..92b85bc 100644
--- a/perform/perf.c
+++ b/perform/perf.c
@@ -82,79 +82,76 @@ char opt_pvfstab[256] = "notset";
int opt_pvfstab_set = 0;
/* function prototypes */
-int parse_args(int argc, char **argv);
-double Wtime(void);
+static int parse_args(int argc, char **argv);
extern int errno;
-extern int debug_on;
/* globals needed for getopt */
extern char *optarg;
-extern int optind, opterr;
int main(int argc, char **argv)
{
- char *buf, *tmp, *buf2, *tmp2, *check;
- int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
- double stim, etim;
- double write_tim = 0;
- double read_tim = 0;
- double read_bw, write_bw;
- double max_read_tim, max_write_tim;
- double min_read_tim, min_write_tim;
- double ave_read_tim, ave_write_tim;
- int64_t iter_jump = 0;
- int64_t seek_position = 0;
- MPI_File fh;
- MPI_Status status;
- int nchars;
+ char *buf, *tmp, *buf2, *tmp2, *check;
+ int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno;
+ double stim, etim;
+ double write_tim = 0;
+ double read_tim = 0;
+ double read_bw, write_bw;
+ double max_read_tim, max_write_tim;
+ double min_read_tim, min_write_tim;
+ double ave_read_tim, ave_write_tim;
+ int64_t iter_jump = 0;
+ int64_t seek_position = 0;
+ MPI_File fh;
+ MPI_Status status;
+ int nchars;
herr_t ret; /* Generic return value */
- /* startup MPI and determine the rank of this process */
- MPI_Init(&argc,&argv);
- MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
- MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
+ /* startup MPI and determine the rank of this process */
+ MPI_Init(&argc,&argv);
+ MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mynod);
- /* parse the command line arguments */
- parse_args(argc, argv);
+ /* parse the command line arguments */
+ parse_args(argc, argv);
- if (mynod == 0) printf("# Using hdf5-io calls.\n");
+ if (mynod == 0) printf("# Using hdf5-io calls.\n");
- /* kindof a weird hack- if the location of the pvfstab file was
- * specified on the command line, then spit out this location into
- * the appropriate environment variable: */
+ /* kindof a weird hack- if the location of the pvfstab file was
+ * specified on the command line, then spit out this location into
+ * the appropriate environment variable: */
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- if (opt_pvfstab_set) {
- if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
- perror("setenv");
- goto die_jar_jar_die;
- }
- }
+ if (opt_pvfstab_set) {
+ if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){
+ perror("setenv");
+ goto die_jar_jar_die;
+ }
+ }
#endif
- /* this is how much of the file data is covered on each iteration of
- * the test. used to help determine the seek offset on each
- * iteration */
- iter_jump = nprocs * opt_block;
+ /* this is how much of the file data is covered on each iteration of
+ * the test. used to help determine the seek offset on each
+ * iteration */
+ iter_jump = nprocs * opt_block;
- /* setup a buffer of data to write */
- if (!(tmp = (char *) malloc(opt_block + 256))) {
- perror("malloc");
- goto die_jar_jar_die;
- }
- buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
-
- if (opt_correct) {
- /* do the same buffer setup for verifiable data */
- if (!(tmp2 = (char *) malloc(opt_block + 256))) {
- perror("malloc2");
- goto die_jar_jar_die;
- }
- buf2 = tmp + 128 - (((long)tmp) % 128);
- }
+ /* setup a buffer of data to write */
+ if (!(tmp = (char *) malloc(opt_block + 256))) {
+ perror("malloc");
+ goto die_jar_jar_die;
+ }
+ buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */
+
+ if (opt_correct) {
+ /* do the same buffer setup for verifiable data */
+ if (!(tmp2 = (char *) malloc(opt_block + 256))) {
+ perror("malloc2");
+ goto die_jar_jar_die;
+ }
+ buf2 = tmp + 128 - (((long)tmp) % 128);
+ }
/* setup file access template with parallel IO access. */
if (opt_split_vfd){
@@ -319,137 +316,131 @@ int main(int argc, char **argv)
ret=H5Pclose(acc_tpl);
VRFY((ret >= 0), "H5Pclose succeeded", H5FATAL);
- /* compute the read and write times */
- MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
+ /* compute the read and write times */
+ MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
- /* calculate the average from the sum */
- ave_read_tim = ave_read_tim / nprocs;
+ /* calculate the average from the sum */
+ ave_read_tim = ave_read_tim / nprocs;
- MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
- MPI_COMM_WORLD);
- MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
- MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN,
+ MPI_COMM_WORLD);
+ MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM,
+ MPI_COMM_WORLD);
- /* calculate the average from the sum */
- ave_write_tim = ave_write_tim / nprocs;
+ /* calculate the average from the sum */
+ ave_write_tim = ave_write_tim / nprocs;
- /* print out the results on one node */
- if (mynod == 0) {
- read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
- write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
+ /* print out the results on one node */
+ if (mynod == 0) {
+ read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
+ write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
- printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
- opt_iter, (long)opt_block);
+ printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
+ opt_iter, (long)opt_block);
- printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
+ printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter));
- printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
- min_write_tim, max_write_tim, ave_write_tim);
- printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
- min_read_tim, max_read_tim, ave_read_tim);
+ printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_write_tim, max_write_tim, ave_write_tim);
+ printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n",
+ min_read_tim, max_read_tim, ave_read_tim);
- printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
- printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
+ printf("Write bandwidth = %f Mbytes/sec\n", write_bw);
+ printf("Read bandwidth = %f Mbytes/sec\n", read_bw);
- if (opt_correct) {
- printf("Correctness test %s.\n", correct ? "passed" : "failed");
- }
- }
+ if (opt_correct) {
+ printf("Correctness test %s.\n", correct ? "passed" : "failed");
+ }
+ }
die_jar_jar_die:
#if H5_HAVE_SETENV
/* no setenv or unsetenv */
- /* clear the environment variable if it was set earlier */
- if (opt_pvfstab_set){
- unsetenv("PVFSTAB_FILE");
- }
+ /* clear the environment variable if it was set earlier */
+ if (opt_pvfstab_set){
+ unsetenv("PVFSTAB_FILE");
+ }
#endif
- free(tmp);
- if (opt_correct) free(tmp2);
- MPI_Finalize();
- return(0);
-}
+ free(tmp);
+ if (opt_correct) free(tmp2);
+ MPI_Finalize();
-int parse_args(int argc, char **argv)
-{
- int c;
-
- while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) {
- switch (c) {
- case 's': /* stripe */
- opt_stripe = atoi(optarg);
- break;
- case 'b': /* block size */
- opt_block = atoi(optarg);
- break;
- case 'i': /* iterations */
- opt_iter = atoi(optarg);
- break;
- case 'f': /* filename */
- strncpy(opt_file, optarg, 255);
- break;
- case 'p': /* pvfstab file */
- strncpy(opt_pvfstab, optarg, 255);
- opt_pvfstab_set = 1;
- break;
- case 'a': /* aligned allocation.
- * syntax: -a<alignment>/<threshold>
- * e.g., -a4096/512 allocate at 4096 bytes
- * boundary if request size >= 512.
- */
- {char *p;
- opt_alignment = atoi(optarg);
- if (p=(char*)strchr(optarg, '/'))
- opt_threshold = atoi(p+1);
- }
- HDfprintf(stdout,
- "alignment/threshold=%Hu/%Hu\n",
- opt_alignment, opt_threshold);
- break;
- case '2': /* use 2-files, i.e., split file driver */
- opt_split_vfd=1;
- /* get meta and raw file extension. */
- /* syntax is <raw_ext>,<meta_ext> */
- meta_ext = raw_ext = optarg;
- while (*raw_ext != '\0'){
- if (*raw_ext == ','){
- *raw_ext = '\0';
- raw_ext++;
- break;
- }
- raw_ext++;
- }
- printf("split-file-vfd used: %s,%s\n",
- meta_ext, raw_ext);
- break;
- case 'c': /* correctness */
- opt_correct = 1;
- break;
- case '?': /* unknown */
- default:
- break;
- }
- }
- return(0);
+ return(0);
}
-/* Wtime() - returns current time in sec., in a double */
-double Wtime()
+static int
+parse_args(int argc, char **argv)
{
- struct timeval t;
+ int c;
+
+ while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) {
+ switch (c) {
+ case 's': /* stripe */
+ opt_stripe = atoi(optarg);
+ break;
+ case 'b': /* block size */
+ opt_block = atoi(optarg);
+ break;
+ case 'i': /* iterations */
+ opt_iter = atoi(optarg);
+ break;
+ case 'f': /* filename */
+ strncpy(opt_file, optarg, 255);
+ break;
+ case 'p': /* pvfstab file */
+ strncpy(opt_pvfstab, optarg, 255);
+ opt_pvfstab_set = 1;
+ break;
+ case 'a': /* aligned allocation.
+ * syntax: -a<alignment>/<threshold>
+ * e.g., -a4096/512 allocate at 4096 bytes
+ * boundary if request size >= 512.
+ */
+ {char *p;
+ opt_alignment = atoi(optarg);
+ if (p=(char*)strchr(optarg, '/'))
+ opt_threshold = atoi(p+1);
+ }
+ HDfprintf(stdout,
+ "alignment/threshold=%Hu/%Hu\n",
+ opt_alignment, opt_threshold);
+ break;
+ case '2': /* use 2-files, i.e., split file driver */
+ opt_split_vfd=1;
+ /* get meta and raw file extension. */
+ /* syntax is <raw_ext>,<meta_ext> */
+ meta_ext = raw_ext = optarg;
+ while (*raw_ext != '\0'){
+ if (*raw_ext == ','){
+ *raw_ext = '\0';
+ raw_ext++;
+ break;
+ }
+ raw_ext++;
+ }
+ printf("split-file-vfd used: %s,%s\n",
+ meta_ext, raw_ext);
+ break;
+ case 'c': /* correctness */
+ opt_correct = 1;
+ break;
+ case '?': /* unknown */
+ default:
+ break;
+ }
+ }
- gettimeofday(&t, NULL);
- return((double)t.tv_sec + (double)t.tv_usec / 1000000);
+ return(0);
}
/*
@@ -461,11 +452,12 @@ double Wtime()
*/
#else /* H5_HAVE_PARALLEL */
-/* dummy program since H5_HAVE_PARALLE is not configured in */
+/* dummy program since H5_HAVE_PARALLEL is not configured in */
int
main(int UNUSED argc, char UNUSED **argv)
{
-printf("No parallel performance because parallel is not configured in\n");
-return(0);
+ printf("No parallel performance because parallel is not configured in\n");
+ return(0);
}
#endif /* H5_HAVE_PARALLEL */
+
diff --git a/perform/pio_perf.c b/perform/pio_perf.c
index a6057b3..d3e2531 100644
--- a/perform/pio_perf.c
+++ b/perform/pio_perf.c
@@ -427,7 +427,6 @@ run_test_loop(struct options *opts)
parameters parms;
int num_procs;
int doing_pio; /* if this process is doing PIO */
- off_t snbytes;
parms.num_files = opts->num_files;
parms.num_dsets = opts->num_dsets;
diff --git a/perform/sio_engine.c b/perform/sio_engine.c
index 0fdfac5..d4e7ad3 100644
--- a/perform/sio_engine.c
+++ b/perform/sio_engine.c
@@ -127,7 +127,6 @@ static int cont_dim; /* lowest dimension for contiguous POSIX
static size_t cont_size; /* size of contiguous POSIX access */
static hid_t fapl; /* file access list */
static unsigned char *buf_p; /* buffer pointer */
-static unsigned char *buf2_p; /* buffer pointer */
static const char *multi_letters = "msbrglo"; /* string for multi driver */
static char *buffer2=NULL; /* buffer for data verification */
@@ -151,10 +150,7 @@ static hid_t h5dxpl = -1; /* Dataset transfer property list */
do_sio(parameters param)
{
char *buffer = NULL; /*data buffer pointer */
- off_t nbytes; /* dataset raw size */
- off_t dset_size[MAX_DIMS]; /* dataset size in bytes */
size_t buf_size[MAX_DIMS]; /* general buffer size in bytes */
- size_t chk_size[MAX_DIMS]; /* chunk size in bytes */
file_descr fd; /* file handles */
iotype iot; /* API type */
char base_name[256]; /* test file base name */
@@ -183,17 +179,14 @@ do_sio(parameters param)
break;
default:
/* unknown request */
- fprintf(stderr, "Unknown IO type request (%d)\n", iot);
+ fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
GOTOERROR(FAIL);
}
- nbytes = param.num_bytes;
linear_buf_size = 1;
for (i=0; i<param.rank; i++){
- dset_size[i] = param.dset_size[i];
buf_size[i] = param.buf_size[i];
- chk_size[i] = param.chk_size[i];
order[i] = param.order[i];
linear_buf_size *= buf_size[i];
buf_offset[i] = 0;
@@ -777,7 +770,6 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
/* HDF5 variables */
herr_t hrc; /*HDF5 return code */
hsize_t h5dims[MAX_DIMS]; /*dataset dim sizes */
- hsize_t h5chunk[MAX_DIMS]; /*dataset dim sizes */
hsize_t h5block[MAX_DIMS]; /*dataspace selection */
hsize_t h5stride[MAX_DIMS]; /*selection stride */
hsize_t h5start[MAX_DIMS]; /*selection start */
@@ -816,7 +808,6 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
h5stride[i] = 1;
h5block[i] = 1;
h5count[i] = parms->buf_size[i];
- h5chunk[i] = parms->chk_size[i];
}
h5dset_space_id = H5Screate_simple(rank, h5dims, NULL);
@@ -955,7 +946,6 @@ static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, void *
buf_offset[j] = 0;
}
buf_p = (unsigned char*)buffer;
- buf2_p = (unsigned char*)buffer2;
posix_buffer_read(0, fd, parms, buffer);
break;
@@ -1028,13 +1018,6 @@ static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms
rc = ((ssize_t)cont_size ==
POSIXREAD(fd->posixfd, buf_p, cont_size));
VRFY((rc != 0), "POSIXREAD");
-#if 0
- for (j=0; j<cont_size; j++) {
- if (buf_p[j]!=buf2_p[j])
- printf("Inconsistent data in %d\n", j);
- }
- buf2_p += cont_size;
-#endif
/* Advance location in buffer */
buf_p += cont_size;
diff --git a/perform/sio_perf.c b/perform/sio_perf.c
index 271bf20..5b97667 100644
--- a/perform/sio_perf.c
+++ b/perform/sio_perf.c
@@ -340,7 +340,6 @@ static void report_parameters(struct options *opts);
int
main(int argc, char **argv)
{
- int ret;
int exit_value = EXIT_SUCCESS;
struct options *opts = NULL;
@@ -396,7 +395,6 @@ run_test_loop(struct options *opts)
{
parameters parms;
int i;
- int doing_sio; /* if this process is doing SIO */
size_t buf_bytes;
/* load options into parameter structure */
parms.num_files = opts->num_files;
@@ -449,7 +447,6 @@ run_test(iotype iot, parameters parms, struct options *opts)
{
results res;
register int i, ret_value = SUCCESS;
- int comm_size;
off_t raw_size;
minmax *write_sys_mm_table=NULL;
minmax *write_mm_table=NULL;
@@ -988,7 +985,6 @@ parse_command_line(int argc, char *argv[])
const char *end = opt_arg;
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1028,7 +1024,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1057,7 +1052,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1116,7 +1110,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1185,7 +1178,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
@@ -1214,7 +1206,6 @@ parse_command_line(int argc, char *argv[])
while (end && *end != '\0') {
char buf[10];
- int i;
memset(buf, '\0', sizeof(buf));
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index b756130..425b7d5 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -1,4 +1,4 @@
-HDF5 version 1.9.34 currently under development
+HDF5 version 1.9.36 currently under development
================================================================================
@@ -98,6 +98,8 @@ New Features
Tools:
------
+ - h5import: By selecting a compression type, a big endian byte order was being
+ selected (PVN - 2009/3/11)
- h5dump: added a printing of the compression ratio of uncompressed and compressed
sizes for cases where compression filters are present. (PVN - 2008/05/01)
- h5dump: added an option to allow a user defined formatting string for printf
@@ -123,6 +125,8 @@ New Features
The size of the hyperslabs are defined as the size of each dimension or a
predefined constant, whatever is smaller. This assures that the chunk
read fits in the chunk cache. (PVN - 2008/11/21)
+
+
@@ -130,6 +134,12 @@ New Features
------
- Table: In version 3.0 of Table, "NROWS" (used to store number of records) was
deprecated (PVN - 2008/11/24)
+
+ Fortran High-Level APIs:
+ ------
+ - Lite: The h5ltget_dataset_info_f function (gets information about a dataset)
+ was not correctly returning the dimension array (PVN - 2009/3/23)
+
Documentation
-------------
@@ -142,6 +152,15 @@ Bug Fixes since HDF5-1.8.0 release
Library
-------
+ - Fixed a rare problem that could occur with files using the old (pre 1.4)
+ array datatype. (NAF - 2009/03/23)
+ - Modified library to be able to open files with corrupt root group symbol
+ table messages, and correct these errors if they are found. Such
+ files can only be successfully opened with write access.
+ (NAF - 2009/03/23 - 1189)
+ - Removed the long_long #define and replaced all instances with
+ "long long". This caused problems with third party products. All
+ currently supported compliers support the type. (ADB - 2009/03/05)
- Fixed various bugs that could prevent the fill value from being written
in certain rare cases. (NAF - 2009/02/26)
- Fixed a bug that prevented more than one dataset chunk from being cached
@@ -227,6 +246,13 @@ Bug Fixes since HDF5-1.8.0 release
Configuration
-------------
+ - The --includedir=DIR configuration option now works as intended, and can
+ be used to specify the location to install C header files. The default
+ location remains unchanged, residing at ${prefix}/include.
+ MAM - 2009/03/10 - BZ #1381
+ - Configure no longer removes the '-g' flag from CFLAGS when in production
+ mode if it has been explicitly set in the CFLAGS environment variable
+ prior to configuration. MAM - 2009/03/09 - BZ #1401.
- Fixed error with 'make check install' failing due to h5dump
needing other tools built first. MAM - 2008/10/24.
- When using shared szip, it is no longer necessary to specify
diff --git a/src/H5AC.c b/src/H5AC.c
index 950615a..ccdd493 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -2288,10 +2288,10 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
{
herr_t result;
herr_t ret_value=SUCCEED; /* Return value */
- hbool_t size_changed = FALSE;
hbool_t dirtied;
size_t new_size = 0;
#ifdef H5_HAVE_PARALLEL
+ hbool_t size_changed = FALSE;
H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
#if H5AC__TRACE_FILE_ENABLED
@@ -2345,7 +2345,9 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
if ( ((H5AC_info_t *)thing)->size != new_size ) {
+#ifdef H5_HAVE_PARALLEL
size_changed = TRUE;
+#endif /* H5_HAVE_PARALLEL */
flags = flags | H5AC__SIZE_CHANGED_FLAG;
#if H5AC__TRACE_FILE_ENABLED
trace_flags = flags;
diff --git a/src/H5Aint.c b/src/H5Aint.c
index c7013a2..2ac17fa 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -716,7 +716,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo)
/* Retrieve # of records in "name" B-tree */
/* (should be same # of records in all indices) */
if(H5B2_get_nrec(f, dxpl_id, H5A_BT2_NAME, ainfo->name_bt2_addr, &ainfo->nattrs) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't retrieve # of records in index")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve # of records in index")
} /* end if */
else
/* Retrieve # of attributes from object header */
diff --git a/src/H5B.c b/src/H5B.c
index d5ac87a..254183f 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -2057,3 +2057,47 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_get_info() */
+#ifndef H5_STRICT_FORMAT_CHECKS
+
+/*-------------------------------------------------------------------------
+ * Function: H5B_valid
+ *
+ * Purpose: Attempt to load a b-tree node.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Neil Fortner
+ * March 17, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+htri_t
+H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr)
+{
+ H5B_t *bt; /* The btree */
+ htri_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5B_valid, FAIL)
+
+ /*
+ * Check arguments.
+ */
+ HDassert(f);
+ HDassert(type);
+
+ if(!H5F_addr_defined(addr))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "address is undefined")
+
+ /* Protect the node */
+ if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, type, NULL, H5AC_READ)))
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree node")
+
+ /* Release the node */
+ if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5B_valid() */
+#endif /* H5_STRICT_FORMAT_CHECKS */
+
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index 93c2d80..2ec2c22 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -168,5 +168,9 @@ H5_DLL H5B_shared_t *H5B_shared_new(const H5F_t *f, const H5B_class_t *type,
H5_DLL herr_t H5B_shared_free(void *_shared);
H5_DLL herr_t H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
int indent, int fwidth, const H5B_class_t *type, void *udata);
+#ifndef H5_STRICT_FORMAT_CHECKS
+H5_DLL htri_t H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type,
+ haddr_t addr);
+#endif /* H5_STRICT_FORMAT_CHECKS */
#endif /* _H5Bprivate_H */
diff --git a/src/H5C.c b/src/H5C.c
index 7d2d4ea..27b98d0 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -3147,6 +3147,10 @@ H5C_create(size_t max_cache_size,
cache_ptr->epoch_marker_ringbuf_last = 0;
cache_ptr->epoch_marker_ringbuf_size = 0;
+ /* Initialize all epoch marker entries' fields to zero/FALSE/NULL */
+ HDmemset(cache_ptr->epoch_markers, 0, sizeof(cache_ptr->epoch_markers));
+
+ /* Set non-zero/FALSE/NULL fields for epoch markers */
for ( i = 0; i < H5C__MAX_EPOCH_MARKERS; i++ )
{
(cache_ptr->epoch_marker_active)[i] = FALSE;
@@ -3155,27 +3159,7 @@ H5C_create(size_t max_cache_size,
H5C__H5C_CACHE_ENTRY_T_MAGIC;
#endif /* NDEBUG */
((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i;
- ((cache_ptr->epoch_markers)[i]).size = (size_t)0;
((cache_ptr->epoch_markers)[i]).type = &epoch_marker_class;
- ((cache_ptr->epoch_markers)[i]).is_dirty = FALSE;
- ((cache_ptr->epoch_markers)[i]).dirtied = FALSE;
- ((cache_ptr->epoch_markers)[i]).is_protected = FALSE;
- ((cache_ptr->epoch_markers)[i]).is_read_only = FALSE;
- ((cache_ptr->epoch_markers)[i]).ro_ref_count = 0;
- ((cache_ptr->epoch_markers)[i]).is_pinned = FALSE;
- ((cache_ptr->epoch_markers)[i]).in_slist = FALSE;
- ((cache_ptr->epoch_markers)[i]).ht_next = NULL;
- ((cache_ptr->epoch_markers)[i]).ht_prev = NULL;
- ((cache_ptr->epoch_markers)[i]).next = NULL;
- ((cache_ptr->epoch_markers)[i]).prev = NULL;
- ((cache_ptr->epoch_markers)[i]).aux_next = NULL;
- ((cache_ptr->epoch_markers)[i]).aux_prev = NULL;
-#if H5C_COLLECT_CACHE_ENTRY_STATS
- ((cache_ptr->epoch_markers)[i]).accesses = 0;
- ((cache_ptr->epoch_markers)[i]).clears = 0;
- ((cache_ptr->epoch_markers)[i]).flushes = 0;
- ((cache_ptr->epoch_markers)[i]).pins = 0;
-#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
}
if ( H5C_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) {
@@ -3824,222 +3808,244 @@ H5C_flush_cache(H5F_t * f,
( protected_entries == 0 ) &&
( flushed_entries_last_pass ) )
{
- flushed_entries_last_pass = FALSE;
- node_ptr = H5SL_first(cache_ptr->slist_ptr);
+ unsigned curr_flush_dep_height = 0;
+ unsigned flush_dep_passes = 0;
- if ( node_ptr != NULL ) {
+ flushed_entries_last_pass = FALSE;
- next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
+ /* Loop over all flush dependency heights of entries */
+ while((curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) &&
+ (cache_ptr->slist_len != 0) &&
+ (flush_dep_passes < H5C__MAX_PASSES_ON_FLUSH) )
+ {
+ hbool_t flushed_during_dep_loop = FALSE;
- if ( next_entry_ptr == NULL ) {
+ /* Start at beginning of skip list each time */
+ node_ptr = H5SL_first(cache_ptr->slist_ptr);
+ HDassert( node_ptr != NULL );
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "next_entry_ptr == NULL 1 ?!?!");
- }
-#ifndef NDEBUG
- HDassert( next_entry_ptr->magic ==
- H5C__H5C_CACHE_ENTRY_T_MAGIC );
-#endif /* NDEBUG */
- HDassert( next_entry_ptr->is_dirty );
+ /* Get cache entry for this node */
+ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
+ if ( NULL == next_entry_ptr )
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!")
+ HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
+ HDassert( next_entry_ptr->is_dirty );
HDassert( next_entry_ptr->in_slist );
- } else {
-
- next_entry_ptr = NULL;
-
- }
-
- HDassert( node_ptr != NULL );
-
#if H5C_DO_SANITY_CHECKS
- /* For sanity checking, try to verify that the skip list has
- * the expected size and number of entries at the end of each
- * internal while loop (see below).
- *
- * Doing this get a bit tricky, as depending on flags, we may
- * or may not flush all the entries in the slist.
- *
- * To make things more entertaining, with the advent of the
- * fractal heap, the entry flush callback can cause entries
- * to be dirtied, resized, and/or renamed.
- *
- * To deal with this, we first make note of the initial
- * skip list length and size:
- */
- initial_slist_len = cache_ptr->slist_len;
- initial_slist_size = cache_ptr->slist_size;
+ /* For sanity checking, try to verify that the skip list has
+ * the expected size and number of entries at the end of each
+ * internal while loop (see below).
+ *
+ * Doing this get a bit tricky, as depending on flags, we may
+ * or may not flush all the entries in the slist.
+ *
+ * To make things more entertaining, with the advent of the
+ * fractal heap, the entry flush callback can cause entries
+ * to be dirtied, resized, and/or renamed.
+ *
+ * To deal with this, we first make note of the initial
+ * skip list length and size:
+ */
+ initial_slist_len = cache_ptr->slist_len;
+ initial_slist_size = cache_ptr->slist_size;
- /* We then zero counters that we use to track the number
- * and total size of entries flushed:
- */
- flushed_entries_count = 0;
- flushed_entries_size = 0;
-
- /* As mentioned above, there is the possibility that
- * entries will be dirtied, resized, and/or flushed during
- * our pass through the skip list. To capture the number
- * of entries added, and the skip list size delta,
- * zero the slist_len_increase and slist_size_increase of
- * the cache's instance of H5C_t. These fields will be
- * updated elsewhere to account for slist insertions and/or
- * dirty entry size changes.
- */
- cache_ptr->slist_len_increase = 0;
- cache_ptr->slist_size_increase = 0;
+ /* We then zero counters that we use to track the number
+ * and total size of entries flushed:
+ */
+ flushed_entries_count = 0;
+ flushed_entries_size = 0;
+
+ /* As mentioned above, there is the possibility that
+ * entries will be dirtied, resized, and/or flushed during
+ * our pass through the skip list. To capture the number
+ * of entries added, and the skip list size delta,
+ * zero the slist_len_increase and slist_size_increase of
+ * the cache's instance of H5C_t. These fields will be
+ * updated elsewhere to account for slist insertions and/or
+ * dirty entry size changes.
+ */
+ cache_ptr->slist_len_increase = 0;
+ cache_ptr->slist_size_increase = 0;
- /* at the end of the loop, use these values to compute the
- * expected slist length and size and compare this with the
- * value recorded in the cache's instance of H5C_t.
- */
+ /* at the end of the loop, use these values to compute the
+ * expected slist length and size and compare this with the
+ * value recorded in the cache's instance of H5C_t.
+ */
#endif /* H5C_DO_SANITY_CHECKS */
- while ( node_ptr != NULL )
- {
- entry_ptr = next_entry_ptr;
-
- /* With the advent of the fractal heap, it is possible
- * that the flush callback will dirty and/or resize
- * other entries in the cache. In particular, while
- * Quincey has promised me that this will never happen,
- * it is possible that the flush callback for an
- * entry may protect an entry that is not in the cache,
- * perhaps causing the cache to flush and possibly
- * evict the entry associated with node_ptr to make
- * space for the new entry.
- *
- * Thus we do a bit of extra sanity checking on entry_ptr,
- * and break out of this scan of the skip list if we
- * detect minor problems. We have a bit of leaway on the
- * number of passes though the skip list, so this shouldn't
- * be an issue in the flush in and of itself, as it should
- * be all but impossible for this to happen more than once
- * in any flush.
- *
- * Observe that that breaking out of the scan early
- * shouldn't break the sanity checks just after the end
- * of this while loop.
- *
- * If an entry has merely been marked clean and removed from
- * the s-list, we simply break out of the scan.
- *
- * If the entry has been evicted, we flag an error and
- * exit.
- */
+ while ( node_ptr != NULL )
+ {
+ entry_ptr = next_entry_ptr;
+
+ /* With the advent of the fractal heap, it is possible
+ * that the flush callback will dirty and/or resize
+ * other entries in the cache. In particular, while
+ * Quincey has promised me that this will never happen,
+ * it is possible that the flush callback for an
+ * entry may protect an entry that is not in the cache,
+ * perhaps causing the cache to flush and possibly
+ * evict the entry associated with node_ptr to make
+ * space for the new entry.
+ *
+ * Thus we do a bit of extra sanity checking on entry_ptr,
+ * and break out of this scan of the skip list if we
+ * detect minor problems. We have a bit of leaway on the
+ * number of passes though the skip list, so this shouldn't
+ * be an issue in the flush in and of itself, as it should
+ * be all but impossible for this to happen more than once
+ * in any flush.
+ *
+ * Observe that that breaking out of the scan early
+ * shouldn't break the sanity checks just after the end
+ * of this while loop.
+ *
+ * If an entry has merely been marked clean and removed from
+ * the s-list, we simply break out of the scan.
+ *
+ * If the entry has been evicted, we flag an error and
+ * exit.
+ */
#ifndef NDEBUG
- if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
+ if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "entry_ptr->magic invalid ?!?!");
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "entry_ptr->magic invalid ?!?!");
- } else
+ } else
#endif /* NDEBUG */
- if ( ( ! entry_ptr->is_dirty ) ||
- ( ! entry_ptr->in_slist ) ) {
+ if ( ( ! entry_ptr->is_dirty ) ||
+ ( ! entry_ptr->in_slist ) ) {
- /* the s-list has been modified out from under us.
- * set node_ptr to NULL and break out of the loop.
- */
- node_ptr = NULL;
- break;
- }
+ /* the s-list has been modified out from under us.
+ * set node_ptr to NULL and break out of the inner loop.
+ */
+ node_ptr = NULL;
+ goto end_of_inner_loop;;
+ }
- /* increment node pointer now, before we delete its target
- * from the slist.
- */
- node_ptr = H5SL_next(node_ptr);
+ /* increment node pointer now, before we delete its target
+ * from the slist.
+ */
+ node_ptr = H5SL_next(node_ptr);
- if ( node_ptr != NULL ) {
- next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
+ if ( node_ptr != NULL ) {
+ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- if ( next_entry_ptr == NULL ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "next_entry_ptr == NULL 2 ?!?!");
+ if ( next_entry_ptr == NULL ) {
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "next_entry_ptr == NULL 2 ?!?!");
+ }
+ HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
+ HDassert( next_entry_ptr->is_dirty );
+ HDassert( next_entry_ptr->in_slist );
+ } else {
+ next_entry_ptr = NULL;
}
-#ifndef NDEBUG
- HDassert( next_entry_ptr->magic ==
- H5C__H5C_CACHE_ENTRY_T_MAGIC );
-#endif /* NDEBUG */
- HDassert( next_entry_ptr->is_dirty );
- HDassert( next_entry_ptr->in_slist );
- } else {
- next_entry_ptr = NULL;
- }
- HDassert( entry_ptr != NULL );
- HDassert( entry_ptr->in_slist );
+ HDassert( entry_ptr != NULL );
+ HDassert( entry_ptr->in_slist );
- if ( ( ! flush_marked_entries ) ||
- ( entry_ptr->flush_marker ) ) {
+ if ( ( ! flush_marked_entries ) ||
+ ( entry_ptr->flush_marker ) ) {
- if ( entry_ptr->is_protected ) {
+ if ( entry_ptr->is_protected ) {
- /* we probably have major problems -- but lets flush
- * everything we can before we decide whether to flag
- * an error.
- */
- tried_to_flush_protected_entry = TRUE;
- protected_entries++;
-
- } else if ( entry_ptr->is_pinned ) {
- /* Test to see if we are can flush the entry now.
- * If we can, go ahead and flush. Note that we
- * aren't trying to do a destroy here, so that
- * is not an issue.
- */
- if ( TRUE ) { /* When we get to multithreaded cache,
- * we will need either locking code,
- * and/or a test to see if the entry
- * is in flushable condition here.
- */
+ /* we probably have major problems -- but lets flush
+ * everything we can before we decide whether to flag
+ * an error.
+ */
+ tried_to_flush_protected_entry = TRUE;
+ protected_entries++;
+
+ } else if ( entry_ptr->is_pinned ) {
+ /* Test to see if we are can flush the entry now.
+ * If we can, go ahead and flush. Note that we
+ * aren't trying to do a destroy here, so that
+ * is not an issue.
+ */
+ if(entry_ptr->flush_dep_height == curr_flush_dep_height ) {
#if H5C_DO_SANITY_CHECKS
- flushed_entries_count++;
- flushed_entries_size += entry_ptr->size;
+ flushed_entries_count++;
+ flushed_entries_size += entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
- status = H5C_flush_single_entry(f,
- primary_dxpl_id,
- secondary_dxpl_id,
- cache_ptr,
- NULL,
- entry_ptr->addr,
- flags,
- &first_flush,
- FALSE);
- if ( status < 0 ) {
-
- /* This shouldn't happen -- if it does, we are
- * toast so just scream and die.
- */
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "dirty pinned entry flush failed.")
- }
- flushed_entries_last_pass = TRUE;
- }
- } else {
+ status = H5C_flush_single_entry(f,
+ primary_dxpl_id,
+ secondary_dxpl_id,
+ cache_ptr,
+ NULL,
+ entry_ptr->addr,
+ flags,
+ &first_flush,
+ FALSE);
+ if ( status < 0 ) {
+
+ /* This shouldn't happen -- if it does, we are
+ * toast so just scream and die.
+ */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
+ "dirty pinned entry flush failed.")
+ }
+ flushed_during_dep_loop = TRUE;
+ } /* end if */
+ else if(entry_ptr->flush_dep_height < curr_flush_dep_height)
+ /* This shouldn't happen -- if it does, just scream and die. */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.")
+ } else {
+ /* Test to see if we are can flush the entry now.
+ * If we can, go ahead and flush. Note that we
+ * aren't trying to do a destroy here, so that
+ * is not an issue.
+ */
+ if(entry_ptr->flush_dep_height == curr_flush_dep_height ){
#if H5C_DO_SANITY_CHECKS
- flushed_entries_count++;
- flushed_entries_size += entry_ptr->size;
+ flushed_entries_count++;
+ flushed_entries_size += entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
- status = H5C_flush_single_entry(f,
- primary_dxpl_id,
- secondary_dxpl_id,
- cache_ptr,
- NULL,
- entry_ptr->addr,
- flags,
- &first_flush,
- FALSE);
- if ( status < 0 ) {
+ status = H5C_flush_single_entry(f,
+ primary_dxpl_id,
+ secondary_dxpl_id,
+ cache_ptr,
+ NULL,
+ entry_ptr->addr,
+ flags,
+ &first_flush,
+ FALSE);
+ if ( status < 0 ) {
+
+ /* This shouldn't happen -- if it does, we are
+ * toast so just scream and die.
+ */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
+ "Can't flush entry.")
+ }
+ flushed_during_dep_loop = TRUE;
+ } /* end if */
+ else if(entry_ptr->flush_dep_height < curr_flush_dep_height)
+ /* This shouldn't happen -- if it does, just scream and die. */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.")
+ } /* end else */
+ } /* end if */
+ } /* while ( node_ptr != NULL ) */
+
+ /* Check for incrementing flush dependency height */
+ if(flushed_during_dep_loop) {
+ /* If we flushed an entry at this flush dependency height
+ * start over at the bottom level of the flush dependencies
+ */
+ curr_flush_dep_height = 0;
- /* This shouldn't happen -- if it does, we are
- * toast so just scream and die.
- */
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "Can't flush entry.")
- }
- flushed_entries_last_pass = TRUE;
- }
- }
- } /* while ( node_ptr != NULL ) */
+ /* Make certain we don't get stuck in an infinite loop */
+ flush_dep_passes++;
+
+ /* Set flag for outer loop */
+ flushed_entries_last_pass = TRUE;
+ } /* end if */
+ else
+ curr_flush_dep_height++;
+
+ } /* while ( curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) */
+end_of_inner_loop:
#if H5C_DO_SANITY_CHECKS
/* Verify that the slist size and length are as expected. */
@@ -4802,9 +4808,7 @@ H5C_insert_entry(H5F_t * f,
void * thing,
unsigned int flags)
{
- /* const char * fcn_name = "H5C_insert_entry()"; */
herr_t result;
- herr_t ret_value = SUCCEED; /* Return value */
hbool_t first_flush = TRUE;
hbool_t insert_pinned;
hbool_t set_flush_marker;
@@ -4812,6 +4816,8 @@ H5C_insert_entry(H5F_t * f,
size_t empty_space;
H5C_cache_entry_t * entry_ptr;
H5C_cache_entry_t * test_entry_ptr;
+ unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5C_insert_entry, FAIL)
@@ -4900,6 +4906,12 @@ H5C_insert_entry(H5F_t * f,
entry_ptr->destroy_in_progress = FALSE;
entry_ptr->free_file_space_on_destroy = FALSE;
+ /* Initialize flush dependency height fields */
+ entry_ptr->flush_dep_parent = NULL;
+ for(u = 0; u < H5C__NUM_FLUSH_DEP_HEIGHTS; u++)
+ entry_ptr->child_flush_dep_height_rc[u] = 0;
+ entry_ptr->flush_dep_height = 0;
+
entry_ptr->ht_next = NULL;
entry_ptr->ht_prev = NULL;
@@ -7661,20 +7673,14 @@ H5C_stats__reset(H5C_t UNUSED * cache_ptr)
/*-------------------------------------------------------------------------
* Function: H5C_unpin_entry()
*
- * Purpose: Unpin a cache entry. The entry must be unprotected at
- * the time of call, and must be pinned.
+ * Purpose: Unpin a cache entry. The entry can be either protected or
+ * unprotected at the time of call, but must be pinned.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: John Mainzer
* 3/22/06
*
- * Modifications:
- *
- * JRM -- 4/26/06
- * Modified routine to allow it to operate on protected
- * entries.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -8490,6 +8496,342 @@ done:
} /* H5C_validate_resize_config() */
+/*-------------------------------------------------------------------------
+ * Function: H5C_adjust_flush_dependency_rc()
+ *
+ * Purpose: "Atomicly" adjust flush dependency ref. counts for an entry,
+ * as a result of a flush dependency child's height changing.
+ *
+ * Note: Entry will remain in flush dependency relationship with its
+ * child entry (i.e. it's not going to get unpinned as a result
+ * of this change), but change could trickle upward, if this
+ * entry's height changes and it has a flush dependency parent.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * 3/05/09
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+H5C_adjust_flush_dependency_rc(H5C_cache_entry_t * cache_entry,
+ unsigned old_child_height, unsigned new_child_height)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5C_adjust_flush_dependency_rc)
+
+ /* Sanity checks */
+ HDassert(cache_entry);
+ HDassert(cache_entry->is_pinned);
+ HDassert(cache_entry->flush_dep_height > 0);
+ HDassert(cache_entry->flush_dep_height < H5C__NUM_FLUSH_DEP_HEIGHTS);
+ HDassert(cache_entry->child_flush_dep_height_rc[old_child_height] > 0);
+ HDassert(old_child_height < H5C__NUM_FLUSH_DEP_HEIGHTS);
+ HDassert(old_child_height != new_child_height);
+ HDassert(new_child_height < H5C__NUM_FLUSH_DEP_HEIGHTS);
+
+ /* Adjust ref. counts for entry's flush dependency children heights */
+ cache_entry->child_flush_dep_height_rc[new_child_height]++;
+ cache_entry->child_flush_dep_height_rc[old_child_height]--;
+
+ /* Check for flush dependency height of entry increasing */
+ if((new_child_height + 1) > cache_entry->flush_dep_height) {
+
+ /* Check if entry has _its_ own parent flush dependency entry */
+ if(NULL != cache_entry->flush_dep_parent) {
+ /* Adjust flush dependency ref. counts on entry's parent */
+ H5C_adjust_flush_dependency_rc(cache_entry->flush_dep_parent, cache_entry->flush_dep_height, new_child_height + 1);
+ } /* end if */
+
+ /* Set new flush dependency height of entry */
+ cache_entry->flush_dep_height = new_child_height + 1;
+ } /* end if */
+ else {
+ /* Check for child's flush dep. height decreasing and ref. count of
+ * old child height going to zero, it could mean the parent's
+ * flush dependency height dropped.
+ */
+ if((new_child_height < old_child_height)
+ && ((old_child_height + 1) == cache_entry->flush_dep_height)
+ && (0 == cache_entry->child_flush_dep_height_rc[old_child_height])) {
+ int i; /* Local index variable */
+
+ /* Re-scan child flush dependency height ref. counts to determine
+ * this entry's height.
+ */
+#ifndef NDEBUG
+ for(i = (H5C__NUM_FLUSH_DEP_HEIGHTS - 1); i > (int)new_child_height; i--)
+ HDassert(0 == cache_entry->child_flush_dep_height_rc[i]);
+#endif /* NDEBUG */
+ for(i = (int)new_child_height; i >= 0; i--)
+ /* Check for child flush dependencies of this height */
+ if(cache_entry->child_flush_dep_height_rc[i] > 0)
+ break;
+
+ /* Sanity checks */
+ HDassert((unsigned)(i + 1) < cache_entry->flush_dep_height);
+
+ /* Check if entry has _its_ own parent flush dependency entry */
+ if(NULL != cache_entry->flush_dep_parent) {
+ /* Adjust flush dependency ref. counts on entry's parent */
+ H5C_adjust_flush_dependency_rc(cache_entry->flush_dep_parent, cache_entry->flush_dep_height, (unsigned)(i + 1));
+ } /* end if */
+
+ /* Set new flush dependency height of entry */
+ cache_entry->flush_dep_height = (unsigned)(i + 1);
+ } /* end if */
+ } /* end else */
+
+
+ /* Post-conditions, for successful operation */
+ HDassert(cache_entry->is_pinned);
+ HDassert(cache_entry->flush_dep_height > 0);
+ HDassert(cache_entry->flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS);
+ HDassert(cache_entry->child_flush_dep_height_rc[new_child_height] > 0);
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* H5C_adjust_flush_dependency_rc() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5C_create_flush_dependency()
+ *
+ * Purpose: Initiates a parent<->child entry flush dependency. The parent
+ * entry must be protected at the time of call, and must have all
+ * dependencies removed before the cache can shut down.
+ *
+ * Note: Flush dependencies in the cache indicate that a child entry
+ * must be flushed to the file before its parent. (This is
+ * currently used to implement Single-Writer/Multiple-Reader (SWMR)
+ * I/O access for data structures in the file).
+ *
+ * Each child entry can have only one parent entry, but parent
+ * entries can have >1 child entries. The flush dependency
+ * height of a parent entry is one greater than the max. flush
+ * dependency height of its children.
+ *
+ * Creating a flush dependency between two entries will also pin
+ * the parent entry. (The parent entry must _not_ be pinned
+ * through some other mechanism)
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * 3/05/09
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef NDEBUG
+herr_t
+H5C_create_flush_dependency(H5C_t * cache_ptr, void * parent_thing,
+ void * child_thing)
+#else
+herr_t
+H5C_create_flush_dependency(H5C_t UNUSED * cache_ptr, void * parent_thing,
+ void * child_thing)
+#endif
+{
+ H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent thing's entry */
+ H5C_cache_entry_t * child_entry = (H5C_cache_entry_t *)child_thing; /* Ptr to child thing's entry */
+#ifndef NDEBUG
+ unsigned prev_flush_dep_height = parent_entry->flush_dep_height; /* Previous flush height for parent entry */
+#endif /* NDEBUG */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5C_create_flush_dependency, FAIL)
+
+ /* Sanity checks */
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ HDassert(parent_entry);
+ HDassert(parent_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(parent_entry->flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS);
+ HDassert(H5F_addr_defined(parent_entry->addr));
+ HDassert(child_entry);
+ HDassert(child_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(H5F_addr_defined(child_entry->addr));
+ HDassert(child_entry->flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS);
+
+ /* More sanity checks */
+ if(child_entry == parent_entry)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Child entry flush dependency parent can't be itself")
+ if(!parent_entry->is_protected)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Parent entry isn't protected")
+ if(NULL != child_entry->flush_dep_parent)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Child entry already has flush dependency parent")
+ {
+ H5C_cache_entry_t *tmp_entry = parent_entry; /* Temporary cache entry in flush dependency chain */
+ unsigned tmp_flush_height = 0; /* Different in heights of parent entry */
+
+ /* Find the top entry in the flush dependency list */
+ while(NULL != tmp_entry->flush_dep_parent) {
+ tmp_flush_height++;
+ tmp_entry = tmp_entry->flush_dep_parent;
+ } /* end while */
+
+ /* Check if we will make the dependency chain too long */
+ if((tmp_flush_height + child_entry->flush_dep_height + 1)
+ > H5C__NUM_FLUSH_DEP_HEIGHTS)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Combined flush dependency height too large")
+ }
+
+ /* Check for parent already pinned */
+ if(parent_entry->is_pinned) {
+ /* Verify that the parent entry was pinned through a flush dependency relationship */
+ if(0 == parent_entry->flush_dep_height)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Parent entry wasn't pinned through flush dependency")
+ } /* end if */
+ else {
+ /* Sanity check */
+ HDassert(parent_entry->flush_dep_height == 0);
+
+ /* Pin the parent entry */
+ parent_entry->is_pinned = TRUE;
+ H5C__UPDATE_STATS_FOR_PIN(cache_ptr, parent_entry)
+ } /* end else */
+
+ /* Increment ref. count for parent's flush dependency children heights */
+ parent_entry->child_flush_dep_height_rc[child_entry->flush_dep_height]++;
+
+ /* Check for increasing parent flush dependency height */
+ if((child_entry->flush_dep_height + 1) > parent_entry->flush_dep_height) {
+
+ /* Check if parent entry has _its_ own parent flush dependency entry */
+ if(NULL != parent_entry->flush_dep_parent) {
+ /* Adjust flush dependency ref. counts on parent entry's parent */
+ H5C_adjust_flush_dependency_rc(parent_entry->flush_dep_parent, parent_entry->flush_dep_height, (child_entry->flush_dep_height + 1));
+ } /* end if */
+
+ /* Increase flush dependency height of parent entry */
+ parent_entry->flush_dep_height = child_entry->flush_dep_height + 1;
+ } /* end if */
+
+ /* Set parent for child entry */
+ child_entry->flush_dep_parent = parent_entry;
+
+
+ /* Post-conditions, for successful operation */
+ HDassert(parent_entry->is_pinned);
+ HDassert(parent_entry->flush_dep_height > 0);
+ HDassert(parent_entry->flush_dep_height < H5C__NUM_FLUSH_DEP_HEIGHTS);
+ HDassert(prev_flush_dep_height <= parent_entry->flush_dep_height);
+ HDassert(parent_entry->child_flush_dep_height_rc[child_entry->flush_dep_height] > 0);
+ HDassert(NULL != child_entry->flush_dep_parent);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5C_create_flush_dependency() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5C_destroy_flush_dependency()
+ *
+ * Purpose: Terminates a parent<-> child entry flush dependency. The
+ * parent entry must be pinned and have a positive flush
+ * dependency height (which could go to zero as a result of
+ * this operation).
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * 3/05/09
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5C_destroy_flush_dependency(H5C_t * cache_ptr, void *parent_thing,
+ void * child_thing)
+{
+ H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent entry */
+ H5C_cache_entry_t * child_entry = (H5C_cache_entry_t *)child_thing; /* Ptr to child entry */
+#ifndef NDEBUG
+ unsigned prev_flush_dep_height = parent_entry->flush_dep_height; /* Previous flush height for parent entry */
+#endif /* NDEBUG */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5C_destroy_flush_dependency, FAIL)
+
+ /* Sanity checks */
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ HDassert(parent_entry);
+ HDassert(parent_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(H5F_addr_defined(parent_entry->addr));
+ HDassert(parent_entry->flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS);
+ HDassert(child_entry);
+ HDassert(child_entry->flush_dep_parent != child_entry);
+ HDassert(child_entry->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(H5F_addr_defined(child_entry->addr));
+
+ /* Usage checks */
+ if(!parent_entry->is_pinned)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "Parent entry isn't pinned")
+ if(0 == parent_entry->flush_dep_height)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "Parent entry isn't a flush dependency parent")
+ if(NULL == child_entry->flush_dep_parent)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "Child entry doesn't have a flush dependency parent")
+ if(0 == parent_entry->child_flush_dep_height_rc[child_entry->flush_dep_height])
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "Parent entry flush dependency ref. count has no child entries of this height")
+ if(child_entry->flush_dep_parent != parent_entry)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "Parent entry isn't flush dependency parent for child entry")
+
+ /* Decrement the ref. count for flush dependency height of children for parent entry */
+ parent_entry->child_flush_dep_height_rc[child_entry->flush_dep_height]--;
+
+ /* Check for flush dependency ref. count at this height going to zero and
+ * parent entry flush dependency height dropping
+ */
+ if(((child_entry->flush_dep_height + 1) == parent_entry->flush_dep_height) &&
+ 0 == parent_entry->child_flush_dep_height_rc[child_entry->flush_dep_height]) {
+ int i; /* Local index variable */
+
+ /* Reverse scan for new flush dependency height of parent */
+#ifndef NDEBUG
+ for(i = (H5C__NUM_FLUSH_DEP_HEIGHTS - 1); i > (int)child_entry->flush_dep_height; i--)
+ HDassert(0 == parent_entry->child_flush_dep_height_rc[i]);
+#endif /* NDEBUG */
+ for(i = (int)child_entry->flush_dep_height; i >= 0; i--)
+ /* Check for child flush dependencies of this height */
+ if(parent_entry->child_flush_dep_height_rc[i] > 0)
+ break;
+
+ /* Sanity check */
+ HDassert((unsigned)(i + 1) < parent_entry->flush_dep_height);
+
+ /* Check if parent entry is a child in another flush dependency relationship */
+ if(NULL != parent_entry->flush_dep_parent) {
+ /* Change flush dependency ref. counts of parent's parent */
+ H5C_adjust_flush_dependency_rc(parent_entry->flush_dep_parent, parent_entry->flush_dep_height, (unsigned)(i + 1));
+ } /* end if */
+
+ /* Increase flush dependency height of parent entry */
+ parent_entry->flush_dep_height = (unsigned)(i + 1);
+
+ /* Check for height of parent dropping to zero (i.e. no longer a
+ * parent of _any_ child flush dependencies).
+ */
+ if(0 == parent_entry->flush_dep_height) {
+ if(!parent_entry->is_protected)
+ H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, parent_entry, FAIL)
+
+ /* Unpin parent entry */
+ parent_entry->is_pinned = FALSE;
+ H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, parent_entry)
+ } /* end if */
+ } /* end if */
+
+ /* Reset parent of child entry */
+ child_entry->flush_dep_parent = NULL;
+
+ /* Post-conditions, for successful operation */
+ HDassert(prev_flush_dep_height >= parent_entry->flush_dep_height);
+ HDassert(NULL == child_entry->flush_dep_parent);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5C_destroy_flush_dependency() */
+
+
/*************************************************************************/
/**************************** Private Functions: *************************/
/*************************************************************************/
@@ -9874,8 +10216,6 @@ H5C_flush_invalidate_cache(H5F_t * f,
herr_t ret_value = SUCCEED;
hbool_t done = FALSE;
hbool_t first_flush = TRUE;
- hbool_t first_pass = TRUE;
- hbool_t have_pinned_entries;
int32_t protected_entries = 0;
int32_t i;
int32_t cur_pel_len;
@@ -9952,347 +10292,376 @@ H5C_flush_invalidate_cache(H5F_t * f,
while ( ! done )
{
- first_pass = FALSE;
+ unsigned curr_flush_dep_height = 0;
+ unsigned flush_dep_passes = 0;
- have_pinned_entries = ( cur_pel_len > 0 );
+ /* Loop over all flush dependency heights of entries */
+ while((curr_flush_dep_height <= H5C__NUM_FLUSH_DEP_HEIGHTS) &&
+ (cache_ptr->index_len > 0 ) &&
+ (flush_dep_passes < H5C__MAX_PASSES_ON_FLUSH) )
+ {
+ hbool_t flushed_during_dep_loop = FALSE;
- /* first, try to flush-destroy any dirty entries. Do this by
- * making a scan through the slist. Note that new dirty entries
- * may be created by the flush call backs. Thus it is possible
- * that the slist will not be empty after we finish the scan.
- */
+ /* first, try to flush-destroy any dirty entries. Do this by
+ * making a scan through the slist. Note that new dirty entries
+ * may be created by the flush call backs. Thus it is possible
+ * that the slist will not be empty after we finish the scan.
+ */
- if ( cache_ptr->slist_len == 0 ) {
+ if ( cache_ptr->slist_len == 0 ) {
- node_ptr = NULL;
- HDassert( cache_ptr->slist_size == 0 );
+ node_ptr = NULL;
+ HDassert( cache_ptr->slist_size == 0 );
- } else {
+ } else {
- node_ptr = H5SL_first(cache_ptr->slist_ptr);
+ node_ptr = H5SL_first(cache_ptr->slist_ptr);
- if ( node_ptr == NULL ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "slist_len != 0 && node_ptr == NULL");
- }
+ if ( node_ptr == NULL ) {
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "slist_len != 0 && node_ptr == NULL");
+ }
- next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
+ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- if ( next_entry_ptr == NULL ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "next_entry_ptr == NULL 1 ?!?!");
- }
-#ifndef NDEBUG
- HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
-#endif /* NDEBUG */
- HDassert( next_entry_ptr->is_dirty );
- HDassert( next_entry_ptr->in_slist );
+ if ( next_entry_ptr == NULL ) {
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "next_entry_ptr == NULL 1 ?!?!");
+ }
+ HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
+ HDassert( next_entry_ptr->is_dirty );
+ HDassert( next_entry_ptr->in_slist );
- }
+ }
#if H5C_DO_SANITY_CHECKS
- /* Depending on circumstances, H5C_flush_single_entry() will
- * remove dirty entries from the slist as it flushes them.
- * Thus for sanity checks we must make note of the initial
- * slist length and size before we do any flushes.
- */
- initial_slist_len = cache_ptr->slist_len;
- initial_slist_size = cache_ptr->slist_size;
-
- /* There is also the possibility that entries will be
- * dirtied, resized, and/or renamed as the result of
- * calls to the flush callbacks. We use the slist_len_increase
- * and slist_size_increase increase fields in struct H5C_t
- * to track these changes for purpose of sanity checking.
- * To this end, we must zero these fields before we start
- * the pass through the slist.
- */
- cache_ptr->slist_len_increase = 0;
- cache_ptr->slist_size_increase = 0;
+ /* Depending on circumstances, H5C_flush_single_entry() will
+ * remove dirty entries from the slist as it flushes them.
+ * Thus for sanity checks we must make note of the initial
+ * slist length and size before we do any flushes.
+ */
+ initial_slist_len = cache_ptr->slist_len;
+ initial_slist_size = cache_ptr->slist_size;
- /* Finally, reset the actual_slist_len and actual_slist_size
- * fields to zero, as these fields are used to accumulate
- * the slist lenght and size that we see as we scan through
- * the slist.
- */
- actual_slist_len = 0;
- actual_slist_size = 0;
-#endif /* H5C_DO_SANITY_CHECKS */
+ /* There is also the possibility that entries will be
+ * dirtied, resized, and/or renamed as the result of
+ * calls to the flush callbacks. We use the slist_len_increase
+ * and slist_size_increase increase fields in struct H5C_t
+ * to track these changes for purpose of sanity checking.
+ * To this end, we must zero these fields before we start
+ * the pass through the slist.
+ */
+ cache_ptr->slist_len_increase = 0;
+ cache_ptr->slist_size_increase = 0;
- while ( node_ptr != NULL )
- {
- entry_ptr = next_entry_ptr;
-
- /* With the advent of the fractal heap, it is possible
- * that the flush callback will dirty and/or resize
- * other entries in the cache. In particular, while
- * Quincey has promised me that this will never happen,
- * it is possible that the flush callback for an
- * entry may protect an entry that is not in the cache,
- * perhaps causing the cache to flush and possibly
- * evict the entry associated with node_ptr to make
- * space for the new entry.
- *
- * Thus we do a bit of extra sanity checking on entry_ptr,
- * and break out of this scan of the skip list if we
- * detect major problems. We have a bit of leaway on the
- * number of passes though the skip list, so this shouldn't
- * be an issue in the flush in and of itself, as it should
- * be all but impossible for this to happen more than once
- * in any flush.
- *
- * Observe that that breaking out of the scan early
- * shouldn't break the sanity checks just after the end
- * of this while loop.
- *
- * If an entry has merely been marked clean and removed from
- * the s-list, we simply break out of the scan.
- *
- * If the entry has been evicted, we flag an error and
- * exit.
+ /* Finally, reset the actual_slist_len and actual_slist_size
+ * fields to zero, as these fields are used to accumulate
+ * the slist lenght and size that we see as we scan through
+ * the slist.
*/
+ actual_slist_len = 0;
+ actual_slist_size = 0;
+#endif /* H5C_DO_SANITY_CHECKS */
+
+ while ( node_ptr != NULL )
+ {
+ entry_ptr = next_entry_ptr;
+
+ /* With the advent of the fractal heap, it is possible
+ * that the flush callback will dirty and/or resize
+ * other entries in the cache. In particular, while
+ * Quincey has promised me that this will never happen,
+ * it is possible that the flush callback for an
+ * entry may protect an entry that is not in the cache,
+ * perhaps causing the cache to flush and possibly
+ * evict the entry associated with node_ptr to make
+ * space for the new entry.
+ *
+ * Thus we do a bit of extra sanity checking on entry_ptr,
+ * and break out of this scan of the skip list if we
+ * detect major problems. We have a bit of leaway on the
+ * number of passes though the skip list, so this shouldn't
+ * be an issue in the flush in and of itself, as it should
+ * be all but impossible for this to happen more than once
+ * in any flush.
+ *
+ * Observe that that breaking out of the scan early
+ * shouldn't break the sanity checks just after the end
+ * of this while loop.
+ *
+ * If an entry has merely been marked clean and removed from
+ * the s-list, we simply break out of the scan.
+ *
+ * If the entry has been evicted, we flag an error and
+ * exit.
+ */
#ifndef NDEBUG
- if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
+ if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "entry_ptr->magic is invalid ?!?!");
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "entry_ptr->magic is invalid ?!?!");
- } else
+ } else
#endif /* NDEBUG */
- if ( ( ! entry_ptr->is_dirty ) ||
- ( ! entry_ptr->in_slist ) ) {
+ if ( ( ! entry_ptr->is_dirty ) ||
+ ( ! entry_ptr->in_slist ) ) {
- /* the s-list has been modified out from under us.
- * break out of the loop.
- */
- break;
- }
+ /* the s-list has been modified out from under us.
+ * break out of the loop.
+ */
+ goto end_of_inner_loop;;
+ }
- /* increment node pointer now, before we delete its target
- * from the slist.
- */
+ /* increment node pointer now, before we delete its target
+ * from the slist.
+ */
- node_ptr = H5SL_next(node_ptr);
- if ( node_ptr != NULL ) {
+ node_ptr = H5SL_next(node_ptr);
+ if ( node_ptr != NULL ) {
- next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
+ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- if ( next_entry_ptr == NULL ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "next_entry_ptr == NULL 2 ?!?!");
- }
-#ifndef NDEBUG
- HDassert( next_entry_ptr->magic ==
- H5C__H5C_CACHE_ENTRY_T_MAGIC );
-#endif /* NDEBUG */
- HDassert( next_entry_ptr->is_dirty );
- HDassert( next_entry_ptr->in_slist );
+ if ( next_entry_ptr == NULL ) {
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "next_entry_ptr == NULL 2 ?!?!");
+ }
+ HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
+ HDassert( next_entry_ptr->is_dirty );
+ HDassert( next_entry_ptr->in_slist );
- } else {
+ } else {
- next_entry_ptr = NULL;
- }
+ next_entry_ptr = NULL;
+ }
- /* Note that we now remove nodes from the slist as we flush
- * the associated entries, instead of leaving them there
- * until we are done, and then destroying all nodes in
- * the slist.
- *
- * While this optimization used to be easy, with the possibility
- * of new entries being added to the slist in the midst of the
- * flush, we must keep the slist in cannonical form at all
- * times.
- */
+ /* Note that we now remove nodes from the slist as we flush
+ * the associated entries, instead of leaving them there
+ * until we are done, and then destroying all nodes in
+ * the slist.
+ *
+ * While this optimization used to be easy, with the possibility
+ * of new entries being added to the slist in the midst of the
+ * flush, we must keep the slist in cannonical form at all
+ * times.
+ */
- HDassert( entry_ptr != NULL );
- HDassert( entry_ptr->in_slist );
+ HDassert( entry_ptr != NULL );
+ HDassert( entry_ptr->in_slist );
#if H5C_DO_SANITY_CHECKS
- /* update actual_slist_len & actual_slist_size before
- * the flush. Note that the entry will be removed
- * from the slist after the flush, and thus may be
- * resized by the flush callback. This is OK, as
- * we will catch the size delta in
- * cache_ptr->slist_size_increase.
- *
- * Note that we include pinned entries in this count, even
- * though we will not actually flush them.
- */
- actual_slist_len++;
- actual_slist_size += entry_ptr->size;
+ /* update actual_slist_len & actual_slist_size before
+ * the flush. Note that the entry will be removed
+ * from the slist after the flush, and thus may be
+ * resized by the flush callback. This is OK, as
+ * we will catch the size delta in
+ * cache_ptr->slist_size_increase.
+ *
+ * Note that we include pinned entries in this count, even
+ * though we will not actually flush them.
+ */
+ actual_slist_len++;
+ actual_slist_size += entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
- if ( entry_ptr->is_protected ) {
-
- /* we have major problems -- but lets flush
- * everything we can before we flag an error.
- */
- protected_entries++;
+ if ( entry_ptr->is_protected ) {
- } else if ( entry_ptr->is_pinned ) {
+ /* we have major problems -- but lets flush
+ * everything we can before we flag an error.
+ */
+ protected_entries++;
- /* Test to see if we are can flush the entry now.
- * If we can, go ahead and flush, but don't tell
- * H5C_flush_single_entry() to destroy the entry
- * as pinned entries can't be evicted.
- */
- if ( TRUE ) { /* When we get to multithreaded cache,
- * we will need either locking code, and/or
- * a test to see if the entry is in flushable
- * condition here.
- */
+ } else if ( entry_ptr->is_pinned ) {
- status = H5C_flush_single_entry(f,
- primary_dxpl_id,
- secondary_dxpl_id,
- cache_ptr,
- NULL,
- entry_ptr->addr,
- H5C__NO_FLAGS_SET,
- &first_flush,
- FALSE);
- if ( status < 0 ) {
+ /* Test to see if we are can flush the entry now.
+ * If we can, go ahead and flush, but don't tell
+ * H5C_flush_single_entry() to destroy the entry
+ * as pinned entries can't be evicted.
+ */
+ if(entry_ptr->flush_dep_height == curr_flush_dep_height ) {
+ status = H5C_flush_single_entry(f,
+ primary_dxpl_id,
+ secondary_dxpl_id,
+ cache_ptr,
+ NULL,
+ entry_ptr->addr,
+ H5C__NO_FLAGS_SET,
+ &first_flush,
+ FALSE);
+ if ( status < 0 ) {
- /* This shouldn't happen -- if it does, we are toast
- * so just scream and die.
- */
+ /* This shouldn't happen -- if it does, we are toast
+ * so just scream and die.
+ */
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "dirty pinned entry flush failed.")
- }
- }
- } else {
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
+ "dirty pinned entry flush failed.")
+ } /* end if */
+ flushed_during_dep_loop = TRUE;
+ } /* end if */
+ else if(entry_ptr->flush_dep_height < curr_flush_dep_height)
+ /* This shouldn't happen -- if it does, just scream and die. */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.")
+ } /* end if */
+ else {
+ if(entry_ptr->flush_dep_height == curr_flush_dep_height ){
- status = H5C_flush_single_entry(f,
- primary_dxpl_id,
- secondary_dxpl_id,
- cache_ptr,
- NULL,
- entry_ptr->addr,
- (cooked_flags |
- H5C__FLUSH_INVALIDATE_FLAG),
- &first_flush,
- TRUE);
- if ( status < 0 ) {
+ status = H5C_flush_single_entry(f,
+ primary_dxpl_id,
+ secondary_dxpl_id,
+ cache_ptr,
+ NULL,
+ entry_ptr->addr,
+ (cooked_flags |
+ H5C__FLUSH_INVALIDATE_FLAG),
+ &first_flush,
+ TRUE);
+ if ( status < 0 ) {
- /* This shouldn't happen -- if it does, we are toast so
- * just scream and die.
- */
+ /* This shouldn't happen -- if it does, we are toast so
+ * just scream and die.
+ */
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "dirty entry flush destroy failed.")
- }
- }
- } /* end while loop scanning skip list */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
+ "dirty entry flush destroy failed.")
+ } /* end if */
+ flushed_during_dep_loop = TRUE;
+ } /* end if */
+ else if(entry_ptr->flush_dep_height < curr_flush_dep_height)
+ /* This shouldn't happen -- if it does, just scream and die. */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.")
+ } /* end else */
+ } /* end while loop scanning skip list */
#if H5C_DO_SANITY_CHECKS
- /* It is possible that entries were added to the slist during
- * the scan, either before or after scan pointer. The following
- * asserts take this into account.
- *
- * Don't bother with the sanity checks if node_ptr != NULL, as
- * in this case we broke out of the loop because it got changed
- * out from under us.
- */
+ /* It is possible that entries were added to the slist during
+ * the scan, either before or after scan pointer. The following
+ * asserts take this into account.
+ *
+ * Don't bother with the sanity checks if node_ptr != NULL, as
+ * in this case we broke out of the loop because it got changed
+ * out from under us.
+ */
- if ( node_ptr == NULL ) {
+ if ( node_ptr == NULL ) {
- HDassert( (actual_slist_len + cache_ptr->slist_len) ==
- (initial_slist_len + cache_ptr->slist_len_increase) );
- HDassert( (actual_slist_size + cache_ptr->slist_size) ==
- (initial_slist_size + cache_ptr->slist_size_increase) );
- }
+ HDassert( (actual_slist_len + cache_ptr->slist_len) ==
+ (initial_slist_len + cache_ptr->slist_len_increase) );
+ HDassert( (actual_slist_size + cache_ptr->slist_size) ==
+ (initial_slist_size + cache_ptr->slist_size_increase) );
+ }
#endif /* H5C_DO_SANITY_CHECKS */
- /* Since we are doing a destroy, we must make a pass through
- * the hash table and try to flush - destroy all entries that
- * remain.
- *
- * It used to be that all entries remaining in the cache at
- * this point had to be clean, but with the fractal heap mods
- * this may not be the case. If so, we will flush entries out
- * of increasing address order.
- *
- * Writes to disk are possible here.
- */
- for ( i = 0; i < H5C__HASH_TABLE_LEN; i++ )
- {
- next_entry_ptr = cache_ptr->index[i];
-
- while ( next_entry_ptr != NULL )
+ /* Since we are doing a destroy, we must make a pass through
+ * the hash table and try to flush - destroy all entries that
+ * remain.
+ *
+ * It used to be that all entries remaining in the cache at
+ * this point had to be clean, but with the fractal heap mods
+ * this may not be the case. If so, we will flush entries out
+ * of increasing address order.
+ *
+ * Writes to disk are possible here.
+ */
+ for ( i = 0; i < H5C__HASH_TABLE_LEN; i++ )
{
- entry_ptr = next_entry_ptr;
+ next_entry_ptr = cache_ptr->index[i];
- next_entry_ptr = entry_ptr->ht_next;
-#ifndef NDEBUG
- HDassert ( ( next_entry_ptr == NULL ) ||
- ( next_entry_ptr->magic ==
- H5C__H5C_CACHE_ENTRY_T_MAGIC ) );
-#endif /* NDEBUG */
- if ( entry_ptr->is_protected ) {
+ while ( next_entry_ptr != NULL )
+ {
+ entry_ptr = next_entry_ptr;
- /* we have major problems -- but lets flush and destroy
- * everything we can before we flag an error.
- */
- protected_entries++;
+ next_entry_ptr = entry_ptr->ht_next;
+ HDassert ( ( next_entry_ptr == NULL ) ||
+ ( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ) );
+ if ( entry_ptr->is_protected ) {
- if ( ! entry_ptr->in_slist ) {
+ /* we have major problems -- but lets flush and destroy
+ * everything we can before we flag an error.
+ */
+ protected_entries++;
- HDassert( !(entry_ptr->is_dirty) );
- }
- } else if ( ! ( entry_ptr->is_pinned ) ) {
+ if ( ! entry_ptr->in_slist ) {
- status = H5C_flush_single_entry(f,
- primary_dxpl_id,
- secondary_dxpl_id,
- cache_ptr,
- NULL,
- entry_ptr->addr,
- (cooked_flags |
- H5C__FLUSH_INVALIDATE_FLAG),
- &first_flush,
- TRUE);
- if ( status < 0 ) {
+ HDassert( !(entry_ptr->is_dirty) );
+ }
+ } else if ( ! ( entry_ptr->is_pinned ) ) {
- /* This shouldn't happen -- if it does, we are toast so
- * just scream and die.
+ /* Test to see if we are can flush the entry now.
+ * If we can, go ahead and flush.
*/
+ if(entry_ptr->flush_dep_height == curr_flush_dep_height ){
+ status = H5C_flush_single_entry(f,
+ primary_dxpl_id,
+ secondary_dxpl_id,
+ cache_ptr,
+ NULL,
+ entry_ptr->addr,
+ (cooked_flags |
+ H5C__FLUSH_INVALIDATE_FLAG),
+ &first_flush,
+ TRUE);
+ if ( status < 0 ) {
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
- "Entry flush destroy failed.")
- }
- }
- /* We can't do anything if the entry is pinned. The
- * hope is that the entry will be unpinned as the
- * result of destroys of entries that reference it.
- *
- * We detect this by noting the change in the number
- * of pinned entries from pass to pass. If it stops
- * shrinking before it hits zero, we scream and die.
- */
- /* if the flush function on the entry we last evicted
- * loaded an entry into cache (as Quincey has promised me
- * it never will), and if the cache was full, it is
- * possible that *next_entry_ptr was flushed or evicted.
- *
- * Test to see if this happened here. Note that if this
- * test is triggred, we are accessing a deallocated piece
- * of dynamically allocated memory, so we just scream and
- * die.
- */
-#ifndef NDEBUG
- if ( ( next_entry_ptr != NULL ) &&
- ( next_entry_ptr->magic !=
- H5C__H5C_CACHE_ENTRY_T_MAGIC ) ) {
+ /* This shouldn't happen -- if it does, we are toast so
+ * just scream and die.
+ */
- /* Something horrible has happened to
- * *next_entry_ptr -- scream and die.
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
+ "Entry flush destroy failed.")
+ }
+ flushed_during_dep_loop = TRUE;
+ } /* end if */
+ else if(entry_ptr->flush_dep_height < curr_flush_dep_height)
+ /* This shouldn't happen -- if it does, just scream and die. */
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry below current flush dep. height.")
+ } /* end if */
+ /* We can't do anything if the entry is pinned. The
+ * hope is that the entry will be unpinned as the
+ * result of destroys of entries that reference it.
+ *
+ * We detect this by noting the change in the number
+ * of pinned entries from pass to pass. If it stops
+ * shrinking before it hits zero, we scream and die.
*/
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "next_entry_ptr->magic is invalid?!?!?.")
- }
+ /* if the flush function on the entry we last evicted
+ * loaded an entry into cache (as Quincey has promised me
+ * it never will), and if the cache was full, it is
+ * possible that *next_entry_ptr was flushed or evicted.
+ *
+ * Test to see if this happened here. Note that if this
+ * test is triggred, we are accessing a deallocated piece
+ * of dynamically allocated memory, so we just scream and
+ * die.
+ */
+#ifndef NDEBUG
+ if ( ( next_entry_ptr != NULL ) &&
+ ( next_entry_ptr->magic !=
+ H5C__H5C_CACHE_ENTRY_T_MAGIC ) ) {
+
+ /* Something horrible has happened to
+ * *next_entry_ptr -- scream and die.
+ */
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "next_entry_ptr->magic is invalid?!?!?.")
+ }
#endif /* NDEBUG */
- } /* end while loop scanning hash table bin */
- } /* end for loop scanning hash table */
+ } /* end while loop scanning hash table bin */
+ } /* end for loop scanning hash table */
+
+ /* Check for incrementing flush dependency height */
+ if(flushed_during_dep_loop) {
+ /* If we flushed an entry at this flush dependency height
+ * start over at the bottom level of the flush dependencies
+ */
+ curr_flush_dep_height = 0;
+
+ /* Make certain we don't get stuck in an infinite loop */
+ flush_dep_passes++;
+ } /* end if */
+ else
+ curr_flush_dep_height++;
+
+ } /* end while loop over flush dependency heights */
+end_of_inner_loop:
old_pel_len = cur_pel_len;
cur_pel_len = cache_ptr->pel_len;
@@ -11029,8 +11398,9 @@ H5C_load_entry(H5F_t * f,
#endif /* NDEBUG */
{
void * thing = NULL;
- void * ret_value = NULL;
H5C_cache_entry_t * entry_ptr = NULL;
+ unsigned u; /* Local index variable */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5C_load_entry)
@@ -11097,6 +11467,12 @@ H5C_load_entry(H5F_t * f,
HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE );
+ /* Initialize flush dependency height fields */
+ entry_ptr->flush_dep_parent = NULL;
+ for(u = 0; u < H5C__NUM_FLUSH_DEP_HEIGHTS; u++)
+ entry_ptr->child_flush_dep_height_rc[u] = 0;
+ entry_ptr->flush_dep_height = 0;
+
entry_ptr->ht_next = NULL;
entry_ptr->ht_prev = NULL;
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 4ce321c..855c861 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -32,7 +32,7 @@
#include "H5Cpublic.h" /*public prototypes */
-/* Pivate headers needed by this header */
+/* Private headers needed by this header */
#include "H5private.h" /* Generic Functions */
#include "H5Fprivate.h" /* File access */
@@ -183,6 +183,14 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
+/* Maximum height of flush dependency relationships between entries. This is
+ * currently tuned to the extensible array (H5EA) data structure, which only
+ * requires 4 levels of dependency (i.e. heights 0-4).
+ */
+
+#define H5C__NUM_FLUSH_DEP_HEIGHTS 4
+
+
/****************************************************************************
*
@@ -496,6 +504,12 @@ typedef struct H5C_cache_entry_t
hbool_t destroy_in_progress;
hbool_t free_file_space_on_destroy;
+ /* fields supporting the 'flush dependency height': */
+
+ struct H5C_cache_entry_t * flush_dep_parent;
+ uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
+ unsigned flush_dep_height;
+
/* fields supporting the hash table: */
struct H5C_cache_entry_t * ht_next;
@@ -1040,6 +1054,9 @@ H5_DLL herr_t H5C_rename_entry(H5C_t * cache_ptr,
H5_DLL herr_t H5C_pin_protected_entry(H5C_t * cache_ptr,
void * thing);
+H5_DLL herr_t H5C_create_flush_dependency(H5C_t *cache_ptr, void *parent_thing,
+ void *child_thing);
+
H5_DLL void * H5C_protect(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
@@ -1079,6 +1096,9 @@ H5_DLL void H5C_stats__reset(H5C_t * cache_ptr);
H5_DLL herr_t H5C_unpin_entry(H5C_t * cache_ptr, void * thing);
+H5_DLL herr_t H5C_destroy_flush_dependency(H5C_t *cache_ptr, void *parent_thing,
+ void *child_thing);
+
H5_DLL herr_t H5C_unprotect(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
diff --git a/src/H5D.c b/src/H5D.c
index 4dad2aa..bb5e772 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -368,14 +368,13 @@ done:
herr_t
H5Dclose(hid_t dset_id)
{
- H5D_t *dset; /* Dataset object to release */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(H5Dclose, FAIL)
H5TRACE1("e", "i", dset_id);
/* Check args */
- if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET)))
+ if(NULL == H5I_object_verify(dset_id, H5I_DATASET))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
/*
diff --git a/src/H5Dio.c b/src/H5Dio.c
index c1d57fd..cc75981 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -66,8 +66,7 @@ static herr_t H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_
H5D_type_info_t *type_info);
#ifdef H5_HAVE_PARALLEL
static herr_t H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset,
- const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
- const H5S_t *file_space, const H5S_t *mem_space,
+ hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space,
const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm);
static herr_t H5D_ioinfo_term(H5D_io_info_t *io_info);
#endif /* H5_HAVE_PARALLEL */
@@ -396,7 +395,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
#ifdef H5_HAVE_PARALLEL
/* Adjust I/O info for any parallel I/O */
- if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_cache, dxpl_id, file_space, mem_space, &type_info, &fm) < 0)
+ if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O")
#endif /*H5_HAVE_PARALLEL*/
@@ -570,7 +569,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
#ifdef H5_HAVE_PARALLEL
/* Adjust I/O info for any parallel I/O */
- if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_cache, dxpl_id, file_space, mem_space, &type_info, &fm) < 0)
+ if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O")
#endif /*H5_HAVE_PARALLEL*/
@@ -845,8 +844,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset,
- const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
+H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id,
const H5S_t *file_space, const H5S_t *mem_space,
const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm)
{
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index e4dd8b5..6693348 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -117,8 +117,10 @@ static herr_t H5D_inter_collective_io(H5D_io_info_t *io_info,
static herr_t H5D_final_collective_io(H5D_io_info_t *io_info,
const H5D_type_info_t *type_info, size_t nelmts, MPI_Datatype *mpi_file_type,
MPI_Datatype *mpi_buf_type);
+#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS
static herr_t H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm,
H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt);
+#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */
static herr_t H5D_obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm,
H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]);
static herr_t H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist,
@@ -1074,7 +1076,6 @@ static herr_t
H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist)
{
- H5D_t *dataset = io_info->dset;/* Local pointer to dataset info */
H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */
H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */
H5D_io_info_t cpt_io_info; /* Compact I/O info object */
@@ -1347,7 +1348,6 @@ static herr_t
H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info,
const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist)
{
- H5D_t *dataset = io_info->dset;/* Local pointer to dataset info */
H5SL_node_t *chunk_node; /* Current node in chunk skip list */
H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */
H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */
@@ -1366,7 +1366,7 @@ if(H5DEBUG(D)) {
int mpi_rank;
mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file);
- HDfprintf(H5DEBUG(D), "coming to multi_chunk_collective_io_no_opt\n");
+ HDfprintf(H5DEBUG(D), "Rank %d: coming to multi_chunk_collective_io_no_opt\n", mpi_rank);
}
#endif
@@ -1614,7 +1614,6 @@ static herr_t
H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
size_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type)
{
- int mpi_code; /* MPI return code */
hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */
herr_t ret_value = SUCCEED;
@@ -1626,13 +1625,11 @@ H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info
plist_is_setup = TRUE;
if(io_info->op_type == H5D_IO_OP_WRITE) {
- if((io_info->io_ops.single_write)(io_info, type_info,
- (hsize_t)mpi_buf_count, NULL, NULL) < 0)
+ if((io_info->io_ops.single_write)(io_info, type_info, (hsize_t)mpi_buf_count, NULL, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed")
} /* end if */
else {
- if((io_info->io_ops.single_read)(io_info, type_info,
- (hsize_t)mpi_buf_count, NULL, NULL) < 0)
+ if((io_info->io_ops.single_read)(io_info, type_info, (hsize_t)mpi_buf_count, NULL, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed")
} /* end else */
@@ -1649,6 +1646,7 @@ if(H5DEBUG(D))
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_final_collective_io */
+#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS
/*-------------------------------------------------------------------------
* Function: H5D_sort_chunk
@@ -1790,6 +1788,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_sort_chunk() */
+#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */
/*-------------------------------------------------------------------------
@@ -1833,17 +1832,19 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm,
H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[])
{
int total_chunks;
- unsigned percent_nproc_per_chunk,threshold_nproc_per_chunk;
+ unsigned percent_nproc_per_chunk, threshold_nproc_per_chunk;
+#if defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) && defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS)
H5FD_mpio_chunk_opt_t chunk_opt_mode;
- uint8_t* io_mode_info=NULL;
- uint8_t* recv_io_mode_info=NULL;
- uint8_t* mergebuf=NULL;
+#endif
+ uint8_t* io_mode_info = NULL;
+ uint8_t* recv_io_mode_info = NULL;
+ uint8_t* mergebuf = NULL;
uint8_t* tempbuf;
H5SL_node_t* chunk_node;
H5D_chunk_info_t* chunk_info;
- int mpi_size,mpi_rank;
+ int mpi_size, mpi_rank;
MPI_Comm comm;
- int ic,root;
+ int ic, root;
int mpi_code;
int mem_cleanup = 0;
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
diff --git a/src/H5Edefin.h b/src/H5Edefin.h
index 612fcb1..b31b31b 100644
--- a/src/H5Edefin.h
+++ b/src/H5Edefin.h
@@ -164,6 +164,8 @@ hid_t H5E_CANTMARKDIRTY_g = FAIL; /* Unable to mark a pinned entry as dirt
hid_t H5E_CANTDIRTY_g = FAIL; /* Unable to mark metadata as dirty */
hid_t H5E_CANTEXPUNGE_g = FAIL; /* Unable to expunge a metadata cache entry */
hid_t H5E_CANTRESIZE_g = FAIL; /* Unable to resize a metadata cache entry */
+hid_t H5E_CANTDEPEND_g = FAIL; /* Unable to create a flush dependency */
+hid_t H5E_CANTUNDEPEND_g = FAIL; /* Unable to destroy a flush dependency */
/* Link related errors */
hid_t H5E_TRAVERSE_g = FAIL; /* Link traversal failure */
diff --git a/src/H5Einit.h b/src/H5Einit.h
index 20e156c..204644f 100644
--- a/src/H5Einit.h
+++ b/src/H5Einit.h
@@ -622,6 +622,16 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to resize a metadata cache entr
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
if((H5E_CANTRESIZE_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
+assert(H5E_CANTDEPEND_g==(-1));
+if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to create a flush dependency"))==NULL)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
+if((H5E_CANTDEPEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
+assert(H5E_CANTUNDEPEND_g==(-1));
+if((msg = H5E_create_msg(cls, H5E_MINOR, "Unable to destroy a flush dependency"))==NULL)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
+if((H5E_CANTUNDEPEND_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Link related errors */
assert(H5E_TRAVERSE_g==(-1));
diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h
index 4e981dc..736349a 100644
--- a/src/H5Epubgen.h
+++ b/src/H5Epubgen.h
@@ -266,6 +266,8 @@ H5_DLLVAR hid_t H5E_NOIDS_g; /* Out of IDs for group */
#define H5E_CANTDIRTY (H5OPEN H5E_CANTDIRTY_g)
#define H5E_CANTEXPUNGE (H5OPEN H5E_CANTEXPUNGE_g)
#define H5E_CANTRESIZE (H5OPEN H5E_CANTRESIZE_g)
+#define H5E_CANTDEPEND (H5OPEN H5E_CANTDEPEND_g)
+#define H5E_CANTUNDEPEND (H5OPEN H5E_CANTUNDEPEND_g)
H5_DLLVAR hid_t H5E_CANTFLUSH_g; /* Unable to flush data from cache */
H5_DLLVAR hid_t H5E_CANTSERIALIZE_g; /* Unable to serialize data from cache */
H5_DLLVAR hid_t H5E_CANTLOAD_g; /* Unable to load metadata into cache */
@@ -282,6 +284,8 @@ H5_DLLVAR hid_t H5E_CANTMARKDIRTY_g; /* Unable to mark a pinned entry as dirty *
H5_DLLVAR hid_t H5E_CANTDIRTY_g; /* Unable to mark metadata as dirty */
H5_DLLVAR hid_t H5E_CANTEXPUNGE_g; /* Unable to expunge a metadata cache entry */
H5_DLLVAR hid_t H5E_CANTRESIZE_g; /* Unable to resize a metadata cache entry */
+H5_DLLVAR hid_t H5E_CANTDEPEND_g; /* Unable to create a flush dependency */
+H5_DLLVAR hid_t H5E_CANTUNDEPEND_g; /* Unable to destroy a flush dependency */
/* Link related errors */
#define H5E_TRAVERSE (H5OPEN H5E_TRAVERSE_g)
diff --git a/src/H5Eterm.h b/src/H5Eterm.h
index 7595e7f..8936dc0 100644
--- a/src/H5Eterm.h
+++ b/src/H5Eterm.h
@@ -165,7 +165,9 @@ H5E_CANTUNPIN_g=
H5E_CANTMARKDIRTY_g=
H5E_CANTDIRTY_g=
H5E_CANTEXPUNGE_g=
-H5E_CANTRESIZE_g=
+H5E_CANTRESIZE_g=
+H5E_CANTDEPEND_g=
+H5E_CANTUNDEPEND_g=
/* Link related errors */
H5E_TRAVERSE_g=
diff --git a/src/H5F.c b/src/H5F.c
index 7b9ce79..e7b4cd3 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1115,6 +1115,9 @@ H5F_dest(H5F_t *f, hid_t dxpl_id)
f->shared->mtab.child = (H5F_mount_t *)H5MM_xfree(f->shared->mtab.child);
f->shared->mtab.nalloc = 0;
+ /* Free root group symbol table entry, if any */
+ f->shared->root_ent = H5MM_xfree(f->shared->root_ent);
+
/* Destroy shared file struct */
f->shared = (H5F_file_t *)H5FL_FREE(H5F_file_t, f->shared);
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 61eb318..fff31f3 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -1081,7 +1081,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
hbool_t _must_align = TRUE;
herr_t ret_value=SUCCEED; /* Return value */
size_t alloc_size;
- void *copy_buf, *p1, *p3;
+ void *copy_buf, *p1;
+ const void *p3;
size_t _boundary;
size_t _fbsize;
size_t _cbsize;
@@ -1187,7 +1188,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
HDmemcpy(p1, p3, copy_size);
}else if(size >= _cbsize && copy_size > (alloc_size-(size_t)(copy_addr%_fbsize))) {
HDmemcpy(p1, p3, (alloc_size - (size_t)(copy_addr % _fbsize)));
- p3 = (unsigned char*)p3 + (alloc_size - (size_t)(copy_addr % _fbsize));
+ p3 = (const unsigned char *)p3 + (alloc_size - (size_t)(copy_addr % _fbsize));
}
/*look for the aligned position for writing the data*/
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 57da069..5e5349d 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1913,7 +1913,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing)
+H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing)
{
H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
herr_t ret_value = SUCCEED;
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index 245fc3e..ff5b118 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -1215,7 +1215,9 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
size_t size, const void *buf)
{
H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file;
+#if 0 /* JRM */
int mpi_code; /* MPI return code */
+#endif /* JRM */
ssize_t nbytes; /* Number of bytes written each I/O call */
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 59e5b1e..0ae09a6 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -563,7 +563,9 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
{
H5FD_stdio_t *file = (H5FD_stdio_t*)_file;
haddr_t addr;
+#ifndef H5_HAVE_FSEEKO
static const char *func = "H5FD_stdio_alloc"; /* Function Name for error reporting */
+#endif
haddr_t ret_value; /* Return value */
/* Shut compiler up */
diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c
index ef26fec..37228d7 100644
--- a/src/H5FDwindows.c
+++ b/src/H5FDwindows.c
@@ -1008,7 +1008,7 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5FD_windows_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing)
+H5FD_windows_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing)
{
H5FD_windows_t *file = (H5FD_windows_t*)_file;
#ifndef WINDOWS_USE_STDIO
diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h
index 446c852..a799dc4 100644
--- a/src/H5FLprivate.h
+++ b/src/H5FLprivate.h
@@ -118,7 +118,7 @@ typedef struct H5FL_reg_head_t {
#define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t)
/* Reference a free list for type 't' defined in another file */
-#define H5FL_EXTERN(t) extern H5_DLL H5FL_reg_head_t H5FL_REG_NAME(t)
+#define H5FL_EXTERN(t) H5_DLLVAR H5FL_reg_head_t H5FL_REG_NAME(t)
/* Declare a static free list to manage objects of type 't' */
#define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t)
@@ -142,7 +142,7 @@ typedef struct H5FL_reg_head_t {
#define H5FL_DEFINE_COMMON(t) int UNUSED H5FL_REG_NAME(t)
#define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t)
-#define H5FL_EXTERN(t) extern H5_DLL H5FL_DEFINE_COMMON(t)
+#define H5FL_EXTERN(t) H5_DLLVAR H5FL_DEFINE_COMMON(t)
#define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t)
#define H5FL_MALLOC(t) (t *)H5MM_malloc(sizeof(t))
#define H5FL_CALLOC(t) (t *)H5MM_calloc(sizeof(t))
@@ -187,7 +187,7 @@ typedef struct H5FL_blk_head_t {
#define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t)
/* Reference a free list for type 't' defined in another file */
-#define H5FL_BLK_EXTERN(t) extern H5_DLL H5FL_blk_head_t H5FL_BLK_NAME(t)
+#define H5FL_BLK_EXTERN(t) H5_DLLVAR H5FL_blk_head_t H5FL_BLK_NAME(t)
/* Declare a static free list to manage objects of type 't' */
#define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t)
@@ -212,7 +212,7 @@ typedef struct H5FL_blk_head_t {
#define H5FL_BLK_DEFINE_COMMON(t) int UNUSED H5FL_BLK_NAME(t)
#define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t)
-#define H5FL_BLK_EXTERN(t) extern H5_DLL H5FL_BLK_DEFINE_COMMON(t)
+#define H5FL_BLK_EXTERN(t) H5_DLLVAR H5FL_BLK_DEFINE_COMMON(t)
#define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t)
#define H5FL_BLK_MALLOC(t,size) (uint8_t *)H5MM_malloc(size)
#define H5FL_BLK_CALLOC(t,size) (uint8_t *)H5MM_calloc(size)
@@ -263,7 +263,7 @@ typedef struct H5FL_arr_head_t {
#define H5FL_BARR_DEFINE(b,t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(sizeof(b),t,m)
/* Reference a free list for arrays of type 't' defined in another file */
-#define H5FL_ARR_EXTERN(t) extern H5_DLL H5FL_arr_head_t H5FL_ARR_NAME(t)
+#define H5FL_ARR_EXTERN(t) H5_DLLVAR H5FL_arr_head_t H5FL_ARR_NAME(t)
/* Declare a static free list to manage arrays of type 't' */
#define H5FL_ARR_DEFINE_STATIC(t,m) static H5FL_ARR_DEFINE_COMMON(0,t,m)
@@ -289,7 +289,7 @@ typedef struct H5FL_arr_head_t {
#define H5FL_ARR_DEFINE(t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) = 0
#define H5FL_BARR_DEFINE(b,t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) = sizeof(b)
-#define H5FL_ARR_EXTERN(t) extern H5_DLL H5FL_ARR_DEFINE_COMMON(t,m)
+#define H5FL_ARR_EXTERN(t) H5_DLLVAR H5FL_ARR_DEFINE_COMMON(t,m)
#define H5FL_ARR_DEFINE_STATIC(t,m) static H5FL_ARR_DEFINE_COMMON(t,m) = 0
#define H5FL_BARR_DEFINE_STATIC(b,t,m) static H5FL_ARR_DEFINE_COMMON(t,m) = sizeof(b)
#define H5FL_ARR_MALLOC(t,elem) H5MM_malloc(H5FL_ARR_NAME(t) + ((elem)*sizeof(t)))
@@ -319,7 +319,7 @@ typedef struct H5FL_seq_head_t {
#define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t)
/* Reference a free list for sequences of type 't' defined in another file */
-#define H5FL_SEQ_EXTERN(t) extern H5_DLL H5FL_seq_head_t H5FL_SEQ_NAME(t)
+#define H5FL_SEQ_EXTERN(t) H5_DLLVAR H5FL_seq_head_t H5FL_SEQ_NAME(t)
/* Declare a static free list to manage sequences of type 't' */
#define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t)
@@ -341,7 +341,7 @@ typedef struct H5FL_seq_head_t {
#define H5FL_SEQ_DEFINE_COMMON(t) int UNUSED H5FL_SEQ_NAME(t)
#define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t)
-#define H5FL_SEQ_EXTERN(t) extern H5_DLL H5FL_SEQ_DEFINE_COMMON(t)
+#define H5FL_SEQ_EXTERN(t) H5_DLLVAR H5FL_SEQ_DEFINE_COMMON(t)
#define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t)
#define H5FL_SEQ_MALLOC(t,elem) (t *)H5MM_malloc((elem)*sizeof(t))
#define H5FL_SEQ_CALLOC(t,elem) (t *)H5MM_calloc((elem)*sizeof(t))
diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c
index e05c32a..a4577c9 100644
--- a/src/H5Fdbg.c
+++ b/src/H5Fdbg.c
@@ -123,21 +123,26 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth)
"Root group symbol table entry:",
f->shared->root_grp ? "" : "(none)");
if(f->shared->root_grp) {
- H5O_loc_t *root_oloc; /* Root object location */
- H5G_entry_t root_ent; /* Constructed root symbol table entry */
-
- /* Reset the root group entry */
- H5G_ent_reset(&root_ent);
-
- /* Build up a simulated root group symbol table entry */
- root_oloc = H5G_oloc(f->shared->root_grp);
- HDassert(root_oloc);
- root_ent.type = H5G_NOTHING_CACHED;
- root_ent.header = root_oloc->addr;
- root_ent.file = f;
-
- /* Display root group symbol table entry info */
- H5G_ent_debug(f, &root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL);
+ if(f->shared->root_ent) /* Use real root group symbol table entry */
+ H5G_ent_debug(f, f->shared->root_ent, stream, indent + 3,
+ MAX(0, fwidth - 3), NULL);
+ else {
+ H5O_loc_t *root_oloc; /* Root object location */
+ H5G_entry_t root_ent; /* Constructed root symbol table entry */
+
+ /* Reset the root group entry */
+ H5G_ent_reset(&root_ent);
+
+ /* Build up a simulated root group symbol table entry */
+ root_oloc = H5G_oloc(f->shared->root_grp);
+ HDassert(root_oloc);
+ root_ent.type = H5G_NOTHING_CACHED;
+ root_ent.header = root_oloc->addr;
+ root_ent.file = f;
+
+ /* Display root group symbol table entry info */
+ H5G_ent_debug(f, &root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL);
+ }
} /* end if */
done:
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index cc74a80..4080705 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -158,6 +158,7 @@ typedef struct H5F_file_t {
int ncwfs; /* Num entries on cwfs list */
struct H5HG_heap_t **cwfs; /* Global heap cache */
struct H5G_t *root_grp; /* Open root group */
+ H5G_entry_t *root_ent; /* Root group symbol table entry */
H5FO_t *open_objs; /* Open objects in file */
H5RC_t *grp_btree_shared; /* Ref-counted group B-tree node info */
@@ -193,7 +194,7 @@ struct H5F_t {
H5FO_t *obj_count; /* # of time each object is opened through top file structure */
hid_t file_id; /* ID of this file */
hbool_t closing; /* File is in the process of being closed */
- struct H5F_t *parent; /* Parent file that this file is mounted to */
+ struct H5F_t *parent; /* Parent file that this file is mounted to */
unsigned nmounts; /* Number of children mounted to this file */
};
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 3c914bd..70e0954 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -383,7 +383,8 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
H5F_addr_decode(f, (const uint8_t **)&p, &shared->extension_addr/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &shared->driver_addr/*out*/);
- if(H5G_obj_ent_decode(f, (const uint8_t **)&p, root_loc->oloc/*out*/) < 0)
+ if(H5G_obj_ent_decode(f, (const uint8_t **)&p, root_loc->oloc/*out*/,
+ &shared->root_ent/*out*/) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read root symbol entry")
/*
diff --git a/src/H5G.c b/src/H5G.c
index 6a7e505..042ce90 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -896,6 +896,24 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, H5G_loc_t *loc)
*/
if(H5O_open(loc->oloc) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open root group")
+
+#ifndef H5_STRICT_FORMAT_CHECKS
+ /* If symbol table information is cached, check if we should replace the
+ * symbol table message with the cached symbol table information */
+ if((H5F_INTENT(f) & H5F_ACC_RDWR) && f->shared->root_ent
+ && (f->shared->root_ent->type == H5G_CACHED_STAB)) {
+ H5O_stab_t cached_stab;
+
+ /* Retrieve the cached symbol table information */
+ cached_stab.btree_addr = f->shared->root_ent->cache.stab.btree_addr;
+ cached_stab.heap_addr = f->shared->root_ent->cache.stab.heap_addr;
+
+ /* Check if the symbol table message is valid, and replace with the
+ * cached symbol table if necessary */
+ if(H5G_stab_valid(loc->oloc, dxpl_id, &cached_stab) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to verify symbol table")
+ } /* end if */
+#endif /* H5_STRICT_FORMAT_CHECKS */
} /* end else */
/* Create the path names for the root group's entry */
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index 6cc15b8..322b31b 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -988,9 +988,10 @@ H5G_dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo,
/* Check on iteration order */
if(order == H5_ITER_NATIVE) {
- HDassert(H5F_addr_defined(bt2_addr));
H5G_bt2_ud_it_t udata; /* User data for iterator callback */
+ HDassert(H5F_addr_defined(bt2_addr));
+
/* Open the fractal heap */
if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr)))
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap")
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index 908c9a3..b6a3a17 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -727,6 +727,7 @@ H5G_loc_set_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name,
{
H5G_loc_sc_t *udata = (H5G_loc_sc_t *)_udata; /* User data passed in */
H5O_name_t comment; /* Object header "comment" message */
+ htri_t exists; /* Whether a "comment" message already exists */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5G_loc_set_comment_cb)
@@ -735,9 +736,14 @@ H5G_loc_set_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name,
if(obj_loc == NULL)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist")
+ /* Check for existing comment message */
+ if((exists = H5O_msg_exists(obj_loc->oloc, H5O_NAME_ID, udata->dxpl_id)) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read object header")
+
/* Remove the previous comment message if any */
- if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE, udata->dxpl_id) < 0)
- H5E_clear_stack(NULL);
+ if(exists)
+ if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE, udata->dxpl_id) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete existing comment object header message")
/* Add the new message */
if(udata->comment && *udata->comment) {
@@ -830,7 +836,7 @@ H5G_loc_get_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name,
} else {
if(udata->comment && udata->bufsize)
HDstrncpy(udata->comment, comment.s, udata->bufsize);
- udata->comment_size = HDstrlen(comment.s);
+ udata->comment_size = (ssize_t)HDstrlen(comment.s);
H5O_msg_reset(H5O_NAME_ID, &comment);
} /* end else */
diff --git a/src/H5Gname.c b/src/H5Gname.c
index 205f2a2..581b649 100644
--- a/src/H5Gname.c
+++ b/src/H5Gname.c
@@ -578,7 +578,6 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char
if(full_suffix_len < path_len) {
const char *dst_suffix; /* Destination suffix that changes */
const char *src_suffix; /* Source suffix that changes */
- const char *path_prefix; /* Prefix for path */
size_t path_prefix_len; /* Length of path prefix */
const char *path_prefix2; /* 2nd prefix for path */
size_t path_prefix2_len; /* Length of 2nd path prefix */
@@ -589,7 +588,6 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char
/* Compute path prefix before full suffix*/
- path_prefix = path;
path_prefix_len = path_len - full_suffix_len;
/* Determine the common prefix for src & dst paths */
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 6b16544..fe381fd 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -815,7 +815,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
/* Get a pointer to the name of the link */
if(NULL == (lnk.name = (char *)H5HL_offset_into(f, udata->common.heap, sn->entry[idx].name_off)))
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get link name")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get link name")
/* Set up rest of link structure */
lnk.corder_valid = FALSE;
@@ -833,7 +833,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
/* Replace any object names */
if(H5G_link_name_replace(f, dxpl_id, udata->grp_full_path_r, &lnk) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object type")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get object type")
/* Decrement the ref. count for hard links */
if(lnk.type == H5L_TYPE_HARD) {
diff --git a/src/H5Gobj.c b/src/H5Gobj.c
index 3220b67..2eb1924 100644
--- a/src/H5Gobj.c
+++ b/src/H5Gobj.c
@@ -237,31 +237,49 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5G_obj_ent_decode(H5F_t *f, const uint8_t **pp, H5O_loc_t *oloc)
+H5G_obj_ent_decode(H5F_t *f, const uint8_t **pp, H5O_loc_t *oloc, H5G_entry_t **entp)
{
const uint8_t *p_ret = *pp;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOFUNC(H5G_obj_ent_decode)
+ FUNC_ENTER_NOAPI(H5G_obj_ent_decode, FAIL)
/* check arguments */
HDassert(f);
HDassert(pp);
HDassert(oloc);
- /* Set file pointer for root object location */
- oloc->file = f;
+ if(entp) {
+ /* If entp is not NULL we allocate space for the symbol table entry and
+ * decode the entire entry. */
+ if(!(*entp)) /* Only allocate space if *entp is NULL */
+ if(NULL == (*entp = (H5G_entry_t *) H5MM_calloc(sizeof(H5G_entry_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate space for symbol table entry")
+ if(H5G_ent_decode_vec(f, pp, *entp, 1) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode symbol table entry")
+
+ /* Set oloc to the correct values */
+ oloc->file = (*entp)->file;
+ oloc->addr = (*entp)->header;
+ } else {
+ /* Set file pointer for root object location */
+ oloc->file = f;
+
+ /* decode header */
+ *pp += H5F_SIZEOF_SIZE(f); /* Skip over local heap address */
+ H5F_addr_decode(f, pp, &(oloc->addr));
+ *pp += 4; /* Skip over "cache type" */
+ *pp += 4; /* Reserved */
+ }
+
+ /* Common oloc settings */
oloc->holding_file = FALSE;
- /* decode header */
- *pp += H5F_SIZEOF_SIZE(f); /* Skip over local heap address */
- H5F_addr_decode(f, pp, &(oloc->addr));
- *pp += 4; /* Skip over "cache type" */
- *pp += 4; /* Reserved */
-
/* Set decode pointer */
*pp = p_ret + H5G_SIZEOF_ENTRY(f);
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_obj_ent_decode() */
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index 31e5713..38c7628 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -100,14 +100,14 @@ typedef union H5G_cache_t {
* also appears in the object header to which this symbol table entry
* points.
*/
-typedef struct H5G_entry_t {
+struct H5G_entry_t {
hbool_t dirty; /*entry out-of-date? */
H5G_cache_type_t type; /*type of information cached */
H5G_cache_t cache; /*cached data from object header */
size_t name_off; /*offset of name within name heap */
haddr_t header; /*file address of object header */
H5F_t *file; /*file to which this obj hdr belongs */
-} H5G_entry_t;
+};
/*
* A symbol table node is a collection of symbol table entries. It can
@@ -402,6 +402,10 @@ H5_DLL herr_t H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name,
H5O_link_t *lnk, hid_t dxpl_id);
H5_DLL herr_t H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order,
hsize_t n, H5O_link_t *lnk, hid_t dxpl_id);
+#ifndef H5_STRICT_FORMAT_CHECKS
+H5_DLL herr_t H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id,
+ H5O_stab_t *alt_stab);
+#endif /* H5_STRICT_FORMAT_CHECKS */
#ifndef H5_NO_DEPRECATED_SYMBOLS
H5_DLL H5G_obj_t H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx,
hid_t dxpl_id);
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index 591be6b..b1db96f 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -145,6 +145,7 @@ typedef struct {
typedef struct H5G_t H5G_t;
typedef struct H5G_shared_t H5G_shared_t;
+typedef struct H5G_entry_t H5G_entry_t;
/*
* Library prototypes... These are the ones that other packages routinely
@@ -181,7 +182,7 @@ H5_DLL herr_t H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream
* These functions operate on group object locations.
*/
H5_DLL herr_t H5G_obj_ent_decode(H5F_t *f, const uint8_t **pp,
- struct H5O_loc_t *oloc);
+ struct H5O_loc_t *oloc, H5G_entry_t **entp);
H5_DLL herr_t H5G_obj_ent_encode(const H5F_t *f, uint8_t **pp,
const struct H5O_loc_t *oloc);
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index f79d78b..c2df8e7 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -982,6 +982,81 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5G_stab_lookup_by_idx() */
+#ifndef H5_STRICT_FORMAT_CHECKS
+
+/*-------------------------------------------------------------------------
+ * Function: H5G_stab_valid
+ *
+ * Purpose: Verify that a group's symbol table message is valid. If
+ * provided, the addresses in alt_stab will be tried if the
+ * addresses in the group's stab message are invalid, and
+ * the stab message will be updated if necessary.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Neil Fortner
+ * nfortne2@hdfgroup.org
+ * Mar 17, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab)
+{
+ H5O_stab_t stab; /* Current symbol table */
+ H5HL_t *heap = NULL; /* Pointer to local heap */
+ hbool_t changed = FALSE; /* Whether stab has been modified */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5G_stab_valid, FAIL)
+
+ /* Read the symbol table message */
+ H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id);
+
+ /* Check if the symbol table message's b-tree address is valid */
+ if(H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr) < 0) {
+ /* Address is invalid, try the b-tree address in the alternate symbol
+ * table message */
+ if(!alt_stab || H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, alt_stab->btree_addr) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to locate b-tree")
+ else {
+ /* The alternate symbol table's b-tree address is valid. Adjust the
+ * symbol table message in the group. */
+ stab.btree_addr = alt_stab->btree_addr;
+ changed = TRUE;
+ } /* end else */
+ } /* end if */
+
+ /* Check if the symbol table message's heap address is valid */
+ if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC_READ))) {
+ /* Address is invalid, try the heap address in the alternate symbol
+ * table message */
+ if(!alt_stab || NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, alt_stab->heap_addr, H5AC_READ)))
+ HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "unable to locate heap")
+ else {
+ /* The alternate symbol table's heap address is valid. Adjust the
+ * symbol table message in the group. */
+ stab.heap_addr = alt_stab->heap_addr;
+ changed = TRUE;
+ } /* end else */
+ } /* end if */
+
+ /* Update the symbol table message and clear errors if necessary */
+ if(changed) {
+ H5E_clear_stack(NULL);
+ if(H5O_msg_write(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME | H5O_UPDATE_FORCE, &stab, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to correct symbol table message")
+ } /* end if */
+
+done:
+ /* Release resources */
+ if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5G_stab_valid */
+#endif /* H5_STRICT_FORMAT_CHECKS */
+
#ifndef H5_NO_DEPRECATED_SYMBOLS
/*-------------------------------------------------------------------------
diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c
index eabb740..b750822 100644
--- a/src/H5HFbtree2.c
+++ b/src/H5HFbtree2.c
@@ -59,15 +59,6 @@
/* Local Prototypes */
/********************/
-/* v2 B-tree function callbacks */
-herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data);
-
/* v2 B-tree driver callbacks */
static herr_t H5HF_huge_btree2_indir_store(void *native, const void *udata);
static herr_t H5HF_huge_btree2_indir_retrieve(void *udata, const void *native);
diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c
index db9f7a1..60c6c9f 100644
--- a/src/H5HFhuge.c
+++ b/src/H5HFhuge.c
@@ -69,13 +69,13 @@
static herr_t H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id);
/* v2 B-tree function callbacks (in H5HFbtree2.c) */
-herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data);
-herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data);
+H5_DLL herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data);
/* Local 'huge' object support routines */
static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr);
diff --git a/src/H5HFsection.c b/src/H5HFsection.c
index 81b353f..91031be 100644
--- a/src/H5HFsection.c
+++ b/src/H5HFsection.c
@@ -3105,7 +3105,6 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_
unsigned start_col; /* Start column in indirect block */
unsigned end_entry; /* Entry for last block covered */
unsigned end_row; /* End row in indirect block */
- unsigned end_col; /* End column in indirect block */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce_row)
@@ -3132,7 +3131,6 @@ HDfprintf(stderr, "%s: row_start_entry = %u, row_end_entry = %u\n", FUNC, row_st
start_entry = (start_row * hdr->man_dtable.cparam.width) + start_col;
end_entry = (start_entry + sect->u.indirect.num_entries) - 1;
end_row = end_entry / hdr->man_dtable.cparam.width;
- end_col = end_entry % hdr->man_dtable.cparam.width;
/* Additional sanity check */
HDassert(sect->u.indirect.span_size > 0);
@@ -3144,7 +3142,7 @@ HDfprintf(stderr, "%s: row_start_entry = %u, row_end_entry = %u\n", FUNC, row_st
HDfprintf(stderr, "%s: sect->sect_info = {%a, %Hu, %u, %s}\n", FUNC, sect->sect_info.addr, sect->sect_info.size, sect->sect_info.type, (sect->sect_info.state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
HDfprintf(stderr, "%s: sect->u.indirect.parent = %p, sect->u.indirect.par_entry = %u\n", FUNC, sect->u.indirect.parent, sect->u.indirect.par_entry);
HDfprintf(stderr, "%s: start_entry = %u, start_row = %u, start_col = %u\n", FUNC, start_entry, start_row, start_col);
-HDfprintf(stderr, "%s: end_entry = %u, end_row = %u, end_col = %u\n", FUNC, end_entry, end_row, end_col);
+HDfprintf(stderr, "%s: end_entry = %u, end_row = %u\n", FUNC, end_entry, end_row);
#endif /* QAK */
/* Check if we should allocate from end of indirect section */
@@ -3400,7 +3398,6 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s
unsigned start_col; /* Start column in indirect block */
unsigned end_entry; /* Entry for last block covered */
unsigned end_row; /* End row in indirect block */
- unsigned end_col; /* End column in indirect block */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce)
@@ -3422,12 +3419,11 @@ HDfprintf(stderr, "%s: child_entry = %u\n", FUNC, child_entry);
start_entry = (start_row * hdr->man_dtable.cparam.width) + start_col;
end_entry = (start_entry + sect->u.indirect.num_entries) - 1;
end_row = end_entry / hdr->man_dtable.cparam.width;
- end_col = end_entry % hdr->man_dtable.cparam.width;
#ifdef QAK
HDfprintf(stderr, "%s: sect->sect_info = {%a, %Hu, %u, %s}\n", FUNC, sect->sect_info.addr, sect->sect_info.size, sect->sect_info.type, (sect->sect_info.state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
HDfprintf(stderr, "%s: sect->u.indirect.parent = %p, sect->u.indirect.par_entry = %u\n", FUNC, sect->u.indirect.parent, sect->u.indirect.par_entry);
HDfprintf(stderr, "%s: start_entry = %u, start_row = %u, start_col = %u\n", FUNC, start_entry, start_row, start_col);
-HDfprintf(stderr, "%s: end_entry = %u, end_row = %u, end_col = %u\n", FUNC, end_entry, end_row, end_col);
+HDfprintf(stderr, "%s: end_entry = %u, end_row = %u\n", FUNC, end_entry, end_row);
#endif /* QAK */
/* Check how to adjust section for allocated entry */
@@ -3780,9 +3776,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id,
unsigned start_row1, start_col1; /* Starting row & column for section #1 */
unsigned end_entry1; /* End entry for section #1 */
unsigned end_row1; /* Ending row for section #1 */
- unsigned start_entry2; /* Start entry for section #2 */
- unsigned start_row2, start_col2; /* Starting row & column for section #2 */
- unsigned end_entry2; /* End entry for section #2 */
+ unsigned start_row2; /* Starting row for section #2 */
hbool_t merged_rows; /* Flag to indicate that rows was merged together */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3831,12 +3825,9 @@ HDfprintf(stderr, "%s: sect1->u.indirect.num_entries = %u\n", FUNC, sect1->u.ind
HDfprintf(stderr, "%s: end_row1 = %u, end_entry1 = %u\n", FUNC, end_row1, end_entry1);
#endif /* QAK */
start_row2 = sect2->u.indirect.row;
- start_col2 = sect2->u.indirect.col;
- start_entry2 = (start_row2 * hdr->man_dtable.cparam.width) + start_col2;
- end_entry2 = (start_entry2 + sect2->u.indirect.num_entries) - 1;
#ifdef QAK
HDfprintf(stderr, "%s: sect2->u.indirect.dir_nrows = %u\n", FUNC, sect2->u.indirect.dir_nrows);
-HDfprintf(stderr, "%s: start_row2 = %u, start_col2 = %u, start_entry2 = %u\n", FUNC, start_row2, start_col2, start_entry2);
+HDfprintf(stderr, "%s: start_row2 = %u\n", FUNC, start_row2);
HDfprintf(stderr, "%s: sect2->u.indirect.num_entries = %u\n", FUNC, sect2->u.indirect.num_entries);
#endif /* QAK */
diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c
index 43c1ed0..7030da5 100644
--- a/src/H5HGdbg.c
+++ b/src/H5HGdbg.c
@@ -113,7 +113,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
(unsigned long)H5HG_ALIGN(h->obj[u].size));
p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR (f);
for (j=0; j<h->obj[u].size; j+=16) {
- fprintf (stream, "%*s%04d: ", indent+6, "", j);
+ fprintf (stream, "%*s%04u: ", indent+6, "", j);
for (k=0; k<16; k++) {
if (8==k) fprintf (stream, " ");
if (j+k<h->obj[u].size) {
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index 667f28c..e61d899 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -403,7 +403,7 @@ H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src,
*/
static void *
H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
- hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id)
+ hbool_t *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id)
{
H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src;
H5O_ainfo_t *ainfo_dst = NULL;
@@ -467,7 +467,7 @@ static herr_t
H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src,
H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info)
{
- H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src;
+ const H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5O_ainfo_post_copy_file)
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 24e443c..fe8c627 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -115,20 +115,23 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{
*
* Purpose: Decodes a datatype
*
- * Return: Non-negative on success/Negative on failure
+ * Return: TRUE if we can upgrade the parent type's version even
+ * with strict format checks
+ * FALSE if we cannot
+ * Negative on failure
*
* Programmer: Robb Matzke
* Monday, December 8, 1997
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static htri_t
H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **pp, H5T_t *dt)
{
unsigned flags, version;
unsigned i;
size_t z;
- herr_t ret_value = SUCCEED; /* Return value */
+ htri_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_decode_helper)
@@ -254,6 +257,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
unsigned offset_nbytes; /* Size needed to encode member offsets */
size_t max_memb_pos = 0; /* Maximum member covered, so far */
unsigned max_version = 0; /* Maximum member version */
+ hbool_t upgrade_to = 0; /* Version number we can "soft" upgrade to */
unsigned j;
/* Compute the # of bytes required to store a member offset */
@@ -271,6 +275,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
for(i = 0; i < dt->shared->u.compnd.nmembs; i++) {
unsigned ndims = 0; /* Number of dimensions of the array field */
+ htri_t can_upgrade; /* Whether we can upgrade this type's version */
hsize_t dim[H5O_LAYOUT_NDIMS]; /* Dimensions of the array */
H5T_t *array_dt; /* Temporary pointer to the array datatype */
H5T_t *temp_type; /* Temporary pointer to the field's datatype */
@@ -318,16 +323,20 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Decode the field's datatype information */
- if(H5O_dtype_decode_helper(f, ioflags, pp, temp_type) < 0) {
+ if((can_upgrade = H5O_dtype_decode_helper(f, ioflags, pp, temp_type)) < 0) {
for(j = 0; j <= i; j++)
H5MM_xfree(dt->shared->u.compnd.memb[j].name);
H5MM_xfree(dt->shared->u.compnd.memb);
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode member type")
} /* end if */
- /* Keep track of the maximum member version found */
- if(temp_type->shared->version > max_version)
- max_version = temp_type->shared->version;
+ /* Upgrade the version if we can and it is necessary */
+ if(can_upgrade && temp_type->shared->version > version) {
+ upgrade_to = temp_type->shared->version;
+
+ /* Pass "can_upgrade" flag down to parent type */
+ ret_value = TRUE;
+ } /* end if */
/* Go create the array datatype now, for older versions of the datatype message */
if(version == H5O_DTYPE_VERSION_1) {
@@ -346,9 +355,26 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
/* Make the array type the type that is set for the field */
temp_type = array_dt;
+
+ /* Reset array version if NOCHANGE is specified (i.e. h5debug) */
+ if(*ioflags & H5O_DECODEIO_NOCHANGE)
+ temp_type->shared->version = H5O_DTYPE_VERSION_1;
+ else {
+ /* Otherwise upgrade the compound version */
+ if(upgrade_to < temp_type->shared->version)
+ upgrade_to = temp_type->shared->version;
+
+ /* Set the return value to indicate that we should freely
+ * upgrade parent types */
+ ret_value = TRUE;
+ } /* end else */
} /* end if */
} /* end if */
+ /* Keep track of the maximum member version found */
+ if(temp_type->shared->version > max_version)
+ max_version = temp_type->shared->version;
+
/*
* Set the "force conversion" flag if VL datatype fields exist in this
* type or any component types
@@ -397,6 +423,17 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p
dt->shared->u.compnd.packed = FALSE;
} /* end if */
} /* end for */
+
+ /* Upgrade the compound if requested */
+ if(version < upgrade_to) {
+ version = upgrade_to;
+ if(H5T_upgrade_version(dt, upgrade_to) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade compound encoding version")
+ /* We won't mark the message dirty since there were no
+ * errors in the file, simply type versions that we will no
+ * longer encode. */
+ } /* end if */
+
/* Check that no member of this compound has a version greater
* than the compound itself. */
H5O_DTYPE_CHECK_VERSION(dt, version, max_version, ioflags, "compound", FAIL)
@@ -1580,11 +1617,11 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
"Version:", dt->shared->version);
if (H5T_COMPOUND == dt->shared->type) {
- fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth,
+ fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Number of members:",
dt->shared->u.compnd.nmembs);
for(i = 0; i < dt->shared->u.compnd.nmembs; i++) {
- sprintf(buf, "Member %d:", i);
+ sprintf(buf, "Member %u:", i);
fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
buf,
dt->shared->u.compnd.memb[i].name);
@@ -1597,11 +1634,11 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
} else if(H5T_ENUM == dt->shared->type) {
fprintf(stream, "%*s%s\n", indent, "", "Base type:");
H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3));
- fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth,
+ fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Number of members:",
dt->shared->u.enumer.nmembs);
for(i = 0; i < dt->shared->u.enumer.nmembs; i++) {
- sprintf(buf, "Member %d:", i);
+ sprintf(buf, "Member %u:", i);
fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
buf,
dt->shared->u.enumer.name[i]);
@@ -1678,7 +1715,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
s = "disk";
break;
default:
- sprintf(buf, "H5T_LOC_%d", dt->shared->u.vlen.loc);
+ sprintf(buf, "H5T_LOC_%d", (int)dt->shared->u.vlen.loc);
s = buf;
break;
} /* end switch */
@@ -1723,7 +1760,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
s);
} /* end if */
} else if(H5T_ARRAY == dt->shared->type) {
- fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth,
+ fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Rank:",
dt->shared->u.array.ndims);
fprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:");
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index 286240c..4a9ecb5 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -393,7 +393,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "message type not found")
/* Check for modifying a constant message */
- if(idx_msg->flags & H5O_MSG_FLAG_CONSTANT)
+ if(!(update_flags & H5O_UPDATE_FORCE) && (idx_msg->flags & H5O_MSG_FLAG_CONSTANT))
HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify constant message")
/* This message is shared, but it's being modified. */
else if((idx_msg->flags & H5O_MSG_FLAG_SHARED) || (idx_msg->flags & H5O_MSG_FLAG_SHAREABLE)) {
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index c623b73..c2116bb 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -79,6 +79,7 @@ typedef struct H5O_t H5O_t;
/* Flags for updating messages */
#define H5O_UPDATE_TIME 0x01u
+#define H5O_UPDATE_FORCE 0x02u /* Force updating the message */
/* Hash value constants */
#define H5O_HASH_SIZE 32
diff --git a/src/H5RC.c b/src/H5RC.c
index 49e26a8..d9f62c3 100644
--- a/src/H5RC.c
+++ b/src/H5RC.c
@@ -55,25 +55,25 @@ H5FL_DEFINE_STATIC(H5RC_t);
H5RC_t *
H5RC_create(void *o, H5RC_free_func_t free_func)
{
- H5RC_t *ret_value=NULL; /* Return value */
+ H5RC_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5RC_create,NULL);
+ FUNC_ENTER_NOAPI(H5RC_create, NULL)
/* Sanity check */
HDassert(o);
HDassert(free_func);
/* Allocate ref-counted string structure */
- if((ret_value=H5FL_MALLOC(H5RC_t))==NULL)
- HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed");
+ if(NULL == (ret_value = H5FL_MALLOC(H5RC_t)))
+ HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed")
/* Set the internal fields */
- ret_value->o=o;
- ret_value->n=1;
- ret_value->free_func=free_func;
+ ret_value->o = o;
+ ret_value->n = 1;
+ ret_value->free_func = free_func;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5RC_create() */
diff --git a/src/H5RS.c b/src/H5RS.c
index 0142c1f..6456ac8 100644
--- a/src/H5RS.c
+++ b/src/H5RS.c
@@ -63,7 +63,7 @@ H5RS_xstrdup(const char *s)
{
char *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5RS_xstrdup)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_xstrdup)
if(s) {
ret_value = (char *)H5FL_BLK_MALLOC(str_buf, HDstrlen(s) + 1);
@@ -99,21 +99,21 @@ H5RS_xstrdup(const char *s)
H5RS_str_t *
H5RS_create(const char *s)
{
- H5RS_str_t *ret_value=NULL; /* Return value */
+ H5RS_str_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5RS_create,NULL);
+ FUNC_ENTER_NOAPI(H5RS_create, NULL)
/* Allocate ref-counted string structure */
- if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL)
- HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed");
+ if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t)))
+ HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set the internal fields */
- ret_value->s=H5RS_xstrdup(s);
- ret_value->wrapped=0;
- ret_value->n=1;
+ ret_value->s = H5RS_xstrdup(s);
+ ret_value->wrapped = 0;
+ ret_value->n = 1;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5RS_create() */
@@ -139,21 +139,21 @@ done:
H5RS_str_t *
H5RS_wrap(const char *s)
{
- H5RS_str_t *ret_value=NULL; /* Return value */
+ H5RS_str_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5RS_wrap,NULL);
+ FUNC_ENTER_NOAPI(H5RS_wrap, NULL)
/* Allocate ref-counted string structure */
- if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL)
- HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed");
+ if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t)))
+ HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set the internal fields */
- ret_value->s=(char*)s; /* (Cast away const OK - QAK) */
- ret_value->wrapped=1;
- ret_value->n=1;
+ ret_value->s = (char*)s; /* (Cast away const OK - QAK) */
+ ret_value->wrapped = 1;
+ ret_value->n = 1;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5RS_wrap() */
@@ -181,21 +181,21 @@ done:
H5RS_str_t *
H5RS_own(char *s)
{
- H5RS_str_t *ret_value=NULL; /* Return value */
+ H5RS_str_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5RS_own,NULL);
+ FUNC_ENTER_NOAPI(H5RS_own, NULL)
/* Allocate ref-counted string structure */
- if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL)
- HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed");
+ if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t)))
+ HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set the internal fields */
- ret_value->s=s;
- ret_value->wrapped=0;
- ret_value->n=1;
+ ret_value->s = s;
+ ret_value->wrapped = 0;
+ ret_value->n = 1;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5RS_own() */
@@ -259,25 +259,25 @@ H5RS_decr(H5RS_str_t *rs)
herr_t
H5RS_incr(H5RS_str_t *rs)
{
- FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr)
/* Sanity check */
- assert(rs);
- assert(rs->n > 0);
+ HDassert(rs);
+ HDassert(rs->n > 0);
/* If the ref-counted string started life as a wrapper around an existing
* string, duplicate the string now, so that the wrapped string can go out
* scope appropriately.
*/
if(rs->wrapped) {
- rs->s=H5RS_xstrdup(rs->s);
- rs->wrapped=0;
+ rs->s = H5RS_xstrdup(rs->s);
+ rs->wrapped = 0;
} /* end if */
/* Increment reference count for string */
rs->n++;
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5RS_incr() */
@@ -303,14 +303,14 @@ H5RS_incr(H5RS_str_t *rs)
H5RS_str_t *
H5RS_dup(H5RS_str_t *ret_value)
{
- FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup)
/* Check for valid reference counted string */
- if(ret_value!=NULL)
+ if(ret_value != NULL)
/* Increment reference count for string */
ret_value->n++;
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5RS_dup() */
@@ -335,7 +335,7 @@ H5RS_dup(H5RS_str_t *ret_value)
H5RS_str_t *
H5RS_dup_str(const char *s)
{
- char *new_str = NULL; /* Duplicate of string */
+ char *new_str; /* Duplicate of string */
size_t path_len; /* Length of the path */
H5RS_str_t *ret_value;
@@ -387,15 +387,15 @@ int
H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2)
{
/* Can't return invalid value from this function */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_cmp);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_cmp)
/* Sanity check */
- assert(rs1);
- assert(rs1->s);
- assert(rs2);
- assert(rs2->s);
+ HDassert(rs1);
+ HDassert(rs1->s);
+ HDassert(rs2);
+ HDassert(rs2->s);
- FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s,rs2->s));
+ FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s, rs2->s))
} /* end H5RS_cmp() */
@@ -420,13 +420,13 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2)
ssize_t
H5RS_len(const H5RS_str_t *rs)
{
- FUNC_ENTER_NOAPI_NOFUNC(H5RS_len);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_len)
/* Sanity check */
- assert(rs);
- assert(rs->s);
+ HDassert(rs);
+ HDassert(rs->s);
- FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s));
+ FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s))
} /* end H5RS_len() */
@@ -454,13 +454,13 @@ H5RS_len(const H5RS_str_t *rs)
char *
H5RS_get_str(const H5RS_str_t *rs)
{
- FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str)
/* Sanity check */
- assert(rs);
- assert(rs->s);
+ HDassert(rs);
+ HDassert(rs->s);
- FUNC_LEAVE_NOAPI(rs->s);
+ FUNC_LEAVE_NOAPI(rs->s)
} /* end H5RS_get_str() */
@@ -486,12 +486,12 @@ H5RS_get_str(const H5RS_str_t *rs)
unsigned
H5RS_get_count(const H5RS_str_t *rs)
{
- FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count)
/* Sanity check */
- assert(rs);
- assert(rs->n>0);
+ HDassert(rs);
+ HDassert(rs->n > 0);
- FUNC_LEAVE_NOAPI(rs->n);
+ FUNC_LEAVE_NOAPI(rs->n)
} /* end H5RS_get_count() */
diff --git a/src/H5ST.c b/src/H5ST.c
index 7dee73f..6d14115 100644
--- a/src/H5ST.c
+++ b/src/H5ST.c
@@ -50,19 +50,19 @@ H5FL_DEFINE_STATIC(H5ST_tree_t);
H5ST_tree_t *
H5ST_create(void)
{
- H5ST_tree_t *ret_value=NULL; /* Return value */
+ H5ST_tree_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_create,NULL);
+ FUNC_ENTER_NOAPI(H5ST_create, NULL)
/* Allocate wrapper for TST */
- if((ret_value=H5FL_MALLOC(H5ST_tree_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,NULL,"memory allocation failed");
+ if(NULL == (ret_value = H5FL_MALLOC(H5ST_tree_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set the internal fields */
- ret_value->root=NULL;
+ ret_value->root = NULL;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_create() */
@@ -178,16 +178,16 @@ H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj)
p = &tree->root;
while((pp = *p)) {
/* If this node matches the character in the key, then drop down to the lower tree */
- if ((d = *s - pp->splitchar) == 0) {
- if (*s++ == 0)
- HGOTO_ERROR(H5E_TST,H5E_EXISTS,FAIL,"key already in tree");
+ if(0 == (d = *s - pp->splitchar)) {
+ if(*s++ == 0)
+ HGOTO_ERROR(H5E_TST, H5E_EXISTS, FAIL, "key already in tree")
up=pp;
p = &(pp->eqkid);
} /* end if */
else {
/* Walk through the current tree, searching for the matching character */
- parent=pp;
- if (d < 0)
+ parent = pp;
+ if(d < 0)
p = &(pp->lokid);
else
p = &(pp->hikid);
@@ -196,8 +196,8 @@ H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj)
/* Finish walking through the key string, adding nodes until the end */
for (;;) {
- if((*p = H5FL_MALLOC(H5ST_node_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,FAIL,"memory allocation failed");
+ if(NULL == (*p = H5FL_MALLOC(H5ST_node_t)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
pp = *p;
pp->splitchar = *s;
pp->up = up;
@@ -205,19 +205,19 @@ H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj)
pp->lokid = pp->eqkid = pp->hikid = NULL;
/* If this is the end of the key string, break out */
- if (*s++ == 0) {
- pp->eqkid = (H5ST_ptr_t) obj;
+ if(*s++ == 0) {
+ pp->eqkid = (H5ST_ptr_t)obj;
break;
} /* end if */
/* Continue to next character */
- parent=NULL;
- up=pp;
+ parent = NULL;
+ up = pp;
p = &(pp->eqkid);
} /* end for */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_insert() */
@@ -247,7 +247,7 @@ H5ST_search(H5ST_tree_t *tree, const char *s)
H5ST_ptr_t p; /* Temporary pointer to TST node */
htri_t ret_value=FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOFUNC(H5ST_search);
+ FUNC_ENTER_NOAPI_NOFUNC(H5ST_search)
p = tree->root;
while (p) {
@@ -262,7 +262,7 @@ H5ST_search(H5ST_tree_t *tree, const char *s)
} /* end while */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_search() */
@@ -289,9 +289,9 @@ done:
static H5ST_ptr_t
H5ST_find_internal(H5ST_ptr_t p, const char *s)
{
- H5ST_ptr_t ret_value=NULL; /* Return value */
+ H5ST_ptr_t ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_find_internal);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_find_internal)
while (p) {
if (*s < p->splitchar)
@@ -305,7 +305,7 @@ H5ST_find_internal(H5ST_ptr_t p, const char *s)
} /* end while */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_find_internal() */
@@ -332,15 +332,15 @@ done:
H5ST_ptr_t
H5ST_find(H5ST_tree_t *tree, const char *s)
{
- H5ST_ptr_t ret_value=NULL; /* Return value */
+ H5ST_ptr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_find,NULL);
+ FUNC_ENTER_NOAPI(H5ST_find, NULL)
- if((ret_value=H5ST_find_internal(tree->root,s))==NULL)
- HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"key not found in TST");
+ if(NULL == (ret_value = H5ST_find_internal(tree->root, s)))
+ HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_find() */
@@ -369,17 +369,17 @@ H5ST_locate(H5ST_tree_t *tree, const char *s)
H5ST_ptr_t node; /* Pointer to node located */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_locate,NULL);
+ FUNC_ENTER_NOAPI(H5ST_locate, NULL)
/* Locate the node to remove */
- if((node=H5ST_find_internal(tree->root,s))==NULL)
- HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"key not found in TST");
+ if(NULL == (node = H5ST_find_internal(tree->root, s)))
+ HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
/* Get the pointer to the object to return */
- ret_value=node->eqkid;
+ ret_value = node->eqkid;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5ST_locate() */
@@ -404,28 +404,28 @@ done:
static H5ST_ptr_t
H5ST_findfirst_internal(H5ST_ptr_t p)
{
- H5ST_ptr_t ret_value=NULL; /* Return value */
+ H5ST_ptr_t ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_findfirst_internal);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_findfirst_internal)
while(p) {
/* Find least node in current tree */
while(p->lokid)
- p=p->lokid;
+ p = p->lokid;
/* Is least node '\0'? */
- if(p->splitchar=='\0') {
+ if(p->splitchar == '\0') {
/* Return it */
HGOTO_DONE(p);
} /* end if */
else {
/* Go down to next level of tree */
- p=p->eqkid;
+ p = p->eqkid;
} /* end else */
} /* end while */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_findfirst_internal() */
@@ -452,13 +452,13 @@ H5ST_findfirst(H5ST_tree_t *tree)
{
H5ST_ptr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_findfirst,NULL);
+ FUNC_ENTER_NOAPI(H5ST_findfirst, NULL)
- if((ret_value=H5ST_findfirst_internal(tree->root))==NULL)
+ if(NULL == (ret_value = H5ST_findfirst_internal(tree->root)))
HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"no nodes in TST");
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_findfirst() */
@@ -483,40 +483,40 @@ done:
static H5ST_ptr_t
H5ST_getnext(H5ST_ptr_t p)
{
- H5ST_ptr_t ret_value=NULL; /* Return value */
+ H5ST_ptr_t ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_getnext);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_getnext)
/* If the node to continue from has higher-valued nodes attached */
if(p->hikid) {
/* Go to first higher-valued node */
- p=p->hikid;
+ p = p->hikid;
/* Find least node from here */
while(p->lokid)
- p=p->lokid;
+ p = p->lokid;
HGOTO_DONE(p);
} /* end if */
else {
H5ST_ptr_t q; /* Temporary TST node pointer */
/* Go up one level in current tree */
- q=p->parent;
- if(q==NULL)
+ q = p->parent;
+ if(q == NULL)
HGOTO_DONE(NULL);
/* While the previous node was the higher-valued node, keep backing up the tree */
- while(q->hikid==p) {
- p=q;
- q=p->parent;
- if(q==NULL)
+ while(q->hikid == p) {
+ p = q;
+ q = p->parent;
+ if(NULL == q)
HGOTO_DONE(NULL);
} /* end while */
HGOTO_DONE(q);
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_getnext() */
@@ -542,22 +542,22 @@ H5ST_ptr_t
H5ST_findnext(H5ST_ptr_t p)
{
H5ST_ptr_t q; /* Temporary pointer to TST node */
- H5ST_ptr_t ret_value=NULL; /* Return value */
+ H5ST_ptr_t ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOFUNC(H5ST_findnext);
+ FUNC_ENTER_NOAPI_NOFUNC(H5ST_findnext)
/* Find the next node at the current level, or go back up the tree */
do {
- q=H5ST_getnext(p);
+ q = H5ST_getnext(p);
if(q) {
HGOTO_DONE(H5ST_findfirst_internal(q->eqkid));
} /* end if */
else
- p=p->up;
+ p = p->up;
} while(p);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_findnext() */
@@ -661,15 +661,15 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p)
herr_t
H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p)
{
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_delete,FAIL);
+ FUNC_ENTER_NOAPI(H5ST_delete, FAIL)
- if(H5ST_delete_internal(&tree->root,p)<0)
- HGOTO_ERROR(H5E_TST,H5E_CANTDELETE,FAIL,"can't delete node from TST");
+ if(H5ST_delete_internal(&tree->root, p) < 0)
+ HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, FAIL, "can't delete node from TST")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5ST_delete() */
@@ -698,21 +698,21 @@ H5ST_remove(H5ST_tree_t *tree, const char *s)
H5ST_ptr_t node; /* Pointer to node to remove */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_remove,NULL);
+ FUNC_ENTER_NOAPI(H5ST_remove, NULL)
/* Locate the node to remove */
- if((node=H5ST_find_internal(tree->root,s))==NULL)
- HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"key not found in TST");
+ if(NULL == (node = H5ST_find_internal(tree->root, s)))
+ HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST")
/* Get the pointer to the object to return */
- ret_value=node->eqkid;
+ ret_value = node->eqkid;
/* Remove the node from the TST */
- if(H5ST_delete_internal(&tree->root,node)<0)
- HGOTO_ERROR(H5E_TST,H5E_CANTDELETE,NULL,"can't delete node from TST");
+ if(H5ST_delete_internal(&tree->root, node) < 0)
+ HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, NULL, "can't delete node from TST")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5ST_remove() */
#ifdef H5ST_DEBUG
@@ -738,26 +738,26 @@ done:
herr_t
H5ST_dump_internal(H5ST_ptr_t p)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_dump_internal);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_dump_internal)
- if (p) {
- printf("p=%p\n",p);
- printf("\tp->up=%p\n",p->up);
- printf("\tp->parent=%p\n",p->parent);
- printf("\tp->lokid=%p\n",p->lokid);
- printf("\tp->hikid=%p\n",p->hikid);
- printf("\tp->eqkid=%p\n",p->eqkid);
- printf("\tp->splitchar=%c\n",p->splitchar);
+ if(p) {
+ printf("p=%p\n", p);
+ printf("\tp->up=%p\n", p->up);
+ printf("\tp->parent=%p\n", p->parent);
+ printf("\tp->lokid=%p\n", p->lokid);
+ printf("\tp->hikid=%p\n", p->hikid);
+ printf("\tp->eqkid=%p\n", p->eqkid);
+ printf("\tp->splitchar=%c\n", p->splitchar);
H5ST_dump_internal(p->lokid);
- if (p->splitchar)
+ if(p->splitchar)
H5ST_dump_internal(p->eqkid);
else
- printf("%s\n", (char *) p->eqkid);
+ printf("%s\n", (char *)p->eqkid);
H5ST_dump_internal(p->hikid);
} /* end if */
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5ST_dump_internal() */
@@ -782,11 +782,12 @@ H5ST_dump_internal(H5ST_ptr_t p)
herr_t
H5ST_dump(H5ST_tree_t *tree)
{
- FUNC_ENTER_NOAPI_NOFUNC(H5ST_dump,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5ST_dump, NULL)
/* Dump the tree */
H5ST_dump_internal(tree->root);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5ST_dump() */
#endif /* H5ST_DEBUG */
+
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 1f69706..72d61e6 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -107,17 +107,17 @@ H5S_mpio_all_type( const H5S_t *space, size_t elmt_size,
hsize_t nelmts; /*total number of elmts */
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_all_type);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_all_type)
/* Check args */
- assert (space);
+ HDassert(space);
/* Just treat the entire extent as a block of bytes */
- if((snelmts = H5S_GET_EXTENT_NPOINTS(space))<0)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection")
- H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t);
+ if((snelmts = H5S_GET_EXTENT_NPOINTS(space)) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection")
+ H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, hsize_t);
- total_bytes = (hsize_t)elmt_size*nelmts;
+ total_bytes = (hsize_t)elmt_size * nelmts;
/* fill in the return values */
*new_type = MPI_BYTE;
@@ -126,7 +126,7 @@ H5S_mpio_all_type( const H5S_t *space, size_t elmt_size,
*is_derived_type = FALSE;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_mpio_all_type() */
@@ -210,7 +210,7 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size,
hbool_t *is_derived_type )
{
H5S_sel_iter_t sel_iter; /* Selection iteration info */
- hbool_t sel_iter_init=0; /* Selection iteration info has been initialized */
+ hbool_t sel_iter_init = FALSE; /* Selection iteration info has been initialized */
struct dim { /* less hassle than malloc/free & ilk */
hssize_t start;
@@ -234,27 +234,27 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size,
FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_hyper_type);
/* Check args */
- assert (space);
- assert(sizeof(MPI_Aint) >= sizeof(elmt_size));
- if (0==elmt_size)
+ HDassert(space);
+ HDassert(sizeof(MPI_Aint) >= sizeof(elmt_size));
+ if(0 == elmt_size)
goto empty;
/* Initialize selection iterator */
- if (H5S_select_iter_init(&sel_iter, space, elmt_size)<0)
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator");
- sel_iter_init=1; /* Selection iteration info has been initialized */
+ if(H5S_select_iter_init(&sel_iter, space, elmt_size) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator")
+ sel_iter_init = 1; /* Selection iteration info has been initialized */
/* Abbreviate args */
- diminfo=sel_iter.u.hyp.diminfo;
- assert (diminfo);
+ diminfo = sel_iter.u.hyp.diminfo;
+ HDassert(diminfo);
/* make a local copy of the dimension info so we can operate with them */
/* Check if this is a "flattened" regular hyperslab selection */
if(sel_iter.u.hyp.iter_rank!=0 && sel_iter.u.hyp.iter_rank<space->extent.rank) {
/* Flattened selection */
- rank=sel_iter.u.hyp.iter_rank;
- assert (rank >= 0 && rank<=H5S_MAX_RANK); /* within array bounds */
+ rank = sel_iter.u.hyp.iter_rank;
+ HDassert(rank >= 0 && rank <= H5S_MAX_RANK); /* within array bounds */
if (0==rank)
goto empty;
#ifdef H5S_DEBUG
@@ -288,7 +288,7 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size,
else {
/* Non-flattened selection */
rank = space->extent.rank;
- assert (rank >= 0 && rank<=H5S_MAX_RANK); /* within array bounds */
+ HDassert(rank >= 0 && rank<=H5S_MAX_RANK); /* within array bounds */
if (0==rank)
goto empty;
#ifdef H5S_DEBUG
@@ -509,47 +509,39 @@ H5S_mpio_span_hyper_type( const H5S_t *space,
MPI_Datatype *new_type,/* out: */
size_t *count,
hsize_t *extra_offset,
- hbool_t *is_derived_type ){
-
- MPI_Datatype span_type;
- H5S_hyper_span_t *ospan;
- H5S_hyper_span_info_t *odown;
- hsize_t *size;
- int rank;
- int mpi_code;
- herr_t ret_value = SUCCEED;
- MPI_Aint extent,lb;
-
-
- FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_span_hyper_type);
-
- /* Check args */
- assert (space);
+ hbool_t *is_derived_type )
+{
- /* assert(sizeof(MPI_Aint) >= sizeof(elmt_size)); not sure the reason*/
+ MPI_Datatype span_type;
+ H5S_hyper_span_t *ospan;
+ H5S_hyper_span_info_t *odown;
+ hsize_t *size;
+ int mpi_code;
+ herr_t ret_value = SUCCEED;
+ FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_span_hyper_type)
- rank = space->extent.rank;
+ /* Check args */
+ HDassert(space);
- /* size = HDcalloc((size_t)rank,sizeof(hsize_t)); */
- if (0==elmt_size)
+ if(0 == elmt_size)
goto empty;
size = space->extent.size;
- if(size == 0)
+ if(0 == size)
goto empty;
odown = space->select.sel_info.hslab->span_lst;
- if(odown == NULL)
- goto empty;
+ if(NULL == odown)
+ goto empty;
ospan = odown->head;
- if(ospan == NULL)
- goto empty;
+ if(NULL == ospan)
+ goto empty;
/* obtain derived data type */
- if(FAIL == H5S_obtain_datatype(space->extent.size,ospan,&span_type,elmt_size,rank))
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type");
+ if(FAIL == H5S_obtain_datatype(space->extent.size, ospan, &span_type, elmt_size, space->extent.rank))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type")
- if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&span_type)))
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&span_type)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code);
*new_type = span_type;
@@ -558,7 +550,7 @@ H5S_mpio_span_hyper_type( const H5S_t *space,
*extra_offset = 0;
*is_derived_type = TRUE;
- HGOTO_DONE(SUCCEED);
+ HGOTO_DONE(SUCCEED)
empty:
/* special case: empty hyperslab */
@@ -568,8 +560,8 @@ empty:
*is_derived_type = FALSE;
done:
- FUNC_LEAVE_NOAPI(ret_value);
- }
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_mpio_span_hyper_type() */
/*-------------------------------------------------------------------------
@@ -585,173 +577,162 @@ done:
* Programmer: kyang
*
*/
-static herr_t H5S_obtain_datatype(const hsize_t size[],
+static herr_t
+H5S_obtain_datatype(const hsize_t size[],
H5S_hyper_span_t* span,
MPI_Datatype *span_type,
size_t elmt_size,
int dimindex)
{
-
- int innercount,outercount;
- MPI_Datatype bas_type;
- MPI_Datatype temp_type;
- MPI_Datatype tempinner_type;
- MPI_Datatype *inner_type;
- int *blocklen;
- MPI_Aint *disp;
- MPI_Aint stride;
- MPI_Aint extent,lb;
- H5S_hyper_span_info_t *down;
- H5S_hyper_span_t *tspan;
- int mpi_code;
- herr_t ret_value = SUCCEED;
-
+ int innercount, outercount;
+ MPI_Datatype bas_type;
+ MPI_Datatype temp_type;
+ MPI_Datatype tempinner_type;
+ MPI_Datatype *inner_type;
+ int *blocklen;
+ MPI_Aint *disp;
+ MPI_Aint stride;
+ H5S_hyper_span_info_t *down;
+ H5S_hyper_span_t *tspan;
#ifdef H5_HAVE_MPI2
- MPI_Aint sizeaint,sizedtype;
+ MPI_Aint sizeaint, sizedtype;
#endif /* H5_HAVE_MPI2 */
- hsize_t total_lowd,total_lowd1;
- int i;
- int ret;
-
- FUNC_ENTER_NOAPI_NOINIT(H5S_obtain_datatype);
- assert(span);
-
- inner_type = NULL;
- down = NULL;
- tspan = NULL;
- down = span->down;
- tspan = span;
-
- outercount = 0;
-
-/* obtain the number of span tree for this dimension */
- while(tspan) {
- tspan = tspan->next;
- outercount ++;
- }
-
- if(outercount == 0) {
- span_type = NULL;
- return 0;
- }
+ hsize_t total_lowd, total_lowd1;
+ int i;
+ int mpi_code;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT(H5S_obtain_datatype)
+
+ HDassert(span);
+
+ inner_type = NULL;
+ down = NULL;
+ tspan = NULL;
+ down = span->down;
+ tspan = span;
+
+ /* obtain the number of span tree for this dimension */
+ outercount = 0;
+ while(tspan) {
+ tspan = tspan->next;
+ outercount++;
+ } /* end while */
+ if(outercount == 0)
+ HGOTO_DONE(SUCCEED)
/* MPI2 hasn't been widely acccepted, adding H5_HAVE_MPI2 for the future use */
#ifdef H5_HAVE_MPI2
- MPI_Type_extent(MPI_Aint,&sizeaint);
- MPI_Type_extent(MPI_Datatype,&sizedtype);
+ MPI_Type_extent(MPI_Aint, &sizeaint);
+ MPI_Type_extent(MPI_Datatype, &sizedtype);
- blocklen = (int *)HDcalloc((size_t)outercount,sizeof(int));
- disp = (MPI_Aint *)HDcalloc((size_t)outercount,sizeaint);
- inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount,sizedtype);
+ blocklen = (int *)HDcalloc((size_t)outercount, sizeof(int));
+ disp = (MPI_Aint *)HDcalloc((size_t)outercount, sizeaint);
+ inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount, sizedtype);
#else
- blocklen = (int *)HDcalloc((size_t)outercount,sizeof(int));
- disp = (MPI_Aint *)HDcalloc((size_t)outercount,sizeof(MPI_Aint));
- inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount,sizeof(MPI_Datatype));
+ blocklen = (int *)HDcalloc((size_t)outercount, sizeof(int));
+ disp = (MPI_Aint *)HDcalloc((size_t)outercount, sizeof(MPI_Aint));
+ inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount, sizeof(MPI_Datatype));
#endif
- tspan = span;
- outercount = 0;
+ tspan = span;
+ outercount = 0;
- /* if this is the fastest changing dimension, it is the base case for derived datatype. */
- if(down == NULL){
+ /* if this is the fastest changing dimension, it is the base case for derived datatype. */
+ if(down == NULL){
- assert(dimindex <= 1);
- if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE,&bas_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code);
+ HDassert(dimindex <= 1);
- if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&bas_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code);
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE,&bas_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code);
- while(tspan){
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&bas_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code);
- disp[outercount] = (MPI_Aint)elmt_size * tspan->low;
- blocklen[outercount] = tspan->nelem;
- tspan = tspan->next;
- outercount ++;
- }
+ while(tspan) {
+ disp[outercount] = (MPI_Aint)elmt_size * tspan->low;
+ blocklen[outercount] = tspan->nelem;
+ tspan = tspan->next;
+ outercount++;
+ } /* end while */
- if(MPI_SUCCESS != (mpi_code = MPI_Type_hindexed(outercount,blocklen,
- disp,bas_type,span_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_hindexed failed", mpi_code);
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_hindexed(outercount, blocklen, disp, bas_type, span_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_hindexed failed", mpi_code);
+ } /* end if */
+ else {/* dimindex is the rank of the dimension */
- }
- else {/* dimindex is the rank of the dimension */
+ HDassert(dimindex > 1);
- assert(dimindex >1);
- /* Calculate the total bytes of the lower dimension */
- total_lowd = 1; /* one dimension down */
- total_lowd1 = 1; /* two dimensions down */
+ /* Calculate the total bytes of the lower dimension */
+ total_lowd = 1; /* one dimension down */
+ total_lowd1 = 1; /* two dimensions down */
- for ( i = dimindex-1; i > 0; i--)
- total_lowd = total_lowd * size[i];
+ for ( i = dimindex-1; i > 0; i--)
+ total_lowd = total_lowd * size[i];
- for ( i = dimindex-1; i > 1; i--)
- total_lowd1 = total_lowd1 * size[i];
+ for ( i = dimindex-1; i > 1; i--)
+ total_lowd1 = total_lowd1 * size[i];
- while(tspan){
+ while(tspan) {
- /* Displacement should be in byte and should have dimension information */
- /* First using MPI Type vector to build derived data type for this span only */
- /* Need to calculate the disp in byte for this dimension. */
- /* Calculate the total bytes of the lower dimension */
+ /* Displacement should be in byte and should have dimension information */
+ /* First using MPI Type vector to build derived data type for this span only */
+ /* Need to calculate the disp in byte for this dimension. */
+ /* Calculate the total bytes of the lower dimension */
- disp[outercount] = tspan->low*total_lowd*elmt_size;
- blocklen[outercount] = 1;
+ disp[outercount] = tspan->low*total_lowd*elmt_size;
+ blocklen[outercount] = 1;
- /* generating inner derived datatype by using MPI_Type_hvector */
- if(FAIL == H5S_obtain_datatype(size,tspan->down->head,&temp_type,elmt_size,dimindex-1))
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type");
+ /* generating inner derived datatype by using MPI_Type_hvector */
+ if(FAIL == H5S_obtain_datatype(size,tspan->down->head,&temp_type,elmt_size,dimindex-1))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type")
- if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&temp_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code);
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&temp_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code);
- /* building the inner vector datatype */
- stride = total_lowd*elmt_size;
- innercount = tspan->nelem;
+ /* building the inner vector datatype */
+ stride = total_lowd*elmt_size;
+ innercount = tspan->nelem;
- if(MPI_SUCCESS != (mpi_code = MPI_Type_hvector(innercount,1,stride,temp_type,&tempinner_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_hvector failed", mpi_code);
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_hvector(innercount,1,stride,temp_type,&tempinner_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_hvector failed", mpi_code);
- if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&tempinner_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code);
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&tempinner_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code);
- if(MPI_SUCCESS != (mpi_code =MPI_Type_free(&temp_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed",mpi_code);
- inner_type[outercount] = tempinner_type;
- outercount ++;
- tspan = tspan->next;
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&temp_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed", mpi_code);
- }
+ inner_type[outercount] = tempinner_type;
+ outercount ++;
+ tspan = tspan->next;
+ } /* end while */
- /* building the whole vector datatype */
- if(MPI_SUCCESS != (mpi_code =
- MPI_Type_struct(outercount,blocklen,disp,inner_type,span_type)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code);
-
- }
+ /* building the whole vector datatype */
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_struct(outercount, blocklen, disp, inner_type, span_type)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code);
+ } /* end else */
- if(inner_type != NULL){
- if(down != NULL) {
- for(i=0;i<outercount;i++)
- if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&inner_type[i])))
- HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed",mpi_code);
- }
- }
+ if(inner_type != NULL && down != NULL) {
+ for(i = 0; i < outercount; i++)
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&inner_type[i])))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed", mpi_code);
+ } /* end if */
- if(inner_type != NULL)
- HDfree(inner_type);
- if(blocklen != NULL)
- HDfree(blocklen);
- if(disp != NULL)
- HDfree(disp);
+ if(inner_type != NULL)
+ HDfree(inner_type);
+ if(blocklen != NULL)
+ HDfree(blocklen);
+ if(disp != NULL)
+ HDfree(disp);
done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_obtain_datatype() */
@@ -791,7 +772,7 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_space_type);
/* Check args */
- assert (space);
+ HDassert(space);
/* Creat MPI type based on the kind of selection */
switch (H5S_GET_EXTENT_TYPE(space)) {
@@ -830,13 +811,13 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
break;
default:
- assert("unknown selection type" && 0);
+ HDassert("unknown selection type" && 0);
break;
} /* end switch */
break;
default:
- assert("unknown data space type" && 0);
+ HDassert("unknown data space type" && 0);
break;
}
@@ -845,3 +826,4 @@ done:
}
#endif /* H5_HAVE_PARALLEL */
+
diff --git a/src/H5Z.c b/src/H5Z.c
index 6ca352f..4df6abd 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -271,17 +271,17 @@ done:
herr_t
H5Z_register (const H5Z_class_t *cls)
{
- size_t i;
- herr_t ret_value=SUCCEED; /* Return value */
+ size_t i;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5Z_register, FAIL)
- assert (cls);
- assert (cls->id>=0 && cls->id<=H5Z_FILTER_MAX);
+ HDassert(cls);
+ HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX);
/* Is the filter already registered? */
- for (i=0; i<H5Z_table_used_g; i++)
- if (H5Z_table_g[i].id==cls->id)
+ for(i = 0; i < H5Z_table_used_g; i++)
+ if(H5Z_table_g[i].id == cls->id)
break;
/* Filter not already registered */
@@ -572,7 +572,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty
break;
default:
- assert("invalid prelude type" && 0);
+ HDassert("invalid prelude type" && 0);
} /* end switch */
} /* end else */
} /* end for */
diff --git a/src/H5err.txt b/src/H5err.txt
index 7f110b8..64e9729 100644
--- a/src/H5err.txt
+++ b/src/H5err.txt
@@ -169,6 +169,8 @@ MINOR, CACHE, H5E_CANTMARKDIRTY, Unable to mark a pinned entry as dirty
MINOR, CACHE, H5E_CANTDIRTY, Unable to mark metadata as dirty
MINOR, CACHE, H5E_CANTEXPUNGE, Unable to expunge a metadata cache entry
MINOR, CACHE, H5E_CANTRESIZE, Unable to resize a metadata cache entry
+MINOR, CACHE, H5E_CANTDEPEND, Unable to create a flush dependency
+MINOR, CACHE, H5E_CANTUNDEPEND, Unable to destroy a flush dependency
# B-tree related errors
MINOR, BTREE, H5E_NOTFOUND, Object not found
diff --git a/src/H5private.h b/src/H5private.h
index ea55a61..695b015 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1898,6 +1898,11 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
} /*end scope from beginning of FUNC_ENTER*/
+/* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */
+/* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */
+#define H5_STRINGIZE(x) #x
+#define H5_TOSTRING(x) H5_STRINGIZE(x)
+
/* Macro for "glueing" together items, for re-scanning macros */
#define H5_GLUE(x,y) x##y
#define H5_GLUE3(x,y,z) x##y##z
diff --git a/src/H5public.h b/src/H5public.h
index e0a9049..ab471b9 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -71,10 +71,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 34 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 36 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.34" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.36" /* 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 e49d68b..5433176 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -328,6 +328,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -339,9 +341,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
@@ -409,7 +409,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 = 24
+LT_VERS_REVISION = 26
LT_VERS_AGE = 0
H5detect_CFLAGS = -g
diff --git a/test/Makefile.in b/test/Makefile.in
index 29f30d0..49674dc 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -546,6 +546,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -557,9 +559,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/test/cache.c b/test/cache.c
index 8c1e328..65a6719 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -27,19 +27,19 @@
/* private function declarations: */
-static void smoke_check_1(void);
-static void smoke_check_2(void);
-static void smoke_check_3(void);
-static void smoke_check_4(void);
-static void smoke_check_5(void);
-static void smoke_check_6(void);
-static void smoke_check_7(void);
-static void smoke_check_8(void);
-static void smoke_check_9(void);
-static void smoke_check_10(void);
-static void write_permitted_check(void);
-static void check_insert_entry(void);
-static void check_flush_cache(void);
+static unsigned smoke_check_1(void);
+static unsigned smoke_check_2(void);
+static unsigned smoke_check_3(void);
+static unsigned smoke_check_4(void);
+static unsigned smoke_check_5(void);
+static unsigned smoke_check_6(void);
+static unsigned smoke_check_7(void);
+static unsigned smoke_check_8(void);
+static unsigned smoke_check_9(void);
+static unsigned smoke_check_10(void);
+static unsigned write_permitted_check(void);
+static unsigned check_insert_entry(void);
+static unsigned check_flush_cache(void);
static void check_flush_cache__empty_cache(H5C_t * cache_ptr);
static void check_flush_cache__multi_entry(H5C_t * cache_ptr);
static void check_flush_cache__multi_entry_test(H5C_t * cache_ptr,
@@ -92,36 +92,40 @@ static void check_flush_cache__flush_op_test(H5C_t * cache_ptr,
int check_size,
struct fo_flush_entry_check check[]);
static void check_flush_cache__flush_op_eviction_test(H5C_t * cache_ptr);
-static void check_flush_protected_err(void);
-static void check_get_entry_status(void);
-static void check_expunge_entry(void);
-static void check_multiple_read_protect(void);
-static void check_rename_entry(void);
+static unsigned check_flush_protected_err(void);
+static unsigned check_get_entry_status(void);
+static unsigned check_expunge_entry(void);
+static unsigned check_multiple_read_protect(void);
+static unsigned check_rename_entry(void);
static void check_rename_entry__run_test(H5C_t * cache_ptr, int test_num,
struct rename_entry_test_spec * spec_ptr);
-static void check_pin_protected_entry(void);
-static void check_resize_entry(void);
-static void check_evictions_enabled(void);
-static void check_destroy_pinned_err(void);
-static void check_destroy_protected_err(void);
-static void check_duplicate_insert_err(void);
-static void check_rename_err(void);
-static void check_double_pin_err(void);
-static void check_double_unpin_err(void);
-static void check_pin_entry_errs(void);
-static void check_double_protect_err(void);
-static void check_double_unprotect_err(void);
-static void check_mark_entry_dirty_errs(void);
-static void check_expunge_entry_errs(void);
-static void check_resize_entry_errs(void);
-static void check_unprotect_ro_dirty_err(void);
-static void check_protect_ro_rw_err(void);
-static void check_check_evictions_enabled_err(void);
-static void check_auto_cache_resize(void);
-static void check_auto_cache_resize_disable(void);
-static void check_auto_cache_resize_epoch_markers(void);
-static void check_auto_cache_resize_input_errs(void);
-static void check_auto_cache_resize_aux_fcns(void);
+static unsigned check_pin_protected_entry(void);
+static unsigned check_resize_entry(void);
+static unsigned check_evictions_enabled(void);
+static unsigned check_destroy_pinned_err(void);
+static unsigned check_destroy_protected_err(void);
+static unsigned check_duplicate_insert_err(void);
+static unsigned check_rename_err(void);
+static unsigned check_double_pin_err(void);
+static unsigned check_double_unpin_err(void);
+static unsigned check_pin_entry_errs(void);
+static unsigned check_double_protect_err(void);
+static unsigned check_double_unprotect_err(void);
+static unsigned check_mark_entry_dirty_errs(void);
+static unsigned check_expunge_entry_errs(void);
+static unsigned check_resize_entry_errs(void);
+static unsigned check_unprotect_ro_dirty_err(void);
+static unsigned check_protect_ro_rw_err(void);
+static unsigned check_check_evictions_enabled_err(void);
+static unsigned check_auto_cache_resize(void);
+static unsigned check_auto_cache_resize_disable(void);
+static unsigned check_auto_cache_resize_epoch_markers(void);
+static unsigned check_auto_cache_resize_input_errs(void);
+static unsigned check_auto_cache_resize_aux_fcns(void);
+static unsigned check_metadata_blizzard_absence(hbool_t fill_via_insertion);
+static unsigned check_flush_deps(void);
+static unsigned check_flush_deps_err(void);
+static unsigned check_flush_deps_order(void);
/**************************************************************************/
@@ -151,7 +155,7 @@ static void check_auto_cache_resize_aux_fcns(void);
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_1(void)
{
const char * fcn_name = "smoke_check_1";
@@ -167,12 +171,9 @@ smoke_check_1(void)
TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
pass = TRUE;
@@ -318,7 +319,7 @@ smoke_check_1(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_1() */
@@ -345,7 +346,7 @@ smoke_check_1(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_2(void)
{
const char * fcn_name = "smoke_check_2";
@@ -361,12 +362,9 @@ smoke_check_2(void)
TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
pass = TRUE;
@@ -512,7 +510,7 @@ smoke_check_2(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_2() */
@@ -538,7 +536,7 @@ smoke_check_2(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_3(void)
{
const char * fcn_name = "smoke_check_3";
@@ -554,12 +552,9 @@ smoke_check_3(void)
TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
pass = TRUE;
@@ -705,7 +700,7 @@ smoke_check_3(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_3() */
@@ -732,7 +727,7 @@ smoke_check_3(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_4(void)
{
const char * fcn_name = "smoke_check_4";
@@ -748,12 +743,9 @@ smoke_check_4(void)
TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
pass = TRUE;
@@ -899,7 +891,7 @@ smoke_check_4(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_4() */
@@ -926,7 +918,7 @@ smoke_check_4(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_5(void)
{
const char * fcn_name = "smoke_check_5";
@@ -995,7 +987,7 @@ smoke_check_5(void)
HDfprintf(stdout, " Long tests disabled.\n");
- return;
+ return 0; /* <========== note return */
}
if ( run_full_test ) {
@@ -1139,7 +1131,7 @@ smoke_check_5(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_5() */
@@ -1166,7 +1158,7 @@ smoke_check_5(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_6(void)
{
const char * fcn_name = "smoke_check_6";
@@ -1232,12 +1224,9 @@ smoke_check_6(void)
pass = TRUE;
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
if ( run_full_test ) {
@@ -1379,7 +1368,7 @@ smoke_check_6(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_6() */
@@ -1406,7 +1395,7 @@ smoke_check_6(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_7(void)
{
const char * fcn_name = "smoke_check_7";
@@ -1471,12 +1460,9 @@ smoke_check_7(void)
TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
if ( run_full_test ) {
@@ -1620,7 +1606,7 @@ smoke_check_7(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_7() */
@@ -1647,7 +1633,7 @@ smoke_check_7(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_8(void)
{
const char * fcn_name = "smoke_check_8";
@@ -1712,12 +1698,9 @@ smoke_check_8(void)
TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
if ( run_full_test ) {
@@ -1861,7 +1844,7 @@ smoke_check_8(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_8() */
@@ -1889,7 +1872,7 @@ smoke_check_8(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_9(void)
{
const char * fcn_name = "smoke_check_9";
@@ -1907,12 +1890,9 @@ smoke_check_9(void)
TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
pass = TRUE;
@@ -2168,7 +2148,7 @@ smoke_check_9(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_9() */
@@ -2196,7 +2176,7 @@ smoke_check_9(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
smoke_check_10(void)
{
const char * fcn_name = "smoke_check_10";
@@ -2214,12 +2194,9 @@ smoke_check_10(void)
TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked");
if ( skip_long_tests ) {
-
SKIPPED();
-
HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
+ return 0; /* <========== note return */
}
pass = TRUE;
@@ -2470,7 +2447,7 @@ smoke_check_10(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* smoke_check_10() */
@@ -2494,7 +2471,7 @@ smoke_check_10(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
write_permitted_check(void)
{
@@ -2661,7 +2638,7 @@ write_permitted_check(void)
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
- return;
+ return (unsigned)!pass;
} /* write_permitted_check() */
@@ -2687,7 +2664,7 @@ write_permitted_check(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_insert_entry(void)
{
const char * fcn_name = "check_insert_entry";
@@ -2963,7 +2940,7 @@ check_insert_entry(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_insert_entry() */
@@ -2984,7 +2961,7 @@ check_insert_entry(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_flush_cache(void)
{
const char * fcn_name = "check_flush_cache";
@@ -3084,7 +3061,7 @@ check_flush_cache(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_flush_cache() */
@@ -5482,17 +5459,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -5510,17 +5487,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -5590,17 +5567,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -5618,17 +5595,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr*/
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -5695,17 +5672,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr:*/
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -5774,17 +5751,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -5854,17 +5831,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -5966,17 +5943,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6080,17 +6057,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 2,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6192,17 +6169,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 2,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6307,17 +6284,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 2,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6405,17 +6382,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 2,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, 0, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6502,17 +6479,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 4,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6599,17 +6576,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 4,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6696,17 +6673,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6825,17 +6802,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6966,17 +6943,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -6994,17 +6971,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ FALSE,
@@ -7022,17 +6999,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7050,17 +7027,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ FALSE,
@@ -7181,17 +7158,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7209,17 +7186,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7237,17 +7214,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7265,17 +7242,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ FALSE,
@@ -7293,17 +7270,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7321,17 +7298,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7451,17 +7428,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7479,17 +7456,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 6,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7507,17 +7484,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7535,17 +7512,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7563,17 +7540,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7591,17 +7568,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7717,17 +7694,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7745,17 +7722,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7773,17 +7750,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7851,17 +7828,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7879,17 +7856,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -7907,17 +7884,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 1,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8055,17 +8032,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8083,17 +8060,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8111,17 +8088,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8139,17 +8116,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 4,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8167,17 +8144,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8195,17 +8172,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8223,17 +8200,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8251,17 +8228,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8279,17 +8256,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8307,17 +8284,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 4,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8492,17 +8469,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8520,17 +8497,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8548,17 +8525,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8576,17 +8553,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 4,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8604,17 +8581,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8632,17 +8609,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8660,17 +8637,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8688,17 +8665,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ FALSE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8716,17 +8693,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8744,17 +8721,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 4,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0, NULL },
+ { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8854,17 +8831,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8882,17 +8859,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8910,17 +8887,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8938,17 +8915,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -8966,17 +8943,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -9047,17 +9024,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -9075,17 +9052,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -9103,17 +9080,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -9131,17 +9108,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 0,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -9159,17 +9136,17 @@ check_flush_cache__flush_ops(H5C_t * cache_ptr)
/* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
/* num_flush_ops = */ 3,
/* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
+ /* op_code: type: idx: flag: size: order_ptr: */
+ { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0, NULL },
+ { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2, NULL },
+ { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL },
+ { FLUSH_OP__NO_OP, 0, 0, FALSE, 0, NULL } },
/* expected_loaded = */ TRUE,
/* expected_cleared = */ FALSE,
/* expected_flushed = */ TRUE,
@@ -9443,7 +9420,8 @@ check_flush_cache__flush_op_test(H5C_t * cache_ptr,
spec[i].flush_ops[j].type,
spec[i].flush_ops[j].idx,
spec[i].flush_ops[j].flag,
- spec[i].flush_ops[j].size);
+ spec[i].flush_ops[j].size,
+ spec[i].flush_ops[j].order_ptr);
}
i++;
@@ -9817,61 +9795,61 @@ check_flush_cache__flush_op_eviction_test(H5C_t * cache_ptr)
* array only processes as much of it as it is told to, we don't have to
* worry about maintaining the status of entries that we haven't used yet.
*/
- /* entry entry in at main */
- /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: */
- { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */
+ { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }
};
if ( pass ) {
@@ -10004,25 +9982,25 @@ check_flush_cache__flush_op_eviction_test(H5C_t * cache_ptr)
* (VET, 7) dirties (VET, 6)
*/
add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
+ VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__RESIZE,
VARIABLE_ENTRY_TYPE, 0, FALSE,
- 3 * VARIABLE_ENTRY_SIZE / 4);
+ 3 * VARIABLE_ENTRY_SIZE / 4, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
+ VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RESIZE,
- VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE);
+ VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RENAME,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
+ VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
+ VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__RESIZE,
- VARIABLE_ENTRY_TYPE, 3, FALSE, VARIABLE_ENTRY_SIZE);
+ VARIABLE_ENTRY_TYPE, 3, FALSE, VARIABLE_ENTRY_SIZE, NULL);
add_flush_op(VARIABLE_ENTRY_TYPE, 7, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 6, FALSE, (size_t)0);
+ VARIABLE_ENTRY_TYPE, 6, FALSE, (size_t)0, NULL);
}
if ( pass ) {
@@ -13526,7 +13504,7 @@ check_flush_cache__pinned_single_entry_test(H5C_t * cache_ptr,
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_get_entry_status(void)
{
const char * fcn_name = "check_get_entry_status";
@@ -13705,7 +13683,7 @@ check_get_entry_status(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_get_entry_status() */
@@ -13727,7 +13705,7 @@ check_get_entry_status(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_expunge_entry(void)
{
const char * fcn_name = "check_expunge_entry";
@@ -14005,7 +13983,7 @@ check_expunge_entry(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_expunge_entry() */
@@ -14029,7 +14007,7 @@ check_expunge_entry(void)
*/
-static void
+static unsigned
check_multiple_read_protect(void)
{
const char * fcn_name = "check_multiple_read_protect()";
@@ -14426,7 +14404,7 @@ check_multiple_read_protect(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_multiple_read_protect() */
@@ -14448,7 +14426,7 @@ check_multiple_read_protect(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_rename_entry(void)
{
const char * fcn_name = "check_rename_entry";
@@ -14539,7 +14517,7 @@ check_rename_entry(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_rename_entry() */
@@ -14709,7 +14687,7 @@ check_rename_entry__run_test(H5C_t * cache_ptr,
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_pin_protected_entry(void)
{
const char * fcn_name = "check_pin_protected_entry";
@@ -14779,7 +14757,7 @@ check_pin_protected_entry(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_pin_protected_entry() */
@@ -14802,7 +14780,7 @@ check_pin_protected_entry(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_resize_entry(void)
{
const char * fcn_name = "check_resize_entry";
@@ -15700,7 +15678,7 @@ check_resize_entry(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_resize_entry() */
@@ -15723,7 +15701,7 @@ check_resize_entry(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_evictions_enabled(void)
{
const char * fcn_name = "check_evictions_enabled";
@@ -15734,7 +15712,6 @@ check_evictions_enabled(void)
hbool_t in_cache;
int i;
int mile_stone = 1;
- size_t entry_size;
H5C_t * cache_ptr = NULL;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -15791,7 +15768,6 @@ check_evictions_enabled(void)
(size_t)( 512 * 1024));
base_addr = entries[MONSTER_ENTRY_TYPE];
- entry_size = MONSTER_ENTRY_SIZE;
}
if ( show_progress ) /* 2 */
@@ -16402,7 +16378,7 @@ check_evictions_enabled(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_evictions_enabled() */
@@ -16423,7 +16399,7 @@ check_evictions_enabled(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_flush_protected_err(void)
{
const char * fcn_name = "check_flush_protected_err";
@@ -16478,7 +16454,7 @@ check_flush_protected_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_flush_protected_err() */
@@ -16500,7 +16476,7 @@ check_flush_protected_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_destroy_pinned_err(void)
{
const char * fcn_name = "check_destroy_pinned_err()";
@@ -16551,7 +16527,7 @@ check_destroy_pinned_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_destroy_pinned_err() */
@@ -16572,7 +16548,7 @@ check_destroy_pinned_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_destroy_protected_err(void)
{
const char * fcn_name = "check_destroy_protected_err";
@@ -16622,7 +16598,7 @@ check_destroy_protected_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_destroy_protected_err() */
@@ -16643,7 +16619,7 @@ check_destroy_protected_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_duplicate_insert_err(void)
{
const char * fcn_name = "check_duplicate_insert_err";
@@ -16701,7 +16677,7 @@ check_duplicate_insert_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_duplicate_insert_err() */
@@ -16722,7 +16698,7 @@ check_duplicate_insert_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_rename_err(void)
{
const char * fcn_name = "check_rename_err()";
@@ -16794,7 +16770,7 @@ check_rename_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_rename_err() */
@@ -16817,7 +16793,7 @@ check_rename_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_double_pin_err(void)
{
const char * fcn_name = "check_double_pin_err()";
@@ -16882,7 +16858,7 @@ check_double_pin_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_double_pin_err() */
@@ -16905,7 +16881,7 @@ check_double_pin_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_double_unpin_err(void)
{
const char * fcn_name = "check_double_unpin_err()";
@@ -16981,7 +16957,7 @@ check_double_unpin_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_double_unpin_err() */
@@ -17004,7 +16980,7 @@ check_double_unpin_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_pin_entry_errs(void)
{
const char * fcn_name = "check_pin_entry_errs()";
@@ -17092,7 +17068,7 @@ check_pin_entry_errs(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_pin_entry_errs() */
@@ -17118,7 +17094,7 @@ check_pin_entry_errs(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_double_protect_err(void)
{
const char * fcn_name = "check_double_protect_err()";
@@ -17149,7 +17125,7 @@ check_double_protect_err(void)
if ( pass ) {
- cache_entry_ptr = H5C_protect(NULL, -1, -1, cache_ptr, &(types[0]),
+ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(NULL, -1, -1, cache_ptr, &(types[0]),
entry_ptr->addr, NULL, NULL,
H5C__NO_FLAGS_SET);
@@ -17178,7 +17154,7 @@ check_double_protect_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_double_protect_err() */
@@ -17207,7 +17183,7 @@ check_double_protect_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_double_unprotect_err(void)
{
const char * fcn_name = "check_double_unprotect_err()";
@@ -17265,7 +17241,7 @@ check_double_unprotect_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_double_unprotect_err() */
@@ -17297,7 +17273,7 @@ check_double_unprotect_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_mark_entry_dirty_errs(void)
{
const char * fcn_name = "check_mark_entry_dirty_errs()";
@@ -17395,7 +17371,7 @@ check_mark_entry_dirty_errs(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_mark_entry_dirty_errs() */
@@ -17418,7 +17394,7 @@ check_mark_entry_dirty_errs(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_expunge_entry_errs(void)
{
const char * fcn_name = "check_expunge_entry_errs()";
@@ -17519,7 +17495,7 @@ check_expunge_entry_errs(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_expunge_entry_errs() */
@@ -17542,7 +17518,7 @@ check_expunge_entry_errs(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_resize_entry_errs(void)
{
const char * fcn_name = "check_resize_entry_errs()";
@@ -17625,7 +17601,7 @@ check_resize_entry_errs(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_resize_entry_errs() */
@@ -17648,7 +17624,7 @@ check_resize_entry_errs(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_unprotect_ro_dirty_err(void)
{
const char * fcn_name = "check_unprotect_ro_dirty_err()";
@@ -17755,7 +17731,7 @@ check_unprotect_ro_dirty_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_unprotect_ro_dirty_err() */
@@ -17778,7 +17754,7 @@ check_unprotect_ro_dirty_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_protect_ro_rw_err(void)
{
const char * fcn_name = "check_protect_ro_rw_err()";
@@ -17838,7 +17814,7 @@ check_protect_ro_rw_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_protect_ro_rw_err() */
@@ -17861,7 +17837,7 @@ check_protect_ro_rw_err(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_check_evictions_enabled_err(void)
{
const char * fcn_name = "check_evictions_enabled_err()";
@@ -17975,7 +17951,7 @@ check_check_evictions_enabled_err(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_evictions_enabled_err() */
@@ -18018,7 +17994,7 @@ static void test_rpt_fcn(UNUSED H5C_t * cache_ptr,
rpt_status = status;
}
-static void
+static unsigned
check_auto_cache_resize(void)
{
const char * fcn_name = "check_auto_cache_resize()";
@@ -22316,7 +22292,7 @@ check_auto_cache_resize(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_auto_cache_resize() */
@@ -22341,7 +22317,7 @@ check_auto_cache_resize(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_auto_cache_resize_disable(void)
{
const char * fcn_name = "check_auto_cache_resize_disable()";
@@ -25070,7 +25046,7 @@ check_auto_cache_resize_disable(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_auto_cache_resize_disable() */
@@ -25091,7 +25067,7 @@ check_auto_cache_resize_disable(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_auto_cache_resize_epoch_markers(void)
{
const char * fcn_name = "check_auto_cache_resize_epoch_markers()";
@@ -25778,7 +25754,7 @@ check_auto_cache_resize_epoch_markers(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_auto_cache_resize_epoch_markers() */
@@ -25804,38 +25780,66 @@ check_auto_cache_resize_epoch_markers(void)
*-------------------------------------------------------------------------
*/
-#define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \
-( ( (a).version == (b).version ) && \
- ( (a).rpt_fcn == (b).rpt_fcn ) && \
- ( ( ! compare_init ) || \
- ( (a).set_initial_size == (b).set_initial_size ) ) && \
- ( ( ! compare_init ) || \
- ( (a).initial_size == (b).initial_size ) ) && \
- ( (a).min_clean_fraction == (b).min_clean_fraction ) && \
- ( (a).max_size == (b).max_size ) && \
- ( (a).min_size == (b).min_size ) && \
- ( (a).epoch_length == (b).epoch_length ) && \
- ( (a).incr_mode == (b).incr_mode ) && \
- ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \
- ( (a).increment == (b).increment ) && \
- ( (a).apply_max_increment == (b).apply_max_increment ) && \
- ( (a).max_increment == (b).max_increment ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( (a).flash_multiple == (b).flash_multiple ) && \
- ( (a).flash_threshold == (b).flash_threshold ) && \
- ( (a).decr_mode == (b).decr_mode ) && \
- ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( (a).flash_multiple == (b).flash_multiple ) && \
- ( (a).flash_threshold == (b).flash_threshold ) && \
- ( (a).decrement == (b).decrement ) && \
- ( (a).apply_max_decrement == (b).apply_max_decrement ) && \
- ( (a).max_decrement == (b).max_decrement ) && \
- ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
- ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
- ( (a).empty_reserve == (b).empty_reserve ) )
+/* Epsilon for floating-point comparisons */
+#define FP_EPSILON 0.000001
-static void
+static hbool_t
+resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
+ const H5C_auto_size_ctl_t *b,
+ hbool_t compare_init)
+{
+ if(a->version != b->version)
+ return(FALSE);
+ else if(a->rpt_fcn != b->rpt_fcn)
+ return(FALSE);
+ else if(compare_init && (a->set_initial_size != b->set_initial_size))
+ return(FALSE);
+ else if(compare_init && (a->initial_size != b->initial_size))
+ return(FALSE);
+ else if(HDfabs(a->min_clean_fraction - b->min_clean_fraction) > FP_EPSILON)
+ return(FALSE);
+ else if(a->max_size != b->max_size)
+ return(FALSE);
+ else if(a->min_size != b->min_size)
+ return(FALSE);
+ else if(a->epoch_length != b->epoch_length)
+ return(FALSE);
+ else if(a->incr_mode != b->incr_mode)
+ return(FALSE);
+ else if(HDfabs(a->lower_hr_threshold - b->lower_hr_threshold) > FP_EPSILON)
+ return(FALSE);
+ else if(HDfabs(a->increment - b->increment) > FP_EPSILON)
+ return(FALSE);
+ else if(a->apply_max_increment != b->apply_max_increment)
+ return(FALSE);
+ else if(a->max_increment != b->max_increment)
+ return(FALSE);
+ else if(a->flash_incr_mode != b->flash_incr_mode)
+ return(FALSE);
+ else if(HDfabs(a->flash_multiple - b->flash_multiple) > FP_EPSILON)
+ return(FALSE);
+ else if(HDfabs(a->flash_threshold - b->flash_threshold) > FP_EPSILON)
+ return(FALSE);
+ else if(a->decr_mode != b->decr_mode)
+ return(FALSE);
+ else if(HDfabs(a->upper_hr_threshold - b->upper_hr_threshold) > FP_EPSILON)
+ return(FALSE);
+ else if(HDfabs(a->decrement - b->decrement) > FP_EPSILON)
+ return(FALSE);
+ else if(a->apply_max_decrement != b->apply_max_decrement)
+ return(FALSE);
+ else if(a->max_decrement != b->max_decrement)
+ return(FALSE);
+ else if(a->epochs_before_eviction != b->epochs_before_eviction)
+ return(FALSE);
+ else if(a->apply_empty_reserve != b->apply_empty_reserve)
+ return(FALSE);
+ else if(HDfabs(a->empty_reserve - b->empty_reserve) > FP_EPSILON)
+ return(FALSE);
+ return(TRUE);
+}
+
+static unsigned
check_auto_cache_resize_input_errs(void)
{
const char * fcn_name = "check_auto_cache_resize_input_errs()";
@@ -25940,8 +25944,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 1.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 1.";
@@ -26013,8 +26017,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 2.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 2.";
@@ -26089,8 +26093,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 3.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 3.";
@@ -26166,8 +26170,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 4.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 4.";
@@ -26240,8 +26244,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 5.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 5.";
@@ -26316,8 +26320,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 6.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 6.";
@@ -26389,8 +26393,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 7.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 7.";
@@ -26466,8 +26470,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 8.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 8.";
@@ -26539,8 +26543,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 9.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 9.";
@@ -26612,8 +26616,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 10.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 10.";
@@ -26688,8 +26692,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 11.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 11.";
@@ -26761,8 +26765,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 12.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 12.";
@@ -26838,8 +26842,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 13.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 13.";
@@ -26912,8 +26916,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 14.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 14.";
@@ -26988,8 +26992,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 15.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 15.";
@@ -27061,8 +27065,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 16.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 16.";
@@ -27134,8 +27138,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 17.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 17.";
@@ -27211,8 +27215,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 18.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 18.";
@@ -27288,8 +27292,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 19.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 19.";
@@ -27364,8 +27368,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 20.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 20.";
@@ -27438,8 +27442,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 21.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 21.";
@@ -27514,8 +27518,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 22.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 22.";
@@ -27588,8 +27592,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 23.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 23.";
@@ -27664,8 +27668,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 24.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 24.";
@@ -27738,8 +27742,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 25.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 25.";
@@ -27814,8 +27818,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 26.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 26.";
@@ -27887,8 +27891,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 27.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 27.";
@@ -27962,8 +27966,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 28.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 28.";
@@ -28035,8 +28039,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 29.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 29.";
@@ -28110,8 +28114,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 30.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 30.";
@@ -28183,8 +28187,8 @@ check_auto_cache_resize_input_errs(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_auto_resize_config failed 31.";
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
+ } else if ( ! resize_configs_are_equal(&test_auto_size_ctl, \
+ &ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
failure_mssg = "Unexpected auto resize config 31.";
@@ -28246,7 +28250,7 @@ check_auto_cache_resize_input_errs(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_auto_cache_resize_input_errs() */
@@ -28272,7 +28276,7 @@ check_auto_cache_resize_input_errs(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_auto_cache_resize_aux_fcns(void)
{
const char * fcn_name = "check_auto_cache_resize_aux_fcns()";
@@ -28394,7 +28398,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( hit_rate != 0.0 ) {
+ } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */
pass = FALSE;
failure_mssg =
@@ -28428,7 +28432,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( hit_rate != 0.0 ) {
+ } else if ( hit_rate > FP_EPSILON ) { /* i.e. hit_rate != 0.0 */
pass = FALSE;
failure_mssg =
@@ -28474,7 +28478,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( hit_rate != 0.5 ) {
+ } else if ( HDfabs(hit_rate - 0.5) > FP_EPSILON ) { /* i.e. hit_rate != 0.5 */
pass = FALSE;
failure_mssg =
@@ -28558,7 +28562,7 @@ check_auto_cache_resize_aux_fcns(void)
pass = FALSE;
failure_mssg = "H5C_get_cache_hit_rate failed.\n";
- } else if ( hit_rate != 0.5 ) {
+ } else if ( HDfabs(hit_rate - 0.5) > FP_EPSILON ) { /* i.e. hit_rate != 0.5 */
pass = FALSE;
failure_mssg =
@@ -28828,7 +28832,7 @@ check_auto_cache_resize_aux_fcns(void)
fcn_name, failure_mssg);
}
- return;
+ return (unsigned)!pass;
} /* check_auto_cache_resize_aux_fcns() */
@@ -28861,7 +28865,7 @@ check_auto_cache_resize_aux_fcns(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_metadata_blizzard_absence(hbool_t fill_via_insertion)
{
const char * fcn_name = "check_metadata_blizzard_absence";
@@ -28876,165 +28880,165 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
/* Expected loaded status of entries depends on how they get into
* the cache. Insertions = not loaded, protect/unprotect = loaded.
*/
- hbool_t loaded = !(fill_via_insertion);
+ hbool_t loaded = (hbool_t)!(fill_via_insertion);
/* Set up the expected array. This is used to maintain a table of the
* expected status of every entry used in this test.
*/
struct expected_entry_status expected[150] =
{
- /* entry entry in at main */
- /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: */
- { entry_type, 0, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 1, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 2, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 3, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 4, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 5, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 6, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 7, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 8, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 9, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 10, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 11, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 12, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 13, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 14, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 15, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 16, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 17, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 18, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 19, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 20, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 21, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 22, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 23, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 24, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 25, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 26, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 27, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 28, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 29, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 30, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 31, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 32, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 33, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 34, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 35, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 36, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 37, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 38, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 39, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 40, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 41, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 42, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 43, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 44, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 45, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 46, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 47, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 48, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 49, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 50, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 51, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 52, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 53, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 54, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 55, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 56, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 57, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 58, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 59, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 60, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 61, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 62, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 63, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 64, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 65, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 66, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 67, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 68, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 69, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 70, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 71, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 72, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 73, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 74, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 75, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 76, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 77, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 78, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 79, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 80, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 81, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 82, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 83, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 84, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 85, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 86, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 87, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 88, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 89, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 90, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 91, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 92, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 93, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 94, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 95, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 96, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 97, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 98, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 99, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 100, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 101, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 102, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 103, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 104, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 105, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 106, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 107, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 108, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 109, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 110, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 111, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 112, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 113, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 114, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 115, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 116, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 117, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 118, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 119, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 120, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 121, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 122, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 123, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 124, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 125, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 126, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 127, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 128, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 129, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 130, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 131, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 132, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 133, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 134, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 135, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 136, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 137, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 138, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 139, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 140, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 141, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 142, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 143, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 144, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 145, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 146, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 147, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 148, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE },
- { entry_type, 149, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */
+ { entry_type, 0, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 1, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 2, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 3, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 4, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 5, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 6, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 7, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 8, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 9, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 10, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 11, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 12, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 13, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 14, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 15, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 16, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 17, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 18, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 19, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 20, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 21, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 22, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 23, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 24, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 25, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 26, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 27, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 28, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 29, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 30, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 31, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 32, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 33, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 34, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 35, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 36, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 37, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 38, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 39, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 40, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 41, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 42, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 43, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 44, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 45, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 46, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 47, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 48, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 49, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 50, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 51, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 52, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 53, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 54, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 55, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 56, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 57, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 58, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 59, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 60, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 61, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 62, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 63, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 64, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 65, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 66, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 67, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 68, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 69, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 70, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 71, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 72, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 73, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 74, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 75, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 76, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 77, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 78, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 79, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 80, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 81, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 82, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 83, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 84, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 85, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 86, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 87, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 88, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 89, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 90, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 91, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 92, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 93, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 94, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 95, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 96, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 97, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 98, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 99, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 100, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 101, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 102, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 103, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 104, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 105, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 106, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 107, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 108, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 109, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 110, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 111, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 112, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 113, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 114, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 115, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 116, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 117, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 118, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 119, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 120, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 121, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 122, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 123, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 124, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 125, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 126, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 127, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 128, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 129, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 130, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 131, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 132, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 133, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 134, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 135, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 136, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 137, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 138, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 139, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 140, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 141, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 142, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 143, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 144, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 145, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 146, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 147, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 148, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 149, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }
};
pass = TRUE;
@@ -29117,7 +29121,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29177,7 +29181,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx++, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29233,7 +29237,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx++, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29287,7 +29291,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29361,7 +29365,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx++, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29426,7 +29430,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29559,7 +29563,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29601,7 +29605,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx++, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29657,7 +29661,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
entry_type, /* int32_t type */
entry_idx, /* int32_t idx */
- TRUE, /* int321_t dirty */
+ TRUE, /* int32_t dirty */
H5C__NO_FLAGS_SET); /* unsigned int flags */
}
@@ -29700,12 +29704,3959 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- return;
+ return (unsigned)!pass;
} /* check_metadata_blizzard_absence() */
/*-------------------------------------------------------------------------
+ * Function: check_flush_deps()
+ *
+ * Purpose: Exercise the flush dependency routines.
+ *
+ * Return: 0 on success, non-zero on failure
+ *
+ * Programmer: Quincey Koziol
+ * 3/12/09
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static unsigned
+check_flush_deps(void)
+{
+ H5C_t * cache_ptr = NULL; /* Metadata cache for this test */
+ int entry_type = PICO_ENTRY_TYPE; /* Use very small entry size (size of entries doesn't matter) */
+ size_t entry_size = PICO_ENTRY_SIZE; /* 1 byte */
+ unsigned u; /* Local index variable */
+ struct expected_entry_status expected[5] =
+ {
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */
+ { entry_type, 0, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 1, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 2, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 3, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 4, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }
+ };
+
+ TESTING("flush dependencies");
+
+ pass = TRUE;
+
+ /* allocate a cache, build up flush dependency hierarchy and tear it down.
+ * Verify that all performs as expected.
+ */
+
+ reset_entries();
+ cache_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
+
+ if ( !pass ) CACHE_ERROR("setup_cache failed")
+
+ /* Insert entries to work with into the cache */
+ for(u = 0; u < 5; u++) {
+ insert_entry(cache_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET);
+ if ( !pass ) CACHE_ERROR("insert_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after each insertion
+ */
+ expected[u].in_cache = TRUE;
+ expected[u].is_dirty = TRUE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)u, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+
+/* Test Case #1 - Single flush dependency relationship */
+
+ /* Create flush dependency between entries 0 (child) & 1 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries 0 (child) & 1 (parent) */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #2 - Multiple children for one parent flush dependency relationship */
+
+ /* Create flush dependency between entries 0, 1 (children) & 2 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 2;
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[0] = 2;
+ expected[2].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries 0, 1 (children) & 2 (parent) */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_protected = FALSE;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[0] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #3a1 - Single chain of flush dependencies, 4 entries tall
+ * created from the "bottom up" and destroyed from the "top down"
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2->3 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[2].flush_dep_par_type = entry_type;
+ expected[2].flush_dep_par_idx = 3;
+ expected[3].is_protected = TRUE;
+ expected[3].is_pinned = TRUE;
+ expected[3].child_flush_dep_height_rc[2] = 1;
+ expected[3].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, from the "top down" */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 3, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[2].flush_dep_par_type = -1;
+ expected[2].flush_dep_par_idx = -1;
+ expected[3].is_protected = FALSE;
+ expected[3].is_pinned = FALSE;
+ expected[3].child_flush_dep_height_rc[2] = 0;
+ expected[3].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_protected = FALSE;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #3a2 - Single chain of flush dependencies, 4 entries tall
+ * created from the "bottom up" and destroyed from the "top down"
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2->3 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[2].flush_dep_par_type = entry_type;
+ expected[2].flush_dep_par_idx = 3;
+ expected[3].is_protected = TRUE;
+ expected[3].is_pinned = TRUE;
+ expected[3].child_flush_dep_height_rc[2] = 1;
+ expected[3].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, from the "bottom up" */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+ expected[2].child_flush_dep_height_rc[0] = 1;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 1;
+ expected[3].child_flush_dep_height_rc[1] = 1;
+ expected[3].child_flush_dep_height_rc[2] = 0;
+ expected[3].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_protected = FALSE;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[0] = 0;
+ expected[2].flush_dep_height = 0;
+ expected[3].child_flush_dep_height_rc[0] = 1;
+ expected[3].child_flush_dep_height_rc[1] = 0;
+ expected[3].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 3, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[2].flush_dep_par_type = -1;
+ expected[2].flush_dep_par_idx = -1;
+ expected[3].is_protected = FALSE;
+ expected[3].is_pinned = FALSE;
+ expected[3].child_flush_dep_height_rc[0] = 0;
+ expected[3].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #3b1 - Single chain of flush dependencies, 4 entries tall
+ * created from the "top down" and destroyed from the "top down"
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2->3 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[2].flush_dep_par_type = entry_type;
+ expected[2].flush_dep_par_idx = 3;
+ expected[3].is_protected = TRUE;
+ expected[3].is_pinned = TRUE;
+ expected[3].child_flush_dep_height_rc[0] = 1;
+ expected[3].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[0] = 1;
+ expected[2].flush_dep_height = 1;
+ expected[3].child_flush_dep_height_rc[0] = 0;
+ expected[3].child_flush_dep_height_rc[1] = 1;
+ expected[3].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+ expected[2].child_flush_dep_height_rc[0] = 0;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+ expected[3].child_flush_dep_height_rc[1] = 0;
+ expected[3].child_flush_dep_height_rc[2] = 1;
+ expected[3].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, from the "top down" */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 3, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[2].flush_dep_par_type = -1;
+ expected[2].flush_dep_par_idx = -1;
+ expected[3].is_protected = FALSE;
+ expected[3].is_pinned = FALSE;
+ expected[3].child_flush_dep_height_rc[2] = 0;
+ expected[3].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_protected = FALSE;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #3b2 - Single chain of flush dependencies, 4 entries tall
+ * created from the "top down" and destroyed from the "bottom up"
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2->3 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[2].flush_dep_par_type = entry_type;
+ expected[2].flush_dep_par_idx = 3;
+ expected[3].is_protected = TRUE;
+ expected[3].is_pinned = TRUE;
+ expected[3].child_flush_dep_height_rc[0] = 1;
+ expected[3].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[0] = 1;
+ expected[2].flush_dep_height = 1;
+ expected[3].child_flush_dep_height_rc[0] = 0;
+ expected[3].child_flush_dep_height_rc[1] = 1;
+ expected[3].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+ expected[2].child_flush_dep_height_rc[0] = 0;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+ expected[3].child_flush_dep_height_rc[1] = 0;
+ expected[3].child_flush_dep_height_rc[2] = 1;
+ expected[3].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, from the "bottom up" */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+ expected[2].child_flush_dep_height_rc[0] = 1;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 1;
+ expected[3].child_flush_dep_height_rc[1] = 1;
+ expected[3].child_flush_dep_height_rc[2] = 0;
+ expected[3].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_protected = FALSE;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[0] = 0;
+ expected[2].flush_dep_height = 0;
+ expected[3].child_flush_dep_height_rc[0] = 1;
+ expected[3].child_flush_dep_height_rc[1] = 0;
+ expected[3].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 3, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[2].flush_dep_par_type = -1;
+ expected[2].flush_dep_par_idx = -1;
+ expected[3].is_protected = FALSE;
+ expected[3].is_pinned = FALSE;
+ expected[3].child_flush_dep_height_rc[0] = 0;
+ expected[3].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #4 - Multiple children for a single parent */
+
+ /* Create flush dependency between entries (child) 0,1,2,3->4 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ for(u = 0; u < 4; u++) {
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, (int32_t)u);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[u].flush_dep_par_type = entry_type;
+ expected[u].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = u + 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+ }
+
+ /* Destroy flush dependency between entries */
+ {
+ for(u = 0; u < 4; u++) {
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, (int32_t)u);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[u].flush_dep_par_type = -1;
+ expected[u].flush_dep_par_idx = -1;
+ expected[4].child_flush_dep_height_rc[0] = 3 - u;
+
+ /* Check for destroying flush dependency on last entry */
+ if(3 == u) {
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].is_protected = FALSE;
+ expected[4].is_pinned = FALSE;
+ expected[4].flush_dep_height = 0;
+ } /* end if */
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+ }
+
+/* Test Case #5a - Join two flush dependency chains together, creating a single
+ * un-forked dependency chain
+ */
+
+ /* Create flush dependency between entries (child) 0->1 and 3->4 (parent)
+ * then add entry 4 as a child of 0
+ */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[3].flush_dep_par_type = entry_type;
+ expected[3].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[4].flush_dep_par_type = entry_type;
+ expected[4].flush_dep_par_idx = 0;
+ expected[0].is_protected = TRUE;
+ expected[0].is_pinned = TRUE;
+ expected[0].child_flush_dep_height_rc[1] = 1;
+ expected[0].flush_dep_height = 2;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].child_flush_dep_height_rc[2] = 1;
+ expected[1].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ }
+
+ /* Destroy flush dependency between entries, detaching 3->4 from 0 first */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].flush_dep_par_type = -1;
+ expected[4].flush_dep_par_idx = -1;
+ expected[0].is_protected = FALSE;
+ expected[0].is_pinned = FALSE;
+ expected[0].child_flush_dep_height_rc[1] = 0;
+ expected[0].flush_dep_height = 0;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].child_flush_dep_height_rc[2] = 0;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[3].flush_dep_par_type = -1;
+ expected[3].flush_dep_par_idx = -1;
+ expected[4].is_protected = FALSE;
+ expected[4].is_pinned = FALSE;
+ expected[4].child_flush_dep_height_rc[0] = 0;
+ expected[4].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #5b - Join two flush dependency chains together, creating a
+ * forked dependency chain
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2 and 3->4 (parent)
+ * then add entry 4 as a child of 1
+ */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[3].flush_dep_par_type = entry_type;
+ expected[3].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[4].flush_dep_par_type = entry_type;
+ expected[4].flush_dep_par_idx = 1;
+ expected[1].child_flush_dep_height_rc[1] = 1;
+ expected[1].flush_dep_height = 2;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].child_flush_dep_height_rc[2] = 1;
+ expected[2].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ }
+
+ /* Destroy flush dependency between entries, detaching 3->4 from 1 first */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].flush_dep_par_type = -1;
+ expected[4].flush_dep_par_idx = -1;
+ expected[1].child_flush_dep_height_rc[1] = 0;
+ expected[1].flush_dep_height = 1;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].child_flush_dep_height_rc[2] = 0;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[3].flush_dep_par_type = -1;
+ expected[3].flush_dep_par_idx = -1;
+ expected[4].is_protected = FALSE;
+ expected[4].is_pinned = FALSE;
+ expected[4].child_flush_dep_height_rc[0] = 0;
+ expected[4].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_protected = FALSE;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #5c - Join two flush dependency chains together, creating a
+ * forked dependency chain
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2 and 3->4 (parent)
+ * then add entry 4 as a child of 2
+ */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[3].flush_dep_par_type = entry_type;
+ expected[3].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[4].flush_dep_par_type = entry_type;
+ expected[4].flush_dep_par_idx = 2;
+ expected[2].child_flush_dep_height_rc[1] = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ }
+
+ /* Destroy flush dependency between entries, detaching 3->4 from 2 first */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].flush_dep_par_type = -1;
+ expected[4].flush_dep_par_idx = -1;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[3].flush_dep_par_type = -1;
+ expected[3].flush_dep_par_idx = -1;
+ expected[4].is_protected = FALSE;
+ expected[4].is_pinned = FALSE;
+ expected[4].child_flush_dep_height_rc[0] = 0;
+ expected[4].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_protected = FALSE;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_protected = FALSE;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+
+done:
+ if(cache_ptr)
+ takedown_cache(cache_ptr, FALSE, FALSE);
+
+ if ( pass )
+ PASSED()
+ else {
+ H5_FAILED();
+ HDfprintf(stdout, "%s.\n", failure_mssg);
+ } /* end else */
+
+ return (unsigned)!pass;
+} /* check_flush_deps() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: check_flush_deps_err()
+ *
+ * Purpose: Check the flush dependency routines for error conditions.
+ *
+ * Return: 0 on success, non-zero on failure
+ *
+ * Programmer: Quincey Koziol
+ * 3/16/09
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static unsigned
+check_flush_deps_err(void)
+{
+ H5C_t * cache_ptr = NULL; /* Metadata cache for this test */
+ int entry_type = PICO_ENTRY_TYPE; /* Use very small entry size (size of entries doesn't matter) */
+ unsigned test_count; /* Test iteration variable */
+
+ TESTING("flush dependency errors");
+
+ pass = TRUE;
+
+ /* Loop over test cases, check for various errors in configuring flush
+ * dependencies. Verify that all performs as expected.
+ */
+ for(test_count = 0; test_count < 11; test_count++) {
+ unsigned u; /* Local index variable */
+ herr_t result; /* Generic return value */
+
+ /* Allocate a cache */
+ reset_entries();
+ cache_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
+ if ( !pass ) CACHE_ERROR("setup_cache failed")
+
+ /* Insert entries to work with into the cache */
+ for(u = 0; u < 10; u++) {
+ insert_entry(cache_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET);
+ if ( !pass ) CACHE_ERROR("insert_entry failed")
+ } /* end for */
+
+ /* Various test cases */
+ switch(test_count) {
+ /* Verify that parent entry in flush dependency must be protected */
+ case 0:
+ result = H5C_create_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[1]));
+ if( result != FAIL ) CACHE_ERROR("Creating flush dependency with unprotected entry succeeded")
+ break;
+
+ /* Verify that entry can't have flush dependency on itself */
+ case 1:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ result = H5C_create_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[0]));
+ if( result != FAIL ) CACHE_ERROR("Creating flush dependency with parent == child")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ /* Verify that a child entry can only have one flush dependency parent */
+ case 2:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ result = H5C_create_flush_dependency(cache_ptr, &((entries[entry_type])[1]), &((entries[entry_type])[2]));
+ if( result != FAIL ) CACHE_ERROR("Creating second flush dependency for child")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ /* Verify that a flush dependency chain can't be higher than (H5C__NUM_FLUSH_DEP_HEIGHTS - 1) */
+ case 3:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 3, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ result = H5C_create_flush_dependency(cache_ptr, &((entries[entry_type])[4]), &((entries[entry_type])[5]));
+ if( result != FAIL ) CACHE_ERROR("Creating second flush dependency for child")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ protect_entry(cache_ptr, entry_type, 5);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ result = H5C_create_flush_dependency(cache_ptr, &((entries[entry_type])[5]), &((entries[entry_type])[0]));
+ if( result != FAIL ) CACHE_ERROR("Creating second flush dependency for child")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 5, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 3, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 3, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ /* Verify that parent entry isn't already pinned */
+ case 4:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ pin_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("pin_entry failed")
+
+ result = H5C_create_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[1]));
+ if( result != FAIL ) CACHE_ERROR("Creating dependency when parent is pinned")
+
+ unpin_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("unpin_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ /* Verify that parent entry must be protected */
+ case 5:
+ result = H5C_destroy_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[1]));
+ if( result != FAIL ) CACHE_ERROR("Destroying [non-existant] dependency when parent isn't protected")
+ break;
+
+ /* Verify that parent entry has flush dependency */
+ case 6:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ result = H5C_destroy_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[1]));
+ if( result != FAIL ) CACHE_ERROR("Destroying dependency when parent isn't in relationship")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ /* Verify that parent entry is still pinned */
+ case 7:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ unpin_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("unpin_entry failed")
+
+ result = H5C_destroy_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[1]));
+ if( result != FAIL ) CACHE_ERROR("Destroying dependency when parent isn't in relationship")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ /* Verify that child entry is in flush dependency relationship */
+ case 8:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ result = H5C_destroy_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[2]));
+ if( result != FAIL ) CACHE_ERROR("Destroying dependency when child isn't in relationship")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ /* Verify that parent has child entries at this height */
+ case 9:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 3, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ result = H5C_destroy_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[4]));
+ if( result != FAIL ) CACHE_ERROR("Destroying dependency when parent has no children at child's height")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 3, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 3, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+
+ /* Verify that child entry is child of parent */
+ case 10:
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ result = H5C_destroy_flush_dependency(cache_ptr, &((entries[entry_type])[0]), &((entries[entry_type])[3]));
+ if( result != FAIL ) CACHE_ERROR("Destroying dependency when child isn't in relationship")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+ break;
+
+ default:
+ CACHE_ERROR("Unknown test case!")
+ } /* end switch */
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ if ( !pass ) CACHE_ERROR("takedown_cache failed")
+ cache_ptr = NULL;
+ } /* end for */
+
+
+done:
+ if(cache_ptr)
+ takedown_cache(cache_ptr, FALSE, FALSE);
+
+ if ( pass )
+ PASSED()
+ else {
+ H5_FAILED();
+ HDfprintf(stdout, "%s.\n", failure_mssg);
+ } /* end else */
+
+ return (unsigned)!pass;
+} /* check_flush_deps_err() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: check_flush_deps_order()
+ *
+ * Purpose: Verify that the order that entries with flush dependencies
+ * is correct
+ *
+ * Return: 0 on success, non-zero on failure
+ *
+ * Programmer: Quincey Koziol
+ * 3/17/09
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static unsigned
+check_flush_deps_order(void)
+{
+ H5C_t * cache_ptr = NULL; /* Metadata cache for this test */
+ int entry_type = PICO_ENTRY_TYPE; /* Use very small entry size (size of entries doesn't matter) */
+ size_t entry_size = PICO_ENTRY_SIZE; /* 1 byte */
+ unsigned u; /* Local index variable */
+ struct expected_entry_status expected[5] =
+ {
+ /* entry entry in at main flush dep flush dep child flush flush flush */
+ /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: par type: par idx: dep ref.count: dep height: order: */
+ { entry_type, 0, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 1, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 2, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 3, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 },
+ { entry_type, 4, entry_size, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, -1, -1, {0,0,0,0}, 0, -1 }
+ };
+ unsigned flush_order; /* Index for tracking flush order */
+
+ TESTING("flush dependencies flush order");
+
+ pass = TRUE;
+
+ /* allocate a cache, build up flush dependency hierarchy and tear it down.
+ * Verify that all performs as expected.
+ */
+
+ reset_entries();
+ cache_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
+
+ if ( !pass ) CACHE_ERROR("setup_cache failed")
+
+ /* Insert entries to work with into the cache */
+ for(u = 0; u < 5; u++) {
+ insert_entry(cache_ptr, entry_type, (int32_t)u, TRUE, H5C__NO_FLAGS_SET);
+ if ( !pass ) CACHE_ERROR("insert_entry failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after each insertion
+ */
+ expected[u].in_cache = TRUE;
+ expected[u].is_dirty = TRUE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)u, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+
+/* Test Case #1a - Single flush dependency relationship, increasing addr order */
+
+ /* Create flush dependency between entries 0 (child) & 1 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 0;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 1;
+ expected[1].is_protected = FALSE;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[3].is_dirty = FALSE;
+ expected[3].flushed = TRUE;
+ expected[4].is_dirty = FALSE;
+ expected[4].flushed = TRUE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries 0 (child) & 1 (parent) */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #1b - Single flush dependency relationship, decreasing addr order */
+
+ /* Create flush dependency between entries 0 (child) & 1 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].is_protected = TRUE;
+ expected[0].is_pinned = TRUE;
+ expected[0].child_flush_dep_height_rc[0] = 1;
+ expected[0].flush_dep_height = 1;
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0 & 1 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, TRUE);
+ dirty_entry(cache_ptr, entry_type, 1, FALSE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 1;
+ expected[0].is_protected = FALSE;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries 0 (child) & 1 (parent) */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_pinned = FALSE;
+ expected[0].child_flush_dep_height_rc[0] = 0;
+ expected[0].flush_dep_height = 0;
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #2a - Multiple children for one parent flush dependency relationship
+ * increasing addr order
+ */
+
+ /* Create flush dependency between entries 0, 1 (children) & 2 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 2;
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[0] = 2;
+ expected[2].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0, 1 & 2 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, FALSE);
+ dirty_entry(cache_ptr, entry_type, 1, FALSE);
+ dirty_entry(cache_ptr, entry_type, 2, TRUE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 0;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 1;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 2;
+ expected[2].is_protected = FALSE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries 0, 1 (children) & 2 (parent) */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[0] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #2b - Multiple children for one parent flush dependency relationship
+ * decreasing addr order
+ */
+
+ /* Create flush dependency between entries 1, 2 (children) & 0 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].is_protected = TRUE;
+ expected[0].is_pinned = TRUE;
+ expected[0].child_flush_dep_height_rc[0] = 2;
+ expected[0].flush_dep_height = 1;
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 0;
+ expected[2].flush_dep_par_type = entry_type;
+ expected[2].flush_dep_par_idx = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0, 1 & 2 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, TRUE);
+ dirty_entry(cache_ptr, entry_type, 1, FALSE);
+ dirty_entry(cache_ptr, entry_type, 2, FALSE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 2;
+ expected[0].is_protected = FALSE;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 0;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries 1, 2 (children) & 0 (parent) */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_pinned = FALSE;
+ expected[0].child_flush_dep_height_rc[0] = 0;
+ expected[0].flush_dep_height = 0;
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].flush_dep_par_type = -1;
+ expected[2].flush_dep_par_idx = -1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #3a - Single chain of flush dependencies, 4 entries tall,
+ * increasing addr order
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2->3 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[2].flush_dep_par_type = entry_type;
+ expected[2].flush_dep_par_idx = 3;
+ expected[3].is_protected = TRUE;
+ expected[3].is_pinned = TRUE;
+ expected[3].child_flush_dep_height_rc[2] = 1;
+ expected[3].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 3, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 3, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0-3 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, FALSE);
+ dirty_entry(cache_ptr, entry_type, 1, TRUE);
+ dirty_entry(cache_ptr, entry_type, 2, TRUE);
+ dirty_entry(cache_ptr, entry_type, 3, TRUE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+ expected[3].flushed = FALSE;
+ expected[3].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 0;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 1;
+ expected[1].is_protected = FALSE;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 2;
+ expected[2].is_protected = FALSE;
+ expected[3].flushed = TRUE;
+ expected[3].flush_order = 3;
+ expected[3].is_protected = FALSE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, from the "top down" */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 3, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[2].flush_dep_par_type = -1;
+ expected[2].flush_dep_par_idx = -1;
+ expected[3].is_pinned = FALSE;
+ expected[3].child_flush_dep_height_rc[2] = 0;
+ expected[3].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #3b - Single chain of flush dependencies, 4 entries tall
+ * decreasing addr order
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2->3 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].is_protected = TRUE;
+ expected[0].is_pinned = TRUE;
+ expected[0].child_flush_dep_height_rc[0] = 1;
+ expected[0].flush_dep_height = 1;
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].child_flush_dep_height_rc[0] = 0;
+ expected[0].child_flush_dep_height_rc[1] = 1;
+ expected[0].flush_dep_height = 2;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+ expected[2].flush_dep_par_type = entry_type;
+ expected[2].flush_dep_par_idx = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].child_flush_dep_height_rc[1] = 0;
+ expected[0].child_flush_dep_height_rc[2] = 1;
+ expected[0].flush_dep_height = 3;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].child_flush_dep_height_rc[1] = 1;
+ expected[1].flush_dep_height = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[0] = 1;
+ expected[2].flush_dep_height = 1;
+ expected[3].flush_dep_par_type = entry_type;
+ expected[3].flush_dep_par_idx = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 3, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0-3 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, TRUE);
+ dirty_entry(cache_ptr, entry_type, 1, TRUE);
+ dirty_entry(cache_ptr, entry_type, 2, TRUE);
+ dirty_entry(cache_ptr, entry_type, 3, FALSE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+ expected[3].flushed = FALSE;
+ expected[3].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 3;
+ expected[0].is_protected = FALSE;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 2;
+ expected[1].is_protected = FALSE;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 1;
+ expected[2].is_protected = FALSE;
+ expected[3].is_dirty = FALSE;
+ expected[3].flushed = TRUE;
+ expected[3].flush_order = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, from the "bottom up" */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].child_flush_dep_height_rc[2] = 0;
+ expected[0].child_flush_dep_height_rc[1] = 1;
+ expected[0].flush_dep_height = 2;
+ expected[1].child_flush_dep_height_rc[1] = 0;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[0] = 0;
+ expected[2].flush_dep_height = 0;
+ expected[3].flush_dep_par_type = -1;
+ expected[3].flush_dep_par_idx = -1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].child_flush_dep_height_rc[1] = 0;
+ expected[0].child_flush_dep_height_rc[0] = 1;
+ expected[0].flush_dep_height = 1;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+ expected[2].flush_dep_par_type = -1;
+ expected[2].flush_dep_par_idx = -1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].is_pinned = FALSE;
+ expected[0].child_flush_dep_height_rc[0] = 0;
+ expected[0].flush_dep_height = 0;
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #4a - Multiple children for a single parent, increasing addr order */
+
+ /* Create flush dependency between entries (child) 0,1,2,3->4 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ for(u = 0; u < 4; u++) {
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, (int32_t)u);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[u].flush_dep_par_type = entry_type;
+ expected[u].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = u + 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 3, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 4, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0-4 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, FALSE);
+ dirty_entry(cache_ptr, entry_type, 1, FALSE);
+ dirty_entry(cache_ptr, entry_type, 2, FALSE);
+ dirty_entry(cache_ptr, entry_type, 3, FALSE);
+ dirty_entry(cache_ptr, entry_type, 4, TRUE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+ expected[3].flushed = FALSE;
+ expected[3].flush_order = -1;
+ expected[4].flushed = FALSE;
+ expected[4].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 0;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 1;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 2;
+ expected[3].is_dirty = FALSE;
+ expected[3].flushed = TRUE;
+ expected[3].flush_order = 3;
+ expected[4].is_dirty = FALSE;
+ expected[4].flushed = TRUE;
+ expected[4].flush_order = 4;
+ expected[4].is_protected = FALSE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries */
+ {
+ for(u = 0; u < 4; u++) {
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, (int32_t)u);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[u].flush_dep_par_type = -1;
+ expected[u].flush_dep_par_idx = -1;
+ expected[4].child_flush_dep_height_rc[0] = 3 - u;
+
+ /* Check for destroying flush dependency on last entry */
+ if(3 == u) {
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].is_pinned = FALSE;
+ expected[4].flush_dep_height = 0;
+ } /* end if */
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+ }
+
+/* Test Case #4b - Multiple children for a single parent, decreasing addr order */
+
+ /* Create flush dependency between entries (child) 0,1,2,3->4 (parent) */
+ {
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ for(u = 1; u < 5; u++) {
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, (int32_t)u);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[u].flush_dep_par_type = entry_type;
+ expected[u].flush_dep_par_idx = 0;
+ expected[0].is_protected = TRUE;
+ expected[0].is_pinned = TRUE;
+ expected[0].child_flush_dep_height_rc[0] = u;
+ expected[0].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 3, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 4, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0-4 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, TRUE);
+ dirty_entry(cache_ptr, entry_type, 1, FALSE);
+ dirty_entry(cache_ptr, entry_type, 2, FALSE);
+ dirty_entry(cache_ptr, entry_type, 3, FALSE);
+ dirty_entry(cache_ptr, entry_type, 4, FALSE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+ expected[3].flushed = FALSE;
+ expected[3].flush_order = -1;
+ expected[4].flushed = FALSE;
+ expected[4].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 4;
+ expected[0].is_protected = FALSE;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 0;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 1;
+ expected[3].is_dirty = FALSE;
+ expected[3].flushed = TRUE;
+ expected[3].flush_order = 2;
+ expected[4].is_dirty = FALSE;
+ expected[4].flushed = TRUE;
+ expected[4].flush_order = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries */
+ {
+ for(u = 1; u < 5; u++) {
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, (int32_t)u);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[u].flush_dep_par_type = -1;
+ expected[u].flush_dep_par_idx = -1;
+ expected[0].child_flush_dep_height_rc[0] = 4 - u;
+
+ /* Check for destroying flush dependency on last entry */
+ if(4 == u) {
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].is_pinned = FALSE;
+ expected[0].flush_dep_height = 0;
+ } /* end if */
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ } /* end for */
+ }
+
+/* Test Case #5a - Join two flush dependency chains together, creating a single
+ * un-forked dependency chain
+ */
+
+ /* Create flush dependency between entries (child) 0->1 and 3->4 (parent)
+ * then add entry 4 as a child of 0
+ */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[3].flush_dep_par_type = entry_type;
+ expected[3].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 0, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[4].flush_dep_par_type = entry_type;
+ expected[4].flush_dep_par_idx = 0;
+ expected[0].is_protected = TRUE;
+ expected[0].is_pinned = TRUE;
+ expected[0].child_flush_dep_height_rc[1] = 1;
+ expected[0].flush_dep_height = 2;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].child_flush_dep_height_rc[2] = 1;
+ expected[1].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ add_flush_op(entry_type, 3, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 4, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 0, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0 & 1, 3 & 4 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, TRUE);
+ dirty_entry(cache_ptr, entry_type, 1, TRUE);
+ dirty_entry(cache_ptr, entry_type, 3, FALSE);
+ dirty_entry(cache_ptr, entry_type, 4, TRUE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+ expected[3].flushed = FALSE;
+ expected[3].flush_order = -1;
+ expected[4].flushed = FALSE;
+ expected[4].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 2;
+ expected[0].is_protected = FALSE;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 3;
+ expected[1].is_protected = FALSE;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[3].is_dirty = FALSE;
+ expected[3].flushed = TRUE;
+ expected[3].flush_order = 0;
+ expected[4].is_dirty = FALSE;
+ expected[4].flushed = TRUE;
+ expected[4].flush_order = 1;
+ expected[4].is_protected = FALSE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, detaching 3->4 from 0 first */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 0, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].flush_dep_par_type = -1;
+ expected[4].flush_dep_par_idx = -1;
+ expected[0].is_pinned = FALSE;
+ expected[0].child_flush_dep_height_rc[1] = 0;
+ expected[0].flush_dep_height = 0;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].child_flush_dep_height_rc[2] = 0;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[3].flush_dep_par_type = -1;
+ expected[3].flush_dep_par_idx = -1;
+ expected[4].is_pinned = FALSE;
+ expected[4].child_flush_dep_height_rc[0] = 0;
+ expected[4].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #5b - Join two flush dependency chains together, creating a
+ * forked dependency chain
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2 and 3->4 (parent)
+ * then add entry 4 as a child of 1
+ */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[3].flush_dep_par_type = entry_type;
+ expected[3].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[4].flush_dep_par_type = entry_type;
+ expected[4].flush_dep_par_idx = 1;
+ expected[1].child_flush_dep_height_rc[1] = 1;
+ expected[1].flush_dep_height = 2;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].child_flush_dep_height_rc[2] = 1;
+ expected[2].flush_dep_height = 3;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 3, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 4, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0-4 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, FALSE);
+ dirty_entry(cache_ptr, entry_type, 1, TRUE);
+ dirty_entry(cache_ptr, entry_type, 2, TRUE);
+ dirty_entry(cache_ptr, entry_type, 3, FALSE);
+ dirty_entry(cache_ptr, entry_type, 4, TRUE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+ expected[3].flushed = FALSE;
+ expected[3].flush_order = -1;
+ expected[4].flushed = FALSE;
+ expected[4].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 0;
+ expected[0].is_protected = FALSE;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 3;
+ expected[1].is_protected = FALSE;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 4;
+ expected[2].is_protected = FALSE;
+ expected[3].is_dirty = FALSE;
+ expected[3].flushed = TRUE;
+ expected[3].flush_order = 1;
+ expected[4].is_dirty = FALSE;
+ expected[4].flushed = TRUE;
+ expected[4].flush_order = 2;
+ expected[4].is_protected = FALSE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, detaching 3->4 from 1 first */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].flush_dep_par_type = -1;
+ expected[4].flush_dep_par_idx = -1;
+ expected[1].child_flush_dep_height_rc[1] = 0;
+ expected[1].flush_dep_height = 1;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].child_flush_dep_height_rc[2] = 0;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[3].flush_dep_par_type = -1;
+ expected[3].flush_dep_par_idx = -1;
+ expected[4].is_pinned = FALSE;
+ expected[4].child_flush_dep_height_rc[0] = 0;
+ expected[4].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+/* Test Case #5c - Join two flush dependency chains together, creating a
+ * forked dependency chain
+ */
+
+ /* Create flush dependency between entries (child) 0->1->2 and 3->4 (parent)
+ * then add entry 4 as a child of 2
+ */
+ {
+ protect_entry(cache_ptr, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[0].flush_dep_par_type = entry_type;
+ expected[0].flush_dep_par_idx = 1;
+ expected[1].is_protected = TRUE;
+ expected[1].is_pinned = TRUE;
+ expected[1].child_flush_dep_height_rc[0] = 1;
+ expected[1].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 2);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[1].flush_dep_par_type = entry_type;
+ expected[1].flush_dep_par_idx = 2;
+ expected[2].is_protected = TRUE;
+ expected[2].is_pinned = TRUE;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+ expected[2].flush_dep_height = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ protect_entry(cache_ptr, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("protect_entry failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[3].flush_dep_par_type = entry_type;
+ expected[3].flush_dep_par_idx = 4;
+ expected[4].is_protected = TRUE;
+ expected[4].is_pinned = TRUE;
+ expected[4].child_flush_dep_height_rc[0] = 1;
+ expected[4].flush_dep_height = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ create_flush_dependency(cache_ptr, entry_type, 2, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("create_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after creating flush dependency
+ */
+ expected[4].flush_dep_par_type = entry_type;
+ expected[4].flush_dep_par_idx = 2;
+ expected[2].child_flush_dep_height_rc[1] = 2;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ }
+
+ /* Flush the cache and verify that the entries were flushed in correct order */
+ {
+ herr_t result; /* Generic return value */
+
+ add_flush_op(entry_type, 0, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 1, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 2, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 3, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+ add_flush_op(entry_type, 4, FLUSH_OP__ORDER,
+ entry_type, 0, FALSE, (size_t)0, &flush_order);
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 1, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 2, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ unprotect_entry(cache_ptr, /* H5C_t * cache_ptr */
+ entry_type, /* int32_t type */
+ 4, /* int32_t idx */
+ FALSE, /* int32_t dirty */
+ H5C__NO_FLAGS_SET); /* unsigned int flags */
+ if ( !pass ) CACHE_ERROR("unprotect_entry failed")
+
+ /* Mark entries 0-4 dirty, so they are flushed */
+ dirty_entry(cache_ptr, entry_type, 0, FALSE);
+ dirty_entry(cache_ptr, entry_type, 1, TRUE);
+ dirty_entry(cache_ptr, entry_type, 2, TRUE);
+ dirty_entry(cache_ptr, entry_type, 3, FALSE);
+ dirty_entry(cache_ptr, entry_type, 4, TRUE);
+ if ( !pass ) CACHE_ERROR("dirty_entry failed")
+
+ /* Reset 'flushed' flag & 'flush_order' value in expected array */
+ expected[0].flushed = FALSE;
+ expected[0].flush_order = -1;
+ expected[1].flushed = FALSE;
+ expected[1].flush_order = -1;
+ expected[2].flushed = FALSE;
+ expected[2].flush_order = -1;
+ expected[3].flushed = FALSE;
+ expected[3].flush_order = -1;
+ expected[4].flushed = FALSE;
+ expected[4].flush_order = -1;
+
+ /* Reset index for tracking flush order */
+ flush_order = 0;
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET);
+ if( result < 0 ) CACHE_ERROR("flushing entries with flush dependendices")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroy flush dependency
+ */
+ expected[0].is_dirty = FALSE;
+ expected[0].flushed = TRUE;
+ expected[0].flush_order = 0;
+ expected[0].is_protected = FALSE;
+ expected[1].is_dirty = FALSE;
+ expected[1].flushed = TRUE;
+ expected[1].flush_order = 2;
+ expected[1].is_protected = FALSE;
+ expected[2].is_dirty = FALSE;
+ expected[2].flushed = TRUE;
+ expected[2].flush_order = 4;
+ expected[2].is_protected = FALSE;
+ expected[3].is_dirty = FALSE;
+ expected[3].flushed = TRUE;
+ expected[3].flush_order = 1;
+ expected[4].is_dirty = FALSE;
+ expected[4].flushed = TRUE;
+ expected[4].flush_order = 3;
+ expected[4].is_protected = FALSE;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+ /* Destroy flush dependency between entries, detaching 3->4 from 2 first */
+ {
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 4);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[4].flush_dep_par_type = -1;
+ expected[4].flush_dep_par_idx = -1;
+ expected[2].child_flush_dep_height_rc[1] = 1;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 4, entry_type, 3);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[3].flush_dep_par_type = -1;
+ expected[3].flush_dep_par_idx = -1;
+ expected[4].is_pinned = FALSE;
+ expected[4].child_flush_dep_height_rc[0] = 0;
+ expected[4].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 2, entry_type, 1);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[1].flush_dep_par_type = -1;
+ expected[1].flush_dep_par_idx = -1;
+ expected[2].is_pinned = FALSE;
+ expected[2].child_flush_dep_height_rc[1] = 0;
+ expected[2].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+
+ destroy_flush_dependency(cache_ptr, entry_type, 1, entry_type, 0);
+ if ( !pass ) CACHE_ERROR("destroy_flush_dependency failed")
+
+ /* Change expected values, and verify the status of the entries
+ * after destroying flush dependency
+ */
+ expected[0].flush_dep_par_type = -1;
+ expected[0].flush_dep_par_idx = -1;
+ expected[1].is_pinned = FALSE;
+ expected[1].child_flush_dep_height_rc[0] = 0;
+ expected[1].flush_dep_height = 0;
+
+ /* Verify the status */
+ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */
+ (int)0, /* int tag */
+ (int)5, /* int num_entries */
+ expected); /* struct expected_entry_staus[] */
+ if ( !pass ) CACHE_ERROR("verify_entry_status failed")
+ }
+
+
+done:
+ if(cache_ptr)
+ takedown_cache(cache_ptr, FALSE, FALSE);
+
+ if ( pass )
+ PASSED()
+ else {
+ H5_FAILED();
+ HDfprintf(stdout, "%s.\n", failure_mssg);
+ } /* end else */
+
+ return (unsigned)!pass;
+} /* check_flush_deps_order() */
+
+
+/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Run tests on the cache code contained in H5C.c
@@ -29725,6 +33676,8 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion)
int
main(void)
{
+ unsigned nerrs = 0;
+
H5open();
skip_long_tests = FALSE;
@@ -29735,55 +33688,54 @@ main(void)
run_full_test = FALSE;
#endif /* NDEBUG */
-#if 0
- run_full_test = TRUE;
-#endif
-
-#if 1
- smoke_check_1();
- smoke_check_2();
- smoke_check_3();
- smoke_check_4();
- smoke_check_5();
- smoke_check_6();
- smoke_check_7();
- smoke_check_8();
- smoke_check_9();
- smoke_check_10();
-#endif
-
- write_permitted_check();
- check_insert_entry();
- check_flush_cache();
- check_get_entry_status();
- check_expunge_entry();
- check_multiple_read_protect();
- check_rename_entry();
- check_pin_protected_entry();
- check_resize_entry();
- check_evictions_enabled();
- check_flush_protected_err();
- check_destroy_pinned_err();
- check_destroy_protected_err();
- check_duplicate_insert_err();
- check_rename_err();
- check_double_pin_err();
- check_double_unpin_err();
- check_pin_entry_errs();
- check_double_protect_err();
- check_double_unprotect_err();
- check_mark_entry_dirty_errs();
- check_expunge_entry_errs();
- check_resize_entry_errs();
- check_unprotect_ro_dirty_err();
- check_protect_ro_rw_err();
- check_check_evictions_enabled_err();
- check_auto_cache_resize();
- check_auto_cache_resize_disable();
- check_auto_cache_resize_epoch_markers();
- check_auto_cache_resize_input_errs();
- check_auto_cache_resize_aux_fcns();
- check_metadata_blizzard_absence(TRUE);
- check_metadata_blizzard_absence(FALSE);
- return(0);
+ nerrs += smoke_check_1();
+ nerrs += smoke_check_2();
+ nerrs += smoke_check_3();
+ nerrs += smoke_check_4();
+ nerrs += smoke_check_5();
+ nerrs += smoke_check_6();
+ nerrs += smoke_check_7();
+ nerrs += smoke_check_8();
+ nerrs += smoke_check_9();
+ nerrs += smoke_check_10();
+
+ nerrs += write_permitted_check();
+ nerrs += check_insert_entry();
+ nerrs += check_flush_cache();
+ nerrs += check_get_entry_status();
+ nerrs += check_expunge_entry();
+ nerrs += check_multiple_read_protect();
+ nerrs += check_rename_entry();
+ nerrs += check_pin_protected_entry();
+ nerrs += check_resize_entry();
+ nerrs += check_evictions_enabled();
+ nerrs += check_flush_protected_err();
+ nerrs += check_destroy_pinned_err();
+ nerrs += check_destroy_protected_err();
+ nerrs += check_duplicate_insert_err();
+ nerrs += check_rename_err();
+ nerrs += check_double_pin_err();
+ nerrs += check_double_unpin_err();
+ nerrs += check_pin_entry_errs();
+ nerrs += check_double_protect_err();
+ nerrs += check_double_unprotect_err();
+ nerrs += check_mark_entry_dirty_errs();
+ nerrs += check_expunge_entry_errs();
+ nerrs += check_resize_entry_errs();
+ nerrs += check_unprotect_ro_dirty_err();
+ nerrs += check_protect_ro_rw_err();
+ nerrs += check_check_evictions_enabled_err();
+ nerrs += check_auto_cache_resize();
+ nerrs += check_auto_cache_resize_disable();
+ nerrs += check_auto_cache_resize_epoch_markers();
+ nerrs += check_auto_cache_resize_input_errs();
+ nerrs += check_auto_cache_resize_aux_fcns();
+ nerrs += check_metadata_blizzard_absence(TRUE);
+ nerrs += check_metadata_blizzard_absence(FALSE);
+ nerrs += check_flush_deps();
+ nerrs += check_flush_deps_err();
+ nerrs += check_flush_deps_order();
+
+ return(nerrs > 0);
}
+
diff --git a/test/cache_common.c b/test/cache_common.c
index 39131bf..7f8a458 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -33,16 +33,18 @@ hbool_t skip_long_tests = TRUE;
hbool_t run_full_test = TRUE;
const char *failure_mssg = NULL;
-test_entry_t pico_entries[NUM_PICO_ENTRIES];
-test_entry_t nano_entries[NUM_NANO_ENTRIES];
-test_entry_t micro_entries[NUM_MICRO_ENTRIES];
-test_entry_t tiny_entries[NUM_TINY_ENTRIES];
-test_entry_t small_entries[NUM_SMALL_ENTRIES];
-test_entry_t medium_entries[NUM_MEDIUM_ENTRIES];
-test_entry_t large_entries[NUM_LARGE_ENTRIES];
-test_entry_t huge_entries[NUM_HUGE_ENTRIES];
-test_entry_t monster_entries[NUM_MONSTER_ENTRIES];
-test_entry_t variable_entries[NUM_VARIABLE_ENTRIES];
+test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES];
+test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES];
+test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES];
+test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES];
+test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES];
+test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES];
+test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES];
+test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES];
+test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES];
+test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES];
+
+hbool_t orig_entry_arrays_init = FALSE;
test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] =
{
@@ -58,6 +60,20 @@ test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] =
variable_entries
};
+test_entry_t * orig_entries[NUMBER_OF_ENTRY_TYPES] =
+{
+ orig_pico_entries,
+ orig_nano_entries,
+ orig_micro_entries,
+ orig_tiny_entries,
+ orig_small_entries,
+ orig_medium_entries,
+ orig_large_entries,
+ orig_huge_entries,
+ orig_monster_entries,
+ orig_variable_entries
+};
+
const int32_t max_indices[NUMBER_OF_ENTRY_TYPES] =
{
NUM_PICO_ENTRIES - 1,
@@ -1155,7 +1171,8 @@ add_flush_op(int target_type,
int type,
int idx,
hbool_t flag,
- size_t new_size)
+ size_t new_size,
+ unsigned * order_ptr)
{
int i;
test_entry_t * target_base_addr;
@@ -1188,6 +1205,7 @@ add_flush_op(int target_type,
(target_entry_ptr->flush_ops)[i].idx = idx;
(target_entry_ptr->flush_ops)[i].flag = flag;
(target_entry_ptr->flush_ops)[i].size = new_size;
+ (target_entry_ptr->flush_ops)[i].order_ptr = order_ptr;
}
@@ -1454,6 +1472,12 @@ execute_flush_op(H5C_t * cache_ptr,
op_ptr->flag);
break;
+ case FLUSH_OP__ORDER:
+ HDassert( op_ptr->order_ptr );
+ entry_ptr->flush_order = *op_ptr->order_ptr;
+ (*op_ptr->order_ptr)++;
+ break;
+
default:
pass = FALSE;
failure_mssg = "Undefined flush op code.";
@@ -1524,7 +1548,7 @@ entry_in_cache(H5C_t * cache_ptr,
/*-------------------------------------------------------------------------
* Function: reset_entries
*
- * Purpose: reset the contents of the entries arrays to know values.
+ * Purpose: reset the contents of the entries arrays to known values.
*
* Return: void
*
@@ -1549,87 +1573,121 @@ reset_entries(void)
{
int i;
- int j;
- int k;
- int32_t max_index;
- haddr_t addr = 0;
- haddr_t alt_addr = PICO_ALT_BASE_ADDR;
- size_t entry_size;
- test_entry_t * base_addr;
- for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
+ if( !orig_entry_arrays_init)
{
- entry_size = entry_sizes[i];
- max_index = max_indices[i];
- base_addr = entries[i];
+ haddr_t addr = 0;
+ haddr_t alt_addr = PICO_ALT_BASE_ADDR;
- HDassert( base_addr );
-
- for ( j = 0; j <= max_index; j++ )
+ for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
{
- /* one can argue that we should fill the header with garbage.
- * If this is desired, we can simply comment out the header
- * initialization - the headers will be full of garbage soon
- * enough.
- */
+ int32_t max_index;
+ size_t entry_size;
+ test_entry_t * base_addr;
+ test_entry_t * orig_base_addr;
+ int j;
+
+ entry_size = entry_sizes[i];
+ max_index = max_indices[i];
+ base_addr = entries[i];
+ orig_base_addr = orig_entries[i];
+
+ HDassert( base_addr );
+ HDassert( orig_base_addr );
- base_addr[j].header.addr = (haddr_t)0;
- base_addr[j].header.size = (size_t)0;
- base_addr[j].header.type = NULL;
- base_addr[j].header.is_dirty = FALSE;
- base_addr[j].header.is_protected = FALSE;
- base_addr[j].header.is_read_only = FALSE;
- base_addr[j].header.ro_ref_count = FALSE;
- base_addr[j].header.next = NULL;
- base_addr[j].header.prev = NULL;
- base_addr[j].header.aux_next = NULL;
- base_addr[j].header.aux_prev = NULL;
-
- base_addr[j].self = &(base_addr[j]);
- base_addr[j].cache_ptr = NULL;
- base_addr[j].addr = addr;
- base_addr[j].at_main_addr = TRUE;
- base_addr[j].main_addr = addr;
- base_addr[j].alt_addr = alt_addr;
- base_addr[j].size = entry_size;
- base_addr[j].type = i;
- base_addr[j].index = j;
- base_addr[j].reads = 0;
- base_addr[j].writes = 0;
- base_addr[j].is_dirty = FALSE;
- base_addr[j].is_protected = FALSE;
- base_addr[j].is_read_only = FALSE;
- base_addr[j].ro_ref_count = FALSE;
-
- base_addr[j].is_pinned = FALSE;
- base_addr[j].pinning_ref_count = 0;
- base_addr[j].num_pins = 0;
- for ( k = 0; k < MAX_PINS; k++ )
+ for ( j = 0; j <= max_index; j++ )
{
- base_addr[j].pin_type[k] = -1;
- base_addr[j].pin_idx[k] = -1;
- }
+ int k;
+
+ /* one can argue that we should fill the header with garbage.
+ * If this is desired, we can simply comment out the header
+ * initialization - the headers will be full of garbage soon
+ * enough.
+ */
+
+ base_addr[j].header.addr = (haddr_t)0;
+ base_addr[j].header.size = (size_t)0;
+ base_addr[j].header.type = NULL;
+ base_addr[j].header.is_dirty = FALSE;
+ base_addr[j].header.is_protected = FALSE;
+ base_addr[j].header.is_read_only = FALSE;
+ base_addr[j].header.ro_ref_count = FALSE;
+ base_addr[j].header.next = NULL;
+ base_addr[j].header.prev = NULL;
+ base_addr[j].header.aux_next = NULL;
+ base_addr[j].header.aux_prev = NULL;
+
+ base_addr[j].self = &(base_addr[j]);
+ base_addr[j].cache_ptr = NULL;
+ base_addr[j].addr = addr;
+ base_addr[j].at_main_addr = TRUE;
+ base_addr[j].main_addr = addr;
+ base_addr[j].alt_addr = alt_addr;
+ base_addr[j].size = entry_size;
+ base_addr[j].type = i;
+ base_addr[j].index = j;
+ base_addr[j].reads = 0;
+ base_addr[j].writes = 0;
+ base_addr[j].is_dirty = FALSE;
+ base_addr[j].is_protected = FALSE;
+ base_addr[j].is_read_only = FALSE;
+ base_addr[j].ro_ref_count = FALSE;
+
+ base_addr[j].is_pinned = FALSE;
+ base_addr[j].pinning_ref_count = 0;
+ base_addr[j].num_pins = 0;
+ for ( k = 0; k < MAX_PINS; k++ )
+ {
+ base_addr[j].pin_type[k] = -1;
+ base_addr[j].pin_idx[k] = -1;
+ }
- base_addr[j].num_flush_ops = 0;
- for ( k = 0; k < MAX_FLUSH_OPS; k++ )
- {
- base_addr[j].flush_ops[k].op_code = FLUSH_OP__NO_OP;
- base_addr[j].flush_ops[k].type = -1;
- base_addr[j].flush_ops[k].idx = -1;
- base_addr[j].flush_ops[k].flag = FALSE;
- base_addr[j].flush_ops[k].size = 0;
- }
- base_addr[j].flush_op_self_resize_in_progress = FALSE;
+ base_addr[j].num_flush_ops = 0;
+ for ( k = 0; k < MAX_FLUSH_OPS; k++ )
+ {
+ base_addr[j].flush_ops[k].op_code = FLUSH_OP__NO_OP;
+ base_addr[j].flush_ops[k].type = -1;
+ base_addr[j].flush_ops[k].idx = -1;
+ base_addr[j].flush_ops[k].flag = FALSE;
+ base_addr[j].flush_ops[k].size = 0;
+ }
+ base_addr[j].flush_op_self_resize_in_progress = FALSE;
- base_addr[j].loaded = FALSE;
- base_addr[j].cleared = FALSE;
- base_addr[j].flushed = FALSE;
- base_addr[j].destroyed = FALSE;
+ base_addr[j].loaded = FALSE;
+ base_addr[j].cleared = FALSE;
+ base_addr[j].flushed = FALSE;
+ base_addr[j].destroyed = FALSE;
- addr += (haddr_t)entry_size;
- alt_addr += (haddr_t)entry_size;
- }
- }
+ base_addr[j].flush_dep_par_type = -1;
+ base_addr[j].flush_dep_par_idx = -1;
+ for ( k = 0; k < H5C__NUM_FLUSH_DEP_HEIGHTS; k++ )
+ base_addr[j].child_flush_dep_height_rc[k] = 0;
+ base_addr[j].flush_dep_height = 0;
+
+ base_addr[j].flush_order = 0;
+
+ addr += (haddr_t)entry_size;
+ alt_addr += (haddr_t)entry_size;
+ } /* end for */
+
+ /* Make copy of entries in base_addr for later */
+ HDmemcpy(orig_base_addr, base_addr, (size_t)(max_index + 1) * sizeof( *base_addr ));
+ } /* end for */
+
+ /* Indicate that we've made a copy for later */
+ orig_entry_arrays_init = TRUE;
+ } /* end if */
+ else {
+ for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
+ {
+ int32_t max_index = max_indices[i];
+ test_entry_t * base_addr = entries[i];
+ test_entry_t * orig_base_addr = orig_entries[i];
+
+ /* Make copy of entries in base_addr for later */
+ HDmemcpy(base_addr, orig_base_addr, (size_t)(max_index + 1) * sizeof( *base_addr ));
+ } /* end for */
+ } /* end else */
return;
@@ -1755,7 +1813,7 @@ resize_pinned_entry(H5C_t * cache_ptr,
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
- HDassert( type = VARIABLE_ENTRY_TYPE ) ;
+ HDassert( type == VARIABLE_ENTRY_TYPE ) ;
HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes[type] ) );
if ( pass ) {
@@ -1891,16 +1949,15 @@ verify_entry_status(H5C_t * cache_ptr,
struct expected_entry_status expected[])
{
static char msg[128];
- hbool_t in_cache = FALSE; /* will set to TRUE if necessary */
int i;
- test_entry_t * entry_ptr;
- test_entry_t * base_addr;
i = 0;
while ( ( pass ) && ( i < num_entries ) )
{
- base_addr = entries[expected[i].entry_type];
- entry_ptr = &(base_addr[expected[i].entry_index]);
+ test_entry_t * base_addr = entries[expected[i].entry_type];
+ test_entry_t * entry_ptr = &(base_addr[expected[i].entry_index]);
+ hbool_t in_cache = FALSE; /* will set to TRUE if necessary */
+ unsigned u; /* Local index variable */
if ( ( ! expected[i].in_cache ) &&
( ( expected[i].is_dirty ) ||
@@ -1937,7 +1994,7 @@ verify_entry_status(H5C_t * cache_ptr,
pass = FALSE;
sprintf(msg,
- "%d entry (%d, %d) size actualexpected = %ld/%ld.\n",
+ "%d entry (%d, %d) size actual/expected = %ld/%ld.\n",
tag,
(int)expected[i].entry_type,
(int)expected[i].entry_index,
@@ -2099,8 +2156,131 @@ verify_entry_status(H5C_t * cache_ptr,
failure_mssg = msg;
}
}
+
+ /* Check flush dependency fields */
+
+ /* Flush dependency parent type & index */
+ if ( pass ) {
+ if ( entry_ptr->flush_dep_par_type != expected[i].flush_dep_par_type ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) flush_dep_par_type actual/expected = %d/%d.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ entry_ptr->flush_dep_par_type,
+ expected[i].flush_dep_par_type);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+ if ( pass ) {
+ if ( entry_ptr->flush_dep_par_idx != expected[i].flush_dep_par_idx ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) flush_dep_par_idx actual/expected = %d/%d.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ entry_ptr->flush_dep_par_idx,
+ expected[i].flush_dep_par_idx);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+ if ( ( pass ) && ( in_cache ) && expected[i].flush_dep_par_idx >= 0 ) {
+ test_entry_t * par_base_addr = entries[expected[i].flush_dep_par_type];
+
+ if ( entry_ptr->header.flush_dep_parent != (H5C_cache_entry_t *)&(par_base_addr[expected[i].flush_dep_par_idx]) ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) header flush_dep_parent actual/expected = %p/%p.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ (void *)entry_ptr->header.flush_dep_parent,
+ (void *)&(par_base_addr[expected[i].flush_dep_par_idx]));
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+
+ /* Flush dependency child ref. counts */
+ for(u = 0; u < H5C__NUM_FLUSH_DEP_HEIGHTS; u++) {
+ if ( pass ) {
+ if ( entry_ptr->child_flush_dep_height_rc[u] != expected[i].child_flush_dep_height_rc[u] ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) child_flush_dep_height_rc[%u] actual/expected = %llu/%llu.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ u,
+ (unsigned long long)(entry_ptr->child_flush_dep_height_rc[u]),
+ (unsigned long long)expected[i].child_flush_dep_height_rc[u]);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+ if ( ( pass ) && ( in_cache ) ) {
+ if ( entry_ptr->header.child_flush_dep_height_rc[u] != expected[i].child_flush_dep_height_rc[u] ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) header child_flush_dep_height_rc[%u] actual/expected = %llu/%llu.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ u,
+ (unsigned long long)entry_ptr->header.child_flush_dep_height_rc[u],
+ (unsigned long long)expected[i].child_flush_dep_height_rc[u]);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+ } /* end for */
+
+ /* Flush dependency height */
+ if ( pass ) {
+ if ( entry_ptr->flush_dep_height != expected[i].flush_dep_height ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) flush_dep_height actual/expected = %u/%u.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ entry_ptr->flush_dep_height,
+ expected[i].flush_dep_height);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+ if ( ( pass ) && ( in_cache ) ) {
+ if ( entry_ptr->header.flush_dep_height != expected[i].flush_dep_height ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) header flush_dep_height actual/expected = %u/%u.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ entry_ptr->header.flush_dep_height,
+ expected[i].flush_dep_height);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+
+ /* Flush dependency flush order */
+ if ( pass ) {
+ if ( expected[i].flush_order >= 0 && entry_ptr->flush_order != (unsigned)expected[i].flush_order ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) flush_order actual/expected = %u/%d.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ entry_ptr->flush_order,
+ expected[i].flush_order);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+
i++;
} /* while */
+if(!pass)
+ HDfprintf(stderr, "failure_mssg = '%s'\n", failure_mssg);
return;
@@ -2461,7 +2641,7 @@ insert_entry(H5C_t * cache_ptr,
HDassert( entry_ptr == entry_ptr->self );
HDassert( !(entry_ptr->is_protected) );
- insert_pinned = ((flags & H5C__PIN_ENTRY_FLAG) != 0 );
+ insert_pinned = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0 );
entry_ptr->is_dirty = TRUE;
@@ -2852,7 +3032,7 @@ protect_entry(H5C_t * cache_ptr,
HDassert( entry_ptr == entry_ptr->self );
HDassert( !(entry_ptr->is_protected) );
- cache_entry_ptr = H5C_protect(NULL, -1, -1, cache_ptr, &(types[type]),
+ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(NULL, -1, -1, cache_ptr, &(types[type]),
entry_ptr->addr, NULL, NULL,
H5C__NO_FLAGS_SET);
@@ -2951,7 +3131,7 @@ protect_entry_ro(H5C_t * cache_ptr,
( ( entry_ptr->is_read_only ) &&
( entry_ptr->ro_ref_count > 0 ) ) );
- cache_entry_ptr = H5C_protect(NULL, -1, -1, cache_ptr, &(types[type]),
+ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(NULL, -1, -1, cache_ptr, &(types[type]),
entry_ptr->addr, NULL, NULL,
H5C__READ_ONLY_FLAG);
@@ -2986,6 +3166,67 @@ protect_entry_ro(H5C_t * cache_ptr,
/*-------------------------------------------------------------------------
+ * Function: pin_entry()
+ *
+ * Purpose: Pin the entry indicated by the type and index.
+ *
+ * Do nothing if pass is FALSE on entry.
+ *
+ * Return: void
+ *
+ * Programmer: Quincey Koziol
+ * 3/17/09
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+pin_entry(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx)
+{
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
+
+ if ( pass ) {
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+ herr_t result;
+
+ base_addr = entries[type];
+ entry_ptr = &(base_addr[idx]);
+
+ HDassert( entry_ptr->index == idx );
+ HDassert( entry_ptr->type == type );
+ HDassert( entry_ptr == entry_ptr->self );
+ HDassert( entry_ptr->is_protected );
+ HDassert( !(entry_ptr->is_pinned) );
+
+ result = H5C_pin_protected_entry(cache_ptr, (void *)entry_ptr);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_pin_protected_entry() reports failure.";
+
+ } else if ( ! ( entry_ptr->header.is_pinned ) ) {
+
+ pass = FALSE;
+ failure_mssg = "entry not pinned when it should be.";
+
+ } else {
+
+ entry_ptr->is_pinned = TRUE;
+ }
+ } /* end if */
+
+ return;
+
+} /* pin_entry() */
+
+
+/*-------------------------------------------------------------------------
* Function: unpin_entry()
*
* Purpose: Unpin the entry indicated by the type and index.
@@ -3027,7 +3268,6 @@ unpin_entry(H5C_t * cache_ptr,
HDassert( entry_ptr->type == type );
HDassert( entry_ptr == entry_ptr->self );
HDassert( entry_ptr->cache_ptr == cache_ptr );
- HDassert( ! (entry_ptr->header.is_protected) );
HDassert( entry_ptr->header.is_pinned );
HDassert( entry_ptr->is_pinned );
@@ -3120,8 +3360,8 @@ unprotect_entry(H5C_t * cache_ptr,
HDassert( entry_ptr->header.is_protected );
HDassert( entry_ptr->is_protected );
- pin_flag_set = ((flags & H5C__PIN_ENTRY_FLAG) != 0 );
- unpin_flag_set = ((flags & H5C__UNPIN_ENTRY_FLAG) != 0 );
+ pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0 );
+ unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0 );
HDassert ( ! ( pin_flag_set && unpin_flag_set ) );
HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) );
@@ -3130,7 +3370,7 @@ unprotect_entry(H5C_t * cache_ptr,
if ( ( dirty == TRUE ) || ( dirty == FALSE ) ) {
flags |= (dirty ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET);
- entry_ptr->is_dirty = (entry_ptr->is_dirty || dirty);
+ entry_ptr->is_dirty = (hbool_t)(entry_ptr->is_dirty || dirty);
}
result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[type]),
@@ -3278,10 +3518,10 @@ unprotect_entry_with_size_change(H5C_t * cache_ptr,
HDassert( entry_ptr->header.is_protected );
HDassert( entry_ptr->is_protected );
- dirty_flag_set = ((flags & H5C__DIRTIED_FLAG) != 0 );
- pin_flag_set = ((flags & H5C__PIN_ENTRY_FLAG) != 0 );
- unpin_flag_set = ((flags & H5C__UNPIN_ENTRY_FLAG) != 0 );
- size_changed_flag_set = ((flags & H5C__SIZE_CHANGED_FLAG) != 0 );
+ dirty_flag_set = (hbool_t)((flags & H5C__DIRTIED_FLAG) != 0 );
+ pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0 );
+ unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0 );
+ size_changed_flag_set = (hbool_t)((flags & H5C__SIZE_CHANGED_FLAG) != 0 );
HDassert ( ! ( pin_flag_set && unpin_flag_set ) );
HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) );
@@ -3290,7 +3530,7 @@ unprotect_entry_with_size_change(H5C_t * cache_ptr,
HDassert ( ( ! size_changed_flag_set ) ||
( type == VARIABLE_ENTRY_TYPE ) );
- entry_ptr->is_dirty = (entry_ptr->is_dirty || dirty_flag_set);
+ entry_ptr->is_dirty = (hbool_t)(entry_ptr->is_dirty || dirty_flag_set);
if ( size_changed_flag_set ) {
@@ -4667,3 +4907,213 @@ hl_col_major_scan_backward(H5C_t * cache_ptr,
} /* hl_col_major_scan_backward() */
+
+/*-------------------------------------------------------------------------
+ * Function: create_flush_dependency()
+ *
+ * Purpose: Create a 'flush dependency' between two entries.
+ *
+ * Do nothing if pass is false.
+ *
+ * Return: void
+ *
+ * Programmer: Quincey Koziol
+ * 3/16/09
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+create_flush_dependency(H5C_t * cache_ptr,
+ int32_t par_type,
+ int32_t par_idx,
+ int32_t chd_type,
+ int32_t chd_idx)
+{
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= par_type ) && ( par_type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= par_idx ) && ( par_idx <= max_indices[par_type] ) );
+ HDassert( ( 0 <= chd_type ) && ( chd_type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= chd_idx ) && ( chd_idx <= max_indices[chd_type] ) );
+
+ if ( pass ) {
+ test_entry_t * par_base_addr; /* Base entry of parent's entry array */
+ test_entry_t * par_entry_ptr; /* Parent entry */
+ test_entry_t * chd_base_addr; /* Base entry of child's entry array */
+ test_entry_t * chd_entry_ptr; /* Child entry */
+ hbool_t par_is_pinned; /* Whether parent is already pinned */
+ herr_t result; /* API routine status */
+
+ /* Get parent entry */
+ par_base_addr = entries[par_type];
+ par_entry_ptr = &(par_base_addr[par_idx]);
+ par_is_pinned = par_entry_ptr->header.is_pinned;
+
+ /* Sanity check parent entry */
+ HDassert( par_entry_ptr->index == par_idx );
+ HDassert( par_entry_ptr->type == par_type );
+ HDassert( par_entry_ptr->header.is_protected );
+ HDassert( par_entry_ptr == par_entry_ptr->self );
+
+ /* Get parent entry */
+ chd_base_addr = entries[chd_type];
+ chd_entry_ptr = &(chd_base_addr[chd_idx]);
+
+ /* Sanity check child entry */
+ HDassert( chd_entry_ptr->index == chd_idx );
+ HDassert( chd_entry_ptr->type == chd_type );
+ HDassert( chd_entry_ptr == chd_entry_ptr->self );
+
+ result = H5C_create_flush_dependency(cache_ptr, par_entry_ptr,
+ chd_entry_ptr);
+
+ if ( ( result < 0 ) ||
+ ( !par_entry_ptr->header.is_pinned ) ||
+ ( !(par_entry_ptr->header.flush_dep_height > 0) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "error in H5C_create_flush_dependency().";
+ } /* end if */
+
+ /* Update information about entries */
+ chd_entry_ptr->flush_dep_par_type = par_type;
+ chd_entry_ptr->flush_dep_par_idx = par_idx;
+ par_entry_ptr->child_flush_dep_height_rc[chd_entry_ptr->flush_dep_height]++;
+ if( !par_is_pinned )
+ par_entry_ptr->is_pinned = TRUE;
+
+ /* Check flush dependency heights */
+ while(chd_entry_ptr->flush_dep_height >= par_entry_ptr->flush_dep_height) {
+ unsigned prev_par_flush_dep_height = par_entry_ptr->flush_dep_height; /* Save the previous height */
+
+ par_entry_ptr->flush_dep_height = chd_entry_ptr->flush_dep_height + 1;
+
+ /* Check for parent entry being in flush dependency relationship */
+ if(par_entry_ptr->flush_dep_par_idx >= 0) {
+ /* Move parent & child entries up the flushd dependency 'chain' */
+ chd_entry_ptr = par_entry_ptr;
+ par_base_addr = entries[chd_entry_ptr->flush_dep_par_type];
+ par_entry_ptr = &(par_base_addr[chd_entry_ptr->flush_dep_par_idx]);
+
+ /* Adjust the ref. counts in new parent */
+ HDassert(par_entry_ptr->child_flush_dep_height_rc[prev_par_flush_dep_height] > 0);
+ par_entry_ptr->child_flush_dep_height_rc[prev_par_flush_dep_height]--;
+ par_entry_ptr->child_flush_dep_height_rc[chd_entry_ptr->flush_dep_height]++;
+ } /* end if */
+ } /* end if */
+ } /* end if */
+
+ return;
+
+} /* create_flush_dependency() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: destroy_flush_dependency()
+ *
+ * Purpose: Destroy a 'flush dependency' between two entries.
+ *
+ * Do nothing if pass is false.
+ *
+ * Return: void
+ *
+ * Programmer: Quincey Koziol
+ * 3/16/09
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+destroy_flush_dependency(H5C_t * cache_ptr,
+ int32_t par_type,
+ int32_t par_idx,
+ int32_t chd_type,
+ int32_t chd_idx)
+{
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= par_type ) && ( par_type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= par_idx ) && ( par_idx <= max_indices[par_type] ) );
+ HDassert( ( 0 <= chd_type ) && ( chd_type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= chd_idx ) && ( chd_idx <= max_indices[chd_type] ) );
+
+ if ( pass ) {
+ test_entry_t * par_base_addr; /* Base entry of parent's entry array */
+ test_entry_t * par_entry_ptr; /* Parent entry */
+ test_entry_t * chd_base_addr; /* Base entry of child's entry array */
+ test_entry_t * chd_entry_ptr; /* Child entry */
+ unsigned chd_flush_dep_height; /* Child flush dep. height */
+
+ /* Get parent entry */
+ par_base_addr = entries[par_type];
+ par_entry_ptr = &(par_base_addr[par_idx]);
+
+ /* Sanity check parent entry */
+ HDassert( par_entry_ptr->index == par_idx );
+ HDassert( par_entry_ptr->type == par_type );
+ HDassert( par_entry_ptr->is_pinned );
+ HDassert( par_entry_ptr->flush_dep_height > 0 );
+ HDassert( par_entry_ptr == par_entry_ptr->self );
+
+ /* Get parent entry */
+ chd_base_addr = entries[chd_type];
+ chd_entry_ptr = &(chd_base_addr[chd_idx]);
+
+ /* Sanity check child entry */
+ HDassert( chd_entry_ptr->index == chd_idx );
+ HDassert( chd_entry_ptr->type == chd_type );
+ HDassert( chd_entry_ptr->flush_dep_height < par_entry_ptr->flush_dep_height );
+ HDassert( chd_entry_ptr == chd_entry_ptr->self );
+
+ if ( H5C_destroy_flush_dependency(cache_ptr, par_entry_ptr, chd_entry_ptr) < 0 ) {
+ pass = FALSE;
+ failure_mssg = "error in H5C_destroy_flush_dependency().";
+ } /* end if */
+
+ /* Update information about entries */
+ chd_entry_ptr->flush_dep_par_type = -1;
+ chd_entry_ptr->flush_dep_par_idx = -1;
+ par_entry_ptr->child_flush_dep_height_rc[chd_entry_ptr->flush_dep_height]--;
+
+ /* Check flush dependency heights */
+ chd_flush_dep_height = chd_entry_ptr->flush_dep_height;
+ while( 0 == par_entry_ptr->child_flush_dep_height_rc[chd_flush_dep_height] ) {
+ unsigned prev_par_flush_dep_height = par_entry_ptr->flush_dep_height; /* Save the previous height */
+ int i; /* Local index variable */
+
+ /* Check for new flush dependency height of parent */
+ for(i = (H5C__NUM_FLUSH_DEP_HEIGHTS - 1); i >= 0; i--)
+ if(par_entry_ptr->child_flush_dep_height_rc[i] > 0)
+ break;
+
+ HDassert((i + 1) <= (int)prev_par_flush_dep_height);
+
+ if((unsigned)(i + 1) < prev_par_flush_dep_height) {
+ par_entry_ptr->flush_dep_height = (unsigned)(i + 1);
+ if(i < 0)
+ par_entry_ptr->is_pinned = FALSE;
+
+ /* Check for parent entry being in flush dependency relationship */
+ if(par_entry_ptr->flush_dep_par_idx >= 0) {
+ /* Move parent & child entries up the flushd dependency 'chain' */
+ chd_entry_ptr = par_entry_ptr;
+ par_base_addr = entries[chd_entry_ptr->flush_dep_par_type];
+ par_entry_ptr = &(par_base_addr[chd_entry_ptr->flush_dep_par_idx]);
+
+ /* Adjust the ref. counts in new parent */
+ HDassert(par_entry_ptr->child_flush_dep_height_rc[prev_par_flush_dep_height] > 0);
+ par_entry_ptr->child_flush_dep_height_rc[prev_par_flush_dep_height]--;
+ par_entry_ptr->child_flush_dep_height_rc[chd_entry_ptr->flush_dep_height]++;
+ chd_flush_dep_height = prev_par_flush_dep_height;
+ } /* end if */
+ else
+ break;
+ } /* end if */
+ else
+ break;
+ } /* end while */
+ } /* end if */
+
+ return;
+
+} /* destroy_flush_dependency() */
+
diff --git a/test/cache_common.h b/test/cache_common.h
index f76f47c..1284ea3 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -19,17 +19,23 @@
* This file contains common #defines, type definitions, and
* externs for tests of the cache implemented in H5C.c
*/
-#include "h5test.h"
-#include "H5Iprivate.h"
-#include "H5ACprivate.h"
+#ifndef _CACHE_COMMON_H
+#define _CACHE_COMMON_H
#define H5C_PACKAGE /*suppress error about including H5Cpkg */
+#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Include library header files */
+#include "H5ACprivate.h"
#include "H5Cpkg.h"
+#include "H5Fpkg.h"
+#include "H5Iprivate.h"
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Include test header files */
+#include "h5test.h"
-#include "H5Fpkg.h"
+/* Macro to make error reporting easier */
+#define CACHE_ERROR(s) {failure_mssg = "Line #" H5_TOSTRING(__LINE__) ": " s ; goto done;}
#define NO_CHANGE -1
@@ -121,7 +127,8 @@
#define FLUSH_OP__DIRTY 1
#define FLUSH_OP__RESIZE 2
#define FLUSH_OP__RENAME 3
-#define FLUSH_OP__MAX_OP 3
+#define FLUSH_OP__ORDER 4
+#define FLUSH_OP__MAX_OP 4
#define MAX_FLUSH_OPS 10 /* Maximum number of flush operations
* that can be associated with a
@@ -138,6 +145,7 @@ typedef struct flush_op
* FLUSH_OP__DIRTY
* FLUSH_OP__RESIZE
* FLUSH_OP__RENAME
+ * FLUSH_OP__ORDER
*/
int type; /* type code of the cache entry that
* is the target of the operation.
@@ -177,6 +185,10 @@ typedef struct flush_op
* FLUSH_OP__RENAME operation.
* Unused elsewhere.
*/
+ unsigned * order_ptr; /* Pointer to outside counter for
+ * recording the order of entries
+ * flushed.
+ */
} flush_op;
typedef struct test_entry_t
@@ -287,6 +299,14 @@ typedef struct test_entry_t
hbool_t destroyed; /* entry has been destroyed since the
* last time it was reset.
*/
+ int flush_dep_par_type; /* Entry type of flush dependency parent */
+ int flush_dep_par_idx; /* Index of flush dependency parent */
+ uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
+ /* flush dependency heights of flush
+ * dependency children
+ */
+ unsigned flush_dep_height; /* flush dependency height of entry */
+ unsigned flush_order; /* Order that entry was flushed in */
} test_entry_t;
/* The following is a cut down copy of the hash table manipulation
@@ -451,6 +471,14 @@ struct expected_entry_status
hbool_t cleared;
hbool_t flushed;
hbool_t destroyed;
+ int flush_dep_par_type; /* Entry type of flush dependency parent */
+ int flush_dep_par_idx; /* Index of flush dependency parent */
+ uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
+ /* flush dependency heights of flush
+ * dependency children
+ */
+ unsigned flush_dep_height; /* flush dependency height of entry */
+ int flush_order; /* flush order of entry */
};
@@ -582,7 +610,8 @@ void add_flush_op(int target_type,
int type,
int idx,
hbool_t flag,
- size_t size);
+ size_t size,
+ unsigned * order);
void addr_to_type_and_index(haddr_t addr,
@@ -632,6 +661,10 @@ void protect_entry_ro(H5C_t * cache_ptr,
int32_t type,
int32_t idx);
+void pin_entry(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx);
+
hbool_t entry_in_cache(H5C_t * cache_ptr,
int32_t type,
int32_t idx);
@@ -784,3 +817,17 @@ void verify_entry_status(H5C_t * cache_ptr,
void verify_unprotected(void);
+void create_flush_dependency(H5C_t * cache_ptr,
+ int32_t parent_type,
+ int32_t parent_idx,
+ int32_t child_type,
+ int32_t child_idx);
+
+void destroy_flush_dependency(H5C_t * cache_ptr,
+ int32_t parent_type,
+ int32_t parent_idx,
+ int32_t child_type,
+ int32_t child_idx);
+
+#endif /* _CACHE_COMMON_H */
+
diff --git a/test/corrupt_stab_msg.h5 b/test/corrupt_stab_msg.h5
new file mode 100755
index 0000000..4fa287c
--- /dev/null
+++ b/test/corrupt_stab_msg.h5
Binary files differ
diff --git a/test/dsets.c b/test/dsets.c
index 2df76cd..912098f 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -175,7 +175,8 @@ const char *FILENAME[] = {
#define TOO_HUGE_CHUNK_DIM2_2 ((hsize_t)1024)
/* Parameters for testing bypassing chunk cache */
-#define BYPASS_DATASET "Dset"
+#define BYPASS_DATASET1 "Dset1"
+#define BYPASS_DATASET2 "Dset2"
#define BYPASS_DIM 1000
#define BYPASS_CHUNK_DIM 500
#define BYPASS_FILL_VALUE 7
@@ -5741,21 +5742,16 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_filters_endianess(hid_t fapl)
+test_filters_endianess(void)
{
hid_t fid=-1; /* file ID */
hid_t dsid=-1; /* dataset ID */
hid_t sid=-1; /* dataspace ID */
hid_t dcpl=-1; /* dataset creation property list ID */
- int buf[2];
int i;
char *srcdir = getenv("srcdir"); /* the source directory */
char data_file[512]=""; /* buffer to hold name of existing file */
- for(i=0; i<2; i++){
- buf[i]=1;
- }
-
TESTING("filters with big-endian/little-endian data");
#if defined H5_HAVE_FILTER_FLETCHER32
@@ -6704,7 +6700,7 @@ error:
* bypasses the cache.
*
* Note: This test is not very conclusive - it doesn't actually check
- * is the chunks bypass the cache... :-( -QAK
+ * if the chunks bypass the cache... :-( -QAK
*
* Return: Success: 0
* Failure: -1
@@ -6727,9 +6723,9 @@ test_big_chunks_bypass_cache(hid_t fapl)
size_t rdcc_nelmts, rdcc_nbytes;
int fvalue = BYPASS_FILL_VALUE;
hsize_t count, stride, offset, block;
- static int wdata[BYPASS_CHUNK_DIM], rdata[BYPASS_DIM];
+ static int wdata[BYPASS_CHUNK_DIM/2], rdata1[BYPASS_DIM],
+ rdata2[BYPASS_CHUNK_DIM/2];
int i, j;
- herr_t ret; /* Generic return value */
TESTING("big chunks bypassing the cache");
@@ -6762,51 +6758,81 @@ test_big_chunks_bypass_cache(hid_t fapl)
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) FAIL_STACK_ERROR
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR) < 0) FAIL_STACK_ERROR
- /* Try to create dataset */
- if((dsid = H5Dcreate2(fid, BYPASS_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ /* Create a first dataset */
+ if((dsid = H5Dcreate2(fid, BYPASS_DATASET1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Select first chunk to write the data */
offset = 0;
count = 1;
stride = 1;
- block = BYPASS_CHUNK_DIM;
+ block = BYPASS_CHUNK_DIM / 2;
if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &offset, &stride, &count, &block) < 0)
FAIL_STACK_ERROR
/* Initialize data to write */
- for(i = 0; i < BYPASS_CHUNK_DIM; i++)
+ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
wdata[i] = i;
- /* This write should bypass the cache because the chunk is bigger than the cache size
- * and it's not allocated on disk. */
+ /* This write should go through the cache because fill value is used. */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, wdata) < 0)
FAIL_STACK_ERROR
if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
/* Reopen the dataset */
- if((dsid = H5Dopen2(fid, BYPASS_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dsid = H5Dopen2(fid, BYPASS_DATASET1, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Reads both 2 chunks. Reading the second chunk should bypass the cache because the
* chunk is bigger than the cache size and it isn't allocated on disk. */
- if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0)
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata1) < 0)
FAIL_STACK_ERROR
- for(i = 0; i < BYPASS_CHUNK_DIM; i++)
- if(rdata[i] != i) {
+ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
+ if(rdata1[i] != i) {
printf(" Read different values than written in the 1st chunk.\n");
- printf(" At line %d and index %d, rdata = %d. It should be %d.\n", __LINE__, i, rdata[i], i);
+ printf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], i);
TEST_ERROR
} /* end if */
- for(j = BYPASS_CHUNK_DIM; j < BYPASS_DIM; j++)
- if(rdata[j] != fvalue) {
+ for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++)
+ if(rdata1[j] != fvalue) {
printf(" Read different values than written in the 2nd chunk.\n");
- printf(" At line %d and index %d, rdata = %d. It should be %d.\n", __LINE__, i, rdata[i], fvalue);
+ printf(" At line %d and index %d, rdata1 = %d. It should be %d.\n", __LINE__, i, rdata1[i], fvalue);
TEST_ERROR
} /* end if */
+
+ /* Close the first dataset */
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+ /* Create a second dataset without fill value. This time, both write
+ * and read should bypass the cache because the chunk is bigger than the
+ * cache size and it's not allocated on disk. */
+ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) FAIL_STACK_ERROR
+
+ if((dsid = H5Dcreate2(fid, BYPASS_DATASET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, wdata) < 0)
+ FAIL_STACK_ERROR
+
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+
+ /* Reopen the dataset */
+ if((dsid = H5Dopen2(fid, BYPASS_DATASET2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Read back only the part that was written to the file. Reading the
+ * half chunk should bypass the cache because the chunk is bigger than
+ * the cache size. */
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, rdata2) < 0)
+
+ for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
+ if(rdata2[i] != i) {
+ printf(" Read different values than written in the chunk.\n");
+ printf(" At line %d and index %d, rdata2 = %d. It should be %d.\n", __LINE__, i, rdata2[i], i);
+ TEST_ERROR
+ } /* end if */
+
/* Close IDs */
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
@@ -7181,7 +7207,7 @@ main(void)
nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0);
nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0);
nerrors += (test_filter_delete(file) < 0 ? 1 : 0);
- nerrors += (test_filters_endianess(my_fapl) < 0 ? 1 : 0);
+ nerrors += (test_filters_endianess() < 0 ? 1 : 0);
nerrors += (test_zero_dims(file) < 0 ? 1 : 0);
nerrors += (test_missing_chunk(file) < 0 ? 1 : 0);
nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0);
diff --git a/test/dt_arith.c b/test/dt_arith.c
index e507fd0..6c59555 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -617,12 +617,10 @@ generates_sigfpe(void)
static int
test_hard_query(void)
{
- htri_t ret;
-
TESTING("query functions of compiler conversion");
/* Verify the conversion from int to float is a hard conversion. */
- if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) {
+ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) {
H5_FAILED();
printf("Can't query conversion function\n");
goto error;
@@ -631,7 +629,7 @@ test_hard_query(void)
/* Unregister the hard conversion from int to float. Verify the conversion
* is a soft conversion. */
H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float);
- if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=FALSE) {
+ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != FALSE) {
H5_FAILED();
printf("Can't query conversion function\n");
goto error;
@@ -640,7 +638,7 @@ test_hard_query(void)
/* Register the hard conversion from int to float. Verify the conversion
* is a hard conversion. */
H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float);
- if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) {
+ if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) {
H5_FAILED();
printf("Can't query conversion function\n");
goto error;
@@ -676,19 +674,18 @@ static H5T_conv_ret_t
expt_handle(H5T_conv_except_t except_type, hid_t UNUSED src_id, hid_t UNUSED dst_id, void UNUSED *src_buf,
void *dst_buf, void *user_data)
{
- H5T_conv_ret_t ret = H5T_CONV_HANDLED;
signed char fill_value1 = 7;
int fill_value2 = 13;
if(except_type == H5T_CONV_EXCEPT_RANGE_HI || except_type == H5T_CONV_EXCEPT_RANGE_LOW ||
- except_type == H5T_CONV_EXCEPT_TRUNCATE) {
+ except_type == H5T_CONV_EXCEPT_TRUNCATE) {
if(*(hbool_t*)user_data)
*(signed char*)dst_buf = fill_value1;
else
*(int*)dst_buf = fill_value2;
- }
+ } /* end if */
- return ret;
+ return H5T_CONV_HANDLED;
}
@@ -2710,7 +2707,6 @@ my_isinf(int endian, unsigned char *val, size_t size,
unsigned char *bits;
int retval = 0;
size_t i;
- ssize_t ret1=0, ret2=0;
bits = (unsigned char*)calloc(1, size);
@@ -2732,8 +2728,8 @@ my_isinf(int endian, unsigned char *val, size_t size,
bits[size-(i+1)] = *(val + ENDIAN(size, i, endian));
#endif /*H5_VMS*/
- if((ret1=H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1))<0 &&
- (ret2=H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0))<0)
+ if(H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 &&
+ H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0)
retval = 1;
free(bits);
diff --git a/test/dtransform.c b/test/dtransform.c
index 3297fe6..8b5dce0 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -19,12 +19,12 @@
#define COLS 18
#define FLOAT_TOL 0.0001
-int init_test(hid_t file_id);
-int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy);
-int test_trivial(const hid_t dxpl_id_simple);
-int test_poly(const hid_t dxpl_id_polynomial);
-int test_set(void);
-int test_getset(const hid_t dxpl_id_simple);
+static int init_test(hid_t file_id);
+static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy);
+static int test_trivial(const hid_t dxpl_id_simple);
+static int test_poly(const hid_t dxpl_id_polynomial);
+static int test_set(void);
+static int test_getset(const hid_t dxpl_id_simple);
/* These are needed for multiple tests, so are declared here globally and are init'ed in init_test */
hid_t dset_id_int;
@@ -336,7 +336,8 @@ error:
return -1;
}
-int init_test(hid_t file_id)
+static int
+init_test(hid_t file_id)
{
const char* f_to_c = "(5/9.0)*(x-32)";
/* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */
@@ -389,7 +390,8 @@ error:
return -1;
}
-int test_poly(const hid_t dxpl_id_polynomial)
+static int
+test_poly(const hid_t dxpl_id_polynomial)
{
float polyflres[ROWS][COLS];
int polyintread[ROWS][COLS];
@@ -430,7 +432,8 @@ error:
return -1;
}
-int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy)
+static int
+test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy)
{
int windchillC;
float polyflres[ROWS][COLS];
@@ -462,7 +465,8 @@ error:
return -1;
}
-int test_trivial(const hid_t dxpl_id_simple)
+static int
+test_trivial(const hid_t dxpl_id_simple)
{
float windchillFfloatread[ROWS][COLS];
int windchillFintread[ROWS][COLS];
@@ -505,7 +509,8 @@ error:
return -1;
}
-int test_getset(const hid_t dxpl_id_c_to_f)
+static int
+test_getset(const hid_t dxpl_id_c_to_f)
{
int row, col;
float windchillFfloatread[ROWS][COLS];
@@ -566,7 +571,8 @@ error:
return -1;
}
-int test_set(void)
+static int
+test_set(void)
{
hid_t dxpl_id;
H5E_auto2_t func;
diff --git a/test/dtypes.c b/test/dtypes.c
index 991b2c9..548cc59 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -64,15 +64,11 @@
* the soft conversion list. One must call reset_hdf5() after this.
*/
#define CHECK_NMEMBS(NMEMBS,SRC_ID,DST_ID) \
- if (H5Tunregister(H5T_PERS_SOFT, NULL, SRC_ID, DST_ID, NULL) < 0) { \
+ if(H5Tunregister(H5T_PERS_SOFT, NULL, SRC_ID, DST_ID, NULL) < 0) \
FAIL_STACK_ERROR \
- goto error; \
- } \
- if (H5Tclose(SRC_ID) < 0 || ((SRC_ID) != (DST_ID) && H5Tclose(DST_ID) < 0)) { \
+ if(H5Tclose(SRC_ID) < 0 || ((SRC_ID) != (DST_ID) && H5Tclose(DST_ID) < 0)) \
FAIL_STACK_ERROR \
- goto error; \
- } \
- if ((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \
+ if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \
H5_FAILED(); \
printf(" #dtype ids expected: %d; found: %d\n", NMEMBS, \
H5I_nmembers(H5I_DATATYPE)); \
@@ -4096,7 +4092,6 @@ test_conv_str_3(void)
int ret_value = 1;
int size;
H5T_pad_t inpad;
- H5T_cset_t cset;
H5T_sign_t sign;
char* tag;
herr_t ret;
@@ -4116,13 +4111,13 @@ test_conv_str_3(void)
buf[i*8+j++] = '\0';
}
- if ((size=H5Tget_precision(type))==0) goto error;
- if ((size=H5Tget_size(type))==0) goto error;
- if (H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE) < 0) goto error;
- if ((cset=H5Tget_cset(type)) < 0) goto error;
- if (H5Tget_strpad(type) < 0) goto error;
- if (H5Tset_offset(type, 0) < 0) goto error;
- if (H5Tget_order(type) < 0) goto error;
+ if(H5Tget_precision(type) == 0) FAIL_STACK_ERROR
+ if(H5Tget_size(type) == 0) FAIL_STACK_ERROR
+ if(H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE) < 0) FAIL_STACK_ERROR
+ if(H5Tget_cset(type) < 0) FAIL_STACK_ERROR
+ if(H5Tget_strpad(type) < 0) FAIL_STACK_ERROR
+ if(H5Tset_offset(type, 0) < 0) FAIL_STACK_ERROR
+ if(H5Tget_order(type) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
ret=H5Tset_precision(type, nelmts);
@@ -4134,7 +4129,7 @@ test_conv_str_3(void)
} /* end if */
H5E_BEGIN_TRY {
- size=H5Tget_ebias(type);
+ size = H5Tget_ebias(type);
} H5E_END_TRY;
if (size>0) {
H5_FAILED();
diff --git a/test/enum.c b/test/enum.c
index 91a3790..4599a7c 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -455,7 +455,6 @@ test_funcs(void)
hid_t type=-1;
c_e1 val;
size_t size;
- int offset;
H5T_pad_t inpad;
H5T_cset_t cset;
herr_t ret;
@@ -463,18 +462,18 @@ test_funcs(void)
TESTING("some functions with enumeration types");
/* A native integer */
- if ((type = H5Tcreate(H5T_ENUM, sizeof(c_e1)))<0) goto error;
- if (H5Tenum_insert(type, "RED", CPTR(val, E1_RED ))<0) goto error;
- if (H5Tenum_insert(type, "GREEN", CPTR(val, E1_GREEN))<0) goto error;
- if (H5Tenum_insert(type, "BLUE", CPTR(val, E1_BLUE ))<0) goto error;
- if (H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE))<0) goto error;
- if (H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK))<0) goto error;
-
- if ((size=H5Tget_precision(type))==0) goto error;
- if ((size=H5Tget_size(type))==0) goto error;
- if ((offset=H5Tget_offset(type))<0) goto error;
- if (H5Tget_sign(type)<0) goto error;
- if (H5Tget_super(type)<0) goto error;
+ if((type = H5Tcreate(H5T_ENUM, sizeof(c_e1))) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "RED", CPTR(val, E1_RED )) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "GREEN", CPTR(val, E1_GREEN)) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "BLUE", CPTR(val, E1_BLUE )) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE)) < 0) FAIL_STACK_ERROR
+ if(H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK)) < 0) FAIL_STACK_ERROR
+
+ if(H5Tget_precision(type) == 0) FAIL_STACK_ERROR
+ if(H5Tget_size(type) == 0) FAIL_STACK_ERROR
+ if(H5Tget_offset(type) < 0) FAIL_STACK_ERROR
+ if(H5Tget_sign(type) < 0) FAIL_STACK_ERROR
+ if(H5Tget_super(type) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
ret=H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE);
diff --git a/test/error_test.c b/test/error_test.c
index 027f31b..a5afcfc 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -77,7 +77,7 @@ hid_t ERR_MIN_GETNUM;
#define LONG_DESC_SIZE 8192
-herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc,
+static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc,
void *client_data);
@@ -420,7 +420,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data)
{
FILE *stream = (FILE *)client_data;
diff --git a/test/fillval.c b/test/fillval.c
index 5bf5c03..2f58380 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -1966,7 +1966,7 @@ skip:
*-------------------------------------------------------------------------
*/
static int
-test_compatible(hid_t fapl)
+test_compatible(void)
{
hid_t file=-1, dset1=-1, dset2=-1;
hid_t dcpl1=-1, dcpl2=-1, fspace=-1, mspace=-1;
@@ -2170,7 +2170,7 @@ main(int argc, char *argv[])
nerrors += test_create(my_fapl, FILENAME[1], H5D_CONTIGUOUS);
nerrors += test_rdwr (my_fapl, FILENAME[3], H5D_CONTIGUOUS);
nerrors += test_extend(my_fapl, FILENAME[5], H5D_CONTIGUOUS);
- nerrors += test_compatible(my_fapl);
+ nerrors += test_compatible();
} /* end if */
/* Compact dataset storage tests */
diff --git a/test/freespace.c b/test/freespace.c
index 52a5deb..79a0864 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -2056,7 +2056,6 @@ test_fs_sect_change_class(hid_t fapl)
TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL, *sect_node3=NULL;
unsigned init_flags=0;
TEST_free_section_t *node;
- htri_t node_found = FALSE;
TESTING("the change of section class via H5FS_sect_change_class() in free-space: Test 1");
@@ -2130,8 +2129,8 @@ test_fs_sect_change_class(hid_t fapl)
if(check_stats(frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
+ (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE_NONE)
@@ -2235,8 +2234,8 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section B has changed class */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
+ (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE)
@@ -2246,8 +2245,8 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section C has changed class */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
- (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
+ (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
if (node->sect_info.type != TEST_FSPACE_SECT_TYPE)
diff --git a/test/getname.c b/test/getname.c
index 4084f9e..0dc623e 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -2672,7 +2672,6 @@ test_reg_ref(hid_t fapl)
hsize_t dimsr[1] = {2};
int rank = 2;
int rankr = 1;
- herr_t status;
hdset_reg_ref_t ref[2];
hdset_reg_ref_t ref_out[2];
int data[2][9] = {{1,1,2,3,3,4,5,5,6},{1,2,2,3,4,4,5,6,6}};
@@ -2701,9 +2700,9 @@ test_reg_ref(hid_t fapl)
TEST_ERROR
/* Write data to the dataset */
- if((status = H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data)) < 0)
+ if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, data) < 0)
TEST_ERROR
- if((status = H5Dclose(dsetv_id)) < 0)
+ if(H5Dclose(dsetv_id) < 0)
TEST_ERROR
/* Dataset with references */
@@ -2717,31 +2716,31 @@ test_reg_ref(hid_t fapl)
start[1] = 3;
count[0] = 2;
count[1] = 3;
- if((status = H5Sselect_hyperslab(space_id,H5S_SELECT_SET,start,NULL,count,NULL)) < 0)
+ if(H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
TEST_ERROR
- if((status = H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id)) < 0)
+ if(H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
TEST_ERROR
/* Create a reference to elements selection */
- if((status = H5Sselect_none(space_id)) < 0)
+ if(H5Sselect_none(space_id) < 0)
TEST_ERROR
- if((status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord)) < 0)
+ if(H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0)
TEST_ERROR
- if((status = H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id)) < 0)
+ if(H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
TEST_ERROR
/* Write dataset with the references */
- if((status = H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT,ref)) < 0)
+ if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0)
TEST_ERROR
/* Close all objects */
- if((status = H5Sclose(space_id)) < 0)
+ if(H5Sclose(space_id) < 0)
TEST_ERROR
- if((status = H5Sclose(spacer_id)) < 0)
+ if(H5Sclose(spacer_id) < 0)
TEST_ERROR
- if((status = H5Dclose(dsetr_id)) < 0)
+ if(H5Dclose(dsetr_id) < 0)
TEST_ERROR
- if((status = H5Fclose(file_id)) < 0)
+ if(H5Fclose(file_id) < 0)
TEST_ERROR
@@ -2753,7 +2752,7 @@ test_reg_ref(hid_t fapl)
if((dsetr_id = H5Dopen2(file_id, REFREG_DSETNAMER, H5P_DEFAULT)) < 0)
TEST_ERROR
- if((status = H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out)) < 0)
+ if(H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out) < 0)
TEST_ERROR
/* Get name of the dataset the first region reference points to using H5Rget_name */
@@ -2773,7 +2772,7 @@ test_reg_ref(hid_t fapl)
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
- if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR
+ if(H5Dclose(dsetv_id) < 0) TEST_ERROR
PASSED()
@@ -2794,13 +2793,13 @@ test_reg_ref(hid_t fapl)
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
- if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR
+ if(H5Dclose(dsetv_id) < 0) TEST_ERROR
PASSED()
- if((status = H5Dclose(dsetr_id)) < 0)
+ if(H5Dclose(dsetr_id) < 0)
TEST_ERROR
- if((status = H5Fclose(file_id)) < 0)
+ if(H5Fclose(file_id) < 0)
TEST_ERROR
return 0;
diff --git a/test/h5test.c b/test/h5test.c
index 029ca3e..f5bf180 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -1031,49 +1031,45 @@ int h5_szip_can_encode(void )
*
*-------------------------------------------------------------------------
*/
-
-char* getenv_all(MPI_Comm comm, int root, const char* name)
+char *
+getenv_all(MPI_Comm comm, int root, const char* name)
{
int mpi_size, mpi_rank, mpi_initialized;
int len;
static char* env = NULL;
- MPI_Status Status;
assert(name);
MPI_Initialized(&mpi_initialized);
- if (!mpi_initialized){
+ if(!mpi_initialized) {
/* use original getenv */
if(env)
HDfree(env);
env = HDgetenv(name);
- }else{
+ } /* end if */
+ else {
MPI_Comm_rank(comm, &mpi_rank);
MPI_Comm_size(comm, &mpi_size);
assert(root < mpi_size);
/* The root task does the getenv call
* and sends the result to the other tasks */
- if(mpi_rank == root)
- {
+ if(mpi_rank == root) {
env = HDgetenv(name);
- if(env)
- {
+ if(env) {
len = HDstrlen(env);
MPI_Bcast(&len, 1, MPI_INT, root, comm);
MPI_Bcast(env, len, MPI_CHAR, root, comm);
}
- else{
+ else {
/* len -1 indicates that the variable was not in the environment */
len = -1;
MPI_Bcast(&len, 1, MPI_INT, root, comm);
}
}
- else
- {
+ else {
MPI_Bcast(&len, 1, MPI_INT, root, comm);
- if(len >= 0)
- {
+ if(len >= 0) {
if(env == NULL)
env = (char*) HDmalloc(len+1);
else if(strlen(env) < len)
@@ -1082,8 +1078,7 @@ char* getenv_all(MPI_Comm comm, int root, const char* name)
MPI_Bcast(env, len, MPI_CHAR, root, comm);
env[len] = '\0';
}
- else
- {
+ else {
if(env)
HDfree(env);
env = NULL;
diff --git a/test/links.c b/test/links.c
index ec0d21b..c169670 100644
--- a/test/links.c
+++ b/test/links.c
@@ -814,7 +814,6 @@ toomany(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename[NAME_BUF_SIZE];
if(new_format)
@@ -888,7 +887,7 @@ toomany(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "hard21", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/hard21")) TEST_ERROR
/* Create object in hard-linked group */
@@ -914,7 +913,7 @@ toomany(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "soft16", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/soft16")) TEST_ERROR
/* Create object using soft links */
@@ -1742,7 +1741,6 @@ external_link_root(hid_t fapl, hbool_t new_format)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
H5L_info_t linfo; /* Link information */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
const char *file; /* File from external link */
@@ -1801,7 +1799,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/")) TEST_ERROR
/* Create object in external file */
@@ -1834,9 +1832,9 @@ external_link_root(hid_t fapl, hbool_t new_format)
if((gid2 = H5Gopen2(fid, "newer_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check names */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/new_group")) TEST_ERROR
- if((name_len = H5Iget_name( gid2, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/newer_group")) TEST_ERROR
/* Close opened objects */
@@ -1903,7 +1901,6 @@ external_link_path(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
@@ -1943,7 +1940,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
/* Create object in external file */
@@ -1966,7 +1963,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C/new_group")) TEST_ERROR
/* Close opened object */
@@ -2012,7 +2009,6 @@ external_link_mult(hid_t fapl, hbool_t new_format)
hid_t fid = (-1), fid2 = (-1); /* File IDs */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE],
filename3[NAME_BUF_SIZE],
@@ -2090,7 +2086,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
/* Create object in external file */
@@ -2113,7 +2109,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C/new_group")) TEST_ERROR
/* Close opened object */
@@ -2177,7 +2173,6 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
hid_t lcpl_id = (-1); /* Link Creation Property List ID */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
char filename3[NAME_BUF_SIZE];
@@ -2218,7 +2213,7 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "A/B/C/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/X")) TEST_ERROR
/* Create object through external link */
@@ -2234,7 +2229,7 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "X/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/X/new_group")) TEST_ERROR
/* Close opened object */
@@ -2343,7 +2338,6 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -2394,7 +2388,7 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "link1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/final")) TEST_ERROR
/* Create object in external file */
@@ -2417,7 +2411,7 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/final/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/final/new_group")) TEST_ERROR
/* Close opened object */
@@ -2488,7 +2482,6 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -2562,7 +2555,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "link3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/final")) TEST_ERROR
/* Create object in external file */
@@ -5315,7 +5308,6 @@ external_link_move(hid_t fapl, hbool_t new_format)
hid_t fid = (-1); /* File ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -5360,7 +5352,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "src2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5405,7 +5397,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5441,14 +5433,14 @@ external_link_move(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Move external link back to original location */
if(H5Lmove(fid, "/group2/src3", H5L_SAME_LOC, "/src", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5509,7 +5501,6 @@ external_link_ride(hid_t fapl, hbool_t new_format)
hid_t gcpl = (-1); /* Group creation property list ID */
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
unsigned nmsgs; /* Number of messages in group's header */
@@ -5593,7 +5584,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -5628,7 +5619,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/dst")) TEST_ERROR
/* Create object in external file */
@@ -6030,7 +6021,6 @@ external_link_strong(hid_t fapl, hbool_t new_format)
hid_t fid1 = (-1), fid2 = (-1); /* File ID */
hid_t gid1 = (-1), gid2 = (-1); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename1[NAME_BUF_SIZE],
filename2[NAME_BUF_SIZE];
@@ -6071,7 +6061,7 @@ external_link_strong(hid_t fapl, hbool_t new_format)
/* Access external link from file #1 */
if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
if((gid2 = H5Gopen2(fid2, "/W/X/DLINK", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((name_len = H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR
if(H5Gclose(gid2) < 0) TEST_ERROR
if(H5Fclose(fid2) < 0) TEST_ERROR
@@ -6250,7 +6240,6 @@ ud_hard_links(hid_t fapl)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
H5L_info_t li; /* Link information */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
h5_stat_size_t empty_size; /* Size of an empty file */
char filename[NAME_BUF_SIZE];
@@ -6299,7 +6288,7 @@ ud_hard_links(hid_t fapl)
if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/group")) TEST_ERROR
/* Create object in group */
@@ -6313,7 +6302,7 @@ ud_hard_links(hid_t fapl)
if((gid = H5Gopen2(fid, "group/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/group/new_group")) TEST_ERROR
/* Close opened object */
@@ -6417,7 +6406,6 @@ ud_link_reregister(hid_t fapl)
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
H5L_info_t li; /* Link information */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename[NAME_BUF_SIZE];
h5_stat_size_t empty_size; /* Size of an empty file */
@@ -6486,7 +6474,7 @@ ud_link_reregister(hid_t fapl)
if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/" REREG_TARGET_NAME)) TEST_ERROR
/* Create object in group */
@@ -6500,7 +6488,7 @@ ud_link_reregister(hid_t fapl)
if((gid = H5Gopen2(fid, "rereg_target/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/rereg_target/new_group")) TEST_ERROR
/* Close opened object */
@@ -7291,7 +7279,6 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
hid_t tid = (-1), sid = (-1), did = (-1); /* Other IDs */
hid_t gapl = (-1), dapl = (-1), tapl = (-1); /* Other property lists */
char objname[NAME_BUF_SIZE]; /* Object name */
- ssize_t name_len; /* Length of object name */
char filename[NAME_BUF_SIZE];
size_t nlinks; /* nlinks for H5Pset_nlinks */
hsize_t dims[2];
@@ -7356,7 +7343,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
if((gid = H5Oopen(fid, "soft17", plist)) < 0) TEST_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/soft17")) TEST_ERROR
/* Create group using soft link */
@@ -7389,7 +7376,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
if((gid = H5Oopen(fid, "soft4", plist)) < 0) TEST_ERROR
/* Check name */
- if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
if(HDstrcmp(objname, "/soft4")) TEST_ERROR
@@ -8756,7 +8743,7 @@ corder_transition(hid_t fapl)
sprintf(objname, "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
- sprintf(objname, "filler %u", 0);
+ sprintf(objname, "filler %u", (unsigned)0);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Close the group */
diff --git a/test/mf.c b/test/mf.c
index 527fa4a..ff54751 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -277,7 +277,6 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
h5_stat_size_t file_size, new_file_size; /* file size */
- htri_t status;
H5FD_mem_t type;
haddr_t addr;
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF;
@@ -355,8 +354,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should succeed */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30);
- if (status <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30) <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -404,8 +402,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* should not succeed in shrinking */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30-10);
- if (status > 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30 - 10) > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -449,8 +446,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should not succeed in shrinking */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30+10);
- if (status > 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30 + 10) > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -493,8 +489,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should succeed in shrinking */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr+10, (hsize_t)(TEST_BLOCK_SIZE30-10));
- if (status <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr+10, (hsize_t)(TEST_BLOCK_SIZE30 - 10)) <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
@@ -847,7 +842,6 @@ test_mf_fs_alloc_free(hid_t fapl)
frspace_state_t state;
H5MF_sect_ud_t udata;
H5FS_section_info_t *node;
- htri_t node_found = FALSE;
TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 1");
@@ -933,8 +927,8 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0)
/* Free the free-space section node */
if(H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0)
@@ -1014,8 +1008,8 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space manager */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
/* Free the free-space section node */
@@ -1090,8 +1084,8 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
/* Free the free-space section node */
@@ -1187,7 +1181,6 @@ test_mf_fs_extend(hid_t fapl)
frspace_state_t state; /* State of free space*/
H5MF_sect_ud_t udata;
H5FS_section_info_t *node;
- htri_t node_found = FALSE;
htri_t extended;
TESTING("H5MF_try_extend() of free-space manager:test 1");
@@ -1305,8 +1298,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the extended block */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1415,8 +1408,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the merged sections A & B from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1525,8 +1518,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the merged sections A & B from free-space */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1635,8 +1628,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space manger */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(TEST_BLOCK_SIZE30-10), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(TEST_BLOCK_SIZE30-10), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1644,8 +1637,8 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove section B from free-space manager */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE50, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE50, (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
/* Remove the free-space section node */
@@ -1710,7 +1703,6 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
hsize_t ma_size=0;
H5MF_free_section_t *sect_node=NULL;
H5MF_sect_ud_t udata;
- htri_t node_found=FALSE;
H5FS_section_info_t *node;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -1765,8 +1757,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Verify that the section did absorb the aggregator */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)TEST_BLOCK_SIZE2048, (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)TEST_BLOCK_SIZE2048, (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
if (node->addr != ma_addr) TEST_ERROR
@@ -1835,8 +1827,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Verify that the section did absorb the aggregator */
- if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
- (hsize_t)(ma_size+TEST_BLOCK_SIZE30), (H5FS_section_info_t **)&node)) < 0)
+ if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type],
+ (hsize_t)(ma_size+TEST_BLOCK_SIZE30), (H5FS_section_info_t **)&node) < 0)
TEST_ERROR
if ((node->addr + TEST_BLOCK_SIZE30) != ma_addr) TEST_ERROR
@@ -2939,7 +2931,7 @@ test_mf_aggr_extend(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 */
- h5_stat_size_t empty_size;
+ h5_stat_size_t empty_size, file_size;
H5FD_mem_t type, stype;
haddr_t new_addr, addr, saddr;
haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF;
@@ -3012,6 +3004,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3074,6 +3074,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3134,6 +3142,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3177,14 +3193,13 @@ test_mf_aggr_absorb(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 */
- h5_stat_size_t empty_size;
+ h5_stat_size_t empty_size, file_size;
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;
hsize_t ma_size=0, new_ma_size=0;
hsize_t sdata_size=0, new_sdata_size=0;
- htri_t status;
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1");
@@ -3221,11 +3236,11 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
ma_addr = new_ma_addr - TEST_BLOCK_SIZE30;
- if ((addr1+TEST_BLOCK_SIZE30) != new_ma_addr)
+ if((addr1 + TEST_BLOCK_SIZE30) != new_ma_addr)
TEST_ERROR
/* should succeed */
- if ((status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30)) <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30) <= 0)
TEST_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
@@ -3235,6 +3250,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3269,7 +3292,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
/* should succeed */
- if ((status = H5MF_try_shrink(f, stype, H5P_DATASET_XFER_DEFAULT, saddr1, (hsize_t)TEST_BLOCK_SIZE50)) <= 0)
+ 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);
@@ -3286,6 +3309,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3326,7 +3357,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* should not succeed */
- if ((status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr2, (hsize_t)TEST_BLOCK_SIZE50)) > 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr2, (hsize_t)TEST_BLOCK_SIZE50) > 0)
TEST_ERROR
/* aggregator info should be the same as before */
@@ -3340,6 +3371,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
+
+ /* Verify the file is the correct size */
+ if (file_size != empty_size)
+ TEST_ERROR
+
PASSED()
} /* end if */
else {
@@ -3398,7 +3437,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
haddr_t addr1, addr2;
haddr_t ma_addr=HADDR_UNDEF;
hsize_t ma_size=0;
- htri_t status, extended;
+ htri_t extended;
frspace_state_t state;
hsize_t alignment=0, mis_align=0, tmp=0, accum=0;
hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */
@@ -3545,8 +3584,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* shrink the block */
- status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE50);
- if (status <= 0)
+ if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE50) <= 0)
TEST_ERROR
if(H5Fclose(file) < 0)
diff --git a/test/mount.c b/test/mount.c
index 492f490..14ab346 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -2558,7 +2558,6 @@ test_acc_perm(hid_t fapl)
hid_t gidA = -1, gidB = -1, gidC = -1, gidM = -1, gidAM = -1, gidAMZ = -1; /* Group IDs */
hid_t bad_id = -1; /* Bad ID from object create */
char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */
- ssize_t name_len; /* Filename length */
char filename1[1024],
filename2[1024],
filename3[1024]; /* Name of files to mount */
@@ -2605,7 +2604,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(gidA, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(gidA, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename1) != 0)
TEST_ERROR
@@ -2614,7 +2613,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(fid2, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(fid2, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename2) != 0)
TEST_ERROR
@@ -2624,7 +2623,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(fid2, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(fid2, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename2) != 0)
TEST_ERROR
@@ -2634,7 +2633,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(gidAM, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(gidAM, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename2) != 0)
TEST_ERROR
@@ -2676,7 +2675,7 @@ test_acc_perm(hid_t fapl)
TEST_ERROR
/* Get and verify file name */
- if((name_len = H5Fget_name(gidAMZ, name, NAME_BUF_SIZE)) < 0)
+ if(H5Fget_name(gidAMZ, name, NAME_BUF_SIZE) < 0)
TEST_ERROR
if(HDstrcmp(name, filename3) != 0)
TEST_ERROR
diff --git a/test/stab.c b/test/stab.c
index b57b542..319046e 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -75,6 +75,12 @@ const char *FILENAME[] = {
/* Definitions for 'old_api' test */
#define OLD_API_GROUP "/old_api"
+/* Definitions for 'corrupt_stab_msg' test */
+#define CORRUPT_STAB_FILE "corrupt_stab_msg.h5"
+#define CORRUPT_STAB_TMP_FILE "corrupt_stab_msg_tmp.h5"
+#define CORRUPT_STAB_COPY_BUF_SIZE 4096
+#define CORRUPT_STAB_DSET "DS1"
+
/*-------------------------------------------------------------------------
* Function: test_misc
@@ -1084,6 +1090,121 @@ error:
/*-------------------------------------------------------------------------
+ * Function: corrupt_stab_msg
+ *
+ * Purpose: Test that a corrupt symbol table message can be fixed
+ * using the cached symbol table information.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Neil Fortner
+ * Wednesday, March 18, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+corrupt_stab_msg(void)
+{
+ char testfile[512]=""; /* Character buffer for corrected test file name */
+ char *srcdir = HDgetenv("srcdir"); /* Pointer to the directory the source code is located within */
+ FILE *tmp_fp, *old_fp; /* Pointers to temp & old files */
+ void *copy_buf; /* Pointer to buffer for copying data */
+ size_t written; /* Amount of data written to new file */
+ size_t read_in; /* Amount of data read in from old file */
+ hid_t fid = (-1); /* File ID */
+ hid_t did = (-1); /* Dataset ID */
+
+ TESTING("corrupt symbol table message");
+
+ /* Generate the correct name for the test file, by prepending the source path */
+ if(srcdir && ((HDstrlen(srcdir) + HDstrlen(CORRUPT_STAB_FILE) + 1) < sizeof(testfile))) {
+ HDstrcpy(testfile, srcdir);
+ HDstrcat(testfile, "/");
+ }
+ HDstrcat(testfile, CORRUPT_STAB_FILE);
+
+ /* Open the temporary file */
+ if(NULL == (tmp_fp = HDfopen(CORRUPT_STAB_TMP_FILE,"wb"))) TEST_ERROR
+
+ /* Open the old file */
+ if(NULL == (old_fp = fopen(testfile,"rb"))) TEST_ERROR
+
+ /* Allocate space for the copy buffer */
+ if(NULL == (copy_buf = HDmalloc((size_t)CORRUPT_STAB_COPY_BUF_SIZE))) TEST_ERROR
+
+ /* Copy data from the old file to the new file */
+ while((read_in = HDfread(copy_buf, (size_t)1, (size_t)CORRUPT_STAB_COPY_BUF_SIZE, old_fp)) > 0)
+ /* Write the data to the new file */
+ if(read_in != (written = HDfwrite(copy_buf, (size_t)1, read_in, tmp_fp))) TEST_ERROR
+
+ /* Close the old file */
+ if(HDfclose(old_fp)) TEST_ERROR
+
+ /* Close the new file */
+ if(HDfclose(tmp_fp)) TEST_ERROR
+
+ /* Free the copy buffer */
+ free(copy_buf);
+
+#ifndef H5_STRICT_FORMAT_CHECKS
+ /* Open temp file through HDF5 library */
+ if((fid = H5Fopen(CORRUPT_STAB_TMP_FILE, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Open dataset */
+ if((did = H5Dopen2(fid, CORRUPT_STAB_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close dataset and file */
+ if(H5Dclose(did) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Now reopen with read only access. This verifies that the issue has been
+ * corrected, as the symbol table message is not patched in read only mode.
+ */
+
+ /* Open file */
+ if((fid = H5Fopen(CORRUPT_STAB_TMP_FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Open dataset */
+ if((did = H5Dopen2(fid, CORRUPT_STAB_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close dataset and file */
+ if(H5Dclose(did) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+#else /* H5_STRICT_FORMAT_CHECKS */
+ /* Open file */
+ if((fid = H5Fopen(CORRUPT_STAB_TMP_FILE, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Verify that an error is thrown when we try to access the dataset */
+ H5E_BEGIN_TRY {
+ did = H5Dopen2(fid, CORRUPT_STAB_DSET, H5P_DEFAULT);
+ } H5E_END_TRY
+ if(did >= 0) TEST_ERROR
+
+ /* Close file */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+#endif /* H5_STRICT_FORMAT_CHECKS */
+ /* Remove temporary file */
+ if(HDremove(CORRUPT_STAB_TMP_FILE)) TEST_ERROR
+
+ PASSED();
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ HDremove(CORRUPT_STAB_TMP_FILE);
+
+ return 1;
+} /* end old_api() */
+
+
+/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Test groups
@@ -1133,6 +1254,7 @@ main(void)
/* Old group API specific tests */
nerrors += old_api(fapl);
+ nerrors += corrupt_stab_msg();
/* Close 2nd FAPL */
H5Pclose(fapl2);
@@ -1152,3 +1274,4 @@ error:
puts("*** TESTS FAILED ***");
return 1;
}
+
diff --git a/test/tarray.c b/test/tarray.c
index 8d739b9..cc0a0ca 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -1952,9 +1952,9 @@ test_compat(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid1,0);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"i")!=0)
+ if(mname && HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ if(mname) free(mname);
/* Check the 1st field's offset */
off=H5Tget_member_offset(tid1,0);
@@ -1971,9 +1971,9 @@ test_compat(void)
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid1,1);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"f")!=0)
+ if(mname && HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ if(mname) free(mname);
/* Check the 2nd field's offset */
off=H5Tget_member_offset(tid1,1);
@@ -2016,9 +2016,9 @@ test_compat(void)
/* Check the 3rd field's name */
mname=H5Tget_member_name(tid1,2);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"l")!=0)
+ if(mname && HDstrcmp(mname,"l")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ if(mname) free(mname);
/* Check the 3rd field's offset */
off=H5Tget_member_offset(tid1,2);
@@ -2061,9 +2061,9 @@ test_compat(void)
/* Check the 4th field's name */
mname=H5Tget_member_name(tid1,3);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"d")!=0)
+ if(mname && HDstrcmp(mname,"d")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- free(mname);
+ if(mname) free(mname);
/* Check the 4th field's offset */
off=H5Tget_member_offset(tid1,3);
diff --git a/test/tmisc.c b/test/tmisc.c
index 9ac2bc4..4db800c 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -2273,7 +2273,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz
VERIFY(ret, 0, "HDfclose");
/* Close the new file */
- ret=fclose(new_fp);
+ ret=HDfclose(new_fp);
VERIFY(ret, 0, "HDfclose");
/* Free the copy buffer */
diff --git a/test/trefstr.c b/test/trefstr.c
index 81394f2..c39a6eb 100644
--- a/test/trefstr.c
+++ b/test/trefstr.c
@@ -290,7 +290,6 @@ test_refstr_wrap(void)
static void
test_refstr_own(void)
{
- static const char *FUNC = "test_refstr_own";
H5RS_str_t *rs; /* Ref-counted string created */
char *s; /* Pointer to string to transfer */
const char *t; /* Temporary pointers to string */
diff --git a/test/tselect.c b/test/tselect.c
index 6d8f1bd..5845a9b 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -164,21 +164,21 @@
/* Location comparison function */
-int compare_size_t(const void *s1, const void *s2);
+static int compare_size_t(const void *s1, const void *s2);
-herr_t test_select_hyper_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_point_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_all_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_none_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
-herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_operator_data);
-herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_hyper_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_point_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_all_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_none_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+static herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_operator_data);
+static herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
/****************************************************************
**
** test_select_hyper_iter1(): Iterator for checking hyperslab iteration
**
****************************************************************/
-herr_t
+static herr_t
test_select_hyper_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data)
{
uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */
@@ -367,7 +367,7 @@ struct pnt_iter {
** (This is really ugly code, not a very good example of correct usage - QAK)
**
****************************************************************/
-herr_t
+static herr_t
test_select_point_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data)
{
uint8_t *elem=(uint8_t *)_elem; /* Pointer to the element to examine */
@@ -641,7 +641,7 @@ test_select_point(hid_t xfer_plist)
**
**
****************************************************************/
-herr_t
+static herr_t
test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data)
{
uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */
@@ -661,7 +661,7 @@ test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, c
** (This is never supposed to be called, so it always returns -1)
**
****************************************************************/
-herr_t
+static herr_t
test_select_none_iter1(void UNUSED *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void UNUSED *_operator_data)
{
return(-1);
@@ -1012,7 +1012,7 @@ test_select_combo(void)
HDfree(rbuf);
} /* test_select_combo() */
-int
+static int
compare_size_t(const void *s1, const void *s2)
{
if(*(const size_t *)s1<*(const size_t *)s2)
@@ -3714,7 +3714,7 @@ test_select_hyper_nota_2d(void)
** test_select_hyper_iter2(): Iterator for checking hyperslab iteration
**
****************************************************************/
-herr_t
+static herr_t
test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data)
{
int *tbuf=(int *)_elem, /* temporary buffer pointer */
@@ -4900,7 +4900,7 @@ typedef struct {
** test_select_hyper_iter3(): Iterator for checking hyperslab iteration
**
****************************************************************/
-herr_t
+static herr_t
test_select_hyper_iter3(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data)
{
unsigned short *tbuf=(unsigned short *)_elem; /* temporary buffer pointer */
diff --git a/test/tsohm.c b/test/tsohm.c
index 0516590..348677d 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -731,7 +731,6 @@ static void test_sohm_size1(void)
hid_t file = -1;
hid_t fcpl_id = -1;
hid_t fapl_id = -1;
- hsize_t norm_oh_size;
hsize_t sohm_oh_size;
hsize_t sohm_btree_oh_size;
h5_stat_size_t norm_empty_filesize;
@@ -782,13 +781,8 @@ static void test_sohm_size1(void)
CHECK_I(file, "H5Fopen");
file = size1_helper(file, FILENAME, fapl_id, 0);
CHECK_I(file, "size1_helper");
-
- /* Get the size of a dataset object header */
- ret = H5Oget_info_by_name(file, DSETNAME[0], &oinfo, H5P_DEFAULT);
- CHECK_I(ret, "H5Oget_info_by_name");
ret = H5Fclose(file);
CHECK_I(ret, "H5Fclose");
- norm_oh_size = oinfo.hdr.space.total;
/* Get the new file size */
norm_final_filesize = h5_get_file_size(FILENAME, fapl_id);
@@ -927,13 +921,6 @@ static void test_sohm_size1(void)
* headers. How the SOHM messages are stored shouldn't affect the
* size of the object header.
*/
- /* JAMES: this fails because while the headers are the same size, the
- * SOHM header is broken up by the SOHM table, so has to have a
- * continuation message and a NULL message.
-
- if(sohm_oh_size >= norm_oh_size)
- VERIFY(sohm_oh_size, 1, "H5Oget_info_by_name");
- */
if(sohm_oh_size != sohm_btree_oh_size)
VERIFY(sohm_btree_oh_size, 1, "H5Oget_info_by_name");
@@ -1378,14 +1365,14 @@ static void
size2_dump_struct(const char *name, size2_helper_struct *sizes)
{
puts(name);
- printf(" empty size: %llu\n", sizes->empty_size);
- printf(" first dataset: %llu \tdelta: %llu\n", sizes->first_dset, sizes->first_dset - sizes->empty_size);
- printf("second dataset: %llu \tdelta: %llu\n", sizes->second_dset, sizes->second_dset - sizes->first_dset);
- printf(" dsets 1: %llu \tdelta: %llu\n", sizes->dsets1, sizes->dsets1 - sizes->second_dset);
- printf(" dsets 2: %llu \tdelta: %llu\n", sizes->dsets2, sizes->dsets2 - sizes->dsets1);
- printf(" interleaved: %llu \tdelta: %llu\n", sizes->interleaved, sizes->interleaved - sizes->dsets2);
- printf(" attributes: %llu \tdelta: %llu\n", sizes->attrs1, sizes->attrs1 - sizes->interleaved);
- printf(" attributes 2: %llu \tdelta: %llu\n", sizes->attrs2, sizes->attrs2 - sizes->attrs1);
+ printf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
+ printf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
+ printf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
+ printf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
+ printf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
+ printf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
+ printf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
+ printf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
}
diff --git a/testpar/Makefile.in b/testpar/Makefile.in
index 249f3f8..9a275df 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -282,6 +282,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -293,9 +295,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 0fdd78a..ed3110a 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -276,52 +276,51 @@ MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */
/* stats functions */
-void print_stats(void);
-void reset_stats(void);
+static void reset_stats(void);
/* MPI setup functions */
-hbool_t set_up_file_communicator(void);
+static hbool_t set_up_file_communicator(void);
/* data array manipulation functions */
-int addr_to_datum_index(haddr_t base_addr);
-void init_data(void);
+static int addr_to_datum_index(haddr_t base_addr);
+static void init_data(void);
/* test coodination related functions */
-int do_express_test(void);
-void do_sync(void);
-int get_max_nerrors(void);
+static int do_express_test(void);
+static void do_sync(void);
+static int get_max_nerrors(void);
/* mssg xfer related functions */
-hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset);
-hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag);
-hbool_t setup_derived_types(void);
-hbool_t takedown_derived_types(void);
+static hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset);
+static hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag);
+static hbool_t setup_derived_types(void);
+static hbool_t takedown_derived_types(void);
/* server functions */
-hbool_t server_main(void);
-hbool_t serve_read_request(struct mssg_t * mssg_ptr);
-hbool_t serve_sync_request(struct mssg_t * mssg_ptr);
-hbool_t serve_write_request(struct mssg_t * mssg_ptr);
+static hbool_t server_main(void);
+static hbool_t serve_read_request(struct mssg_t * mssg_ptr);
+static hbool_t serve_sync_request(struct mssg_t * mssg_ptr);
+static hbool_t serve_write_request(struct mssg_t * mssg_ptr);
/* call back functions & related data structures */
-herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest);
-herr_t destroy_datum(H5F_t UNUSED * f, void * thing);
-herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr,
+static herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest);
+static herr_t destroy_datum(H5F_t UNUSED * f, void * thing);
+static herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr,
void *thing);
-void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr,
+static void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr,
const void UNUSED *udata1, void UNUSED *udata2);
-herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr);
+static herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr);
#define DATUM_ENTRY_TYPE H5AC_TEST_ID
@@ -398,6 +397,7 @@ hbool_t trace_file_check(void);
/****************************** stats functions ******************************/
/*****************************************************************************/
+#ifdef UNUSED
/*****************************************************************************
*
* Function: print_stats()
@@ -417,7 +417,7 @@ hbool_t trace_file_check(void);
*
*****************************************************************************/
-void
+static void
print_stats(void)
{
HDfprintf(stdout,
@@ -436,6 +436,7 @@ print_stats(void)
return;
} /* print_stats() */
+#endif /* UNUSED */
/*****************************************************************************
*
@@ -453,7 +454,7 @@ print_stats(void)
*
*****************************************************************************/
-void
+static void
reset_stats(void)
{
datum_clears = 0;
@@ -494,7 +495,7 @@ reset_stats(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
set_up_file_communicator(void)
{
const char * fcn_name = "set_up_file_communicator()";
@@ -647,7 +648,7 @@ set_up_file_communicator(void)
*
*****************************************************************************/
-int
+static int
addr_to_datum_index(haddr_t base_addr)
{
/* const char * fcn_name = "addr_to_datum_index()"; */
@@ -704,7 +705,7 @@ addr_to_datum_index(haddr_t base_addr)
*
*****************************************************************************/
-void
+static void
init_data(void)
{
/* const char * fcn_name = "init_data()"; */
@@ -785,7 +786,7 @@ init_data(void)
*
*****************************************************************************/
-int
+static int
do_express_test(void)
{
const char * fcn_name = "do_express_test()";
@@ -839,7 +840,7 @@ do_express_test(void)
*
*****************************************************************************/
-void
+static void
do_sync(void)
{
const char * fcn_name = "do_sync()";
@@ -915,7 +916,7 @@ do_sync(void)
*
*****************************************************************************/
-int
+static int
get_max_nerrors(void)
{
const char * fcn_name = "get_max_nerrors()";
@@ -970,7 +971,7 @@ get_max_nerrors(void)
#define CACHE_TEST_TAG 99 /* different from any used by the library */
-hbool_t
+static hbool_t
recv_mssg(struct mssg_t *mssg_ptr,
int mssg_tag_offset)
{
@@ -1055,7 +1056,7 @@ recv_mssg(struct mssg_t *mssg_ptr,
*
*****************************************************************************/
-hbool_t
+static hbool_t
send_mssg(struct mssg_t *mssg_ptr,
hbool_t add_req_to_tag)
{
@@ -1129,7 +1130,7 @@ send_mssg(struct mssg_t *mssg_ptr,
*
*****************************************************************************/
-hbool_t
+static hbool_t
setup_derived_types(void)
{
const char * fcn_name = "setup_derived_types()";
@@ -1223,7 +1224,7 @@ setup_derived_types(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
takedown_derived_types(void)
{
const char * fcn_name = "takedown_derived_types()";
@@ -1275,7 +1276,7 @@ takedown_derived_types(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
server_main(void)
{
const char * fcn_name = "server_main()";
@@ -1382,7 +1383,7 @@ server_main(void)
*
*****************************************************************************/
-hbool_t
+static hbool_t
serve_read_request(struct mssg_t * mssg_ptr)
{
const char * fcn_name = "serve_read_request()";
@@ -1488,7 +1489,7 @@ serve_read_request(struct mssg_t * mssg_ptr)
*
*****************************************************************************/
-hbool_t
+static hbool_t
serve_sync_request(struct mssg_t * mssg_ptr)
{
const char * fcn_name = "serve_sync_request()";
@@ -1556,7 +1557,7 @@ serve_sync_request(struct mssg_t * mssg_ptr)
*
*****************************************************************************/
-hbool_t
+static hbool_t
serve_write_request(struct mssg_t * mssg_ptr)
{
const char * fcn_name = "serve_write_request()";
@@ -1682,7 +1683,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
clear_datum(H5F_t * f,
void * thing,
hbool_t dest)
@@ -1756,7 +1757,7 @@ clear_datum(H5F_t * f,
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
destroy_datum(H5F_t UNUSED * f,
void * thing)
{
@@ -1822,7 +1823,7 @@ destroy_datum(H5F_t UNUSED * f,
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
flush_datum(H5F_t *f,
hid_t UNUSED dxpl_id,
hbool_t dest,
@@ -1959,7 +1960,7 @@ flush_datum(H5F_t *f,
*-------------------------------------------------------------------------
*/
-void *
+static void *
load_datum(H5F_t UNUSED *f,
hid_t UNUSED dxpl_id,
haddr_t addr,
@@ -2129,7 +2130,7 @@ load_datum(H5F_t UNUSED *f,
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
size_datum(H5F_t UNUSED * f,
void * thing,
size_t * size_ptr)
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index 5d02822..a0cf0e2 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -82,7 +82,7 @@ typedef enum access_ {
* elements. The allocation time is set to H5D_ALLOC_TIME_EARLY. Another
* routine will open this in parallel for extension test.
*/
-void
+static void
create_chunked_dataset(const char *filename, int nchunks, write_type write_pattern)
{
hid_t file_id, dataset; /* handles */
@@ -98,7 +98,6 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
hsize_t offset[1]; /* Selection offset within dataspace */
/* Variables used in reading data back */
char buffer[CHUNKSIZE];
- int i;
herr_t hrc;
@@ -195,7 +194,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
* opens the dataset. At the end, it verifies the size of the dataset to be
* consistent with argument 'nchunks'.
*/
-void
+static void
parallel_access_dataset(const char *filename, int nchunks, access_type action, hid_t *file_id, hid_t *dataset)
{
/* HDF5 gubbins */
@@ -203,7 +202,6 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
hid_t access_plist; /* HDF5 ID for file access property list */
herr_t hrc; /* HDF5 return code */
hsize_t size[1];
- hsize_t dim_size;
hsize_t chunk_dims[1] ={CHUNKSIZE};
hsize_t count[1];
@@ -217,7 +215,6 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
/* MPI Gubbins */
MPI_Offset filesize, /* actual file size */
est_filesize; /* estimated file size */
- int mpierr;
/* Initialize MPI */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
@@ -328,7 +325,8 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h
* 3. it returns correct values when the whole dataset has been written in an
* interleaved pattern.
*/
-void verify_data(const char *filename, int nchunks, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset)
+static void
+verify_data(const char *filename, int nchunks, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset)
{
/* HDF5 gubbins */
hid_t dataspace, memspace; /* HDF5 file identifier */
@@ -343,12 +341,7 @@ void verify_data(const char *filename, int nchunks, write_type write_pattern, in
/* Variables used in reading data back */
char buffer[CHUNKSIZE];
int value, i;
- int index, current;
-
- /* MPI Gubbins */
- MPI_Offset filesize, /* actual file size */
- est_filesize; /* estimated file size */
- int mpierr;
+ int index;
/* Initialize MPI */
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index fe0405e..61e7bfd 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -71,12 +71,9 @@ static void coll_chunktest(const char* filename,int chunk_factor,int select_fact
void
coll_chunk1(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
-
- filename = GetTestParameters();
- coll_chunktest(filename,1,BYROW_CONT,API_NONE);
-
+ coll_chunktest(filename, 1, BYROW_CONT, API_NONE);
}
@@ -118,12 +115,9 @@ coll_chunk1(void)
void
coll_chunk2(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
-
- filename = GetTestParameters();
- coll_chunktest(filename,1,BYROW_DISCONT,API_NONE);
-
+ coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE);
}
@@ -166,16 +160,11 @@ coll_chunk2(void)
void
coll_chunk3(void)
{
+ const char *filename = GetTestParameters();
+ int mpi_size;
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
- MPI_Comm_size(comm,&mpi_size);
-
- filename = GetTestParameters();
- coll_chunktest(filename,mpi_size,BYROW_CONT,API_NONE);
-
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE);
}
/*-------------------------------------------------------------------------
@@ -217,15 +206,9 @@ coll_chunk3(void)
void
coll_chunk4(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,1,BYROW_SELECTNONE,API_NONE);
-
+ coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE);
}
/*-------------------------------------------------------------------------
@@ -267,15 +250,9 @@ coll_chunk4(void)
void
coll_chunk5(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_HARD);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD);
}
/*-------------------------------------------------------------------------
@@ -317,15 +294,9 @@ coll_chunk5(void)
void
coll_chunk6(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_MULTI_HARD);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD);
}
/*-------------------------------------------------------------------------
@@ -367,15 +338,9 @@ coll_chunk6(void)
void
coll_chunk7(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_TRUE);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE);
}
/*-------------------------------------------------------------------------
@@ -417,15 +382,9 @@ coll_chunk7(void)
void
coll_chunk8(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_FALSE);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE);
}
/*-------------------------------------------------------------------------
@@ -467,15 +426,9 @@ coll_chunk8(void)
void
coll_chunk9(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_MULTI_COLL);
-
+ coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL);
}
/*-------------------------------------------------------------------------
@@ -517,15 +470,9 @@ coll_chunk9(void)
void
coll_chunk10(void)
{
+ const char *filename = GetTestParameters();
- const char *filename;
- int mpi_size;
-
- MPI_Comm comm = MPI_COMM_WORLD;
-
- filename = GetTestParameters();
- coll_chunktest(filename,4,BYROW_SELECTINCHUNK,API_MULTI_IND);
-
+ coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND);
}
@@ -555,8 +502,8 @@ static void
coll_chunktest(const char* filename,
int chunk_factor,
int select_factor,
- int api_option) {
-
+ int api_option)
+{
hid_t file,dataset, file_dataspace;
hid_t acc_plist,xfer_plist,crp_plist;
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index aa642b4..f38b30e 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -210,7 +210,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
void
test_filter_read(void)
{
- hid_t dc,file; /* HDF5 IDs */
+ hid_t dc; /* HDF5 IDs */
const hsize_t chunk_size[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */
hsize_t null_size; /* Size of dataset without filters */
herr_t hrc;
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index c4b319a..f7d7ebb 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -22,16 +22,16 @@
enum obj_type { is_group, is_dset };
-int get_size(void);
-void write_dataset(hid_t, hid_t, hid_t);
-int read_dataset(hid_t, hid_t, hid_t);
-void create_group_recursive(hid_t, hid_t, hid_t, int);
-void recursive_read_group(hid_t, hid_t, hid_t, int);
-void group_dataset_read(hid_t fid, int mpi_rank, int m);
-void write_attribute(hid_t, int, int);
-int read_attribute(hid_t, int, int);
-int check_value(DATATYPE *, DATATYPE *, int);
-void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
+static int get_size(void);
+static void write_dataset(hid_t, hid_t, hid_t);
+static int read_dataset(hid_t, hid_t, hid_t);
+static void create_group_recursive(hid_t, hid_t, hid_t, int);
+static void recursive_read_group(hid_t, hid_t, hid_t, int);
+static void group_dataset_read(hid_t fid, int mpi_rank, int m);
+static void write_attribute(hid_t, int, int);
+static int read_attribute(hid_t, int, int);
+static int check_value(DATATYPE *, DATATYPE *, int);
+static void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
/*
@@ -44,7 +44,8 @@ void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
* JRM - 8/11/04
*/
-int get_size(void)
+static int
+get_size(void)
{
int mpi_rank;
int mpi_size;
@@ -867,7 +868,8 @@ void independent_group_read(void)
*
* JRM - 8/16/04
*/
-void group_dataset_read(hid_t fid, int mpi_rank, int m)
+static void
+group_dataset_read(hid_t fid, int mpi_rank, int m)
{
int ret, i, j, size;
char gname[64], dname[32];
@@ -1035,7 +1037,8 @@ void multiple_group_write(void)
*
* JRM - 8/16/04
*/
-void write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
+static void
+write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
{
int i, j, n, size;
int mpi_rank, mpi_size;
@@ -1074,8 +1077,8 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
* Creates subgroups of depth GROUP_DEPTH recursively. Also writes datasets
* in parallel in each group.
*/
-void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid,
- int counter)
+static void
+create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, int counter)
{
hid_t child_gid;
int mpi_rank;
@@ -1196,7 +1199,8 @@ void multiple_group_read(void)
*
* JRM - 8/11/04
*/
-int read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
+static int
+read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
{
int i, j, n, mpi_rank, mpi_size, size, attr_errors=0, vrfy_errors=0;
char dname[32];
@@ -1250,8 +1254,8 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
* This recursive function opens all the groups in vertical direction and
* checks the data.
*/
-void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid,
- int counter)
+static void
+recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, int counter)
{
hid_t child_gid;
int mpi_rank, err_num=0;
@@ -1278,7 +1282,8 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid,
/* Create and write attribute for a group or a dataset. For groups, attribute
* is a scalar datum; for dataset, it is a one-dimensional array.
*/
-void write_attribute(hid_t obj_id, int this_type, int num)
+static void
+write_attribute(hid_t obj_id, int this_type, int num)
{
hid_t sid, aid;
hsize_t dspace_dims[1]={8};
@@ -1309,7 +1314,8 @@ void write_attribute(hid_t obj_id, int this_type, int num)
}
/* Read and verify attribute for group or dataset. */
-int read_attribute(hid_t obj_id, int this_type, int num)
+static int
+read_attribute(hid_t obj_id, int this_type, int num)
{
hid_t aid;
hsize_t group_block[2]={1,1}, dset_block[2]={1, 8};
@@ -1351,7 +1357,8 @@ int read_attribute(hid_t obj_id, int this_type, int num)
*
* JRM - 8/16/04
*/
-int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
+static int
+check_value(DATATYPE *indata, DATATYPE *outdata, int size)
{
int mpi_rank, mpi_size, err_num=0;
hsize_t i, j;
@@ -1387,11 +1394,9 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
* JRM - 8/11/04
*/
-void get_slab(hsize_t chunk_origin[],
- hsize_t chunk_dims[],
- hsize_t count[],
- hsize_t file_dims[],
- int size)
+static void
+get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[],
+ hsize_t file_dims[], int size)
{
int mpi_rank, mpi_size;
@@ -1450,10 +1455,6 @@ void io_mode_confusion(void)
hsize_t dimsf[1]; /* dataset dimensions */
int data[N] = {1}; /* pointer to data buffer to write */
hsize_t coord[N] = {0L,1L,2L,3L};
- hsize_t start[1];
- hsize_t stride[1];
- hsize_t count[1];
- hsize_t block[1];
hid_t plist_id; /* property list identifier */
herr_t status;
@@ -1579,11 +1580,6 @@ void io_mode_confusion(void)
VRFY((filespace >= 0 ), "H5Dget_space() failed");
- start[0] = 0L;
- stride[0] = 1;
- count[0] = 1;
- block[0] = N;
-
/* select all */
if(mpi_rank == 0 ) {
if(verbose )
@@ -1591,8 +1587,7 @@ void io_mode_confusion(void)
"%0d:%s: Calling H5Sselect_elements() -- set up hang?\n",
mpi_rank, fcn_name);
- status = H5Sselect_elements(filespace, H5S_SELECT_SET, N,
- &coord);
+ status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, (const hsize_t *)&coord);
VRFY((status >= 0 ), "H5Sselect_elements() failed");
} else { /* select nothing */
if(verbose )
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 14ba6c6..2195c32 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -697,10 +697,10 @@ static int test_mpio_derived_dtype(char *filename) {
MPI_Datatype etype,filetype;
MPI_Datatype adv_filetype,bas_filetype[2];
MPI_Datatype etypenew, filetypenew;
- MPI_Offset disp,dispnew;
+ MPI_Offset disp;
MPI_Status Status;
MPI_Aint adv_disp[2];
- MPI_Aint offsets[1],adv_offsets[2];
+ MPI_Aint offsets[1];
int blocklens[1],adv_blocklens[2];
int count,outcount;
int retcode;
@@ -896,9 +896,9 @@ If it turns out that the previous working MPI-IO package no longer works, this t
we can turn off the support for special collective IO; currently only special collective IO.
*/
-static int test_mpio_special_collective(char *filename) {
-
- char hostname[128];
+static int
+test_mpio_special_collective(char *filename)
+{
int mpi_size, mpi_rank;
MPI_File fh;
MPI_Datatype etype,buftype,filetype;
@@ -907,12 +907,10 @@ static int test_mpio_special_collective(char *filename) {
int mpi_err;
char writedata[2];
char *buf;
- char expect_val;
- int i, irank;
+ int i;
int count,bufcount;
int blocklens[2];
MPI_Aint offsets[2];
- int nerrors = 0; /* number of errors */
MPI_Offset mpi_off;
MPI_Status mpi_stat;
int retcode;
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c
index 29d5c58..0773b93 100644
--- a/testpar/t_pflush1.c
+++ b/testpar/t_pflush1.c
@@ -50,7 +50,8 @@ static double the_data[100][100];
*
*-------------------------------------------------------------------------
*/
-hid_t create_file(char* name, hid_t fapl)
+static hid_t
+create_file(char* name, hid_t fapl)
{
hid_t file, dcpl, space, dset, groups, grp, plist;
hsize_t ds_size[2] = {100, 100};
@@ -121,8 +122,7 @@ int
main(int argc, char* argv[])
{
hid_t file1, file2, fapl;
- MPI_File mpifh=-2;
- int *mpifh_p = NULL;
+ MPI_File *mpifh_p = NULL;
char name[1024];
const char *envval = NULL;
int mpi_size, mpi_rank;
diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c
index 82c112f..a570d4c 100644
--- a/testpar/t_pflush2.c
+++ b/testpar/t_pflush2.c
@@ -49,7 +49,8 @@ static double the_data[100][100];
*
*-------------------------------------------------------------------------
*/
-int check_file(char* name, hid_t fapl)
+static int
+check_file(char* name, hid_t fapl)
{
hid_t file, space, dset, groups, grp, plist;
hsize_t ds_size[2];
diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c
index a4b8a86..1be3e99 100644
--- a/testpar/t_posix_compliant.c
+++ b/testpar/t_posix_compliant.c
@@ -701,7 +701,8 @@ static int find_writesize(int rank, int numprocs, int size)
return write_size;
}
-static void vrfy_elements(int* a, int* b, int size, int rank)
+static void
+vrfy_elements(int* a, int* b, int size, int rank)
{
int i, counter = 0;
@@ -725,6 +726,7 @@ static void vrfy_elements(int* a, int* b, int size, int rank)
/* print an explanation message by MAIN (0) process.
*/
+static void
header_msg(void)
{
printf(
@@ -736,7 +738,8 @@ header_msg(void)
);
}
-int main(int argc, char* argv[])
+int
+main(int argc, char* argv[])
{
int numprocs, rank, opt, mpi_tests=1, posix_tests=1;
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 800ad41..667872c 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -248,7 +248,7 @@ void coll_write_test(int chunk_factor)
hsize_t chunk_dims[2];
herr_t ret;
- unsigned i,j;
+ unsigned i;
int fillvalue = 0; /* Fill value for the dataset */
#if 0
@@ -689,7 +689,8 @@ void coll_write_test(int chunk_factor)
coll_write_test.
*-------------------------------------------------------------------------
*/
-void coll_read_test(int chunk_factor)
+static void
+coll_read_test(int chunk_factor)
{
const char *filename;
@@ -713,7 +714,7 @@ void coll_read_test(int chunk_factor)
hsize_t block[2]; /* Block sizes */
herr_t ret;
- unsigned i,j;
+ unsigned i;
int *matrix_out;
int *matrix_out1;
@@ -932,3 +933,4 @@ void coll_read_test(int chunk_factor)
return ;
}
+
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 52ece40..5dc816f 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -246,6 +246,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -257,9 +259,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in
index 5928706..3ea702b 100644
--- a/tools/h5copy/Makefile.in
+++ b/tools/h5copy/Makefile.in
@@ -263,6 +263,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -274,9 +276,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in
index dc0b25c..bf70681 100644
--- a/tools/h5diff/Makefile.in
+++ b/tools/h5diff/Makefile.in
@@ -270,6 +270,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -281,9 +283,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 547d910..8e7b181 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -19,9 +19,9 @@
#include "h5diff_common.h"
#include "h5tools_utils.h"
-int check_n_input( const char* );
-int check_p_input( const char* );
-int check_d_input( const char* );
+static int check_n_input( const char* );
+static int check_p_input( const char* );
+static int check_d_input( const char* );
/* module-scoped variables */
@@ -228,7 +228,8 @@ void parse_command_line(int argc,
*
*-------------------------------------------------------------------------
*/
-int check_n_input( const char *str )
+static int
+check_n_input( const char *str )
{
unsigned i;
char c;
@@ -263,7 +264,8 @@ int check_n_input( const char *str )
*
*-------------------------------------------------------------------------
*/
-int check_p_input( const char *str )
+static int
+check_p_input( const char *str )
{
double x;
@@ -296,7 +298,8 @@ int check_p_input( const char *str )
*
*-------------------------------------------------------------------------
*/
-int check_d_input( const char *str )
+static int
+check_d_input( const char *str )
{
double x;
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index d9495e5..181e242 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -55,7 +55,7 @@ return -1;
}
const H5L_class_t UD_link_class[1] = {{
H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
- MY_LINKCLASS, /* Link type id number */
+ (H5L_type_t)MY_LINKCLASS, /* Link type id number */
"UD link class", /* name for debugging */
NULL, /* Creation callback */
NULL, /* Move/rename callback */
@@ -492,7 +492,7 @@ int test_types(const char *fname)
*/
H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT);
H5Lregister(UD_link_class);
- H5Lcreate_ud(fid1, "ud_link", MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT);
+ H5Lcreate_ud(fid1, "ud_link", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT);
/*-------------------------------------------------------------------------
* Close
@@ -2608,6 +2608,7 @@ void gen_datareg(hid_t fid,
sid1 = H5Screate_simple(2, dims1, NULL);
did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ assert(status >= 0);
/* create the reference dataset */
sid2 = H5Screate_simple(1, dims2, NULL);
@@ -2624,10 +2625,12 @@ void gen_datareg(hid_t fid,
}
status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
+ assert(status >= 0);
H5Sget_select_npoints(sid1);
/* store first dataset region */
status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1);
+ assert(status >= 0);
/* select sequence of five points for second reference */
coord[0][0]=6; coord[0][1]=9;
@@ -2649,15 +2652,20 @@ void gen_datareg(hid_t fid,
/* write */
status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf);
+ assert(status >= 0);
/* close, free memory buffers */
status = H5Dclose(did1);
+ assert(status >= 0);
status = H5Sclose(sid1);
+ assert(status >= 0);
status = H5Dclose(did2);
+ assert(status >= 0);
status = H5Sclose(sid2);
+ assert(status >= 0);
+
free(rbuf);
free(buf);
-
}
diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c
index a4ac793..c613879 100644
--- a/tools/h5diff/ph5diff_main.c
+++ b/tools/h5diff/ph5diff_main.c
@@ -16,6 +16,7 @@
#include "h5diff.h"
#include "ph5diff.h"
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include "h5diff_common.h"
@@ -59,7 +60,6 @@ int main(int argc, const char *argv[])
const char *fname2 = NULL;
const char *objname1 = NULL;
const char *objname2 = NULL;
- hsize_t nfound=0;
diff_opt_t options;
outBuffOffset = 0;
@@ -78,7 +78,7 @@ int main(int argc, const char *argv[])
parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
- nfound = h5diff(fname1, fname2, objname1, objname2, &options);
+ h5diff(fname1, fname2, objname1, objname2, &options);
print_info(&options);
@@ -92,7 +92,7 @@ int main(int argc, const char *argv[])
{
parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
- nfound = h5diff(fname1, fname2, objname1, objname2, &options);
+ h5diff(fname1, fname2, objname1, objname2, &options);
MPI_Barrier(MPI_COMM_WORLD);
@@ -131,7 +131,6 @@ ph5diff_worker(int nID)
hid_t file1_id, file2_id;
char filenames[2][1024];
char out_data[PRINT_DATA_MAX_SIZE] = {0};
- hsize_t nfound=0;
struct diffs_found diffs;
int i;
MPI_Status Status;
@@ -170,8 +169,7 @@ ph5diff_worker(int nID)
/*Recv parameters for diff from manager task */
MPI_Recv(&args, sizeof(args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status);
/*Do the diff */
- nfound = diff(file1_id, args.name, file2_id, args.name, &(args.options), args.type);
- diffs.nfound = nfound;
+ diffs.nfound = diff(file1_id, args.name, file2_id, args.name, &(args.options), args.type);
diffs.not_cmp = args.options.not_cmp;
/*If print buffer has something in it, request print token.*/
diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in
index 1ecb430..9bf42b7 100644
--- a/tools/h5dump/Makefile.in
+++ b/tools/h5dump/Makefile.in
@@ -268,6 +268,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -279,9 +281,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 3b11eac..fc75681 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -5502,7 +5502,6 @@ static int gent_ldouble(void)
hid_t did;
hid_t tid;
hid_t sid;
- size_t size;
hsize_t dims[1] = {3};
long double buf[3] = {1,2,3};
@@ -5515,7 +5514,7 @@ static int gent_ldouble(void)
if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0)
goto error;
- if((size = H5Tget_size(tid)) == 0)
+ if(H5Tget_size(tid) == 0)
goto error;
if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in
index 3cf4217..65cefc8 100755
--- a/tools/h5import/Makefile.in
+++ b/tools/h5import/Makefile.in
@@ -263,6 +263,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -274,9 +276,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 89d14f9..933754e 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -1437,7 +1437,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm)
if (in->configOptionVector[COMPRESS] == 0)
in->compressionType = 0;
- in->configOptionVector[COMPRESS] = 1;
+
break;
case 12: /* EXTERNAL-STORAGE */
@@ -1990,7 +1990,7 @@ getCompressionType(struct Input *in, FILE** strm)
return (-1);
}
- in->outputByteOrder = kindex;
+ in->compressionType = kindex;
return (0);
}
diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c
index 718ec6b..dd1a2be 100755
--- a/tools/h5import/h5importtest.c
+++ b/tools/h5import/h5importtest.c
@@ -33,7 +33,6 @@ main(void)
int i, j, k;
FILE *sp;
- float b32r3[5][3][4];
float row4[3], col4[4], pln4[5];
float rowo4 = (float)11.0e0, colo4 = (float)21.0e0, plno4 = (float)51.0e0;
float rowi4 = (float)1.0e0, coli4 = (float)2.0e0, plni4 = (float)5.0e0;
@@ -44,7 +43,6 @@ main(void)
int rowi4i = (int)1 , coli4i = (int)2 , plni4i = (int)5 ;
#ifndef WIN32
- long long b64i2[3][4], b64i3[5][3][4];
long long row4i64[3], col4i64[4], pln4i64[5];
long long rowo4i64 = (long long)11 , colo4i64 = (long long)21 , plno4i64 = (long long)51 ;
long long rowi4i64 = (long long)1 , coli4i64 = (long long)2 , plni4i64 = (long long)5 ;
@@ -142,16 +140,6 @@ main(void)
pln4i8[k] = pln4i8[k - 1] + plni4i8;
}
- for (i = 0; i < nrow; i++)
- {
- for (j = 0; j < ncol; j++)
- {
-#ifndef WIN32
- b64i2[i][j] = row4i64[i] + col4i64[j];
-#endif
- }
- }
-
/*
* build array elements - rank 3
*
@@ -159,29 +147,18 @@ main(void)
*/
for (i = 0; i < nrow; i++)
- {
for (j = 0; j < ncol; j++)
- {
- for (k = 0; k < npln; k++)
- {
- b32r3[k][i][j] = row4[i] + col4[j] + pln4[k];
+ for (k = 0; k < npln; k++) {
b64r3[k][i][j] = row8[i] + col8[j] + pln8[k];
b32i3[k][i][j] = row4i[i] + col4i[j] + pln4i[k];
-#ifndef WIN32
- b64i3[k][i][j] = row4i64[i] + col4i64[j] + pln4i64[k];
-#endif
b16i3[k][i][j] = row4i16[i] + col4i16[j] + pln4i16[k];
b8i3[k][i][j] = row4i8[i] + col4i8[j] + pln4i8[k];
}
- }
- }
#ifndef UNICOS
-
-
/*-------------------------------------------------------------------------
* TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5
*-------------------------------------------------------------------------
diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh
index ed0a930..ca445ed 100755
--- a/tools/h5import/h5importtestutil.sh
+++ b/tools/h5import/h5importtestutil.sh
@@ -60,61 +60,48 @@ cp $srcdir/testfiles/*.h5 tmp_testfiles/
$RUNSERIAL ./h5importtest
TESTING "ASCII I32 rank 3 - Output BE " ;
-#TOOLTEST txtin32 -c $srcdir/testfiles/textin32 -o test1.h5
TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin32.conf -o txtin32.h5
TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended"
-#TOOLTEST txtin16 -c $srcdir/testfiles/textin16 -o test2.h5
TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5
-TESTING "ASCII I8 - rank 3 - Output I16 LE-Chunked+Extended+Compressed "
-#TOOLTEST txtin16 -c $srcdir/testfiles/textin8 -o test3.h5
+TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed "
TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin8.conf -o txtin8.h5
TESTING "ASCII UI32 - rank 3 - Output BE"
-#TOOLTEST $srcdir/testfiles/in1 -c $srcdir/testfiles/textuin32 -o test4.h5
TOOLTEST $srcdir/testfiles/txtuin32.txt -c $srcdir/testfiles/txtuin32.conf -o txtuin32.h5
TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed "
-#TOOLTEST $srcdir/testfiles/in1 -c $srcdir/testfiles/textuin16 -o test5.h5
TOOLTEST $srcdir/testfiles/txtuin32.txt -c $srcdir/testfiles/txtuin16.conf -o txtuin16.h5
TESTING "ASCII F32 - rank 3 - Output LE "
-#TOOLTEST $srcdir/testfiles/fp1 -c $srcdir/testfiles/textfp32 -o test6.h5
TOOLTEST $srcdir/testfiles/txtfp32.txt -c $srcdir/testfiles/txtfp32.conf -o txtfp32.h5
TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed "
-#TOOLTEST $srcdir/testfiles/fp2 -c $srcdir/testfiles/textfp64 -o test7.h5
TOOLTEST $srcdir/testfiles/txtfp64.txt -c $srcdir/testfiles/txtfp64.conf -o txtfp64.h5
TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed "
-#TOOLTEST bfp64 -c $srcdir/testfiles/conbfp64 -o test8.h5
TOOLTEST binfp64.bin -c $srcdir/testfiles/binfp64.conf -o binfp64.h5
TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended "
-#TOOLTEST bin16 -c $srcdir/testfiles/conbin16 -o test9.h5
TOOLTEST binin16.bin -c $srcdir/testfiles/binin16.conf -o binin16.h5
TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed "
-#TOOLTEST bin8 -c $srcdir/testfiles/conbin8 -o test10.h5
TOOLTEST binin8.bin -c $srcdir/testfiles/binin8.conf -o binin8.h5
TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED "
-#TOOLTEST bin32 -c $srcdir/testfiles/conbin32 -o test11.h5
TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5
TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED "
-#TOOLTEST buin16 -c $srcdir/testfiles/conbuin16 -o test12.h5
TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5
TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED "
-#TOOLTEST buin32 -c $srcdir/testfiles/conbuin32 -o test13.h5
TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5
diff --git a/tools/h5import/testfiles/txtin8.conf b/tools/h5import/testfiles/txtin8.conf
index 4405338..9dbfd2b 100755
--- a/tools/h5import/testfiles/txtin8.conf
+++ b/tools/h5import/testfiles/txtin8.conf
@@ -10,6 +10,8 @@ DIMENSION-SIZES 2 4 3
CHUNKED-DIMENSION-SIZES 2 2 2
MAXIMUM-DIMENSIONS -1 -1 -1
COMPRESSION-PARAM 3
+COMPRESSION-TYPE GZIP
+
diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in
index 81425ec..32a6c2f 100644
--- a/tools/h5jam/Makefile.in
+++ b/tools/h5jam/Makefile.in
@@ -274,6 +274,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -285,9 +287,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in
index 771bd20..bfc0e78 100644
--- a/tools/h5ls/Makefile.in
+++ b/tools/h5ls/Makefile.in
@@ -257,6 +257,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -268,9 +270,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in
index 59b3668..1a5990d 100644
--- a/tools/h5repack/Makefile.in
+++ b/tools/h5repack/Makefile.in
@@ -277,6 +277,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -288,9 +290,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index c5f9d69..1a9422e 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -3735,9 +3735,11 @@ void make_dset_reg_ref(hid_t loc_id)
/* Write selection to disk */
ret = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dset2);
+ assert(ret >= 0);
/* Create dataspace for the reference dataset */
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
@@ -3753,17 +3755,23 @@ void make_dset_reg_ref(hid_t loc_id)
count[0] = 6; count[1] = 6;
block[0] = 1; block[1] = 1;
ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
+ assert(ret >= 0);
/* Store dataset region */
ret = H5Rcreate(&wbuf[0], loc_id, "dsetreg", H5R_DATASET_REGION, sid2);
+ assert(ret >= 0);
/* Write selection to disk */
ret=H5Dwrite(dset1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf);
+ assert(ret >= 0);
/* Close all objects */
ret = H5Sclose(sid1);
+ assert(ret >= 0);
ret = H5Dclose(dset1);
+ assert(ret >= 0);
ret = H5Sclose(sid2);
+ assert(ret >= 0);
free(wbuf);
free(dwbuf);
diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in
index 67b1280..3bcdd8c 100644
--- a/tools/h5stat/Makefile.in
+++ b/tools/h5stat/Makefile.in
@@ -266,6 +266,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -277,9 +279,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index e95a9ee..315c558 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -98,9 +98,7 @@ int d_status = EXIT_SUCCESS;
static int display_all = TRUE;
static int display_file_metadata = FALSE;
static int display_file = FALSE;
-static int display_group_metadata = FALSE;
static int display_group = FALSE;
-static int display_dset_metadata = FALSE;
static int display_dset = FALSE;
static int display_dtype_metadata = FALSE;
static int display_object = FALSE;
@@ -698,7 +696,6 @@ parse_command_line(int argc, const char *argv[])
case 'G':
display_all = FALSE;
- display_group_metadata = TRUE;
break;
case 'g':
@@ -713,7 +710,6 @@ parse_command_line(int argc, const char *argv[])
case 'D':
display_all = FALSE;
- display_dset_metadata = TRUE;
break;
case 'd':
@@ -1106,7 +1102,6 @@ print_file_statistics(const iter_t *iter)
display_file = TRUE;
display_file_metadata = TRUE;
display_group = TRUE;
- display_group_metadata = TRUE;
display_dset = TRUE;
display_dtype_metadata = TRUE;
display_attr = TRUE;
diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c
index 250226e..3f933f2 100644
--- a/tools/h5stat/h5stat_gentest.c
+++ b/tools/h5stat/h5stat_gentest.c
@@ -23,6 +23,7 @@
* of the expected output and update the corresponding *.ddl files.
*/
+#include <assert.h>
#include "hdf5.h"
#define FILE "h5stat_newgrat.h5"
@@ -47,6 +48,7 @@ static void gen_file(void)
fapl = H5Pcreate(H5P_FILE_ACCESS);
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
+ assert(ret >= 0);
/* Create dataset */
file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
@@ -68,12 +70,17 @@ static void gen_file(void)
sprintf(attrname, "%s%d", ATTR_NAME,i);
attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Aclose(attr_id);
+ assert(ret >= 0);
} /* end for */
ret = H5Dclose(dset_id);
+ assert(ret >= 0);
ret = H5Sclose(space_id);
+ assert(ret >= 0);
ret = H5Tclose(type_id);
+ assert(ret >= 0);
ret = H5Fclose(file);
+ assert(ret >= 0);
}
int main(void)
diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in
index b08c0a3..3f29521 100644
--- a/tools/lib/Makefile.in
+++ b/tools/lib/Makefile.in
@@ -262,6 +262,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -273,9 +275,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in
index e70a93f..98f2d1d 100644
--- a/tools/misc/Makefile.in
+++ b/tools/misc/Makefile.in
@@ -281,6 +281,8 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+
+# Install directories that automake doesn't know about
docdir = $(exec_prefix)/doc
dvidir = @dvidir@
enable_shared = @enable_shared@
@@ -292,9 +294,7 @@ host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
-
-# Install directories that automake doesn't know about
-includedir = $(exec_prefix)/include
+includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h
index da54a4f..d79c993 100644
--- a/vms/src/h5pubconf.h
+++ b/vms/src/h5pubconf.h
@@ -480,13 +480,13 @@
#define H5_PACKAGE_NAME "HDF5"
/* Define to the full name and version of this package. */
-#define H5_PACKAGE_STRING "HDF5 1.9.34"
+#define H5_PACKAGE_STRING "HDF5 1.9.36"
/* Define to the one symbol short name of this package. */
#define H5_PACKAGE_TARNAME "hdf5"
/* Define to the version of this package. */
-#define H5_PACKAGE_VERSION "1.9.34"
+#define H5_PACKAGE_VERSION "1.9.36"
/* Width for printf() for type `long long' or `__int64', use `ll' */
#define H5_PRINTF_LL_WIDTH "ll"
@@ -639,7 +639,7 @@
/* #undef H5_USING_MEMCHECKER */
/* Version number of package */
-#define H5_VERSION "1.9.34"
+#define H5_VERSION "1.9.36"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */
diff --git a/vms/tools/h5stat/make.com b/vms/tools/h5stat/make.com
new file mode 100644
index 0000000..a822aaa
--- /dev/null
+++ b/vms/tools/h5stat/make.com
@@ -0,0 +1,39 @@
+$!#
+$!# Copyright by The HDF Group.
+$!# Copyright by the Board of Trustees of the University of Illinois.
+$!# All rights reserved.
+$!#
+$!# This file is part of HDF5. The full HDF5 copyright notice, including
+$!# terms governing use, modification, and redistribution, is contained in
+$!# the files COPYING and Copyright.html. COPYING can be found at the root
+$!# of the source code distribution tree; Copyright.html can be found at the
+$!# root level of an installed copy of the electronic HDF5 document set and
+$!# is linked from the top-level documents page. It can also be found at
+$!# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+$!# access to either file, you may request a copy from help@hdfgroup.org.
+$!#
+$! Makefile for VMS systems.
+$!
+$! Make h5stat tool
+$!
+$! The next two lines should be uncommented only when building by hand in the
+$! current directory. Use build.com in the vms directory to build
+$! the distribution. Make sure that location of the zlib library is correct.
+$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3]
+$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir"
+$ ccc := cc 'ccopt /include=([-.-.src], [-.lib], [-.-.test])
+$ type sys$input
+ Creating h5stat
+$!
+$ cobj= " h5stat "
+$!
+$ ccc 'cobj
+$ type sys$input
+$ link/exe=h5stat.exe -
+ h5stat, -
+ [-.lib]libh5tools.olb/lib,[-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib
+$ type sys$input
+ Created h5stat
+$!
+$!
+$ exit
diff --git a/vms/tools/misc/make.com b/vms/tools/misc/make.com
new file mode 100644
index 0000000..4c8e223
--- /dev/null
+++ b/vms/tools/misc/make.com
@@ -0,0 +1,54 @@
+$!#
+$!# Copyright by The HDF Group.
+$!# Copyright by the Board of Trustees of the University of Illinois.
+$!# All rights reserved.
+$!#
+$!# This file is part of HDF5. The full HDF5 copyright notice, including
+$!# terms governing use, modification, and redistribution, is contained in
+$!# the files COPYING and Copyright.html. COPYING can be found at the root
+$!# of the source code distribution tree; Copyright.html can be found at the
+$!# root level of an installed copy of the electronic HDF5 document set and
+$!# is linked from the top-level documents page. It can also be found at
+$!# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+$!# access to either file, you may request a copy from help@hdfgroup.org.
+$!#
+$! Makefile for VMS systems.
+$!
+$! Make miscellaneous tools
+$!
+$! The next two lines should be uncommented only when building by hand in the
+$! current directory. Use build.com in the vms directory to build
+$! the distribution. Make sure that location of the zlib library is correct.
+$! define zlib_dir sys$sysusers:[pourmal.zlib-1_2_3]
+$! ccopt = "/float=ieee_float/define=H5_VMS/include=zlib_dir"
+$ ccc := cc 'ccopt /include=([-.-.src], [-.lib], [-.-.test])
+$ type sys$input
+ Creating h5debug
+$!
+$ cobj= " h5debug "
+$!
+$ ccc 'cobj
+$ type sys$input
+$ link/exe=h5debug.exe -
+ h5debug, -
+ [-.lib]libh5tools.olb/lib,[-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib
+$ type sys$input
+ Created h5debug
+$!
+$ type sys$input
+ Creating h5mkgrp
+$!
+$ cobj= " h5mkgrp "
+$!
+$ ccc 'cobj
+$ type sys$input
+$ link/exe=h5mkgrp.exe -
+ h5mkgrp, -
+ [-.lib]libh5tools.olb/lib,[-.-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib
+$ type sys$input
+ Created h5mkgrp
+$!
+$ type sys$input
+ Done with misc tools compilation
+$!
+$ exit
diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h
index bf591d7..892a847 100755
--- a/windows/src/H5pubconf.h
+++ b/windows/src/H5pubconf.h
@@ -479,13 +479,13 @@
#define H5_PACKAGE_NAME "HDF5"
/* Define to the full name and version of this package. */
-#define H5_PACKAGE_STRING "HDF5 1.9.34"
+#define H5_PACKAGE_STRING "HDF5 1.9.36"
/* Define to the one symbol short name of this package. */
#define H5_PACKAGE_TARNAME "hdf5"
/* Define to the version of this package. */
-#define H5_PACKAGE_VERSION "1.9.34"
+#define H5_PACKAGE_VERSION "1.9.36"
/* Width for printf() for type `long long' or `__int64', use `ll' */
#define H5_PRINTF_LL_WIDTH "I64"
@@ -642,7 +642,7 @@
/* #undef H5_USING_MEMCHECKER */
/* Version number of package */
-#define H5_VERSION "1.9.34"
+#define H5_VERSION "1.9.36"
/* Define if vsnprintf() returns the correct value for formatted strings that
don't fit into size allowed */