From 0cc75ef161066d0e6b6d7f4f962ed6cc0cb1c235 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Jun 2017 15:49:48 -0500 Subject: Change file name --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index ed43dea..3c4b142 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2415,5 +2415,5 @@ ./config/cmake/CTestScript.cmake ./config/cmake/HDF5_Examples_options.cmake ./config/cmake/scripts/CTestScript.cmake -./config/cmake/scripts/HDF518config.cmake +./config/cmake/scripts/HDF5config.cmake ./config/cmake/scripts/HDF5options.cmake -- cgit v0.12 From 34c1ca89db3557a7c9f4ed7a63df547cd722be10 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 5 Jun 2017 17:10:39 -0500 Subject: Update h5vers and release scripts for 1.8.19 branch, set version to 1.8.19-pre1. Note: changes to these scripts were brought from develop/hdf5_1_10 and modified for 1.8 version differences. Update HDF5 version to 1.8.20-snap0. Update HL .so number for added API function. --- README.txt | 2 +- bin/h5vers | 109 ++++++---- bin/release | 224 ++++++++++++++++++++- c++/src/Makefile.in | 6 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 4 +- config/lt_vers.am | 6 +- configure | 22 +- configure.ac | 2 +- fortran/src/Makefile.in | 6 +- hl/c++/src/Makefile.in | 6 +- hl/fortran/src/Makefile.in | 6 +- hl/src/H5LTparse.c | 144 ++++++------- hl/src/H5LTparse.h | 4 +- hl/src/Makefile.in | 6 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 6 +- src/Makefile.in | 6 +- .../h5repack_layout.h5-plugin_version_test.ddl | 14 +- 19 files changed, 408 insertions(+), 169 deletions(-) diff --git a/README.txt b/README.txt index f209f77..d782f4e 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap4 currently under development +HDF5 version 1.8.20-snap0 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/bin/h5vers b/bin/h5vers index 55ece48..c8abef8 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -125,7 +125,7 @@ EOF exit 1; } -# Parse arguments + my ($verbose, $set, $inc, $file, $rc); my (@files) = ("H5public.h", "src/H5public.h", "../src/H5public.h"); while ($_ = shift) { @@ -158,21 +158,26 @@ die "mutually exclusive options given\n" if $set && $inc; # Determine file to use as H5public.h, README.txt, # release_docs/RELEASE.txt, configure.ac, windows/src/H5pubconf.h -# and config/lt_vers.am. +# config/lt_vers.am and config/cmake/scripts/HDF5config.cmake. # The README.txt, release_docs/RELEASE.txt, configure.ac, -# windows/src/H5pubconf.h, and config/lt_vers.am +# windows/src/H5pubconf.h, config/lt_vers.am and +# config/cmake/scripts/HDF5config.cmake # files are always in the directory above H5public.h unless ($file) { for (@files) { ($file=$_,last) if -f $_; } } -die "unable to find source files\n" unless defined $file; +die "unable to find source file $file\n" unless defined $file; die "unable to read file: $file\n" unless -r $file; # config/lt_vers.am my $LT_VERS = $file; $LT_VERS =~ s/[^\/]*$/..\/config\/lt_vers.am/; die "unable to read file: $LT_VERS\n" unless -r $file; +# config/cmake/scripts/HDF5config.cmake +my $HDF5CONFIGCMAKE = $file; +$HDF5CONFIGCMAKE =~ s/[^\/]*$/..\/config\/cmake\/scripts\/HDF5config.cmake/; +die "unable to read file: $HDF5CONFIGCMAKE\n" unless -r $file; # README.txt my $README = $file; $README =~ s/[^\/]*$/..\/README.txt/; @@ -189,6 +194,9 @@ die "unable to read file: $CONFIGURE\n" unless -r $file; my $CPP_DOC_CONFIG = $file; $CPP_DOC_CONFIG =~ s/[^\/]*$/..\/c++\/src\/cpp_doc_config/; die "unable to read file: $CPP_DOC_CONFIG\n" unless -r $file; +my $REPACK_LAYOUT_PLUGIN_VERSION = $file; +$REPACK_LAYOUT_PLUGIN_VERSION =~ s/[^\/]*$/..\/tools\/h5repack\/testfiles\/h5repack_layout.h5-plugin_version_test.ddl/; +die "unable to read file: $REPACK_LAYOUT_PLUGIN_VERSION\n" unless -r $file; # Get the current version number. open FILE, $file or die "unable to open $file: $!\n"; @@ -237,18 +245,11 @@ if ($set) { $RELEASE = ""; $CONFIGURE = ""; $CPP_DOC_CONFIG = ""; - $LT_VERS = ""; + $LT_VERS = ""; + $HDF5CONFIGCMAKE = ""; @newver = @curver; } -# Note if the new version is for an official release. -# if the fourth version field is empty or contains "patch", -# "currently under development" shouldn't be printed as -# part of the version string. -my $is_official_release=""; -if ($newver[3] eq "" || $newver[3] =~ /patch\d/) { - $is_official_release="true"; -} # Note if the version increased or decreased my $version_increased=""; # Print a warning if the version got smaller (don't check annot field) @@ -282,29 +283,29 @@ if ($LT_VERS && $version_increased) { close FILE; local($_) = $contentsy; - - # As of the HDF5 v1.8.16 release, h5vers should not increment - # the LT_VERS numbers, so the next 6 lines are commented out. - # A future version may copy the numbers to H5public.h, so this - # section is retained for future reference. - #my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m; - #my $new_lt_revision = $lt_revision+1; - #($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m; - - #open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n"; - #print FILE $contentsy; - #close FILE; -} +# As of the HDF5 v1.8.16 release, h5vers should not increment +# the LT_VERS numbers, so the next 6 lines are commented out. +# A future version may copy the numbers to H5public.h, so this +# section is retained for future reference. +# my ($lt_revision) = /^LT_VERS_REVISION\s*=\s*(\d+)/m; +# my $new_lt_revision = $lt_revision+1; +# ($contentsy) =~ s/^(LT_VERS_REVISION\s*=\s*)\d+/$1$new_lt_revision/m; + +# open FILE, ">$LT_VERS" or die "$LT_VERS: $!\n"; +# print FILE $contentsy; +# close FILE; +} # Update the README.txt file if ($README) { open FILE, $README or die "$README: $!\n"; my @contents = ; close FILE; - $contents[0] = sprintf("HDF5 version %d.%d.%d%s\n", + $contents[0] = sprintf("HDF5 version %d.%d.%d%s %s", @newver[0,1,2], - $is_official_release ? $newver[3] eq "" ? "" : "-".$newver[3] : "-".$newver[3]." currently under development"); + $newver[3] eq "" ? "" : "-".$newver[3], + "currently under development\n"); open FILE, ">$README" or die "$README: $!\n"; print FILE @contents; close FILE; @@ -315,9 +316,10 @@ if ($RELEASE) { open FILE, $RELEASE or die "$RELEASE: $!\n"; my @contents = ; close FILE; - $contents[0] = sprintf("HDF5 version %d.%d.%d%s\n", + $contents[0] = sprintf("HDF5 version %d.%d.%d%s %s", @newver[0,1,2], - $is_official_release ? $newver[3] eq "" ? "" : "-".$newver[3] : "-".$newver[3]." currently under development"); + $newver[3] eq "" ? "" : "-".$newver[3], + "currently under development\n"); open FILE, ">$RELEASE" or die "$RELEASE: $!\n"; print FILE @contents; close FILE; @@ -326,19 +328,53 @@ if ($RELEASE) { # Update the c++/src/cpp_doc_config file if ($CPP_DOC_CONFIG) { my $data = read_file($CPP_DOC_CONFIG); - my $version_string = sprintf("\"%d.%d.%d%s\"", - @newver[0,1,2], - $is_official_release ? $newver[3] eq "" ? "" : "-".$newver[3] : "-".$newver[3]." currently under development"); - + my $sub_rel_ver_str = ( + $newver[3] eq "" + ? sprintf("%s", "") + : sprintf("%s", "-".$newver[3].", currently under development") + ); + my $version_string = sprintf("\"%d.%d.%d%s%s\"", + @newver[0,1,2], + $sub_rel_ver_str); $data =~ s/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $version_string/; write_file($CPP_DOC_CONFIG, $data); } -# helper function to read the file for updating c++/src/cpp_doc_config file. +# Update the config/cmake/scripts/HDF5config.cmake file +if ($HDF5CONFIGCMAKE) { + my $data = read_file($HDF5CONFIGCMAKE); +# my $sub_rel_ver_str = ""; + my $sub_rel_ver_str = ( + $newver[3] eq "" + ? sprintf("\"%s\"", "") + : sprintf("\"%s\"", "-".$newver[3]) + ); + my $version_string = sprintf("\"%d.%d.%d\"", @newver[0,1,2]); + + $data =~ s/set \(CTEST_SOURCE_VERSION .*\)/set \(CTEST_SOURCE_VERSION $version_string\)/; + $data =~ s/set \(CTEST_SOURCE_VERSEXT .*\)/set \(CTEST_SOURCE_VERSEXT $sub_rel_ver_str\)/; + + write_file($HDF5CONFIGCMAKE, $data); +} + + +# Update the tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl file +if ($REPACK_LAYOUT_PLUGIN_VERSION) { + my $data = read_file($REPACK_LAYOUT_PLUGIN_VERSION); + my $version_string = sprintf("%d %d %d", @newver[0,1,2]); + + $data =~ s/ PARAMS { 9 \d* \d* \d* }/ PARAMS { 9 $version_string }/g; + + write_file($REPACK_LAYOUT_PLUGIN_VERSION, $data); +} + +# helper function to read the file for updating c++/src/cpp_doc_config, +# config/cmake/scripts/HDF5Config.cmake, and java files. # The version string in that file is not at the top, so the string replacement # is not for the first line, and reading/writing the entire file as one string # facilitates the substring replacement. +#Presumably these will also work for resetting the version in HDF5config.cmake. sub read_file { my ($filename) = @_; @@ -350,7 +386,8 @@ sub read_file { return $all; } -# helper function to write the file for updating c++/src/cpp_doc_config file. +# helper function to write the file for updating c++/src/cpp_doc_config, +# config/cmake/scripts/HDF5config.cmake and java files. sub write_file { my ($filename, $content) = @_; diff --git a/bin/release b/bin/release index 0ac9986..cb7a2fe 100755 --- a/bin/release +++ b/bin/release @@ -55,8 +55,13 @@ for compressing the resulting tar archive (if none are given then tar -- use tar and don't do any compressing. gzip -- use gzip with "-9" and append ".gz" to the output name. + cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh + command file and all other CMake files needed to build HDF5 source + using CMake on unix machines. bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name. zip -- convert all text files to DOS style and form a zip file for Windows use. + cmake-zip -- convert all text files to DOS style and create a zip file inluding cmake + scripts and .bat files to build HDF5 source using CMake on Windows. doc -- produce the latest doc tree in addition to the archive. An md5 checksum is produced for each archive created and stored in the md5 file. @@ -93,9 +98,9 @@ EOF # Modifications # # Steps: -# 1. untar the tarball in a temporay directory; +# 1. untar the tarball in a temporary directory; # Note: do this in a temporary directory to avoid changing -# the original source directory which maybe around. +# the original source directory which may be around. # 2. convert all its text files to DOS (LF-CR) style; # 3. form a zip file which is usable by Windows users. # @@ -112,7 +117,7 @@ tar2zip() echo "usage: tar2zip " return 1 fi - ztmpdir=/tmp/tmpdir$$ + ztmpdir=/tmp/ztmpdir$$ mkdir -p $ztmpdir version=$1 tarfile=$2 @@ -151,9 +156,180 @@ tar2zip() rm -rf $ztmpdir } +# Function name: tar2cmakezip +# Convert the release tarball to a Windows zipball with files to run CMake build. +# +# Programmer: Larry Knox +# Creation date: 2017-02-20 +# +# Modifications +# +# Steps: +# 1. untar the tarball in a temporary directory; +# Note: do this in a temporary directory to avoid changing +# the original source directory which may be around. +# 2. add build-unix.sh script. +# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory. +# 4. create gzipped tar file with these contents: +# build-unix.sh script +# hdf5- source code directory extracted from tar file +# CTestScript.cmake cmake file copied from /config/cmake/scripts +# HDF5config.cmake cmake file copied from /config/cmake/scripts +# HDF5options.cmake cmake file copied from /config/cmake/scripts +# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake +# ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake + + +# Parameters: +# $1 version +# $2 release tarball +# $3 output zipball file name +# +# Returns 0 if successful; 1 otherwise +# + # need function to create another temporary directory, extract the + + # CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz and ZLib.tar.gz, + # and then tar.gz it. +tar2cmakezip() +{ + if [ $# -ne 3 ]; then + echo "usage: tar2cmakezip " + return 1 + fi + cmziptmpdir=/tmp/cmziptmpdir + cmziptmpsubdir=$cmziptmpdir/CMake-$HDF5_VERS + mkdir -p $cmziptmpsubdir + version=$1 + tarfile=$2 + zipfile=$3 + + # step 1: untar tarball in cmgztmpdir + (cd $cmziptmpsubdir; tar xf -) < $tarfile + # sanity check + if [ ! -d $cmziptmpsubdir/$version ]; then + echo "untar did not create $cmziptmpsubdir/$version source dir" + # cleanup + rm -rf $cmziptmpdir + return 1 + fi + + # step 2: add batch file for building CMake on window + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2012 -C Release -V -O hdf5.log" > build-VS2012-32.bat; chmod 755 build-VS2012-32.bat) + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf5.log" > build-VS2012-64.bat; chmod 755 build-VS2012-64.bat) + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2013 -C Release -V -O hdf5.log" > build-VS2013-32.bat; chmod 755 build-VS2013-32.bat) + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201364 -C Release -V -O hdf5.log" > build-VS2013-64.bat; chmod 755 build-VS2013-64.bat) + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2015 -C Release -V -O hdf5.log" > build-VS2015-32.bat; chmod 755 build-VS2015-32.bat) + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201564 -C Release -V -O hdf5.log" > build-VS2015-64.bat; chmod 755 build-VS2015-32.bat) + + # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files + cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmziptmpsubdir + cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpsubdir + cp $cmziptmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpsubdir + cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpsubdir + cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmziptmpsubdir + + # step 4: convert text files + # There maybe a simpler way to do this. + # options used in unix2dos: + # -k Keep the date stamp + # -q quiet mode + # grep redirect output to /dev/null because -q or -s are not portable. + find $cmziptmpsubdir/$version | \ + while read inf; do \ + if file $inf | grep "$inf\: .*text" > /dev/null 2>&1 ; then \ + unix2dos -q -k $inf; \ + fi\ + done + # step 3: make zipball + # -9 maximum compression + # -y Store symbolic links as such in the zip archive + # -r recursive + # -q quiet + (cd $cmziptmpdir; zip -9 -y -r -q CMake-$version.zip *) + mv $cmziptmpdir/CMake-$version.zip $zipfile + + # cleanup + rm -rf $cmziptmpdir +} + +# Function name: tar2cmaketgz +# Convert the release tarball to a Windows zipball with files to run CMake build. +# +# Programmer: Larry Knox +# Creation date: 2017-02-20 +# +# Modifications +# +# Steps: +# 1. untar the tarball in a temporary directory; +# Note: do this in a temporary directory to avoid changing +# the original source directory which may be around. +# 2. add build-unix.sh script. +# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory. +# 4. create gzipped tar file with these contents: +# build-unix.sh script +# hdf5- source code directory extracted from tar file +# CTestScript.cmake cmake file copied from /config/cmake/scripts +# HDF5config.cmake cmake file copied from /config/cmake/scripts +# HDF5options.cmake cmake file copied from /config/cmake/scripts +# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake +# ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake + + +# Parameters: +# $1 version +# $2 release tarball +# $3 output zipball file name +# +# Returns 0 if successful; 1 otherwise +# + # need function to create another temporary directory, extract the + # $tmpdir/$HDF5_VERS.tar into it, add (create) build-unix.sh, + # CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz and ZLib.tar.gz, + # and then tar.gz it. +tar2cmaketgz() +{ + if [ $# -ne 3 ]; then + echo "usage: tar2cmaketgz " + return 1 + fi + cmgztmpdir=/tmp/cmgztmpdir$$ + cmgztmpsubdir=$cmgztmpdir/CMake-$HDF5_VERS + mkdir -p $cmgztmpsubdir + version=$1 + tarfile=$2 + tgzfile=$3 + + # step 1: untar tarball in cmgztmpdir + (cd $cmgztmpsubdir; tar xf -) < $tarfile + # sanity check + if [ ! -d $cmgztmpsubdir/$version ]; then + echo "untar did not create $cmgztmpdir/$version source dir" + # cleanup + rm -rf $cmgztmpdir + return 1 + fi + + + # step 2: add build-unix.sh script + (cd $cmgztmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log" > build-unix.sh; chmod 755 build-unix.sh) + + # step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files + cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpsubdir + cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir + cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir + cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir + cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpsubdir + tar czf $DEST/CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1 + + # cleanup + rm -rf $cmgztmpdir +} + # This command must be run at the top level of the hdf5 source directory. # Verify this requirement. -if [ ! \( -f configure -a -f bin/release \) ]; then +if [ ! \( -f configure.ac -a -f bin/release \) ]; then echo "$0 must be run at the top level of the hdf5 source directory" exit 1 fi @@ -171,6 +347,15 @@ pmode='no' tmpdir="../#release_tmp.$$" # tmp work directory DOC_URL=https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5doc.git CPPLUS_RM_NAME=cpplus_RM +MAINT_MODE_ENABLED="" + +# If maintainer mode is enabled in configure, it should be disabled for release, +# and enabled again after release files have been created. If already disabled +# there's no need to do either. +MAINT_MODE_ENABLED=`grep ^AM_MAINTAINER_MODE ./configure.ac | grep enable` +if [ "${MAINT_MODE_ENABLED}" != "" ]; then + bin/switch_maint_mode -disable ./configure.ac +fi # Restore previous Version information RESTORE_VERSION() @@ -245,6 +430,7 @@ if [ X$pmode = Xyes ]; then # (h5vers does not correctly handle just m.n.r-$today.) VERS=`echo $VERS | sed -e s/-.*//`-of$today echo Private release of $VERS +else bin/h5vers -s $VERS fi @@ -314,6 +500,11 @@ for comp in $methods; do gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz (cd $DEST; md5sum $HDF5_VERS.tar.gz >> $MD5file) ;; + cmake-tgz) + test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 + tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 + (cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file) + ;; bzip2) test "$verbose" && echo " Running bzip2..." 1>&2 bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 @@ -324,22 +515,27 @@ for comp in $methods; do tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 (cd $DEST; md5sum $HDF5_VERS.zip >> $MD5file) ;; + cmake-zip) + test "$verbose" && echo " Creating CMake-zip ball..." 1>&2 + tar2cmakezip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.zip 1>&2 + (cd $DEST; md5sum CMake-$HDF5_VERS.zip >> $MD5file) + ;; doc) if [ "${DOCVERSION}" = "" ]; then DOCVERSION=master fi test "$verbose" && echo " Creating docs..." 1>&2 # Check out docs from git repo - (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} ) || exit 1 - # Create doxygen C++ RM + (cd $tmpdir; git clone -q $DOC_URL ${DOCVERSION} > /dev/null) || exit 1 + # Create doxygen C++ RM (cd c++/src && doxygen cpp_doc_config > /dev/null ) || exit 1 # Replace version of C++ RM with just-created version - rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME - mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME + rm -rf $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 + mv c++/src/$CPPLUS_RM_NAME $tmpdir/${DOCVERSION}/html/$CPPLUS_RM_NAME || exit 1 # Compress the docs and move them to the release area - mv $tmpdir/$DOCVERSION $tmpdir/${HDF5_VERS}_docs - (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) - mv $tmpdir/${HDF5_VERS}_docs.tar $DEST + mv $tmpdir/${DOCVERSION} $tmpdir/${HDF5_VERS}_docs || exit 1 + (cd $tmpdir && tar cf ${HDF5_VERS}_docs.tar ${HDF5_VERS}_docs) || exit 1 + mv $tmpdir/${HDF5_VERS}_docs.tar $DEST || exit 1 ;; *) echo "***Error*** Unknown method $comp" @@ -348,6 +544,12 @@ for comp in $methods; do esac done +# If AM_MAINTAINER_MODE was enabled before running this script +# restore it to "enabled". +if [ "${MAINT_MODE_ENABLED}" != "" ]; then + bin/switch_maint_mode -enable ./configure.ac +fi + # Copy the RELEASE.txt to the release area. cp release_docs/RELEASE.txt $DEST/$HDF5_VERS-RELEASE.txt diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 6f1bc29..f2961a4 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -689,9 +689,9 @@ LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 4 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 11 -LT_HL_VERS_REVISION = 1 -LT_HL_VERS_AGE = 1 +LT_HL_VERS_INTERFACE = 12 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 LT_HL_CXX_VERS_REVISION = 0 LT_HL_CXX_VERS_AGE = 1 diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index b94fe2a..3c95721 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.19-snap4 currently under development" +PROJECT_NUMBER = "1.8.20-snap0, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index eb79996..b1ac833 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -37,8 +37,8 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set (CTEST_SOURCE_VERSION 1.8.19) -set (CTEST_SOURCE_VERSEXT "") +set (CTEST_SOURCE_VERSION "1.8.20") +set (CTEST_SOURCE_VERSEXT "-snap0") ############################################################################## # handle input parameters to script. diff --git a/config/lt_vers.am b/config/lt_vers.am index 1f79c56..9612772 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -47,9 +47,9 @@ LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 4 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 11 -LT_HL_VERS_REVISION = 1 -LT_HL_VERS_AGE = 1 +LT_HL_VERS_INTERFACE = 12 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 LT_HL_CXX_VERS_REVISION = 0 diff --git a/configure b/configure index 6e87f81..f58637d 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.19-snap4. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap0. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.19-snap4' -PACKAGE_STRING='HDF5 1.8.19-snap4' +PACKAGE_VERSION='1.8.20-snap0' +PACKAGE_STRING='HDF5 1.8.20-snap0' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1476,7 +1476,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.8.19-snap4 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-snap0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1546,7 +1546,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.19-snap4:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-snap0:";; esac cat <<\_ACEOF @@ -1741,7 +1741,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.19-snap4 +HDF5 configure 1.8.20-snap0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2678,7 +2678,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.8.19-snap4, which was +It was created by HDF5 $as_me 1.8.20-snap0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3549,7 +3549,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.19-snap4' + VERSION='1.8.20-snap0' cat >>confdefs.h <<_ACEOF @@ -29295,7 +29295,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.19-snap4 +HDF5 config.lt 1.8.20-snap0 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31330,7 +31330,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.19-snap4, which was +This file was extended by HDF5 $as_me 1.8.20-snap0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31396,7 +31396,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.19-snap4 +HDF5 config.status 1.8.20-snap0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 699fb78..dc2265f 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.19-snap4], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap0], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 5144906..0494278 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -741,9 +741,9 @@ LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 4 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 11 -LT_HL_VERS_REVISION = 1 -LT_HL_VERS_AGE = 1 +LT_HL_VERS_INTERFACE = 12 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 LT_HL_CXX_VERS_REVISION = 0 LT_HL_CXX_VERS_AGE = 1 diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 2366700..cd0fe7a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -680,9 +680,9 @@ LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 4 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 11 -LT_HL_VERS_REVISION = 1 -LT_HL_VERS_AGE = 1 +LT_HL_VERS_INTERFACE = 12 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 LT_HL_CXX_VERS_REVISION = 0 LT_HL_CXX_VERS_AGE = 1 diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 42d9d2e..62cfdf0 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -698,9 +698,9 @@ LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 4 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 11 -LT_HL_VERS_REVISION = 1 -LT_HL_VERS_AGE = 1 +LT_HL_VERS_INTERFACE = 12 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 LT_HL_CXX_VERS_REVISION = 0 LT_HL_CXX_VERS_AGE = 1 diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 2a0f267..16a0bcf 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 2af0172..7481a45 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 212775d..f49844d 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -679,9 +679,9 @@ LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 4 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 11 -LT_HL_VERS_REVISION = 1 -LT_HL_VERS_AGE = 1 +LT_HL_VERS_INTERFACE = 12 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 LT_HL_CXX_VERS_REVISION = 0 LT_HL_CXX_VERS_AGE = 1 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e1c1573..139589f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.19-snap4 currently under development +HDF5 version 1.8.20-snap0 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 0f7beda..0e46778 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -92,10 +92,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 19 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap4" /* For pre-releases like snap0 */ +#define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_SUBRELEASE "snap0" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.19-snap4" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap0" /* 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 847a245..06e169f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -737,9 +737,9 @@ LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 LT_F_VERS_REVISION = 4 LT_F_VERS_AGE = 0 -LT_HL_VERS_INTERFACE = 11 -LT_HL_VERS_REVISION = 1 -LT_HL_VERS_AGE = 1 +LT_HL_VERS_INTERFACE = 12 +LT_HL_VERS_REVISION = 0 +LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 LT_HL_CXX_VERS_REVISION = 0 LT_HL_CXX_VERS_AGE = 1 diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 09b2484..4bdd7f8 100644 --- a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -11,7 +11,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 19 } + PARAMS { 9 1 8 20 } } } FILLVALUE { @@ -33,7 +33,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 19 } + PARAMS { 9 1 8 20 } } } FILLVALUE { @@ -55,7 +55,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 19 } + PARAMS { 9 1 8 20 } } } FILLVALUE { @@ -77,7 +77,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 19 } + PARAMS { 9 1 8 20 } } } FILLVALUE { @@ -99,7 +99,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 19 } + PARAMS { 9 1 8 20 } } } FILLVALUE { @@ -121,7 +121,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 19 } + PARAMS { 9 1 8 20 } } } FILLVALUE { @@ -143,7 +143,7 @@ GROUP "/" { USER_DEFINED_FILTER { FILTER_ID 260 COMMENT dynlib4 - PARAMS { 9 1 8 19 } + PARAMS { 9 1 8 20 } } } FILLVALUE { -- cgit v0.12 From c8499b192638da0f0eef9544d830f0df959cc76f Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 8 Jun 2017 10:28:18 -0500 Subject: Reset default build mode to enable-production=no. --- configure | 4 ++-- configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index f58637d..4734a60 100755 --- a/configure +++ b/configure @@ -22391,7 +22391,7 @@ fi case "X-$enable_production" in - X-|X-yes) + X-yes) enable_production="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: production" >&5 $as_echo "production" >&6; } @@ -22401,7 +22401,7 @@ $as_echo "production" >&6; } H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" ;; - X-no) + X-|X-no) enable_production="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: development" >&5 $as_echo "development" >&6; } diff --git a/configure.ac b/configure.ac index dc2265f..72909d9 100644 --- a/configure.ac +++ b/configure.ac @@ -784,7 +784,7 @@ AC_ARG_ENABLE([production], [Determines how to run the compiler.])]) case "X-$enable_production" in - X-|X-yes) + X-yes) enable_production="yes" AC_MSG_RESULT([production]) CONFIG_MODE=production @@ -793,7 +793,7 @@ case "X-$enable_production" in H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" ;; - X-no) + X-|X-no) enable_production="no" AC_MSG_RESULT([development]) CONFIG_MODE=development -- cgit v0.12 From ec1eee20ed4e53500c0792e0c3bd8c2d40ebfca7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Jun 2017 09:50:02 -0500 Subject: Synch with hdf5 deveolp improvements --- config/cmake/CTestCustom.cmake | 2 +- config/cmake/CTestScript.cmake | 2 +- config/cmake/ConfigureChecks.cmake | 2 +- config/cmake/ConversionTests.c | 1 - config/cmake/H5cxx_config.h.in | 1 - config/cmake/H5pubconf.h.in | 1 - config/cmake/HDF518_Examples.cmake.in | 2 +- config/cmake/HDF5_Examples_options.cmake | 2 +- config/cmake/cacheinit.cmake | 2 +- config/cmake/hdf5-config-version.cmake.in | 2 +- config/cmake/hdf5-config.cmake.in | 2 +- config/cmake_ext_mod/CheckTypeSize.cmake | 2 +- config/cmake_ext_mod/ConfigureChecks.cmake | 2 +- config/cmake_ext_mod/FindSZIP.cmake | 2 +- config/cmake_ext_mod/GetTimeOfDayTest.cpp | 1 - config/cmake_ext_mod/HDFLibMacros.cmake | 2 +- config/cmake_ext_mod/HDFMacros.cmake | 2 +- config/cmake_ext_mod/HDFTests.c | 1 - config/cmake_ext_mod/HDFUseFortran.cmake | 2 +- config/cmake_ext_mod/grepTest.cmake | 2 +- config/cmake_ext_mod/runTest.cmake | 2 +- 21 files changed, 16 insertions(+), 21 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 4091687..9f5262f 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) # Allow full output to go to CDash set to 0 SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 50000) diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake index bf9e633..c59b10c 100644 --- a/config/cmake/CTestScript.cmake +++ b/config/cmake/CTestScript.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ######################################################## # For any comments please contact cdashhelp@hdfgroup.org diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 7068345..77918a4 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 022a296..082dbd4 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -9,7 +9,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - #ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST #include diff --git a/config/cmake/H5cxx_config.h.in b/config/cmake/H5cxx_config.h.in index 098a5d8..82e85c6 100644 --- a/config/cmake/H5cxx_config.h.in +++ b/config/cmake/H5cxx_config.h.in @@ -9,7 +9,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* src/H5cxx_config.h.in Created manually. */ /* Define if offsetof extension is present */ diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index f413832..4d106aa 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -9,7 +9,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* H5pubconf.h Generated By CMake during the configuration */ #ifndef H5_CONFIG_H_ diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 6214b9f..a239ded 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder diff --git a/config/cmake/HDF5_Examples_options.cmake b/config/cmake/HDF5_Examples_options.cmake index f6e8dd2..b108b5b 100644 --- a/config/cmake/HDF5_Examples_options.cmake +++ b/config/cmake/HDF5_Examples_options.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################################# #### Change default configuration of options in config/cmake/cacheinit.cmake file ### #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 35c05fa..98a2a23 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # This is the CMakeCache file. ######################## diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 5697ead..8e16725 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #----------------------------------------------------------------------------- # HDF5 Version file for install directory #----------------------------------------------------------------------------- diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 7fe71e8..14859c1 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #----------------------------------------------------------------------------- # HDF5 Config file for compiling against hdf5 build/install directory #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake index 116560a..c14c2f2 100644 --- a/config/cmake_ext_mod/CheckTypeSize.cmake +++ b/config/cmake_ext_mod/CheckTypeSize.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # # Check if the type exists and determine size of type. if the type # exists, the size will be stored to the variable. diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 7db1ec3..56d45f9 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 68d2080..699be85 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # - Find SZIP library # - Derived from the FindTiff.cmake that is included with cmake diff --git a/config/cmake_ext_mod/GetTimeOfDayTest.cpp b/config/cmake_ext_mod/GetTimeOfDayTest.cpp index 8871ebc..5fd7c04 100644 --- a/config/cmake_ext_mod/GetTimeOfDayTest.cpp +++ b/config/cmake_ext_mod/GetTimeOfDayTest.cpp @@ -9,7 +9,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - #if defined (TRY_SYS_TIME_H) #include /* #include */ diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 9de5339..f2e03d7 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #------------------------------------------------------------------------------- macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) # May need to build JPEG with PIC on x64 machines with gcc diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 64f6f8d..602b6bf 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #------------------------------------------------------------------------------- macro (SET_GLOBAL_VARIABLE name value) set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index e8353f5..60ac744 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -9,7 +9,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - #define SIMPLE_TEST(x) int main(){ x; return 0; } #ifdef HAVE_C99_DESIGNATED_INITIALIZER diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 5a2885a..7bf4d81 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # # This file provides functions for Fortran support. # diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 82ac090..5b0e8fd 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # grepTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 0a9ebd1..3a02614 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # runTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. cmake_policy(SET CMP0007 NEW) -- cgit v0.12 From 2ba063c0a5d248c059f2422811beed76a2e624d8 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 11 Jul 2017 00:12:02 -0500 Subject: Fix for HDFFV-7853 H5Ocopy to 1.8 branch Apply the fix for HDFFV-7853 H5Ocopy from develop to 1.8 branch. This is the similar set of changes as in develop branch. Some coding is added to do the copying because 1.8 does not flush out the storage address when writing to a dataset. --- src/H5Dchunk.c | 91 ++++++++- src/H5Dcompact.c | 8 +- src/H5Dcontig.c | 47 ++++- src/H5Ocopy.c | 20 +- src/H5Olayout.c | 8 +- src/H5Oprivate.h | 1 + test/objcopy.c | 563 ++++++++++++++++++++++++++++++++++++++++++++----------- 7 files changed, 594 insertions(+), 144 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index fcc752c..021335f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -150,6 +150,10 @@ typedef struct H5D_chunk_it_ud3_t { /* needed for copy object pointed by refs */ H5O_copy_t *cpy_info; /* Copy options */ + + /* needed for getting raw data from chunk cache */ + hbool_t chunk_in_cache; + uint8_t *chunk; /* the unfiltered chunk data */ } H5D_chunk_it_ud3_t; /* Callback info for iteration to dump index */ @@ -324,7 +328,6 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ unsigned space_ndims; /* Dataset's space rank */ - hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -414,7 +417,6 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ unsigned space_ndims; /* Dataset's space rank */ - hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Dataset's chunk offset */ hsize_t chunk_idx; /* Index of chunk cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ @@ -521,7 +523,6 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ unsigned space_ndims; /* Dataset's space rank */ - hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Dataset's chunk offset */ hsize_t chunk_idx; /* Index of chunk cache entry */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ @@ -4836,12 +4837,57 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) udata->buf_size = buf_size = nbytes; } /* end if */ - /* read chunk data from the source file */ - if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, udata->idx_info_dst->dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + if(udata->chunk_in_cache && udata->chunk) { + HDassert(!H5F_addr_defined(chunk_rec->chunk_addr)); + HDmemcpy(buf, udata->chunk, nbytes); + udata->chunk = NULL; + } else { + H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ + unsigned idx; /* Index of chunk in cache, if present */ + unsigned u; /* Counter */ + H5D_shared_t *shared_fo = udata->cpy_info->shared_fo; + + /* See if the written chunk is in the chunk cache */ + if(shared_fo && shared_fo->cache.chunk.nslots > 0) { + hsize_t chunk_idx; /* Index of chunk cache entry */ + H5O_layout_t *layout = &shared_fo->layout; + + /* Calculate the index of this chunk */ + if(H5VM_chunk_index(layout->u.chunk.ndims - 1, chunk_rec->offset, + layout->u.chunk.dim, layout->u.chunk.down_chunks, &chunk_idx) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") + idx = H5D_CHUNK_HASH(shared_fo, chunk_idx); + + /* Get the chunk cache entry for that location */ + ent = shared_fo->cache.chunk.slot[idx]; + if(ent) { + /* Speculatively set the 'found' flag */ + udata->chunk_in_cache = TRUE; + + /* Verify that the cache entry is the correct chunk */ + for(u = 0; u < (layout->u.chunk.ndims -1); u++) + if(chunk_rec->offset[u] != ent->offset[u]) { + udata->chunk_in_cache = FALSE; + break; + } /* end if */ + } /* end if */ + } /* end if */ + + if(udata->chunk_in_cache) { + HDassert(H5F_addr_defined(chunk_rec->chunk_addr)); + HDassert(H5F_addr_defined(ent->chunk_addr)); + + H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); + HDmemcpy(buf, ent->chunk, nbytes); + } else { + /* read chunk data from the source file */ + if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, udata->idx_info_dst->dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + } + } /* Need to uncompress variable-length & reference data elements */ - if(has_filters && (is_vlen || fix_ref)) { + if(has_filters && (is_vlen || fix_ref) && !udata->chunk_in_cache) { unsigned filter_mask = chunk_rec->filter_mask; if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) @@ -4906,7 +4952,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) udata_dst.addr = HADDR_UNDEF; /* Need to compress variable-length & reference data elements before writing to file */ - if(has_filters && (is_vlen || fix_ref) ) { + if(has_filters && (is_vlen || fix_ref || udata->chunk_in_cache) ) { if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 @@ -4971,6 +5017,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, uint32_t nelmts = 0; /* Number of elements in buffer */ hbool_t do_convert = FALSE; /* Indicate that type conversions should be performed */ hbool_t copy_setup_done = FALSE; /* Indicate that 'copy setup' is done */ + H5D_shared_t *shared_fo = (H5D_shared_t *)cpy_info->shared_fo; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -5157,11 +5204,39 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, udata.nelmts = nelmts; udata.pline = pline; udata.cpy_info = cpy_info; + udata.chunk_in_cache = FALSE; + udata.chunk = NULL; + + if(!H5F_addr_defined(idx_info_src.storage->idx_addr)) + idx_info_src.storage = &shared_fo->layout.storage.u.chunk; + + HDassert(H5F_addr_defined(idx_info_src.storage->idx_addr)); /* Iterate over chunks to copy data */ if((storage_src->ops->iterate)(&idx_info_src, H5D__chunk_copy_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to copy data") + /* Iterate over the chunk cache to copy data for chunks with undefined address */ + if(shared_fo) { + H5D_rdcc_ent_t *ent, *next; + H5D_chunk_rec_t chunk_rec; + + chunk_rec.nbytes = layout_src->size; + chunk_rec.filter_mask = 0; + chunk_rec.chunk_addr = HADDR_UNDEF; + + for(ent = shared_fo->cache.chunk.head; ent; ent = next) { + if(!H5F_addr_defined(ent->chunk_addr)) { + HDmemcpy(chunk_rec.offset, ent->offset, sizeof(chunk_rec.offset)); + udata.chunk = ent->chunk; + udata.chunk_in_cache = TRUE; + if(H5D__chunk_copy_cb(&chunk_rec, &udata) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy chunk data in cache") + } + next = ent->next; + } /* end for */ + } + /* I/O buffers may have been re-allocated */ buf = udata.buf; bkg = udata.bkg; diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index b142f3b..4b61442 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -396,7 +396,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, +H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, hid_t dxpl_id) { @@ -407,6 +407,8 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst void *bkg = NULL; /* Temporary buffer for copying data */ void *reclaim_buf = NULL; /* Buffer for reclaiming data */ hid_t buf_sid = -1; /* ID for buffer dataspace */ + H5D_shared_t *shared_fo = cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */ + H5O_storage_compact_t *storage_src = _storage_src; /* Pointer to storage_src */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -418,6 +420,10 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst HDassert(storage_dst); HDassert(dt_src); + /* If the dataset is open in the file, point to "layout" in the shared struct */ + if(shared_fo != NULL) + storage_src = &(shared_fo->layout.storage.u.compact); + /* Allocate space for destination data */ if(NULL == (storage_dst->buf = H5MM_malloc(storage_src->size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate memory for compact dataset") diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index c6cef57..9516d53 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -1298,6 +1298,10 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, hsize_t buf_dim[1] = {0}; /* Dimension for buffer */ hbool_t is_vlen = FALSE; /* Flag to indicate that VL type conversion should occur */ hbool_t fix_ref = FALSE; /* Flag to indicate that ref values should be fixed */ + H5D_shared_t *shared_fo = cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */ + hbool_t try_sieve = FALSE; /* Try to get data from the sieve buffer */ + haddr_t sieve_start = HADDR_UNDEF; /* Start location of sieve buffer */ + haddr_t sieve_end = HADDR_UNDEF; /* End locations of sieve buffer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1418,9 +1422,32 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for copy buffer") } /* end if */ - /* Loop over copying data */ addr_src = storage_src->addr; addr_dst = storage_dst->addr; + + /* If data sieving is enabled and the dataset is open in the file, + set up to copy data out of the sieve buffer if deemed possible later */ + if(H5F_HAS_FEATURE(f_src, H5FD_FEAT_DATA_SIEVE) && + shared_fo && shared_fo->cache.contig.sieve_buf) { + try_sieve = TRUE; + sieve_start = shared_fo->cache.contig.sieve_loc; + sieve_end = sieve_start + shared_fo->cache.contig.sieve_size; + /* + * It is possble for addr_src to be undefined when: + * (a) The dataset is created and data is written to it. + * (b) The dataset is then copied via H5Ocopy(). + * H5D_mark() in H5Dint.c is different between + * 1.8 and develop branches: + * 1.8--it just sets dataset->shared->layout_dirty as TRUE + * to be flushed later. + * develop--it will flush the layout message if it has been changed. + */ + if(!H5F_addr_defined(addr_src)) + addr_src = sieve_start; + } + + HDassert(H5F_addr_defined(addr_src)); + /* Loop over copying data */ while(total_src_nbytes > 0) { /* Check if we should reduce the number of bytes to transfer */ if(total_src_nbytes < src_nbytes) { @@ -1446,14 +1473,20 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, dst_nbytes = mem_nbytes = src_nbytes; } /* end if */ - /* Read raw data from source file */ - if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, H5P_DATASET_XFER_DEFAULT, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data") + /* If the entire copy is within the sieve buffer, copy data from the sieve buffer */ + if(try_sieve && (addr_src >= sieve_start) && ((addr_src + src_nbytes -1) < sieve_end)) { + unsigned char *base_sieve_buf = shared_fo->cache.contig.sieve_buf + (addr_src - sieve_start); + + HDmemcpy(buf, base_sieve_buf, src_nbytes); + } else + /* Read raw data from source file */ + if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, H5P_DATASET_XFER_DEFAULT, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data") /* Perform datatype conversion, if necessary */ if(is_vlen) { /* Convert from source file to memory */ - if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -1463,13 +1496,13 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDmemset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Reclaim space from variable length data */ if(H5D_vlen_reclaim(tid_mem, buf_space, H5P_DATASET_XFER_DEFAULT, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") - } /* end if */ + } /* end if */ else if(fix_ref) { /* Check for expanding references */ if(cpy_info->expand_ref) { diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 9193a4c..31beb0e 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -357,24 +357,8 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, if((obj_class = H5O_obj_class(oloc_src, dxpl_id)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") - /* Check if the object at the address is already open in the file */ - if(H5FO_opened(oloc_src->file, oloc_src->addr) != NULL) { - - H5G_loc_t tmp_loc; /* Location of object */ - H5O_loc_t tmp_oloc; /* Location of object */ - H5G_name_t tmp_path; /* Object's path */ - - tmp_loc.oloc = &tmp_oloc; - tmp_loc.path = &tmp_path; - tmp_oloc.file = oloc_src->file; - tmp_oloc.addr = oloc_src->addr; - tmp_oloc.holding_file = oloc_src->holding_file; - H5G_name_reset(tmp_loc.path); - - /* Flush the object of this class */ - if(obj_class->flush && obj_class->flush(&tmp_loc, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") - } + /* Set the pointer to the shared struct for the object if opened in the file */ + cpy_info->shared_fo = H5FO_opened(oloc_src->file, oloc_src->addr); /* Get source object header */ if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC_READ))) diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 95d66ab..17385c2 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -592,6 +592,7 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, H5O_layout_t *layout_src = (H5O_layout_t *) mesg_src; H5O_layout_t *layout_dst = NULL; hbool_t copied = FALSE; /* Whether the data was copied */ + H5D_shared_t *shared_fo = (H5D_shared_t *)cpy_info->shared_fo; void *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -628,7 +629,9 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, layout_dst->storage.u.contig.size = H5S_extent_nelem(udata->src_space_extent) * H5T_get_size(udata->src_dtype); - if(H5D__contig_is_space_alloc(&layout_src->storage)) { + if(H5D__contig_is_space_alloc(&layout_src->storage) || + (H5F_HAS_FEATURE(file_src, H5FD_FEAT_DATA_SIEVE) && + shared_fo && shared_fo->cache.contig.sieve_buf)) { /* copy contiguous raw data */ if(H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage") @@ -637,7 +640,8 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, break; case H5D_CHUNKED: - if(H5D__chunk_is_space_alloc(&layout_src->storage)) { + if(H5D__chunk_is_space_alloc(&layout_src->storage) || + (shared_fo && H5D__chunk_is_space_alloc(&shared_fo->layout.storage))) { /* Create chunked layout */ if(H5D__chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 9b24977..ca0fc8e 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -169,6 +169,7 @@ typedef struct H5O_copy_t { H5SL_t *dst_dt_list; /* Skip list to hold committed datatypes in dest file */ hbool_t dst_dt_list_complete; /* Whether the destination datatype list is complete (i.e. not only populated with "suggestions" from H5Padd_merge_committed_dtype_path) */ H5O_t *oh_dst; /* The destination object header */ + void *shared_fo; /* The shared pointer for the object */ H5O_mcdt_search_cb_t mcdt_cb; /* The callback to invoke before searching the global list of committed datatypes at destination */ void *mcdt_ud; /* User data passed to callback */ } H5O_copy_t; diff --git a/test/objcopy.c b/test/objcopy.c index 33f43d3..d792462 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -2179,6 +2179,9 @@ error: * Purpose: Create a simple dataset in SRC file and copy it to DST file * (Note: dataset has no data) * + * Note: The parameter "test_open" is added to test for H5Ocopy when + * the dataset is open in the file (HDFFV-7853). + * * Return: Success: 0 * Failure: number of errors * @@ -2188,7 +2191,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) +test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hbool_t test_open) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -2197,7 +2200,11 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - TESTING("H5Ocopy(): empty contiguous dataset"); + if(test_open) { + TESTING("H5Ocopy(): empty and opened contiguous dataset"); + } else { + TESTING("H5Ocopy(): empty contiguous dataset"); + } /* Initialize the filenames */ h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); @@ -2225,15 +2232,18 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h /* attach attributes to the dataset */ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR - /* close the dataset */ - if(H5Dclose(did) < 0) TEST_ERROR + if(!test_open) { - /* close the SRC file */ - if(H5Fclose(fid_src) < 0) TEST_ERROR + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR - /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + } /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -2244,8 +2254,10 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h /* copy the dataset from SRC to DST */ if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR - /* open the dataset for copy */ - if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(!test_open) { + /* open the dataset for copy */ + if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + } /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3092,6 +3104,9 @@ error: * * Purpose: Create a compact dataset in SRC file and copy it to DST file * + * Note: The parameter "test_open" is added to test for H5Ocopy when + * the dataset is open in the file (HDFFV-7853). + * * Return: Success: 0 * Failure: number of errors * @@ -3101,7 +3116,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) +test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hbool_t test_open) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -3113,7 +3128,11 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - TESTING("H5Ocopy(): compact dataset"); + if(test_open) { + TESTING("H5Ocopy(): compact and opened dataset"); + } else { + TESTING("H5Ocopy(): compact dataset"); + } /* set initial data values */ for (i=0; i Date: Wed, 12 Jul 2017 16:14:23 -0500 Subject: Revert change for temporary testing. --- test/objcopy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/objcopy.c b/test/objcopy.c index d792462..e679007 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -6664,8 +6664,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open) addr_reset(); /* open source file (read-only) */ - //if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR - if((fid_src = H5Fopen("../../hdf5/test/fill_old.h5", H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR -- cgit v0.12 From 7a6175f1c6a435c076955c663bfaff9d1ecc9bc9 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 17 Jul 2017 17:27:42 -0500 Subject: Archive RELEASE.txt from HDF5 1.8.19 in HISTORY-1_8.txt. Clear entries from New Features and Bugs Fixed sections of RELEASE.txt. --- release_docs/HISTORY-1_8.txt | 430 +++++++++++++++++++++++++++++++++++++++++++ release_docs/RELEASE.txt | 162 ++++------------ 2 files changed, 470 insertions(+), 122 deletions(-) diff --git a/release_docs/HISTORY-1_8.txt b/release_docs/HISTORY-1_8.txt index 87b6c73..a7aad02 100644 --- a/release_docs/HISTORY-1_8.txt +++ b/release_docs/HISTORY-1_8.txt @@ -3,6 +3,7 @@ HDF5 History This file contains development history of HDF5 1.8 branch +21. Release Information for hdff5-1.8.19 20. Release Information for hdf5-1.8.18 19. Release Information for hdf5-1.8.17 18. Release Information for hdf5-1.8.16 @@ -26,6 +27,435 @@ This file contains development history of HDF5 1.8 branch [Search on the string '%%%%' for section breaks of each release.] +%%%%1.8.19%%%% + + +HDF5 version 1.8.19 released on 2017-06-15 +================================================================================ + +INTRODUCTION +============ + +This document describes the differences between HDF5-1.8.18 and +HDF5-1.8.19, and contains information on the platforms tested and +known problems in HDF5-1.8.19. +For more details, see the files HISTORY-1_0-1_8_0_rc3.txt +and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. + +Links to the HDF5 1.8.19 source code, documentation, and additional materials +can be found on the HDF5 web page at: + + https://support.hdfgroup.org/HDF5/ + +The HDF5 1.8.19 release can be obtained from: + + https://support.hdfgroup.org/HDF5/release/obtain518.html + +User documentation for 1.8.19 can be accessed directly at this location: + + https://support.hdfgroup.org/HDF5/doc1.8/ + +New features in the HDF5-1.8.x release series, including brief general +descriptions of some new and modified APIs, are described in the "What's New +in 1.8.0?" document: + + https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html + +All new and modified APIs are listed in detail in the "HDF5 Software Changes +from Release to Release" document, in the section "Release 1.8.19 (current +release) versus Release 1.8.18 + + https://support.hdfgroup.org/HDF5/doc1.8/ADGuide/Changes.html + +If you have any questions or comments, please send them to the HDF Help Desk: + + help@hdfgroup.org + + +CONTENTS +======== + +- New Features +- Support for New Platforms, Languages, and Compilers +- Bug Fixes since HDF5-1.8.19 +- Supported Platforms +- Supported Configuration Features Summary +- More Tested Platforms +- Known Problems + + +New Features +============ + + Configuration + -------------- + - CMake in the Tools + + User-defined filters on Windows require that tools be built + with shared libraries. + + CMake command code added to build tools with + shared libraries as well as with static libraries. + + (ADB - 2017/02/07, HDFFV-10123) + + + Library + ------- + - H5PL package + + Users would like to be able to set the plugin path programmatically + instead of through the environment variable. + + H5PL package obtained new APIs for manipulating the entries of + the plugin path table. The new APIs are; + H5PLappend - Insert a plugin path at the end of the list. + H5PLprepend - Insert a plugin path at the beginning of the list. + H5PLreplace - Replace the path at the specified index. + H5PLinsert - Insert a plugin path at the specified index, moving + other paths after the index. + H5PLremove - Remove the plugin path at the specifed index and + compacting the list. + H5PLget - Query the plugin path at the specified index. + H5PLsize - Query the size of the current list of plugin paths. + + (ADB - 2017/04/04, HDFFV-10143) + + - H5Dget_chunk_storage_size + + The storage size of a chunk in the file is needed to determine the size + of the buffer to be allocated for reading a chunk directly from a file. + + New API function gets the size in bytes currently allocated within a + file for a raw data chunk in a dataset. This function was added to get + the chunk size in support of the implementation of H5DOread_chunks, but + may also be useful for other purposes. + + (VC - 2017/05/02, HDFFV-9934) + + C++ API + ------- + - The following C++ API wrappers have been added to the C++ Library: + // Determines if a name exists. + H5Location::nameExists() - C API H5Lexists() + + // Checks if an ID is valid. + IdComponent::isValid() - C API H5Iis_valid() + + // Sets the number of soft or user-defined links that can be + // traversed before a failure occurs. + LinkAccPropList::setNumLinks() - C API H5Pset_nlinks() + + // Gets the number of soft or user-defined link traversals allowed + LinkAccPropList::getNumLinks() - C API H5Pget_nlinks() + + // Returns a copy of the creation property list of a datatype. + DataType::getCreatePlist() - C API H5Tget_create_plist() + + // Opens an object within a location, regarless its type. + H5Location::openObjId() - C API H5Oopen() + H5Location::openObjId() - C API H5Oopen() + + // Closes an object opened by openObjId(). + H5Location::closeObjId() - C API H5Oclose() + + // Gets general information about a file. + H5File::getFileInfo() - C API H5Fget_info() + + // Returns the header version of an HDF5 object. + H5Object::objVersion() - C API H5Oget_info() + + (BMR, 2017/05/13, HDFFV-10004, HDFFV-10156) + + - New class LinkAccPropList is added for link access proprety list + + (BMR, 2017/05/13, HDFFV-10156) + + High-Level APIs + --------------- + - H5DOread_chunk + + Users wanted to read compressed data directly from a file without any + processing by the HDF5 data transfer pipeline, just as they were able + to write it directly to a file with H5DOwrite_chunk. + + New API function, corresponding to existing function H5DOwrite_chunk. + H5DOread_chunk reads a raw data chunk directly from a chunked dataset + in the file into the application buffer, bypassing the library’s internal + data transfer pipeline, including filters. + + (VC - 2017/05/02, HDFFV-9934) + + +Support for New Platforms, Languages, and Compilers +=================================================== + + - Added OpenMPI 2.0.1 compiled with GCC 4.9.3 + + +Bug Fixes since HDF5-1.8.18 +=========================== + + Configuration + ------------- + - Support for Fortran shared libraries on OS X with autotools now + works. Cmake builds still disables Fortran shared libraries on OS X. + (MSB - 2017/04/30, HDFFV-2772) + + + Library + ------- + - bitfield datatypes + + bitfield datatypes did not fully support endianness of the data. + + Improved the endianness of bitfield datatypes by adding missing functional + code. This code used integer types as a template. + + (ADB - 2017/05/12, HDFFV-10186) + + - Newly created datasets with H5D_COMPACT layout failed to open after + several H5Dopen/H5Dclose cycles. + + The layout "dirty" flag for a compact dataset is now properly reset + before flushing the message. + + (VC - 2017/05/11, HDFFV-10051) + - Missing #ifdef __cplusplus macros were added to the generated H5Epubgen.h file. + + (DER - 2017/04/25, HDFFV-9638) + + + Tools + ----- + - h5repack + + h5repack did not maintain the creation order flag of the root + group. + + Improved h5repack by reading the creation order and applying the + flag to the new root group. Also added arguments to set the + order and index direction, which applies to the traversing of the + original file, on the command line. + + (ADB - 2017/05/26, HDFFV-8611) + + - h5diff + + h5diff failed to account for strpad type and null terminators + of char strings. Also, h5diff failed to account for string length + differences and would give a different result depending on file + order in the command line. + + Improved h5diff compare of strings and arrays by adding a check for + string lengths and if the strpad was null filled. + + (ADB - 2017/05/18, HDFFV-9055, HDFFV-10128) + + - h5diff + + h5diff help text about epsilon comparison was confusing. + + Changed h5diff help text to indicate that the 'a' refers to the + datapoint in file1 and 'b' refers to the datapoint value in file2. + + (ADB - 2017/05/16, HDFFV-9995) + + - h5diff + + h5diff did not report user-defined filter data differences correctly. + + Improved h5diff compare of user-defined filter data by reporting an + error if the user-defined filter plugin cannot be found. + + (ADB - 2017/01/18, HDFFV-9994) + C++ API + ------- + - The class hierarchy is revised to better reflect the HDF5 model. + Class H5File is now derived from class Group instead of H5Location. + Class Attribute is now derived from H5Location instead of IdComponent. + Wrappers of H5A APIs in H5Location are now duplicated in H5Object, + the original wrappers in H5Location will be deprecated in future + releases. + + (BMR - 2017/05/15, HDFFV-10156) + + + +Supported Platforms +=================== +The following platforms are supported and have been tested for this release. +They are built with the configure process unless specified otherwise. + + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (platypus/mayll) Version 4.4.7 20120313 + Versions 4.9.3, 5.2.0, 6.2.0 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.0.098 Build 20160721 + MPICH 3.1.4 compiled with GCC 4.9.3 + OpenMPI 2.0.1 compiled with GCC 4.9.3 + + Linux 2.6.32-573.18.1.el6 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) + IBM XL C/C++ V13.1 + IBM XL Fortran V15.1 + + Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Versions 4.9.3, 5.3.0, 6.2.0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 17.0.4.196 Build 20170411 + MPICH 3.1.4 compiled with GCC 4.9.3 + + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc + Windows 7 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Windows 7 x64 Visual Studio 2012 w/ Intel Fortran 15 (cmake) + Visual Studio 2013 w/ Intel Fortran 15 (cmake) + Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Visual Studio 2015 w/ Intel C, Fortran 2017 (cmake) + Visual Studio 2015 w/ MSMPI 8 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + Cygwin(CYGWIN_NT-6.1 2.8.0(0.309/5/3) + gcc and gfortran compilers (GCC 5.4.0) + (cmake and autotools) + + Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) + + Mac OS X Mt. Lion 10.8.5 Apple LLVM version 5.1 (clang-503.0.40) + 64-bit gfortran GNU Fortran (GCC) 4.8.2 + (swallow/kite) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Mavericks 10.9.5 Apple LLVM version 6.0 (clang-600.0.57) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (wren/quail) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X Yosemite 10.10.5 Apple LLVM version 6.1 (clang-602.0.53) + 64-bit gfortran GNU Fortran (GCC) 4.9.2 + (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 + + Mac OS X El Capitan 10.11.4 Apple LLVM version 7.3.0 (clang-703.0.29) + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (VM osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + + +Tested Configuration Features Summary +===================================== + + In the tables below + y = tested + n = not tested in this release + C = Cluster + W = Workstation + x = not working in this release + dna = does not apply + ( ) = footnote appears below second table + = testing incomplete on this feature or platform +Platform C F90/ F90 C++ zlib SZIP + parallel F2003 parallel +SunOS 5.11 32-bit n y/y n y y y +SunOS 5.11 64-bit n y/y n y y y +Windows 7 y y/y n y y y +Windows 7 x64 y y/y n y y y +Windows 7 Cygwin n y/n n y y y +Windows 7 x64 Cygwin n y/n n y y y +Windows 10 y y/y n y y y +Windows 10 x64 y y/y n y y y +Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y +Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y +Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +AIX 6.1 32- and 64-bit n y/n n y y y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y/y y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel n y/y n y y y +Linux 2.6.32-431.11.2.el6.ppc64 n y/n n y y y + +Platform Shared Shared Shared Thread- + C libs F90 libs C++ libs safe +SunOS 5.11 32-bit y y y y +SunOS 5.11 64-bit y y y y +Windows 7 y y y y +Windows 7 x64 y y y y +Windows 7 Cygwin n n n y +Windows 7 x64 Cygwin n n n y +Windows 10 y y y y +Windows 10 x64 y y y y +Mac OS X Mountain Lion 10.8.5 64-bit y n y y +Mac OS X Mavericks 10.9.5 64-bit y n y y +Mac OS X Yosemite 10.10.5 64-bit y n y y +AIX 6.1 32- and 64-bit y n n y +CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y y +CentOS 7.1 Linux 3.10.0 x86_64 GNU y y y y +CentOS 7.1 Linux 3.10.0 x86_64 Intel y y y y +Linux 2.6.32-431.11.2.el6.ppc64 y y y y + +Compiler versions for each platform are listed in the preceding +"Supported Platforms" table. + + +More Tested Platforms +===================== +The following platforms are not supported but have been tested for this release. + + Linux 2.6.32-573.22.1.el6 g95 (GCC 4.0.3 (g95 0.94!) + #1 SMP x86_64 GNU/Linux + (mayll) + + Debian8.4.0 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1 x86_64 GNU/Linux + gcc (Debian 4.9.2-10) 4.9.2 + GNU Fortran (Debian 4.9.2-10) 4.9.2 + (cmake and autotools) + + Fedora24 4.7.2-201.fc24.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + GNU Fortran (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) + (cmake and autotools) + + CentOS 7.2 3.10.0-327.28.2.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux + gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4) + (cmake and autotools) + + Ubuntu 16.04 4.4.0-38-generic #62-Ubuntu SMP x86_64 GNU/Linux + gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 + (cmake and autotools) + + +Known Problems +============== + + The dynamically loaded plugin test libraries require undefined references + to HDF5 functions to be resolved at runtime in order to function properly. + With autotools on CYGWIN this results in build errors, and we have not + found a solution that satisfies both. Therefore the dynamically loaded + plugin tests have been disabled on CYGWIN. + + Known problems in previous releases can be found in the HISTORY*.txt files + in the HDF5 source. Please report any new problems found to + help@hdfgroup.org. + + %%%%1.8.18%%%% diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 139589f..792e5b2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -56,173 +56,91 @@ New Features ============ Configuration - -------------- - - CMake in the Tools - - User-defined filters on Windows require that tools be built - with shared libraries. - - CMake command code added to build tools with - shared libraries as well as with static libraries. - - (ADB - 2017/02/07, HDFFV-10123) + ------------- + - None Library ------- - - H5PL package - - Users would like to be able to set the plugin path programmatically - instead of through the environment variable. + - None - H5PL package obtained new APIs for manipulating the entries of - the plugin path table. The new APIs are; - H5PLappend - Insert a plugin path at the end of the list. - H5PLprepend - Insert a plugin path at the beginning of the list. - H5PLreplace - Replace the path at the specified index. - H5PLinsert - Insert a plugin path at the specified index, moving - other paths after the index. - H5PLremove - Remove the plugin path at the specifed index and - compacting the list. - H5PLget - Query the plugin path at the specified index. - H5PLsize - Query the size of the current list of plugin paths. - (ADB - 2017/04/04, HDFFV-10143) - - - C++ API - ------- - - The following C++ API wrappers have been added to the C++ Library: - // Determines if a name exists. - H5Location::nameExists() - C API H5Lexists() + Parallel Library + ---------------- + - None - // Checks if an ID is valid. - IdComponent::isValid() - C API H5Iis_valid() - // Sets the number of soft or user-defined links that can be - // traversed before a failure occurs. - LinkAccPropList::setNumLinks() - C API H5Pset_nlinks() - - // Gets the number of soft or user-defined link traversals allowed - LinkAccPropList::getNumLinks() - C API H5Pget_nlinks() - - // Returns a copy of the creation property list of a datatype. - DataType::getCreatePlist() - C API H5Tget_create_plist() + Tools + ----- + - None - // Opens an object within a location, regarless its type. - H5Location::openObjId() - C API H5Oopen() - H5Location::openObjId() - C API H5Oopen() - // Closes an object opened by openObjId(). - H5Location::closeObjId() - C API H5Oclose() + High-Level APIs + --------------- + - None - // Gets general information about a file. - H5File::getFileInfo() - C API H5Fget_info() - // Returns the header version of an HDF5 object. - H5Object::objVersion() - C API H5Oget_info() + Fortran API + ----------- + - None - (BMR, 2017/05/13, HDFFV-10004, HDFFV-10156) - - New class LinkAccPropList is added for link access proprety list - (BMR, 2017/05/13, HDFFV-10156) + C++ API + ------- + - None Support for New Platforms, Languages, and Compilers =================================================== - - Added OpenMPI 2.0.1 compiled with GCC 4.9.3 -Bug Fixes since HDF5-1.8.18 +Bug Fixes since HDF5-1.8.19 =========================== Configuration ------------- - - Support for Fortran shared libraries on OS X with autotools now - works. Cmake builds still disables Fortran shared libraries on OS X. - (MSB - 2017/04/30, HDFFV-2772) + - None Library ------- - - bitfield datatypes - - bitfield datatypes did not fully support endianness of the data. - - Improved the endianness of bitfield datatypes by adding missing functional - code. This code used integer types as a template. + - None - (ADB - 2017/05/12, HDFFV-10186) - - Compact layout "dirty" flag is not reset properly + Parallel Library + ---------------- + - None - Reset the layout "dirty" flag for a compact dataset before flushing - the message. - (VC - 2017/05/11, HDFFV-10051) - - - Incorporate additional code changes for the H5DOread_chunk patch from GE - Healthcare. - - Incorporate the code changes that were missing from the original patch: - (1) Additional tests in hl/test/test_dset_opt.c - (2) Fix in src/H5Dchunk.c for direct access when an entry is in chunk cache but - not dirty - - (VC - 2017/05/02, HDFFV-9934) - - - Missing #ifdef __cplusplus macros were added to the generated H5Epubgen.h file. - - (DER - 2017/04/25, HDFFV-9638) + Performance + ------------- + - None Tools ----- - - h5repack - - h5repack did not maintain the creation order flag of the root - group. - - Improved h5repack by reading the creation order and applying the - flag to the new root group. Also added arguments to set the - order and index direction, which applies to the traversing of the - original file, on the command line. + - None - (ADB - 2017/05/26, HDFFV-8611) - - h5diff + Fortran API + ----------- + - None - h5diff failed to account for strpad type and null terminators - of char strings. Also, h5diff failed to account for string length - differences and would give a different result depending on file - order in the command line. - - Improved h5diff compare of strings and arrays by adding a check for - string lengths and if the strpad was null filled. - - (ADB - 2017/05/18, HDFFV-9055, HDFFV-10128) - - - h5diff - - h5diff did not report user-defined filter data differences correctly.. - - Improved h5diff compare of user-defined filter data by reporting an - error if the user-defined filter plugin cannot be found.. - - (ADB - 2017/01/18, HDFFV-9994) C++ API ------- - - The class hierarchy is revised to better reflect the HDF5 model. - Class H5File is now derived from class Group instead of H5Location. - Class Attribute is now derived from H5Location instead of IdComponent. - Wrappers of H5A APIs in H5Location are now duplicated in H5Object, - the original wrappers in H5Location will be deprecated in future - releases. + - None + + + High-Level APIs: + --------------- + - None - (BMR - 2017/05/15, HDFFV-10156) + Packet Table APIs: + ------------------ + - None Supported Platforms -- cgit v0.12 From bea3266f1c49f1e67caa8fa1e97730cef6bf7ff2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 24 Jul 2017 16:33:48 -0500 Subject: Correct case of var --- config/cmake_ext_mod/HDFLibMacros.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index f2e03d7..54e408b 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -74,14 +74,14 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") add_dependencies (JPEG jpeg-static) set (JPEG_STATIC_LIBRARY "jpeg-static") - set (JPEG_LIBRARIES ${JPEG_static_LIBRARY}) + set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target jpeg-shared add_library(jpeg-shared SHARED IMPORTED) HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") add_dependencies (JPEG jpeg-shared) set (JPEG_SHARED_LIBRARY "jpeg-shared") - set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_shared_LIBRARY}) + set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY}) endif () set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") @@ -167,14 +167,14 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") add_dependencies (SZIP szip-static) set (SZIP_STATIC_LIBRARY "szip-static") - set (SZIP_LIBRARIES ${SZIP_static_LIBRARY}) + set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target szip-shared add_library(szip-shared SHARED IMPORTED) HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") add_dependencies (SZIP szip-shared) set (SZIP_SHARED_LIBRARY "szip-shared") - set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_shared_LIBRARY}) + set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY}) endif () set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") @@ -262,7 +262,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") add_dependencies (ZLIB zlib-static) set (ZLIB_STATIC_LIBRARY "zlib-static") - set (ZLIB_LIBRARIES ${ZLIB_static_LIBRARY}) + set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY}) if (BUILD_SHARED_LIBS) # Create imported target zlib-shared add_library(zlib-shared SHARED IMPORTED) -- cgit v0.12 From dd51a8c0ad312ae7510fc2da0a757f6cf13658ae Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 09:54:24 -0500 Subject: HDFFV-10246 Fix vl string compare --- MANIFEST | 1 + release_docs/RELEASE.txt | 11 +++++++++-- tools/h5diff/CMakeTests.cmake | 7 +++++++ tools/h5diff/testfiles/h5diff_vlstr.txt | 16 ++++++++++++++++ tools/h5diff/testh5diff.sh.in | 4 ++++ tools/lib/h5diff_array.c | 20 ++++++++++++++++---- 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 tools/h5diff/testfiles/h5diff_vlstr.txt diff --git a/MANIFEST b/MANIFEST index 3c4b142..55f08a9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2021,6 +2021,7 @@ ./tools/h5diff/testfiles/h5diff_udfail.txt ./tools/h5diff/testfiles/diff_strings1.h5 ./tools/h5diff/testfiles/diff_strings2.h5 +./tools/h5diff/testfiles/h5diff_vlstr.txt #test files for h5repack ./tools/h5repack/testfiles/README diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 792e5b2..cd9a1f5 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -92,7 +92,7 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== - + Bug Fixes since HDF5-1.8.19 @@ -120,7 +120,14 @@ Bug Fixes since HDF5-1.8.19 Tools ----- - - None + - h5diff + + h5diff segfaulted on compare of a NULL variable length string. + + Improved h5diff compare of strings by adding a check for + NULL strings and setting the lengths to zero. + + (ADB - 2017/07/25, HDFFV-10246) Fortran API diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 7f6f8c3..e97b78c 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -66,6 +66,8 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/tudfilter2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/diff_strings2.h5 + # tools/testfiles + ${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5 ) set (LIST_OTHER_TEST_FILES @@ -276,6 +278,8 @@ HDFTEST_COPY_FILE("${h5_tstfiles}" "${PROJECT_BINARY_DIR}/PAR/testfiles/${fname}" "h5diff_files") endif () endforeach () + # copy second version of tvlstr.h5 + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/testfiles/tvlstr2.h5" "h5diff_files") # @@ -839,6 +843,8 @@ h5diff_801.out.err h5diff_90.out h5diff_90.out.err + h5diff_vlstr.out + h5diff_vlstr.out.err ) set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") @@ -1403,6 +1409,7 @@ ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) +ADD_H5_TEST (h5diff_vlstr 0 -v tvlstr.h5 tvlstr2.h5) # ############################################################################## # # Test container types (array,vlen) with multiple nested compound types diff --git a/tools/h5diff/testfiles/h5diff_vlstr.txt b/tools/h5diff/testfiles/h5diff_vlstr.txt new file mode 100644 index 0000000..67141f1 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_vlstr.txt @@ -0,0 +1,16 @@ + +file1 file2 +--------------------------------------- + x x / + x x /Dataset1 + x x /vl_string_type + +group : and +0 differences found +attribute: > and > +0 differences found +dataset: and +0 differences found +datatype: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index 45a7a45..c21cbd7 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -120,6 +120,7 @@ $SRC_H5DIFF_TESTFILES/non_comparables1.h5 $SRC_H5DIFF_TESTFILES/non_comparables2.h5 $SRC_H5DIFF_TESTFILES/diff_strings1.h5 $SRC_H5DIFF_TESTFILES/diff_strings2.h5 +$SRC_TOOLS_TESTFILES/tvlstr.h5 " LIST_OTHER_TEST_FILES=" @@ -522,6 +523,8 @@ SKIP() { ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR +# second copy of tvlstr.h5 +$CP -f $SRC_TOOLS_TESTFILES/tvlstr.h5 $TESTDIR/tvlstr2.h5 # ############################################################################ # # Common usage @@ -1097,6 +1100,7 @@ TOOLTEST h5diff_487.txt -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5 # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy +TOOLTEST h5diff_vlstr.txt -v tvlstr.h5 tvlstr2.h5 # ############################################################################## # # Test container types (array,vlen) with multiple nested compound types diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1b17382..6480cf6 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -674,21 +674,33 @@ static hsize_t diff_datum(void *_mem1, h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; - size1 = HDstrlen(s1); + if(s1) + size1 = HDstrlen(s1); + else + size1 = 0; /* Get pointer to second string */ s2 = *(char**) mem2; - size2 = HDstrlen(s2); + if(s2) + size2 = HDstrlen(s2); + else + size2 = 0; } else if (H5T_STR_NULLTERM == pad) { h5difftrace("diff_datum H5T_STRING null term\n"); /* Get pointer to first string */ s1 = (char*) mem1; - size1 = HDstrlen(s1); + if(s1) + size1 = HDstrlen(s1); + else + size1 = 0; if (size1 > size_mtype) size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; - size2 = HDstrlen(s2); + if(s2) + size2 = HDstrlen(s2); + else + size2 = 0; if (size2 > size_mtype) size2 = size_mtype; } -- cgit v0.12 From 507a90d70443d8e381fa09b1e9223882ece91de9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 10:47:09 -0500 Subject: Add test for plugin initialize check --- test/plugin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/plugin.c b/test/plugin.c index b662476..0de8839 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -731,7 +731,10 @@ test_filter_path_apis(void) if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR + TESTING(" initialize"); H5PLsize(&ndx); + if(ndx!=2) TEST_ERROR + PASSED(); TESTING(" remove"); /* Remove all existing paths*/ -- cgit v0.12 From 07ece7f7e71a70820b31726358c84f5789ec5d37 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 10:57:20 -0500 Subject: Insure program execution order --- tools/perform/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perform/CMakeTests.cmake b/tools/perform/CMakeTests.cmake index 5c4b54f..5468b0d 100644 --- a/tools/perform/CMakeTests.cmake +++ b/tools/perform/CMakeTests.cmake @@ -55,6 +55,7 @@ add_test (NAME PERFORM_perf_meta COMMAND $) add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS PERFORM_zip_perf_help) if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -- cgit v0.12 From 2e5665399b14294f44fdf8d645ee5eb722d7cdb0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 11:49:30 -0500 Subject: Add comparison file to list --- tools/h5diff/testh5diff.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in index c21cbd7..ff370a9 100644 --- a/tools/h5diff/testh5diff.sh.in +++ b/tools/h5diff/testh5diff.sh.in @@ -309,6 +309,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_80.txt $SRC_H5DIFF_TESTFILES/h5diff_90.txt $SRC_H5DIFF_TESTFILES/h5diff_tmp1.txt $SRC_H5DIFF_TESTFILES/h5diff_tmp2.txt +$SRC_H5DIFF_TESTFILES/h5diff_vlstr.txt $SRC_H5DIFF_TESTFILES/tmptest.he5 $SRC_H5DIFF_TESTFILES/tmptest2.he5 $SRC_H5DIFF_TESTFILES/tmpSingleSiteBethe.reference.h5 -- cgit v0.12 From 7cc1166920bb73c98d736468d70635c57c628357 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 26 Jul 2017 11:51:07 -0500 Subject: Add comparison file to list --- tools/h5diff/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index e97b78c..24cf332 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -253,6 +253,7 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_vlstr.txt ) set (LIST_WIN_TEST_FILES -- cgit v0.12 From 61cbf3b334905c14c2031dac96a54587954142e1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Jul 2017 11:20:25 -0500 Subject: Parallel needs copy of file in PAR folder --- tools/h5diff/CMakeTests.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 24cf332..aa620ef 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -281,6 +281,9 @@ endforeach () # copy second version of tvlstr.h5 HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/testfiles/tvlstr2.h5" "h5diff_files") + if (H5_HAVE_PARALLEL) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5" "${PROJECT_BINARY_DIR}/PAR/testfiles/tvlstr2.h5" "h5diff_files") + endif () # -- cgit v0.12 From 5bc595f6a686c43ce3d910b7e0da61c331363598 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 27 Jul 2017 11:49:38 -0500 Subject: libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler on Linux (other OSs have not been tested). Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) Removed FCFLAGS when building the examples since they should already be included the h5fc wrapper. NAG complains about doubly declared options. --- configure.ac | 43 +++++++++++++++++++++++++++++++------------ fortran/examples/Makefile.am | 4 ++-- fortran/src/h5fc.in | 2 +- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 72909d9..f0be94d 100644 --- a/configure.ac +++ b/configure.ac @@ -2909,6 +2909,37 @@ else STATIC_SHARED="none" fi +if test "X$HDF_FORTRAN" = "Xyes"; then + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script + ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) + case "`uname`" in + Darwin*) + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + ;; + esac + + ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### on Linux (other OSs have not been tested). + ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to + ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + case "`uname`" in + Linux*) + + fortran_linux_linker_option="-Wl," + + if (grep -i 'NAG_Fortran' libtool > /dev/null); then + cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + fortran_linux_linker_option="-Wl,-Wl,," + fi + + ## Set the correct linker option for use in h5fc.in markup + AC_SUBST([fortran_linux_linker_option]) + ;; + esac + +fi + ## ---------------------------------------------------------------------- ## Set a macro if shared library is enabled. ## @@ -2998,18 +3029,6 @@ AC_OUTPUT chmod 755 tools/misc/h5cc -if test "X$HDF_FORTRAN" = "Xyes"; then - chmod 755 fortran/src/h5fc - ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler - ## on OS X, which is needed when building shared libraries on OS X. This script - ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) - case "`uname`" in - Darwin*) - cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool - ;; - esac -fi - if test "X$HDF_CXX" = "Xyes"; then chmod 755 c++/src/h5c++ fi diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index 3428a9e..d78cbb3 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -68,10 +68,10 @@ h5_crtatt.chkexe_: h5_rdwt.chkexe_ # Additional dependencies for the examples are listed below if BUILD_PARALLEL_CONDITIONAL $(EXTRA_PROG): $(H5FC_PP) - $(H5FC_PP) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC_PP) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; else $(EXTRA_PROG): $(H5FC) - $(H5FC) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; endif # Tell automake how to install examples diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 47642c9..29ef83f 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -307,7 +307,7 @@ if test "x$do_link" = "xyes"; then link_args="$link_args -L${libdir}" case "$host_os" in - linux*) flag="-Wl,-rpath -Wl," ;; + linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;; hpux*) flag="-Wl,+b -Wl," ;; freebsd*|solaris*) flag="-R" ;; rs6000*|aix*) flag="-L" ;; -- cgit v0.12 From cc7badac5ea8204bf0d8f2c343c4b48810d969c0 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 27 Jul 2017 13:10:24 -0500 Subject: added chmod 755 for h5fc --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f0be94d..5ec7210 100644 --- a/configure.ac +++ b/configure.ac @@ -3028,7 +3028,9 @@ AC_CONFIG_FILES([src/libhdf5.settings AC_OUTPUT chmod 755 tools/misc/h5cc - +if test "X$HDF_FORTRAN" = "Xyes"; then + chmod 755 fortran/src/h5fc +fi if test "X$HDF_CXX" = "Xyes"; then chmod 755 c++/src/h5c++ fi -- cgit v0.12 From 3558c82af4127a8b72acdae0177ce0ed5b2aeea6 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 28 Jul 2017 09:29:11 -0500 Subject: Rearranged where the substitution occurs. libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler on Linux (other OSs have not been tested). Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) --- configure.ac | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 5ec7210..c7bdef6 100644 --- a/configure.ac +++ b/configure.ac @@ -2910,14 +2910,6 @@ else fi if test "X$HDF_FORTRAN" = "Xyes"; then - ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler - ## on OS X, which is needed when building shared libraries on OS X. This script - ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) - case "`uname`" in - Darwin*) - cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool - ;; - esac ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). @@ -2927,9 +2919,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then Linux*) fortran_linux_linker_option="-Wl," - + if (grep -i 'NAG_Fortran' libtool > /dev/null); then - cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fortran_linux_linker_option="-Wl,-Wl,," fi @@ -3035,6 +3026,31 @@ if test "X$HDF_CXX" = "Xyes"; then chmod 755 c++/src/h5c++ fi + +if test "X$HDF_FORTRAN" = "Xyes"; then + chmod 755 fortran/src/h5fc + ## libtool does not pass the correct argument linker (wl=) for the Intel Fortran compiler + ## on OS X, which is needed when building shared libraries on OS X. This script + ## replaces the 3rd occurrence, which is for Fortran, of wl="" with wl="-Wl," (HDFFV-2772) + case "`uname`" in + Darwin*) + cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + ;; + esac + + ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### on Linux (other OSs have not been tested). + ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to + ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + case "`uname`" in + Linux*) + if (grep -i 'NAG_Fortran' libtool > /dev/null); then + cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + fi + ;; + esac +fi + ## HDF5 configure code created by autotools with gcc 4.9.2 is adding problematic ## linker flags: -l with no library name; -l , specifically gfortran or m. ## This sed script corrects "-l " first and then "-l " with no library name. -- cgit v0.12 From ca973192bc86f75066fdc8468c4f0293ff0b725d Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 1 Aug 2017 08:45:04 -0500 Subject: Removed extra Fortran flags, (HDFFV-10037) --- hl/fortran/examples/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index b8ed434..71c2866 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -43,10 +43,10 @@ FORTRAN_API=yes # Tell automake how to build examples using h5fc if BUILD_PARALLEL_CONDITIONAL $(EXTRA_PROG): $(H5FC_PP) - $(H5FC_PP) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC_PP) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; else $(EXTRA_PROG): $(H5FC) - $(H5FC) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; + $(H5FC) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; endif # Tell automake how to install examples -- cgit v0.12 From 1c681c47fa1c263dda72123501475556fa00d1f2 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Tue, 1 Aug 2017 11:22:55 -0500 Subject: Snapshot version 1.8 release 20 (snap0) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure | 22 +++++++++++----------- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.txt b/README.txt index d782f4e..a1d8671 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap0 currently under development +HDF5 version 1.8.20-snap1 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 3c95721..cfd98ee 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap0, currently under development" +PROJECT_NUMBER = "1.8.20-snap1, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index b1ac833..4497ab1 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap0") +set (CTEST_SOURCE_VERSEXT "-snap1") ############################################################################## # handle input parameters to script. diff --git a/configure b/configure index 4734a60..0fafee4 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap0. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap1. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-snap0' -PACKAGE_STRING='HDF5 1.8.20-snap0' +PACKAGE_VERSION='1.8.20-snap1' +PACKAGE_STRING='HDF5 1.8.20-snap1' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1476,7 +1476,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.8.20-snap0 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-snap1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1546,7 +1546,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-snap0:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-snap1:";; esac cat <<\_ACEOF @@ -1741,7 +1741,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-snap0 +HDF5 configure 1.8.20-snap1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2678,7 +2678,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.8.20-snap0, which was +It was created by HDF5 $as_me 1.8.20-snap1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3549,7 +3549,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-snap0' + VERSION='1.8.20-snap1' cat >>confdefs.h <<_ACEOF @@ -29295,7 +29295,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-snap0 +HDF5 config.lt 1.8.20-snap1 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31330,7 +31330,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-snap0, which was +This file was extended by HDF5 $as_me 1.8.20-snap1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31396,7 +31396,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-snap0 +HDF5 config.status 1.8.20-snap1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cd9a1f5..994f232 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap0 currently under development +HDF5 version 1.8.20-snap1 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 0e46778..a16edf7 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap0" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap1" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap0" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From cd0e71d998898a29b0d8291497faad4c8ab979de Mon Sep 17 00:00:00 2001 From: hdftest Date: Tue, 1 Aug 2017 16:02:18 -0500 Subject: Commit files missed for commit after Snapshot version 1.8 release 20 (snap0) --- configure.ac | 2 +- hl/src/H5LTparse.c | 144 ++++++++++++++++++++++++++--------------------------- hl/src/H5LTparse.h | 4 +- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/configure.ac b/configure.ac index 72909d9..51553a3 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap0], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap1], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 16a0bcf..2a0f267 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 7481a45..2af0172 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -- cgit v0.12 From df099c726400d67b8be071d59108f3fc11a4d23d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 2 Aug 2017 14:51:08 -0500 Subject: HDFFV-10256 correct len of string copy to the len of esc string Merge from develop --- MANIFEST | 2 ++ release_docs/RELEASE.txt | 10 ++++++++++ tools/h5dump/CMakeTestsXML.cmake | 7 +++++++ tools/h5dump/h5dump_xml.c | 10 ++++------ tools/h5dump/testh5dumpxml.sh.in | 5 +++++ tools/testfiles/test35.nc | Bin 0 -> 14297 bytes tools/testfiles/test35.nc.xml | 20 ++++++++++++++++++++ 7 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 tools/testfiles/test35.nc create mode 100644 tools/testfiles/test35.nc.xml diff --git a/MANIFEST b/MANIFEST index 55f08a9..48d8af7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1713,6 +1713,8 @@ ./tools/testfiles/tdset2.h5.xml ./tools/testfiles/tempty.h5.xml ./tools/testfiles/tenum.h5.xml +./tools/testfiles/test35.nc +./tools/testfiles/test35.nc.xml ./tools/testfiles/tfpformat.h5.xml ./tools/testfiles/tgroup.h5.xml ./tools/testfiles/thlink.h5.xml diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 994f232..39c978b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -120,6 +120,16 @@ Bug Fixes since HDF5-1.8.19 Tools ----- + - h5dump + + h5dump segfaulted on output of XML file. + + Function that escape'd strings used the full buffer length + instead of just the length of the replacement string in a + strncpy call. Using the correct length fixed the issue. + + (ADB - 2017/08/01, HDFFV-10256) + - h5diff h5diff segfaulted on compare of a NULL variable length string. diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 49adc6f..595d0b5 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -50,6 +50,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-quot.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-sp.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/test35.nc ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5 @@ -99,6 +100,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-ns.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-ns-2.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tenum.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/test35.nc.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5.xml @@ -258,6 +260,8 @@ tempty.h5.out.err tenum.h5.out tenum.h5.out.err + test35.nc.out + test35.nc.out.err textlink.h5.out textlink.h5.out.err tfpformat.h5.out @@ -430,3 +434,6 @@ # tests for floating point user defined printf format ADD_XML_H5_TEST (tfpformat.h5 0 -u -m %.7f tfpformat.h5) + # test for HDFFV-10256 issue + ADD_XML_H5_TEST (test35.nc 0 test35.nc) + diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 8f6dd86..ee897ae 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -10,8 +10,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" #include "h5tools.h" @@ -781,20 +779,20 @@ xml_escape_the_string(const char *str, int slen) esc_len = 1; } else if (*cp == '\'') { - HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); + HDstrncpy(ncp, apos, esc_len); } else if (*cp == '<') { - HDstrncpy(ncp, lt, ncp_len); esc_len = HDstrlen(lt); + HDstrncpy(ncp, lt, esc_len); } else if (*cp == '>') { - HDstrncpy(ncp, gt, ncp_len); esc_len = HDstrlen(gt); + HDstrncpy(ncp, gt, esc_len); } else if (*cp == '&') { - HDstrncpy(ncp, amp, ncp_len); esc_len = HDstrlen(amp); + HDstrncpy(ncp, amp, esc_len); } else { *ncp = *cp; diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index 81201b7..64dd737 100644 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -80,6 +80,7 @@ $SRC_H5DUMP_TESTFILES/tdset.h5 $SRC_H5DUMP_TESTFILES/tdset2.h5 $SRC_H5DUMP_TESTFILES/tempty.h5 $SRC_H5DUMP_TESTFILES/tenum.h5 +$SRC_H5DUMP_TESTFILES/test35.nc $SRC_H5DUMP_TESTFILES/textlink.h5 $SRC_H5DUMP_TESTFILES/tfpformat.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 @@ -144,6 +145,7 @@ $SRC_H5DUMP_TESTFILES/tempty-nons-uri.h5.xml $SRC_H5DUMP_TESTFILES/tempty-ns.h5.xml $SRC_H5DUMP_TESTFILES/tempty-ns-2.h5.xml $SRC_H5DUMP_TESTFILES/tenum.h5.xml +$SRC_H5DUMP_TESTFILES/test35.nc.xml $SRC_H5DUMP_TESTFILES/textlink.h5.xml $SRC_H5DUMP_TESTFILES/tfpformat.h5.xml $SRC_H5DUMP_TESTFILES/tgroup.h5.xml @@ -383,6 +385,9 @@ TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=desce # tests for floating point user defined printf format TOOLTEST tfpformat.h5.xml -u -m %.7f tfpformat.h5 +# test for HDFFV-10256 issue +TOOLTEST test35.nc.xml --xml test35.nc + # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/testfiles/test35.nc b/tools/testfiles/test35.nc new file mode 100644 index 0000000..4bd5d7f Binary files /dev/null and b/tools/testfiles/test35.nc differ diff --git a/tools/testfiles/test35.nc.xml b/tools/testfiles/test35.nc.xml new file mode 100644 index 0000000..a38ed8a --- /dev/null +++ b/tools/testfiles/test35.nc.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaa>aaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>a<aaaaaa>aaaaaaaa<aaaaaa>a<aaaaaa>aaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaa>aaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaa<aaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"aaaaa\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaa<aaaa>aaaa<aaaa>>aaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaa>aaaaaaaaaaaaaaaaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<a>aaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<>aaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaa<aaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaaa<aaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaa<aa>aaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaa>aaaaa<aaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<aaaaaaa>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + + + + + -- cgit v0.12 From f05f98ef8d46b2aa302380573fd43ebe72b04a30 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 3 Aug 2017 09:07:52 -0500 Subject: merged NAG changes from develop, (HDFFV-10037) --- config/linux-gnulibc1 | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 3 +-- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index ea12a88..ce07853 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -84,6 +84,20 @@ else $RM $tmpfile fc_version_info=`$FC -V | grep Absoft` ;; + # The NAG compiler + nagfor*|nagftn*) + RM='rm -f' + tmpfile=/tmp/cmpver.$$ + $FC -V >& $tmpfile + if test -s "$tmpfile"; then + if( grep -s 'NAG Fortran' $tmpfile > /dev/null) then + FC_BASENAME=nagfor + fi + fi + fc_version_info=`grep "NAG Fortran" $tmpfile` + echo "compiler '$FC' is $fc_version_info" + $RM $tmpfile + ;; *) ;; @@ -117,6 +131,37 @@ case $FC_BASENAME in PROFILE_FCFLAGS="-g -pg" f9x_flags_set=yes ;; +# +# NAG compiler +# + nagfor) + + F9XSUFFIXFLAG="" +# We force compiler to use upper case for external names +# (just in case since this should be a default EIP) + H5_FCFLAGS="$H5_FCFLAGS" + FSEARCH_DIRS="" + + # Production + PROD_FCFLAGS= + + # Debug + DEBUG_FCFLAGS="-C" + + # Symbols + SYMBOLS_FCFLAGS="-g" + NO_SYMBOLS_FCFLAGS="-s" + + # Profiling + PROFILE_FCFLAGS="-pg" + + # Optimization + HIGH_OPT_FCFLAGS="-O" + DEBUG_OPT_FCFLAGS="-O0" + NO_OPT_FCFLAGS="-O0" + + f9x_flags_set=yes + ;; esac @@ -208,6 +253,19 @@ case $FC in *pgf90*) fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -V 2>&1 | grep 'pgf90'` ;; + *nagfor*|*nagftn*) + RM='rm -f' + tmpfile=/tmp/cmpver.$$ + $FC -V >& $tmpfile + if test -s "$tmpfile"; then + if( grep -s 'NAG Fortran' $tmpfile > /dev/null) then + FC_BASENAME=nagfor + fi + fi + fc_version_info=`grep "NAG Fortran" $tmpfile` + $RM $tmpfile + echo "compiler '$FC' is $fc_version_info" + ;; *) echo "No match to get fc_version_info for $FC" diff --git a/configure.ac b/configure.ac index c7bdef6..469c3f5 100644 --- a/configure.ac +++ b/configure.ac @@ -2919,8 +2919,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then Linux*) fortran_linux_linker_option="-Wl," - - if (grep -i 'NAG_Fortran' libtool > /dev/null); then + if test "X$FC_BASENAME" = "Xnagfor"; then fortran_linux_linker_option="-Wl,-Wl,," fi -- cgit v0.12 From e75b6ae724596c991fe4d91b8bf2d1b7cf24d7f4 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 3 Aug 2017 09:15:34 -0500 Subject: merged NAG changes from develop, (HDFFV-10037) --- configure.ac | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 469c3f5..c453699 100644 --- a/configure.ac +++ b/configure.ac @@ -3018,9 +3018,6 @@ AC_CONFIG_FILES([src/libhdf5.settings AC_OUTPUT chmod 755 tools/misc/h5cc -if test "X$HDF_FORTRAN" = "Xyes"; then - chmod 755 fortran/src/h5fc -fi if test "X$HDF_CXX" = "Xyes"; then chmod 755 c++/src/h5c++ fi @@ -3043,7 +3040,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) - if (grep -i 'NAG_Fortran' libtool > /dev/null); then + if test "X$FC_BASENAME" = "Xnagfor"; then cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; -- cgit v0.12 From c7465bdfb8ebd857dbdd36a6e9e89236241add7e Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 3 Aug 2017 09:21:12 -0500 Subject: changed comments, (HDFFV-10037) --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index c453699..415173b 100644 --- a/configure.ac +++ b/configure.ac @@ -2911,10 +2911,10 @@ fi if test "X$HDF_FORTRAN" = "Xyes"; then - ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to - ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) @@ -3034,10 +3034,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ;; esac - ### libtool does not pass the correct argument linking (-WL,-WL,,) for the NAG Fortran compiler + ### libtool does not pass the correct argument linking (-WL,-Wl,,) for the NAG Fortran compiler ### on Linux (other OSs have not been tested). ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to - ### wl="-Wl,-WL,," in the libtool file. (HDFFV-10037) + ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then -- cgit v0.12 From 51b97cc02d39ae7f05b129463087ef13a97a2822 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 4 Aug 2017 09:03:29 -0500 Subject: generated reconfigure files for configure changes --- Makefile.in | 1 + c++/Makefile.in | 1 + c++/examples/Makefile.in | 1 + c++/src/Makefile.in | 1 + c++/test/Makefile.in | 1 + configure | 40 +++++++++++++++++++++++++++++++++++++--- examples/Makefile.in | 1 + fortran/Makefile.in | 1 + fortran/examples/Makefile.in | 5 +++-- fortran/src/Makefile.in | 1 + fortran/test/Makefile.in | 1 + fortran/testpar/Makefile.in | 1 + hl/Makefile.in | 1 + hl/c++/Makefile.in | 1 + hl/c++/examples/Makefile.in | 1 + hl/c++/src/Makefile.in | 1 + hl/c++/test/Makefile.in | 1 + hl/examples/Makefile.in | 1 + hl/fortran/Makefile.in | 1 + hl/fortran/examples/Makefile.in | 5 +++-- hl/fortran/src/Makefile.in | 1 + hl/fortran/test/Makefile.in | 1 + hl/src/Makefile.in | 1 + hl/test/Makefile.in | 1 + hl/tools/Makefile.in | 1 + hl/tools/gif2h5/Makefile.in | 1 + src/Makefile.in | 1 + test/Makefile.in | 1 + testpar/Makefile.in | 1 + tools/Makefile.in | 1 + tools/h5copy/Makefile.in | 1 + tools/h5diff/Makefile.in | 1 + tools/h5dump/Makefile.in | 1 + tools/h5import/Makefile.in | 1 + tools/h5jam/Makefile.in | 1 + tools/h5ls/Makefile.in | 1 + tools/h5repack/Makefile.in | 1 + tools/h5stat/Makefile.in | 1 + tools/lib/Makefile.in | 1 + tools/misc/Makefile.in | 1 + tools/perform/Makefile.in | 1 + 41 files changed, 81 insertions(+), 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index a8c81ac..f7d883e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -421,6 +421,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/c++/Makefile.in b/c++/Makefile.in index f6e5df0..19c69f8 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -582,6 +582,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index d819404..282e117 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -529,6 +529,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index f2961a4..b01f1f6 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -594,6 +594,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index d528314..afd001f 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -584,6 +584,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/configure b/configure index 4734a60..65900e1 100755 --- a/configure +++ b/configure @@ -640,6 +640,7 @@ LTLIBOBJS LIBOBJS HAVE_SHARED_CONDITIONAL_FALSE HAVE_SHARED_CONDITIONAL_TRUE +fortran_linux_linker_option SEARCH BUILD_HDF5_HL_CONDITIONAL_FALSE BUILD_HDF5_HL_CONDITIONAL_TRUE @@ -30716,6 +30717,27 @@ else STATIC_SHARED="none" fi +if test "X$HDF_FORTRAN" = "Xyes"; then + + ### libtool does not pass the correct argument linking (-Wl,-Wl,,) for the NAG Fortran compiler + ### on Linux (other OSs have not been tested). + ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to + ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) + case "`uname`" in + Linux*) + + fortran_linux_linker_option="-Wl," + if test "X$FC_BASENAME" = "Xnagfor"; then + fortran_linux_linker_option="-Wl,-Wl,," + fi + + ## Set the correct linker option for use in h5fc.in markup + + ;; + esac + +fi + ## ---------------------------------------------------------------------- ## Set a macro if shared library is enabled. ## @@ -33684,6 +33706,10 @@ fi chmod 755 tools/misc/h5cc +if test "X$HDF_CXX" = "Xyes"; then + chmod 755 c++/src/h5c++ +fi + if test "X$HDF_FORTRAN" = "Xyes"; then chmod 755 fortran/src/h5fc @@ -33695,10 +33721,18 @@ if test "X$HDF_FORTRAN" = "Xyes"; then cat libtool | awk '/wl=\"/{c++;if(c==3){sub("wl=\"\"","wl=\"-Wl,\"");c=0}}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool ;; esac -fi -if test "X$HDF_CXX" = "Xyes"; then - chmod 755 c++/src/h5c++ + ### libtool does not pass the correct argument linking (-WL,-Wl,,) for the NAG Fortran compiler + ### on Linux (other OSs have not been tested). + ### Therefore, detect if we are using the NAG Fortran compiler, and replace the wl="-Wl," for Fortran to + ### wl="-Wl,-Wl,," in the libtool file. (HDFFV-10037) + case "`uname`" in + Linux*) + if test "X$FC_BASENAME" = "Xnagfor"; then + cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + fi + ;; + esac fi ## HDF5 configure code created by autotools with gcc 4.9.2 is adding problematic diff --git a/examples/Makefile.in b/examples/Makefile.in index 79ccc89..29f2ce9 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -529,6 +529,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 86d9da6..1444440 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -586,6 +586,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 3e0acbc..f49b5db 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -537,6 +537,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -1053,9 +1054,9 @@ h5_crtatt.chkexe_: h5_rdwt.chkexe_ # Tell automake how to build examples using h5fc # Additional dependencies for the examples are listed below @BUILD_PARALLEL_CONDITIONAL_TRUE@$(EXTRA_PROG): $(H5FC_PP) -@BUILD_PARALLEL_CONDITIONAL_TRUE@ $(H5FC_PP) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; +@BUILD_PARALLEL_CONDITIONAL_TRUE@ $(H5FC_PP) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; @BUILD_PARALLEL_CONDITIONAL_FALSE@$(EXTRA_PROG): $(H5FC) -@BUILD_PARALLEL_CONDITIONAL_FALSE@ $(H5FC) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; +@BUILD_PARALLEL_CONDITIONAL_FALSE@ $(H5FC) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; # List dependencies for each example. Normally, automake would take # care of this for us, but if we tell automake about the programs it diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 0494278..5fe70a1 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -646,6 +646,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index f10240d..b3fe729 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -654,6 +654,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index deeea8d..aa56548 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -582,6 +582,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/Makefile.in b/hl/Makefile.in index 7257abe..bc24f4c 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -586,6 +586,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index b62507f..d7ae139 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -582,6 +582,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 37ce68c..03fd40b 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -529,6 +529,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index cd0fe7a..27f4c04 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -585,6 +585,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 177f103..d544dd9 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -582,6 +582,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 9562b29..30cd1c1 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -529,6 +529,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index e478a34..070762c 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -586,6 +586,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 18c43d3..e5b58b4 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -530,6 +530,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -1028,9 +1029,9 @@ help: # Tell automake how to build examples using h5fc @BUILD_PARALLEL_CONDITIONAL_TRUE@$(EXTRA_PROG): $(H5FC_PP) -@BUILD_PARALLEL_CONDITIONAL_TRUE@ $(H5FC_PP) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; +@BUILD_PARALLEL_CONDITIONAL_TRUE@ $(H5FC_PP) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; @BUILD_PARALLEL_CONDITIONAL_FALSE@$(EXTRA_PROG): $(H5FC) -@BUILD_PARALLEL_CONDITIONAL_FALSE@ $(H5FC) $(H5CCFLAGS) $(FCFLAGS) -o $@ $(srcdir)/$@.f90; +@BUILD_PARALLEL_CONDITIONAL_FALSE@ $(H5FC) $(H5CCFLAGS) -o $@ $(srcdir)/$@.f90; # How to create EXAMPLEDIR if it doesn't already exist $(EXAMPLEDIR): diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 62cfdf0..00152e9 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -603,6 +603,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index bcb4b3c..2186831 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -594,6 +594,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index f49844d..707862a 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -584,6 +584,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index c9544d7..2d2d6d4 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -621,6 +621,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 0589b49..293605e 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -583,6 +583,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index dd7a691..9992e81 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -596,6 +596,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/src/Makefile.in b/src/Makefile.in index 06e169f..3ff3e0e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -642,6 +642,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/test/Makefile.in b/test/Makefile.in index 2bf0ef7..575b1d5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -969,6 +969,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 7ef18e7..3ac4bc6 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -615,6 +615,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 877984e..558c3bf 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -583,6 +583,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index f6b7dac..01b49c3 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -590,6 +590,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index cea2023..c85d036 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -612,6 +612,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 8a42296..c6e4e4a 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -614,6 +614,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index fc9b4ff..bfb1536 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -591,6 +591,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index d069943..ba2906b 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -602,6 +602,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 9479c7e..f9305f3 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -597,6 +597,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 34873e5..281d2db 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -632,6 +632,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 5220f4f..9eb4bcb 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -592,6 +592,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 62fa41d..f3b80bf 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -580,6 +580,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 049171b..966220c 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -617,6 +617,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index a59f3b0..8f3b209 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -621,6 +621,7 @@ dvidir = @dvidir@ enable_shared = @enable_shared@ enable_static = @enable_static@ exec_prefix = @exec_prefix@ +fortran_linux_linker_option = @fortran_linux_linker_option@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ -- cgit v0.12 From cc5aa808e36748908f6ce0e3a55658b7f4093efe Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 4 Aug 2017 09:04:33 -0500 Subject: generated reconfigure files for configure changes --- hl/src/H5LTparse.c | 144 ++++++++++++++++++++++++++--------------------------- hl/src/H5LTparse.h | 4 +- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 2a0f267..16a0bcf 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 2af0172..7481a45 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -- cgit v0.12 From 20d67d61716d9003d0518c9e8f448cd960b3bc9a Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Tue, 8 Aug 2017 16:17:20 -0500 Subject: Snapshot version 1.8 release 20 (snap1) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- hl/src/H5LTparse.c | 144 +++++++++++++++++----------------- hl/src/H5LTparse.h | 4 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 +- 8 files changed, 81 insertions(+), 81 deletions(-) diff --git a/README.txt b/README.txt index a1d8671..de06dc1 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap1 currently under development +HDF5 version 1.8.20-snap2 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index cfd98ee..38a6fe4 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap1, currently under development" +PROJECT_NUMBER = "1.8.20-snap2, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 4497ab1..e7e11ee 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap1") +set (CTEST_SOURCE_VERSEXT "-snap2") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index 45b13a7..c6d5b5a 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap1], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap2], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 16a0bcf..2a0f267 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 7481a45..2af0172 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 39c978b..f538aa2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap1 currently under development +HDF5 version 1.8.20-snap2 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index a16edf7..9fb864d 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap1" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap2" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap1" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap2" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From e4299d463efa0736bc51513b15827e58046cc061 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Tue, 8 Aug 2017 16:29:34 -0500 Subject: The configure file changes should have been committed as part of the Snapshot version 1.8 release 20 (snap1) snapshot release. --- configure | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 07156bd..9ff81ed 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap1. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap2. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-snap1' -PACKAGE_STRING='HDF5 1.8.20-snap1' +PACKAGE_VERSION='1.8.20-snap2' +PACKAGE_STRING='HDF5 1.8.20-snap2' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1477,7 +1477,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.8.20-snap1 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-snap2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1547,7 +1547,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-snap1:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-snap2:";; esac cat <<\_ACEOF @@ -1742,7 +1742,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-snap1 +HDF5 configure 1.8.20-snap2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2679,7 +2679,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.8.20-snap1, which was +It was created by HDF5 $as_me 1.8.20-snap2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3550,7 +3550,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-snap1' + VERSION='1.8.20-snap2' cat >>confdefs.h <<_ACEOF @@ -29296,7 +29296,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-snap1 +HDF5 config.lt 1.8.20-snap2 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31352,7 +31352,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-snap1, which was +This file was extended by HDF5 $as_me 1.8.20-snap2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31418,7 +31418,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-snap1 +HDF5 config.status 1.8.20-snap2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -- cgit v0.12 From 2bd8e1053b89e0348364f951a58449f16aa72da7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 Aug 2017 08:58:06 -0500 Subject: HDFFV-10188 merge fix and tests from develop --- MANIFEST | 4 +++ release_docs/RELEASE.txt | 10 ++++++ tools/h5dump/CMakeTests.cmake | 5 +++ tools/h5dump/CMakeTestsXML.cmake | 8 +++-- tools/h5dump/h5dump_xml.c | 38 ++++++++++++----------- tools/h5dump/h5dumpgentest.c | 39 ++++++++++++++++++++++++ tools/h5dump/testh5dump.sh.in | 3 ++ tools/h5dump/testh5dumpxml.sh.in | 6 ++-- tools/h5ls/CMakeTests.cmake | 7 +++++ tools/h5ls/h5ls.c | 62 ++++++++++++++++++++------------------ tools/h5ls/testh5ls.sh.in | 5 +++ tools/lib/h5tools_ref.c | 5 ++- tools/testfiles/tgrpnullspace.ddl | 33 ++++++++++++++++++++ tools/testfiles/tgrpnullspace.h5 | Bin 0 -> 2504 bytes tools/testfiles/tgrpnullspace.ls | 7 +++++ tools/testfiles/tnullspace.h5.xml | 39 ++++++++++++++++++++++++ 16 files changed, 215 insertions(+), 56 deletions(-) create mode 100644 tools/testfiles/tgrpnullspace.ddl create mode 100644 tools/testfiles/tgrpnullspace.h5 create mode 100644 tools/testfiles/tgrpnullspace.ls create mode 100644 tools/testfiles/tnullspace.h5.xml diff --git a/MANIFEST b/MANIFEST index 48d8af7..16900d2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1390,6 +1390,9 @@ ./tools/testfiles/tgrp_comments.ls ./tools/testfiles/tgrp_comments.ddl ./tools/testfiles/tgrp_comments.h5 +./tools/testfiles/tgrpnullspace.h5 +./tools/testfiles/tgrpnullspace.ddl +./tools/testfiles/tgrpnullspace.ls ./tools/testfiles/thlink-1.ddl ./tools/testfiles/thlink-2.ddl ./tools/testfiles/thlink-3.ddl @@ -1445,6 +1448,7 @@ ./tools/testfiles/tno-subset.h5 ./tools/testfiles/tno-subset.ddl ./tools/testfiles/tnullspace.h5 +./tools/testfiles/tnullspace.h5.xml ./tools/testfiles/tnullspace.ddl ./tools/testfiles/tobjref.h5 ./tools/testfiles/topaque.h5 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f538aa2..d7381ca 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -120,6 +120,16 @@ Bug Fixes since HDF5-1.8.19 Tools ----- + - h5ls + + h5ls generated error on stack when it encountered a H5S_NULL + dataspace. + + Adding checks for H5S_NULL before calling H5Sis_simple (located + in the h5tools_dump_mem function) fixed the issue. + + (ADB - 2017/08/17, HDFFV-10188) + - h5dump h5dump segfaulted on output of XML file. diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 0978265..d930edd 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -103,6 +103,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-2.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-3.ddl @@ -270,6 +271,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tfvalues.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tints4dims.h5 @@ -883,6 +885,8 @@ tgroup-2.out.err tgrp_comments.out tgrp_comments.out.err + tgrpnullspace.out + tgrpnullspace.out.err thlink-1.out thlink-1.out.err thlink-2.out @@ -1389,6 +1393,7 @@ # test for displaying dataset and attribute of null space ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) + ADD_H5_TEST (tgrpnullspace 0 -p --enable-error-stack tgrpnullspace.h5) # test for displaying dataset and attribute of space with 0 dimension size ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5) diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 595d0b5..9a3b511 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -53,6 +53,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/test35.nc ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr.h5 @@ -117,6 +118,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-sp.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.h5.xml @@ -296,6 +298,8 @@ tnodata.h5.out.err tnoname.h5.out tnoname.h5.out.err + tnullspace.h5.out + tnullspace.h5.out.err tobjref.h5.out tobjref.h5.out.err topaque.h5.out @@ -402,9 +406,7 @@ ADD_XML_H5_TEST (tsaf.h5 0 tsaf.h5) ADD_XML_H5_TEST (tempty.h5 0 tempty.h5) ADD_XML_H5_TEST (tnamed_dtype_attr.h5 0 tnamed_dtype_attr.h5) - ##Test dataset and attribute of null space. Commented out: - ## wait until the XML schema is updated for null space. - ## ADD_XML_H5_TEST (tnullspace.h5 0 tnulspace.h5) + ADD_XML_H5_TEST (tnullspace.h5 0 tnullspace.h5) ## So is dataspace with 0 dimension size. ## ADD_XML_H5_TEST (zerodim.h5 0 zerodim.h5) diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index ee897ae..089419b 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -1958,28 +1958,32 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, H5Tclose(type); space = H5Aget_space(obj_id); + if(space == H5S_NULL || space == H5S_NO_CLASS) { + status = SUCCEED; + } + else { + ndims = H5Sget_simple_extent_dims(space, size, NULL); - ndims = H5Sget_simple_extent_dims(space, size, NULL); + for (i = 0; i < ndims; i++) + nelmts *= size[i]; - for (i = 0; i < ndims; i++) - nelmts *= size[i]; + buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); + HDassert(buf); - buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); - HDassert(buf); + if (H5Aread(obj_id, p_type, buf) >= 0) { + h5tools_context_t datactx; + HDmemset(&datactx, 0, sizeof(datactx)); + datactx.need_prefix = TRUE; + datactx.indent_level = ctx.indent_level; + datactx.cur_column = ctx.cur_column; + status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + } + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - if (H5Aread(obj_id, p_type, buf) >= 0) { - h5tools_context_t datactx; - HDmemset(&datactx, 0, sizeof(datactx)); - datactx.need_prefix = TRUE; - datactx.indent_level = ctx.indent_level; - datactx.cur_column = ctx.cur_column; - status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + HDfree(buf); } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - - HDfree(buf); H5Tclose(p_type); H5Sclose(space); H5Tclose(type); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index c74e800..f9450cb 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -112,6 +112,7 @@ #define FILE82 "tcompound_complex2.h5" #define FILE83 "tvlenstr_array.h5" #define FILE84 "tudfilter.h5" +#define FILE85 "tgrpnullspace.h5" /*------------------------------------------------------------------------- * prototypes @@ -10289,6 +10290,43 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, *------------------------------------------------------------------------- */ +/*------------------------------------------------------------------------- + * Function: gent_null_space_group + * + * Purpose: generates dataset and attribute of null dataspace in a group + *------------------------------------------------------------------------- + */ +static void gent_null_space_group(void) +{ + hid_t fid, root, group, dataset, space, attr; + int dset_buf = 10; + int point = 4; + + fid = H5Fcreate(FILE85, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + root = H5Gopen2(fid, "/", H5P_DEFAULT); + + group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* null space */ + space = H5Screate(H5S_NULL); + + /* dataset */ + dataset = H5Dcreate2(group, "dset", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + /* nothing should be written */ + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); + + /* attribute */ + attr = H5Acreate2(group, "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT); + H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */ + + H5Dclose(dataset); + H5Aclose(attr); + H5Gclose(group); + H5Gclose(root); + H5Sclose(space); + H5Fclose(fid); +} + int main(void) { gent_group(); @@ -10376,6 +10414,7 @@ int main(void) gent_bitnopaquefields(); gent_intsfourdims(); + gent_null_space_group(); gent_udfilter(); diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index f941afc..9ceffa5 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -131,6 +131,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.h5 $SRC_H5DUMP_TESTFILES/tfvalues.h5 $SRC_H5DUMP_TESTFILES/tgroup.h5 $SRC_H5DUMP_TESTFILES/tgrp_comments.h5 +$SRC_H5DUMP_TESTFILES/tgrpnullspace.h5 $SRC_H5DUMP_TESTFILES/thlink.h5 $SRC_H5DUMP_TESTFILES/thyperslab.h5 $SRC_H5DUMP_TESTFILES/tintsattrs.h5 @@ -258,6 +259,7 @@ $SRC_H5DUMP_TESTFILES/tfpformat.ddl $SRC_H5DUMP_TESTFILES/tgroup-1.ddl $SRC_H5DUMP_TESTFILES/tgroup-2.ddl $SRC_H5DUMP_TESTFILES/tgrp_comments.ddl +$SRC_H5DUMP_TESTFILES/tgrpnullspace.ddl $SRC_H5DUMP_TESTFILES/thlink-1.ddl $SRC_H5DUMP_TESTFILES/thlink-2.ddl $SRC_H5DUMP_TESTFILES/thlink-3.ddl @@ -1265,6 +1267,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5 # test for displaying dataset and attribute of null space TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5 +TOOLTEST tgrpnullspace.ddl -p --enable-error-stack tgrpnullspace.h5 # test for displaying dataset and attribute of space with 0 dimension size TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5 diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index 64dd737..8aa8811 100644 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -97,6 +97,7 @@ $SRC_H5DUMP_TESTFILES/tname-sp.h5 $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5 $SRC_H5DUMP_TESTFILES/tnestedcomp.h5 $SRC_H5DUMP_TESTFILES/tnodata.h5 +$SRC_H5DUMP_TESTFILES/tnullspace.h5 $SRC_H5DUMP_TESTFILES/tobjref.h5 $SRC_H5DUMP_TESTFILES/topaque.h5 $SRC_H5DUMP_TESTFILES/torderattr.h5 @@ -162,6 +163,7 @@ $SRC_H5DUMP_TESTFILES/tname-quot.h5.xml $SRC_H5DUMP_TESTFILES/tname-sp.h5.xml $SRC_H5DUMP_TESTFILES/tnestedcomp.h5.xml $SRC_H5DUMP_TESTFILES/tnodata.h5.xml +$SRC_H5DUMP_TESTFILES/tnullspace.h5.xml $SRC_H5DUMP_TESTFILES/tobjref.h5.xml $SRC_H5DUMP_TESTFILES/topaque.h5.xml $SRC_H5DUMP_TESTFILES/torderattr1.h5.xml @@ -355,9 +357,7 @@ TOOLTEST tvlstr.h5.xml --xml tvlstr.h5 TOOLTEST tsaf.h5.xml --xml tsaf.h5 TOOLTEST tempty.h5.xml --xml tempty.h5 TOOLTEST tnamed_dtype_attr.h5.xml --xml tnamed_dtype_attr.h5 -##Test dataset and attribute of null space. Commented out: -## wait until the XML schema is updated for null space. -##TOOLTEST tnullspace.h5.xml --xml tnulspace.h5 +TOOLTEST tnullspace.h5.xml --xml tnullspace.h5 # other options for xml diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 343949a..378781c 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -33,6 +33,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 @@ -88,6 +89,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrpnullspace.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls @@ -239,6 +241,8 @@ textlinksrc-7-old.out.err tgrp_comments.out tgrp_comments.out.err + tgrpnullspace.out + tgrpnullspace.out.err tsoftlinks-1.out tsoftlinks-1.out.err tsoftlinks-2.out @@ -413,6 +417,9 @@ # test for empty data ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) + # test for displaying dataset and attribute of null space + ADD_H5_TEST (tgrpnullspace 0 -w80 -v tgrpnullspace.h5) + # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 7daf7e3..a58b96b 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1616,38 +1616,40 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain info = &outputformat; - if(hexdump_g) - p_type = H5Tcopy(type); - else - p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); - - if(p_type >= 0) { - /* VL data special information */ - unsigned int vl_data = 0; /* contains VL datatypes */ - - /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen(p_type) == TRUE) - vl_data = TRUE; - - temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); - HDassert(temp_need == (hsize_t)((size_t)temp_need)); - need = (size_t)temp_need; - buf = HDmalloc(need); - HDassert(buf); - if(H5Aread(attr, p_type, buf) >= 0) { - ctx.need_prefix = TRUE; - ctx.indent_level = 2; - ctx.cur_column = (size_t)curr_pos; - h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); - } + if(space_type != H5S_NULL && space_type != H5S_NO_CLASS) { + if(hexdump_g) + p_type = H5Tcopy(type); + else + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); + + if(p_type >= 0) { + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + /* Check if we have VL data in the dataset's datatype */ + if (h5tools_detect_vlen(p_type) == TRUE) + vl_data = TRUE; + + temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); + HDassert(temp_need == (hsize_t)((size_t)temp_need)); + need = (size_t)temp_need; + buf = HDmalloc(need); + HDassert(buf); + if(H5Aread(attr, p_type, buf) >= 0) { + ctx.need_prefix = TRUE; + ctx.indent_level = 2; + ctx.cur_column = (size_t)curr_pos; + h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); + } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - HDfree(buf); - H5Tclose(p_type); - } /* end if */ + HDfree(buf); + H5Tclose(p_type); + } /* end if */ + } H5Sclose(space); H5Tclose(type); diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index 4b57acc..42913c1 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -80,6 +80,7 @@ $SRC_H5LS_TESTFILES/textlinksrc.h5 $SRC_H5LS_TESTFILES/textlinktar.h5 $SRC_H5LS_TESTFILES/tgroup.h5 $SRC_H5LS_TESTFILES/tgrp_comments.h5 +$SRC_H5LS_TESTFILES/tgrpnullspace.h5 $SRC_H5LS_TESTFILES/thlink.h5 $SRC_H5LS_TESTFILES/tloop.h5 $SRC_H5LS_TESTFILES/tnestedcomp.h5 @@ -134,6 +135,7 @@ $SRC_H5LS_TESTFILES/tgroup.ls $SRC_H5LS_TESTFILES/tgroup-1.ls $SRC_H5LS_TESTFILES/tgroup-2.ls $SRC_H5LS_TESTFILES/tgroup-3.ls +$SRC_H5LS_TESTFILES/tgrpnullspace.ls $SRC_H5LS_TESTFILES/thlink-1.ls $SRC_H5LS_TESTFILES/tloop-1.ls $SRC_H5LS_TESTFILES/tmultifile.ls @@ -390,6 +392,9 @@ TOOLTEST tarray1.ls 0 -w80 -r -d tarray1.h5 # test for empty data TOOLTEST tempty.ls 0 -w80 -d tempty.h5 +# test for displaying dataset and attribute of null space +TOOLTEST tgrpnullspace.ls 0 -w80 -v tgrpnullspace.h5 + # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types TOOLTEST tattr2.ls 0 -w80 -v -S tattr2.h5 diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 85850e3..16a949d 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5tools_ref.h" #include "H5private.h" #include "H5SLprivate.h" @@ -166,7 +164,8 @@ haddr_t ref_path_table_lookup(const char *thepath) { H5O_info_t oi; - + if((HDstrlen(thepath) == 0) || (thepath == NULL)) + return HADDR_UNDEF; /* Allow lookups on the root group, even though it doesn't have any link info */ if(HDstrcmp(thepath, "/")) { H5L_info_t li; diff --git a/tools/testfiles/tgrpnullspace.ddl b/tools/testfiles/tgrpnullspace.ddl new file mode 100644 index 0000000..2b91527 --- /dev/null +++ b/tools/testfiles/tgrpnullspace.ddl @@ -0,0 +1,33 @@ +HDF5 "tgrpnullspace.h5" { +GROUP "/" { + GROUP "g1" { + ATTRIBUTE "attr" { + DATATYPE H5T_STD_U32LE + DATASPACE NULL + DATA { + } + } + DATASET "dset" { + DATATYPE H5T_STD_I32BE + DATASPACE NULL + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 0 + OFFSET 18446744073709551615 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + } + } + } +} +} diff --git a/tools/testfiles/tgrpnullspace.h5 b/tools/testfiles/tgrpnullspace.h5 new file mode 100644 index 0000000..82a405e Binary files /dev/null and b/tools/testfiles/tgrpnullspace.h5 differ diff --git a/tools/testfiles/tgrpnullspace.ls b/tools/testfiles/tgrpnullspace.ls new file mode 100644 index 0000000..b1a1223 --- /dev/null +++ b/tools/testfiles/tgrpnullspace.ls @@ -0,0 +1,7 @@ +Opened "tgrpnullspace.h5" with sec2 driver. +g1 Group + Attribute: attr null + Type: native unsigned int + + Location: 1:800 + Links: 1 diff --git a/tools/testfiles/tnullspace.h5.xml b/tools/testfiles/tnullspace.h5.xml new file mode 100644 index 0000000..b1c1974 --- /dev/null +++ b/tools/testfiles/tnullspace.h5.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v0.12 From 5cc911f3ba2c5d12c3305b348610f9ba80c85db2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 Aug 2017 10:28:24 -0500 Subject: HDFFV-10188 Force non-native type description --- tools/h5ls/CMakeTests.cmake | 2 +- tools/h5ls/testh5ls.sh.in | 2 +- tools/testfiles/tgrpnullspace.ls | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 378781c..a839518 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -418,7 +418,7 @@ ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) # test for displaying dataset and attribute of null space - ADD_H5_TEST (tgrpnullspace 0 -w80 -v tgrpnullspace.h5) + ADD_H5_TEST (tgrpnullspace 0 -w80 -v -S tgrpnullspace.h5) # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index 42913c1..40bb529 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -393,7 +393,7 @@ TOOLTEST tarray1.ls 0 -w80 -r -d tarray1.h5 TOOLTEST tempty.ls 0 -w80 -d tempty.h5 # test for displaying dataset and attribute of null space -TOOLTEST tgrpnullspace.ls 0 -w80 -v tgrpnullspace.h5 +TOOLTEST tgrpnullspace.ls 0 -w80 -v -S tgrpnullspace.h5 # test for all dataset types written to attributes # enable -S for avoiding printing NATIVE types diff --git a/tools/testfiles/tgrpnullspace.ls b/tools/testfiles/tgrpnullspace.ls index b1a1223..439414c 100644 --- a/tools/testfiles/tgrpnullspace.ls +++ b/tools/testfiles/tgrpnullspace.ls @@ -1,7 +1,7 @@ Opened "tgrpnullspace.h5" with sec2 driver. g1 Group Attribute: attr null - Type: native unsigned int + Type: 32-bit little-endian unsigned integer Location: 1:800 Links: 1 -- cgit v0.12 From 4a82cc6db607b1c052eb48c899d7f2dfb16cf31e Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 27 Aug 2017 20:50:47 -0500 Subject: Snapshot version 1.8 release 20 (snap2) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index de06dc1..ba33cb4 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap2 currently under development +HDF5 version 1.8.20-snap3 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 38a6fe4..9e5eb1e 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap2, currently under development" +PROJECT_NUMBER = "1.8.20-snap3, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index e7e11ee..e752596 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap2") +set (CTEST_SOURCE_VERSEXT "-snap3") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index c6d5b5a..7a90186 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap2], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap3], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d7381ca..cc499a0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap2 currently under development +HDF5 version 1.8.20-snap3 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 9fb864d..8bd583f 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap2" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap3" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap2" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap3" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From c5dbc92a32f1a1555103784a76f33e8c207d2c93 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 09:27:38 -0500 Subject: HDFFV-10284 add VS2017 --- config/cmake/scripts/HDF5config.cmake | 102 +++++++++++++++++----------------- release_docs/INSTALL_CMake.txt | 46 +++++++-------- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index e752596..2af9f4d 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -11,7 +11,7 @@ ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### +### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ### ### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf518.log ### ############################################################################################# @@ -22,12 +22,12 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: # Unix * Unix Makefiles -# VS2015 * Visual Studio 14 2015 -# VS201564 * Visual Studio 14 2015 Win64 -# VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 -# VS2012 * Visual Studio 11 2012 -# VS201264 * Visual Studio 11 2012 Win64 +# VS2017 * Visual Studio 15 2017 +# VS201764 * Visual Studio 15 2017 Win64 +# VS2015 * Visual Studio 14 2015 +# VS201564 * Visual Studio 14 2015 Win64 +# VS2013 * Visual Studio 12 2013 +# VS201364 * Visual Studio 12 2013 Win64 # # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc @@ -63,25 +63,7 @@ endif () # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else () - if (${BUILD_GENERATOR} STREQUAL "Unix") - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - elseif (${BUILD_GENERATOR} STREQUAL "VS201564") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif () + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") endif () ################################################################### @@ -128,31 +110,49 @@ endif () if (WIN32) set (SITE_OS_NAME "Windows") set (SITE_OS_VERSION "WIN7") - if (${BUILD_GENERATOR} STREQUAL "VS201564") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") - endif () + if (${BUILD_GENERATOR} STREQUAL "VS201764") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS2017") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index bfec833..2505578 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -650,7 +650,7 @@ adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### +### BUILD_GENERATOR required [Unix, VS2017, VS201764, VS2015, VS201564, VS2013, VS201364] ### ### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf518.log ### ############################################################################################# @@ -661,12 +661,12 @@ cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR) # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: # Unix * Unix Makefiles +# VS2017 * Visual Studio 15 2017 +# VS201764 * Visual Studio 15 2017 Win64 # VS2015 * Visual Studio 14 2015 # VS201564 * Visual Studio 14 2015 Win64 # VS2013 * Visual Studio 12 2013 # VS201364 * Visual Studio 12 2013 Win64 -# VS2012 * Visual Studio 11 2012 -# VS201264 * Visual Studio 11 2012 Win64 # # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc @@ -702,25 +702,7 @@ endif () # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") -else () - if (${BUILD_GENERATOR} STREQUAL "Unix") - set (CTEST_CMAKE_GENERATOR "Unix Makefiles") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - elseif (${BUILD_GENERATOR} STREQUAL "VS201564") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") - endif () + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") endif () ################################################################### @@ -767,30 +749,48 @@ endif () if (WIN32) set (SITE_OS_NAME "Windows") set (SITE_OS_VERSION "WIN7") - if (${BUILD_GENERATOR} STREQUAL "VS201564") + if (${BUILD_GENERATOR} STREQUAL "VS201764") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS2017") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (${BUILD_GENERATOR} STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") set (SITE_OS_BITS "64") set (SITE_COMPILER_NAME "vs2015") set (SITE_COMPILER_VERSION "14") elseif (${BUILD_GENERATOR} STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") set (SITE_OS_BITS "32") set (SITE_COMPILER_NAME "vs2015") set (SITE_COMPILER_VERSION "14") elseif (${BUILD_GENERATOR} STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") set (SITE_OS_BITS "64") set (SITE_COMPILER_NAME "vs2013") set (SITE_COMPILER_VERSION "12") elseif (${BUILD_GENERATOR} STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") set (SITE_OS_BITS "32") set (SITE_COMPILER_NAME "vs2013") set (SITE_COMPILER_VERSION "12") elseif (${BUILD_GENERATOR} STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") set (SITE_OS_BITS "64") set (SITE_COMPILER_NAME "vs2012") set (SITE_COMPILER_VERSION "11") elseif (${BUILD_GENERATOR} STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") set (SITE_OS_BITS "32") set (SITE_COMPILER_NAME "vs2012") set (SITE_COMPILER_VERSION "11") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") endif () ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -- cgit v0.12 From 0d94a84ba680a1dbdf2f201a2f5aa0963aeebace Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 13:44:49 -0500 Subject: HDFFV-9988 Add intel compiler path to list --- config/cmake_ext_mod/FindMPI.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index ff1ead2..7cd6d46 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -175,6 +175,9 @@ if(WIN32) list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") + # INTEL MPI + list(APPEND _MPI_PREFIX_PATH "$ENV{I_MPI_ROOT}/intel64/") + endif() # Build a list of prefixes to search for MPI. -- cgit v0.12 From 297e70a2ddb2481d4f126fa0821fc73ad8231e2d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 13:47:31 -0500 Subject: HDFFV-9988 Update macro file with changes from CMake master. --- config/cmake_ext_mod/FindMPI.cmake | 127 ++++++++++++++++++++++++------------- 1 file changed, 84 insertions(+), 43 deletions(-) diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 7cd6d46..f566ade 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -9,71 +9,78 @@ # The Message Passing Interface (MPI) is a library used to write # high-performance distributed-memory parallel applications, and is # typically deployed on a cluster. MPI is a standard interface (defined -# by the MPI forum) for which many implementations are available. All -# of them have somewhat different include paths, libraries to link -# against, etc., and this module tries to smooth out those differences. +# by the MPI forum) for which many implementations are available. # # Variables # ^^^^^^^^^ # # This module will set the following variables per language in your -# project, where is one of C, CXX, or Fortran: -# -# :: -# -# MPI__FOUND TRUE if FindMPI found MPI flags for -# MPI__COMPILER MPI Compiler wrapper for -# MPI__COMPILE_FLAGS Compilation flags for MPI programs -# MPI__INCLUDE_PATH Include path(s) for MPI header -# MPI__LINK_FLAGS Linking flags for MPI programs -# MPI__LIBRARIES All libraries to link MPI programs against +# project, where ```` is one of C, CXX, or Fortran: +# +# ``MPI__FOUND`` +# Variable indicating the MPI settings for ```` were found. +# ``MPI__COMPILER`` +# MPI Compiler wrapper for ````. +# ``MPI__COMPILE_FLAGS`` +# Compilation flags for MPI programs, separated by spaces. +# This is *not* a :ref:`;-list `. +# ``MPI__INCLUDE_PATH`` +# Include path(s) for MPI header. +# ``MPI__LINK_FLAGS`` +# Linker flags for MPI programs. +# ``MPI__LIBRARIES`` +# All libraries to link MPI programs against. +# +# Additionally, the following :prop_tgt:`IMPORTED` targets are defined: +# +# ``MPI::MPI_`` +# Target for using MPI from ````. # # Additionally, FindMPI sets the following variables for running MPI # programs from the command line: # -# :: -# -# MPIEXEC Executable for running MPI programs -# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving -# it the number of processors to run on -# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly -# before the executable to run. -# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags +# ``MPIEXEC`` +# Executable for running MPI programs, if provided. +# ``MPIEXEC_NUMPROC_FLAG`` +# Flag to pass to ``MPIEXEC`` before giving it the number of processors to run on. +# ``MPIEXEC_MAX_NUMPROCS`` +# Number of MPI processors to utilize. Defaults to the number +# of processors detected on the host system. +# ``MPIEXEC_PREFLAGS`` +# Flags to pass to ``MPIEXEC`` directly before the executable to run. +# ``MPIEXEC_POSTFLAGS`` +# Flags to pass to ``MPIEXEC`` after other flags. # # Usage # ^^^^^ # -# To use this module, simply call FindMPI from a CMakeLists.txt file, or -# run ``find_package(MPI)``, then run CMake. If you are happy with the +# To use this module, call ``find_package(MPI)``. If you are happy with the # auto-detected configuration for your language, then you're done. If # not, you have two options: # -# :: -# -# 1. Set MPI__COMPILER to the MPI wrapper (mpicc, etc.) of your -# choice and reconfigure. FindMPI will attempt to determine all the -# necessary variables using THAT compiler's compile and link flags. -# 2. If this fails, or if your MPI implementation does not come with -# a compiler wrapper, then set both MPI__LIBRARIES and -# MPI__INCLUDE_PATH. You may also set any other variables -# listed above, but these two are required. This will circumvent -# autodetection entirely. +# 1. Set ``MPI__COMPILER`` to the MPI wrapper (e.g. ``mpicc``) of your +# choice and reconfigure. FindMPI will attempt to determine all the +# necessary variables using *that* compiler's compile and link flags. +# 2. If this fails, or if your MPI implementation does not come with +# a compiler wrapper, then set both ``MPI__LIBRARIES`` and +# ``MPI__INCLUDE_PATH``. You may also set any other variables +# listed above, but these two are required. This will circumvent +# autodetection entirely. # # When configuration is successful, ``MPI__COMPILER`` will be set to -# the compiler wrapper for , if it was found. ``MPI__FOUND`` +# the compiler wrapper for ````, if it was found. ``MPI__FOUND`` # and other variables above will be set if any MPI implementation was -# found for , regardless of whether a compiler was found. +# found for ````, regardless of whether a compiler was found. # # When using ``MPIEXEC`` to execute MPI applications, you should typically # use all of the ``MPIEXEC`` flags as follows: # # :: # -# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS +# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} # ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS # -# where ``PROCS`` is the number of processors on which to execute the -# program, ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to +# where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to # pass to the MPI program. # # Backward Compatibility @@ -101,12 +108,12 @@ include(GetPrerequisites) # The compilers are detected in this order: # # 1. Try to find the most generic available MPI compiler, as this is usually set up by -# cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's +# cluster admins, e.g. if plain old mpicc is available, we'll use it and assume it's # the right compiler. # # 2. If a generic mpicc is NOT found, then we attempt to find one that matches # CMAKE__COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc -# and company, but not mpiicc. This hopefully prevents toolchain mismatches. +# and company, but not mpiicc. This hopefully prevents toolchain mismatches. # # If you want to force a particular MPI compiler other than what we autodetect (e.g. if you # want to compile regular stuff with GNU and parallel stuff with Intel), you can always set @@ -498,7 +505,7 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE) mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES) - # clear out our temporary lib/header detectionv variable here. + # clear out our temporary lib/header detection variable here. set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE) set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE) endif() @@ -568,10 +575,21 @@ find_program(MPIEXEC get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH) get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) -set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") +# According to the MPI standard, section 8.8 -n is a guaranteed, and the only guaranteed way to +# launch an MPI process using mpiexec if such a program exists. +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.") set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.") -set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.") + +# Set the number of processes to the processor count and the previous default +# of 2 if that couldn't be determined. +include(${CMAKE_ROOT}/Modules/ProcessorCount.cmake) +ProcessorCount(_MPIEXEC_NUMPROCS) +if("${_MPIEXEC_NUMPROCS}" EQUAL "0") + set(_MPIEXEC_NUMPROCS 2) +endif() +set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") +unset(_MPIEXEC_NUMPROCS) mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) @@ -646,6 +664,28 @@ foreach (lang C CXX Fortran) else() find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) endif() + + if(MPI_${lang}_FOUND) + if(NOT TARGET MPI::MPI_${lang}) + add_library(MPI::MPI_${lang} INTERFACE IMPORTED) + endif() + if(MPI_${lang}_COMPILE_FLAGS) + separate_arguments(_MPI_${lang}_COMPILE_OPTIONS NATIVE_COMMAND "${MPI_${lang}_COMPILE_FLAGS}") + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_COMPILE_OPTIONS "${_MPI_${lang}_COMPILE_OPTIONS}") + endif() + + unset(_MPI_${lang}_LINK_LINE) + if(MPI_${lang}_LINK_FLAGS) + list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LINK_FLAGS}") + endif() + list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LIBRARIES}") + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_LINK_LIBRARIES "${_MPI_${lang}_LINK_LINE}") + + set_property(TARGET MPI::MPI_${lang} PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${MPI_${lang}_INCLUDE_PATH}") + endif() endif() endforeach() @@ -685,6 +725,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) endif() +mark_as_advanced(MPI_LIBRARY MPI_EXTRA_LIBRARY) #============================================================================= # unset these vars to cleanup namespace -- cgit v0.12 From 27b361687d8fda20f3ec885b7dbe36084aac6d85 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 15:27:25 -0500 Subject: HDFFV-10276 add enable-error-stack to h5diff --- tools/h5repack/CMakeTests.cmake | 12 +- tools/h5repack/h5repack.h | 9 +- tools/h5repack/h5repack_filters.c | 306 ++++++++++++----------------- tools/h5repack/h5repack_main.c | 8 +- tools/h5repack/h5repack_parse.c | 17 +- tools/h5repack/h5repack_plugin.sh.in | 14 +- tools/h5repack/testfiles/h5repack-help.txt | 12 +- 7 files changed, 173 insertions(+), 205 deletions(-) diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index dafed86..e9315ca 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -207,7 +207,8 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) else () add_test ( NAME H5REPACK_CMP-${testname} @@ -240,7 +241,8 @@ # If using memchecker add tests without using scripts add_test ( NAME H5REPACK_DMP-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) endif () @@ -1000,15 +1002,15 @@ ############################################################################## ### P L U G I N T E S T S ############################################################################## - ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) - ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) + ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE}) + ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,0,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) # check for no parameters set (TESTRETVAL 255) if (WIN32) set (TESTRETVAL -1) endif () - ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0) + ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 9049472..bdde740 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -54,6 +54,7 @@ typedef struct { typedef struct { H5Z_filter_t filtn; /* filter identification number */ + unsigned filt_flag; /* filter definition flag */ unsigned cd_values[CD_VALUES]; /* filter client data values */ size_t cd_nelmts; /* filter client number of values */ } filter_info_t; @@ -139,10 +140,10 @@ int h5repack_end(pack_opt_t *options); int h5repack_verify(const char *out_fname, pack_opt_t *options); int h5repack_cmp_pl(const char *fname1, const char *fname2); -/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() - * and struct named_dt_t were located in h5repack_copy.c as static prior to - * bugfix1726. - * Made shared functions as copy_attr() was needed in h5repack_refs.c. +/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() + * and struct named_dt_t were located in h5repack_copy.c as static prior to + * bugfix1726. + * Made shared functions as copy_attr() was needed in h5repack_refs.c. * However copy_attr() may be obsoleted when H5Acopy is available and put back * others to static in h5repack_copy.c. */ diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index fc8859d..ac3aa3c 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -32,37 +32,32 @@ * *------------------------------------------------------------------------- */ -static int -aux_find_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ +static int aux_find_obj(const char* name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { - char *pdest; - int result; - unsigned int i; - - for ( i=0; iop_tbl->nelems; i++) - { - if (HDstrcmp(options->op_tbl->objs[i].path,name)==0) - { - *obj = options->op_tbl->objs[i]; - return (int)i; - } - - pdest = HDstrstr(name,options->op_tbl->objs[i].path); - result = (int)(pdest - name); - - /* found at position 1, meaning without '/' */ - if( pdest != NULL && result==1 ) - { - *obj = options->op_tbl->objs[i]; - return (int)i; - } - }/*i*/ - - return -1; -} + char *pdest; + int result; + unsigned int i; + + for (i = 0; i < options->op_tbl->nelems; i++) { + if (HDstrcmp(options->op_tbl->objs[i].path,name) == 0) { + *obj = options->op_tbl->objs[i]; + return (int) i; + } + pdest = HDstrstr(name, options->op_tbl->objs[i].path); + result = (int) (pdest - name); + + /* found at position 1, meaning without '/' */ + if (pdest != NULL && result == 1) { + *obj = options->op_tbl->objs[i]; + return (int) i; + } + }/*i*/ + + return -1; +} /*------------------------------------------------------------------------- * Function: aux_assign_obj @@ -74,35 +69,31 @@ aux_find_obj(const char* name, /* object name from traverse list */ * *------------------------------------------------------------------------- */ -static int -aux_assign_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ +static int aux_assign_obj(const char* name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { - int idx, i; + int idx, i; pack_info_t tmp; init_packobject(&tmp); - idx = aux_find_obj(name,options,&tmp); + idx = aux_find_obj(name, options, &tmp); /* name was on input */ - if (idx>=0) - { - + if (idx >= 0) { /* applying to all objects */ - if (options->all_layout) - { + if (options->all_layout) { /* assign the global layout info to the OBJ info */ - tmp.layout=options->layout_g; - switch (options->layout_g) - { + tmp.layout = options->layout_g; + switch (options->layout_g) { case H5D_CHUNKED: - tmp.chunk.rank=options->chunk_g.rank; - for ( i=0; ichunk_g.chunk_lengths[i]; + tmp.chunk.rank = options->chunk_g.rank; + for (i = 0; i < tmp.chunk.rank; i++) + tmp.chunk.chunk_lengths[i] = + options->chunk_g.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -113,15 +104,14 @@ aux_assign_obj(const char* name, /* object name from traverse list */ break; }/*switch*/ } - else - { + else { tmp.layout = options->op_tbl->objs[idx].layout; - switch (tmp.layout) - { + switch (tmp.layout) { case H5D_CHUNKED: tmp.chunk.rank = options->op_tbl->objs[idx].chunk.rank; - for ( i=0; iop_tbl->objs[idx].chunk.chunk_lengths[i]; + for (i = 0; i < tmp.chunk.rank; i++) + tmp.chunk.chunk_lengths[i] = + options->op_tbl->objs[idx].chunk.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -135,49 +125,37 @@ aux_assign_obj(const char* name, /* object name from traverse list */ } /* applying to all objects */ - if (options->all_filter) - { + if (options->all_filter) { /* assign the global filter */ - tmp.nfilters=1; - tmp.filter[0]=options->filter_g[0]; + tmp.nfilters = 1; + tmp.filter[0] = options->filter_g[0]; } /* if all */ - else - { - tmp.nfilters=options->op_tbl->objs[idx].nfilters; - for ( i=0; iop_tbl->objs[idx].nfilters; + for (i = 0; i < tmp.nfilters; i++) { tmp.filter[i] = options->op_tbl->objs[idx].filter[i]; } } - - } /* if idx */ - - /* no input name */ - - else - { - - if (options->all_filter) - { + else { + if (options->all_filter) { int k; /* assign the global filters */ - tmp.nfilters=options->n_filter_g; - for ( k = 0; k < options->n_filter_g; k++) - tmp.filter[k]=options->filter_g[k]; + tmp.nfilters = options->n_filter_g; + for (k = 0; k < options->n_filter_g; k++) + tmp.filter[k] = options->filter_g[k]; } - if (options->all_layout) - { + if (options->all_layout) { /* assign the global layout info to the OBJ info */ - tmp.layout=options->layout_g; - switch (options->layout_g) - { + tmp.layout = options->layout_g; + switch (options->layout_g) { case H5D_CHUNKED: - tmp.chunk.rank=options->chunk_g.rank; - for ( i=0; ichunk_g.chunk_lengths[i]; + tmp.chunk.rank = options->chunk_g.rank; + for (i = 0; i < tmp.chunk.rank; i++) + tmp.chunk.chunk_lengths[i] = + options->chunk_g.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -192,10 +170,8 @@ aux_assign_obj(const char* name, /* object name from traverse list */ *obj = tmp; return 1; - } - /*------------------------------------------------------------------------- * Function: apply_filters * @@ -212,25 +188,23 @@ aux_assign_obj(const char* name, /* object name from traverse list */ *------------------------------------------------------------------------- */ -int apply_filters(const char* name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t *dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int *has_filter) /* (OUT) object NAME has a filter */ - - +int apply_filters(const char* name, /* object name from traverse list */ + int rank, /* rank of dataset */ + hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t *options, /* repack options */ + int *has_filter) /* (OUT) object NAME has a filter */ { - int nfilters; /* number of filters in DCPL */ - hsize_t chsize[64]; /* chunk size in elements */ + int nfilters; /* number of filters in DCPL */ + hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; - int i; - pack_info_t obj; + int i; + pack_info_t obj; *has_filter = 0; - if (rank==0) /* scalar dataset, do not apply */ + if (rank == 0) /* scalar dataset, do not apply */ return 0; /*------------------------------------------------------------------------- @@ -243,11 +217,11 @@ int apply_filters(const char* name, /* object name from traverse list */ * find options *------------------------------------------------------------------------- */ - if (aux_assign_obj(name,options,&obj)==0) + if (aux_assign_obj(name, options, &obj) == 0) return 0; /* get information about input filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) return -1; /*------------------------------------------------------------------------- @@ -256,10 +230,9 @@ int apply_filters(const char* name, /* object name from traverse list */ * only remove if we are inserting new ones *------------------------------------------------------------------------- */ - if (nfilters && obj.nfilters ) - { + if (nfilters && obj.nfilters) { *has_filter = 1; - if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0) + if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) return -1; } @@ -268,18 +241,16 @@ int apply_filters(const char* name, /* object name from traverse list */ * read it only if there is not a requested layout *------------------------------------------------------------------------- */ - if (obj.layout == -1 ) - { - if ((layout = H5Pget_layout(dcpl_id))<0) + if (obj.layout == -1) { + if ((layout = H5Pget_layout(dcpl_id)) < 0) return -1; - if (layout == H5D_CHUNKED) - { - if ((rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize/*out*/))<0) + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) return -1; obj.layout = H5D_CHUNKED; obj.chunk.rank = rank; - for ( i = 0; i < rank; i++) + for (i = 0; i < rank; i++) obj.chunk.chunk_lengths[i] = chsize[i]; } } @@ -297,19 +268,15 @@ int apply_filters(const char* name, /* object name from traverse list */ *------------------------------------------------------------------------- */ - if (obj.nfilters) - { - - /*------------------------------------------------------------------------- - * filters require CHUNK layout; if we do not have one define a default - *------------------------------------------------------------------------- - */ - if (obj.layout==-1) - { - + if (obj.nfilters) { + /*------------------------------------------------------------------------- + * filters require CHUNK layout; if we do not have one define a default + *------------------------------------------------------------------------- + */ + if (obj.layout == -1) { /* stripmine info */ hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ - hsize_t sm_nbytes; /*bytes per stripmine */ + hsize_t sm_nbytes; /*bytes per stripmine */ obj.chunk.rank = rank; @@ -318,38 +285,29 @@ int apply_filters(const char* name, /* object name from traverse list */ * a hyperslab whose size is manageable. */ - - sm_nbytes = msize; - for ( i = rank; i > 0; --i) - { + for (i = rank; i > 0; --i) { hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ + if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ size = 1; sm_size[i - 1] = MIN(dims[i - 1], size); sm_nbytes *= sm_size[i - 1]; HDassert(sm_nbytes > 0); - } - for ( i = 0; i < rank; i++) - { + for (i = 0; i < rank; i++) { obj.chunk.chunk_lengths[i] = sm_size[i]; } - } - for ( i=0; i=0) - { + if (obj.layout >= 0) { /* a layout was defined */ - if (H5Pset_layout(dcpl_id, obj.layout)<0) + if (H5Pset_layout(dcpl_id, obj.layout) < 0) return -1; - if (H5D_CHUNKED == obj.layout) - { - if(H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths)<0) + if (H5D_CHUNKED == obj.layout) { + if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) return -1; } - else if (H5D_COMPACT == obj.layout) - { - if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY)<0) + else if (H5D_COMPACT == obj.layout) { + if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) return -1; } /* remove filters for the H5D_CONTIGUOUS case */ - else if (H5D_CONTIGUOUS == obj.layout) - { - if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0) + else if (H5D_CONTIGUOUS == obj.layout) { + if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) return -1; } } - return 0; + return 0; } diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index e1f13fd..a8c8475 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -93,7 +93,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " -f FILT, --filter=FILT Filter type\n"); PRINTVALSTREAM(rawoutstream, " -l LAYT, --layout=LAYT Layout type\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, " M - is an integer greater than 1, size of dataset in bytes (default is 0) \n"); + PRINTVALSTREAM(rawoutstream, " M - is an integer greater than 1, size of dataset in bytes (default is 0)\n"); PRINTVALSTREAM(rawoutstream, " E - is a filename.\n"); PRINTVALSTREAM(rawoutstream, " S - is an integer\n"); PRINTVALSTREAM(rawoutstream, " U - is a filename.\n"); @@ -134,8 +134,8 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " NBIT (no parameter)\n"); PRINTVALSTREAM(rawoutstream, " SOFF= scale_factor is an integer and scale_type\n"); PRINTVALSTREAM(rawoutstream, " is either IN or DS\n"); - PRINTVALSTREAM(rawoutstream, " UD=\n"); - PRINTVALSTREAM(rawoutstream, " required values for filter_number,cd_value_count,value_1\n"); + PRINTVALSTREAM(rawoutstream, " UD=\n"); + PRINTVALSTREAM(rawoutstream, " required values for filter_number,filter_flag,cd_value_count,value_1\n"); PRINTVALSTREAM(rawoutstream, " optional values for value_2 to value_N\n"); PRINTVALSTREAM(rawoutstream, " NONE (no parameter)\n"); PRINTVALSTREAM(rawoutstream, "\n"); @@ -179,7 +179,7 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,1,9 file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,0,1,9 file1 file2 \n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add bzip2 filter to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index a9a890d..4d62723 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -42,7 +42,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, size_t i, m, u; char c; size_t len = HDstrlen(str); - int k, l, p, q, end_obj = -1, no_param = 0; + int f, k, l, p, q, end_obj = -1, no_param = 0; unsigned j, n; char sobj[MAX_NC_NAME]; char scomp[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -209,13 +209,14 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, /*------------------------------------------------------------------------- * User Defined - * has the format UD= + * has the format UD= * BZIP2 example - * UD=307,1,9 + * UD=307,0,1,9 *------------------------------------------------------------------------- */ else if (HDstrcmp(scomp, "UD") == 0) { l = -1; /* filter number index check */ + f = -1; /* filter flag index check */ p = -1; /* CD_VAL count check */ for (m = 0, q = 0, u = i + 1; u < len; u++, m++, q++) { if (str[u] == ',') { @@ -224,6 +225,10 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, filt->filtn = HDatoi(stype); l = 0; } + else if (f == -1) { + filt->filt_flag = HDstrtoul(stype, NULL, 0); + f = 0; + } else if (p == -1) { filt->cd_nelmts = HDstrtoull(stype, NULL, 0); p = 0; @@ -240,6 +245,12 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, error_msg("filter number parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } + else if (!HDisdigit(c) && f == -1) { + if (obj_list) + HDfree(obj_list); + error_msg("filter flag parameter is not a digit in <%s>\n", str); + HDexit(EXIT_FAILURE); + } stype[q] = c; } /* for u */ stype[q] = '\0'; diff --git a/tools/h5repack/h5repack_plugin.sh.in b/tools/h5repack/h5repack_plugin.sh.in index eaf6917..f21da3d 100644 --- a/tools/h5repack/h5repack_plugin.sh.in +++ b/tools/h5repack/h5repack_plugin.sh.in @@ -1,10 +1,10 @@ #! /bin/sh # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from @@ -247,10 +247,10 @@ COPY_TESTFILES_TO_TESTDIR version_str=`echo @H5_VERSION@ | awk -F"-" '{print $1}' | sed 's/\./,/g'` # Run the test -arg="h5repack_layout.h5 -v -f UD=260,4,9,$version_str" +arg="h5repack_layout.h5 -v -f UD=260,0,4,9,$version_str" TOOLTEST_DUMP plugin_version_test $arg -arg="h5repack_layout.h5 -v -f UD=257,1,9" +arg="h5repack_layout.h5 -v -f UD=257,0,1,9" TOOLTEST_DUMP plugin_test $arg #arg="h5repack_layout.UD.h5 -v -f NONE" diff --git a/tools/h5repack/testfiles/h5repack-help.txt b/tools/h5repack/testfiles/h5repack-help.txt index b9157d7..337e004 100644 --- a/tools/h5repack/testfiles/h5repack-help.txt +++ b/tools/h5repack/testfiles/h5repack-help.txt @@ -22,7 +22,7 @@ usage: h5repack [OPTIONS] file1 file2 -f FILT, --filter=FILT Filter type -l LAYT, --layout=LAYT Layout type - M - is an integer greater than 1, size of dataset in bytes (default is 0) + M - is an integer greater than 1, size of dataset in bytes (default is 0) E - is a filename. S - is an integer U - is a filename. @@ -63,8 +63,8 @@ usage: h5repack [OPTIONS] file1 file2 NBIT (no parameter) SOFF= scale_factor is an integer and scale_type is either IN or DS - UD= - required values for filter_number,cd_value_count,value_1 + UD= + required values for filter_number,filter_flag,cd_value_count,value_1 optional values for value_2 to value_N NONE (no parameter) @@ -99,16 +99,16 @@ Examples of use: Chunked layout, with a layout size of 20x10, to objects dset1 and dset2 and remove filters to objects dset3, dset4, dset5 -4) h5repack -L -c 10 -s 20:dtype file1 file2 +4) h5repack -L -c 10 -s 20:dtype file1 file2 Using latest file format with maximum compact group size of 10 and and minimum shared datatype size of 20 -5) h5repack -f SHUF -f GZIP=1 file1 file2 +5) h5repack -f SHUF -f GZIP=1 file1 file2 Add both filters SHUF and GZIP in this order to all datasets -6) h5repack -f UD=307,1,9 file1 file2 +6) h5repack -f UD=307,0,1,9 file1 file2 Add bzip2 filter to all datasets -- cgit v0.12 From f21284ae8d8be55f434006eac98d6739a3b5aa31 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 15:34:46 -0500 Subject: HDFFV-9774 Add note to new argument --- release_docs/RELEASE.txt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4907706..0b89aae 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -72,7 +72,14 @@ New Features Tools ----- - - None + - h5diff + + h5diff now supports the 'enable-error-stack' argument. + + Improved h5diff by adding the enable-error-stack argument. + This will capture any H5E error traces to stderr. + + (ADB - 2017/08/31, HDFFV-9774) High-Level APIs @@ -97,7 +104,7 @@ New Features Users wanted to read compressed data directly from a file without any processing by the HDF5 data transfer pipeline, just as they were able to write it directly to a file with H5DOwrite_chunk. - + New API function, corresponding to existing function H5DOwrite_chunk. H5DOread_chunk reads a raw data chunk directly from a chunked dataset in the file into the application buffer, bypassing the library’s internal @@ -351,10 +358,10 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== - The dynamically loaded plugin test libraries require undefined references + The dynamically loaded plugin test libraries require undefined references to HDF5 functions to be resolved at runtime in order to function properly. - With autotools on CYGWIN this results in build errors, and we have not - found a solution that satisfies both. Therefore the dynamically loaded + With autotools on CYGWIN this results in build errors, and we have not + found a solution that satisfies both. Therefore the dynamically loaded plugin tests have been disabled on CYGWIN. Known problems in previous releases can be found in the HISTORY*.txt files -- cgit v0.12 From a8a6f2ef5c0e0e854e70ecc05fbc31ab059ca0fc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 15:49:21 -0500 Subject: HDFFV-10276 Correct note of change in UD parameters --- release_docs/RELEASE.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 0b89aae..2c2f0ac 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -72,15 +72,7 @@ New Features Tools ----- - - h5diff - - h5diff now supports the 'enable-error-stack' argument. - - Improved h5diff by adding the enable-error-stack argument. - This will capture any H5E error traces to stderr. - - (ADB - 2017/08/31, HDFFV-9774) - + - High-Level APIs --------------- @@ -143,6 +135,15 @@ Bug Fixes since HDF5-1.8.19 Tools ----- + - h5repack + + h5repack always set the User Defined filter flag to H5Z_FLAG_MANDATORY. + + Added another parameter to the 'UD=' option to set the flag by default + to '0' or H5Z_FLAG_MANDATORY, the other choice is '1' or H5Z_FLAG_OPTIONAL. + + (ADB - 2017/08/31, HDFFV-10276) + - h5ls h5ls generated error on stack when it encountered a H5S_NULL -- cgit v0.12 From fb9eeb98cf2bb38d30f7b6ac27c423131609d621 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 15:50:27 -0500 Subject: HDFFV-10276 correct typo --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 2c2f0ac..63e503b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -72,7 +72,7 @@ New Features Tools ----- - - + - None High-Level APIs --------------- -- cgit v0.12 From a2ee9660992ab313664fdca866a69e35a859ed5f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 31 Aug 2017 15:51:07 -0500 Subject: HDFFV-10276 add whitespace --- release_docs/RELEASE.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 63e503b..622e632 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -74,6 +74,7 @@ New Features ----- - None + High-Level APIs --------------- - None -- cgit v0.12 From e964568753bcdca01af1bdc0d8b5ee6f4d314243 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 3 Sep 2017 20:46:16 -0500 Subject: Snapshot version 1.8 release 20 (snap3) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- hl/src/H5LTparse.c | 144 +++++++++++++++++----------------- hl/src/H5LTparse.h | 4 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 +- 8 files changed, 81 insertions(+), 81 deletions(-) diff --git a/README.txt b/README.txt index 325f032..f585d8d 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap3 currently under development +HDF5 version 1.8.20-snap4 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 9e5eb1e..1174e9b 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap3, currently under development" +PROJECT_NUMBER = "1.8.20-snap4, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 2af9f4d..846fed2 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap3") +set (CTEST_SOURCE_VERSEXT "-snap4") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index f5ab39b..7338294 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap3], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap4], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 16a0bcf..2a0f267 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 7481a45..2af0172 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4907706..269c19e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap3 currently under development +HDF5 version 1.8.20-snap4 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 8bd583f..90ffb73 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap3" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap4" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap3" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap4" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From ccb68f709181942106eef92e3f39575add1792e6 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 22 Aug 2017 01:36:20 -0500 Subject: Fix for HDFFV-10216 segfault in H5G_node_cmp3 with corrupt h5 file Fix H5HL_offset_into() to return error when offset exceeds heap data block size. Also fix other places that call this routine to detect error return. --- MANIFEST | 2 + src/H5Gent.c | 20 +- src/H5Glink.c | 12 +- src/H5Gnode.c | 748 +++++++++++++++++++++++++------------------------- src/H5Gstab.c | 16 +- src/H5HL.c | 15 +- src/H5Oefl.c | 47 ++-- test/CMakeTests.cmake | 2 + test/Makefile.am | 2 +- test/bad_offset.h5 | Bin 0 -> 3312 bytes test/gen_bad_offset.c | 112 ++++++++ test/tmisc.c | 55 ++++ 12 files changed, 612 insertions(+), 419 deletions(-) create mode 100644 test/bad_offset.h5 create mode 100644 test/gen_bad_offset.c diff --git a/MANIFEST b/MANIFEST index 16900d2..22e7317 100644 --- a/MANIFEST +++ b/MANIFEST @@ -831,6 +831,7 @@ ./test/accum.c ./test/app_ref.c ./test/bad_compound.h5 +./test/bad_offset.h5 ./test/be_data.h5 ./test/be_extlink1.h5 ./test/be_extlink2.h5 @@ -876,6 +877,7 @@ ./test/fixed_idx.h5 ./test/flush1.c ./test/flush2.c +./test/gen_bad_offset.c ./test/gen_bad_ohdr.c ./test/gen_bad_compound.c ./test/gen_bogus.c diff --git a/src/H5Gent.c b/src/H5Gent.c index 05e8b3c..bb6aa38 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -541,8 +541,8 @@ herr_t H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, const H5HL_t *heap) { - const char *lval = NULL; - int nested_indent, nested_fwidth; + const char *lval = NULL; + int nested_indent, nested_fwidth; FUNC_ENTER_PACKAGE_NOERR @@ -551,14 +551,14 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, nested_fwidth = MAX(0, fwidth - 3); HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Name offset into private heap:", - (unsigned long) (ent->name_off)); + "Name offset into private heap:", + (unsigned long) (ent->name_off)); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, - "Object header address:", ent->header); + "Object header address:", ent->header); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, - "Cache info type:"); + "Cache info type:"); switch(ent->type) { case H5G_NOTHING_CACHED: HDfprintf(stream, "Nothing Cached\n"); @@ -581,13 +581,13 @@ H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Cached information:"); HDfprintf(stream, "%*s%-*s %lu\n", nested_indent, "", nested_fwidth, - "Link value offset:", - (unsigned long)(ent->cache.slink.lval_offset)); + "Link value offset:", + (unsigned long)(ent->cache.slink.lval_offset)); if(heap) { lval = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset); HDfprintf(stream, "%*s%-*s %s\n", nested_indent, "", nested_fwidth, - "Link value:", - lval); + "Link value:", + (lval == NULL) ? "" : lval); } /* end if */ else HDfprintf(stream, "%*s%-*s\n", nested_indent, "", nested_fwidth, "Warning: Invalid heap address given, name not displayed!"); diff --git a/src/H5Glink.c b/src/H5Glink.c index 7b99207..fe49458 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -224,7 +224,9 @@ herr_t H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, const char *name) { - FUNC_ENTER_PACKAGE_NOERR + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(lnk); @@ -243,7 +245,8 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, if(ent->type == H5G_CACHED_SLINK) { const char *s; /* Pointer to link value */ - s = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset); + if((s = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset)) == NULL) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") HDassert(s); /* Copy the link value */ @@ -260,7 +263,10 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, lnk->type = H5L_TYPE_HARD; } /* end else */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + if(ret_value < 0 && lnk->name) + H5MM_xfree(lnk->name); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__ent_to_link() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 12e0d5e..7de9ec9 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -13,14 +13,14 @@ /*------------------------------------------------------------------------- * - * Created: H5Gnode.c - * Jun 26 1997 - * Robb Matzke + * Created: H5Gnode.c + * Jun 26 1997 + * Robb Matzke * - * Purpose: Functions for handling symbol table nodes. A - * symbol table node is a small collection of symbol - * table entries. A B-tree usually points to the - * symbol table nodes for any given symbol table. + * Purpose: Functions for handling symbol table nodes. A + * symbol table node is a small collection of symbol + * table entries. A B-tree usually points to the + * symbol table nodes for any given symbol table. * *------------------------------------------------------------------------- */ @@ -35,16 +35,16 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Gpkg.h" /* Groups */ -#include "H5HLprivate.h" /* Local Heaps */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Ppublic.h" /* Property Lists */ +#include "H5private.h" /* Generic Functionsi */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Gpkg.h" /* Groups */ +#include "H5HLprivate.h" /* Local Heaps */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Ppublic.h" /* Property Lists */ /****************/ @@ -77,20 +77,16 @@ typedef struct H5G_node_key_t { /* B-tree callbacks */ static H5RC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata); static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, void *_lt_key, - void *_udata, void *_rt_key, - haddr_t *addr_p/*out*/); + void *_udata, void *_rt_key, haddr_t *addr_p/*out*/); static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key); static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key); static htri_t H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key, - void *_udata); + void *_udata); static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, - hbool_t *lt_key_changed, void *_md_key, - void *_udata, void *_rt_key, - hbool_t *rt_key_changed, - haddr_t *new_node_p/*out*/); + hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, + hbool_t *rt_key_changed, haddr_t *new_node_p/*out*/); static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *lt_key, - hbool_t *lt_key_changed, void *udata, - void *rt_key, hbool_t *rt_key_changed); + hbool_t *lt_key_changed, void *udata, void *rt_key, hbool_t *rt_key_changed); static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, @@ -103,21 +99,21 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, /* H5G inherits B-tree like properties from H5B */ H5B_class_t H5B_SNODE[1] = {{ - H5B_SNODE_ID, /*id */ - sizeof(H5G_node_key_t), /*sizeof_nkey */ - H5G_node_get_shared, /*get_shared */ - H5G_node_create, /*new */ - H5G_node_cmp2, /*cmp2 */ - H5G_node_cmp3, /*cmp3 */ - H5G_node_found, /*found */ - H5G_node_insert, /*insert */ - TRUE, /*follow min branch? */ - TRUE, /*follow max branch? */ - H5B_RIGHT, /*critical key */ - H5G_node_remove, /*remove */ - H5G_node_decode_key, /*decode */ - H5G_node_encode_key, /*encode */ - H5G_node_debug_key, /*debug */ + H5B_SNODE_ID, /*id */ + sizeof(H5G_node_key_t), /*sizeof_nkey */ + H5G_node_get_shared, /*get_shared */ + H5G_node_create, /*new */ + H5G_node_cmp2, /*cmp2 */ + H5G_node_cmp3, /*cmp3 */ + H5G_node_found, /*found */ + H5G_node_insert, /*insert */ + TRUE, /*follow min branch? */ + TRUE, /*follow max branch? */ + H5B_RIGHT, /*critical key */ + H5G_node_remove, /*remove */ + H5G_node_decode_key, /*decode */ + H5G_node_encode_key, /*encode */ + H5G_node_debug_key /*debug */ }}; /* Declare a free list to manage the H5G_node_t struct */ @@ -138,17 +134,16 @@ H5FL_SEQ_DEFINE(H5G_entry_t); /*------------------------------------------------------------------------- - * Function: H5G_node_get_shared + * Function: H5G_node_get_shared * - * Purpose: Returns the shared B-tree info for the specified UDATA. + * Purpose: Returns the shared B-tree info for the specified UDATA. * - * Return: Success: Pointer to the raw B-tree page for this - file's groups + * Return: Success: Pointer to the raw B-tree page for this file's groups * - * Failure: Can't fail + * Failure: Can't fail * - * Programmer: Robb Matzke - * Wednesday, October 8, 1997 + * Programmer: Robb Matzke + * Wednesday, October 8, 1997 * * Modifications: * @@ -167,22 +162,22 @@ H5G_node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) /*------------------------------------------------------------------------- - * Function: H5G_node_decode_key + * Function: H5G_node_decode_key * - * Purpose: Decodes a raw key into a native key. + * Purpose: Decodes a raw key into a native key. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 8 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 8 1997 * *------------------------------------------------------------------------- */ static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { - H5G_node_key_t *key = (H5G_node_key_t *) _key; + H5G_node_key_t *key = (H5G_node_key_t *) _key; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -199,13 +194,13 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) /*------------------------------------------------------------------------- * Function: H5G_node_encode_key * - * Purpose: Encodes a native key into a raw key. + * Purpose: Encodes a native key into a raw key. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 8 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 8 1997 * *------------------------------------------------------------------------- */ @@ -227,13 +222,13 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) /*------------------------------------------------------------------------- - * Function: H5G_node_debug_key + * Function: H5G_node_debug_key * - * Purpose: Prints a key. + * Purpose: Prints a key. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 28, 2003 * *------------------------------------------------------------------------- @@ -242,7 +237,7 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) { - const H5G_node_key_t *key = (const H5G_node_key_t *) _key; + const H5G_node_key_t *key = (const H5G_node_key_t *) _key; const H5G_bt_common_t *udata = (const H5G_bt_common_t *) _udata; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -250,15 +245,15 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, HDassert(key); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Heap offset:", - (unsigned)key->offset); + (unsigned)key->offset); if(udata->heap) { const char *s; HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Name:"); - s = (const char *)H5HL_offset_into(udata->heap, key->offset); - HDfprintf(stream, "%s\n", s); + if((s = (const char *)H5HL_offset_into(udata->heap, key->offset)) != NULL) + HDfprintf(stream, "%s\n", s); } /* end if */ else HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Cannot get name; heap address not specified\n"); @@ -270,13 +265,13 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, /*------------------------------------------------------------------------- * Function: H5G__node_free * - * Purpose: Destroy a symbol table node in memory. + * Purpose: Destroy a symbol table node in memory. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Jan 15 2003 * *------------------------------------------------------------------------- */ @@ -305,29 +300,29 @@ H5G__node_free(H5G_node_t *sym) * Function: H5G_node_create * * Purpose: Creates a new empty symbol table node. This function is - * called by the B-tree insert function for an empty tree. It - * is also called internally to split a symbol node with LT_KEY - * and RT_KEY null pointers. + * called by the B-tree insert function for an empty tree. It + * is also called internally to split a symbol node with LT_KEY + * and RT_KEY null pointers. * - * Return: Success: Non-negative. The address of symbol table - * node is returned through the ADDR_P argument. + * Return: Success: Non-negative. The address of symbol table + * node is returned through the ADDR_P argument. * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 23 1997 * *------------------------------------------------------------------------- */ static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, - void H5_ATTR_UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/) + void H5_ATTR_UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/) { - H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; - H5G_node_t *sym = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; + H5G_node_t *sym = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -338,15 +333,15 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_ HDassert(H5B_INS_FIRST == op); if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") sym->node_size = H5G_NODE_SIZE(f); if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)sym->node_size))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space") if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) - HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "memory allocation failed") if(H5AC_insert_entry(f, dxpl_id, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node") + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node") /* * The left and right symbols in an empty tree are both the * empty string stored at offset zero by the H5G functions. This @@ -375,36 +370,36 @@ done: * Function: H5G_node_cmp2 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY). - * The UDATA pointer supplies extra data not contained in the - * keys (in this case, the heap address). + * The UDATA pointer supplies extra data not contained in the + * keys (in this case, the heap address). * - * Return: Success: negative if LT_KEY is less than RT_KEY. + * Return: Success: negative if LT_KEY is less than RT_KEY. * - * positive if LT_KEY is greater than RT_KEY. + * positive if LT_KEY is greater than RT_KEY. * - * zero if LT_KEY and RT_KEY are equal. + * zero if LT_KEY and RT_KEY are equal. * - * Failure: FAIL (same as LT_KEYheap); @@ -416,12 +411,15 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(base); /* Get pointers to string names */ - s1 = base + lt_key->offset; - s2 = base + rt_key->offset; + if((s1 = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") + if((s2 = (const char *)H5HL_offset_into(udata->heap, rt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") /* Set return value */ ret_value = HDstrcmp(s1, s2); +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5G_node_cmp2() */ @@ -430,40 +428,40 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) * Function: H5G_node_cmp3 * * Purpose: Compares two keys from a B-tree node (LT_KEY and RT_KEY) - * against another key (not necessarily the same type) - * pointed to by UDATA. + * against another key (not necessarily the same type) + * pointed to by UDATA. * - * Return: Success: negative if the UDATA key is less than - * or equal to the LT_KEY + * Return: Success: negative if the UDATA key is less than + * or equal to the LT_KEY * - * positive if the UDATA key is greater - * than the RT_KEY. + * positive if the UDATA key is greater + * than the RT_KEY. * - * zero if the UDATA key falls between - * the LT_KEY (exclusive) and the - * RT_KEY (inclusive). + * zero if the UDATA key falls between + * the LT_KEY (exclusive) and the + * RT_KEY (inclusive). * - * Failure: FAIL (same as UDATA < LT_KEY) + * Failure: FAIL (same as UDATA < LT_KEY) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 23 1997 * * Modifications: * *------------------------------------------------------------------------- */ -static int +static herr_t H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) { - H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; - H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; - const char *s; - const char *base; /* Base of heap */ - int ret_value = 0; /* Return value */ + H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata; + H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; + const char *s; + const char *base; /* Base of heap */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(udata && udata->heap); @@ -475,43 +473,46 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) HDassert(base); /* left side */ - s = base + lt_key->offset; + if((s = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") if(HDstrcmp(udata->name, s) <= 0) - ret_value = (-1); + ret_value = (-1); else { /* right side */ - s = base + rt_key->offset; + if((s = (const char *)H5HL_offset_into(udata->heap, rt_key->offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") if(HDstrcmp(udata->name, s) > 0) ret_value = 1; } /* end else */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_cmp3() */ /*------------------------------------------------------------------------- - * Function: H5G_node_found + * Function: H5G_node_found * - * Purpose: The B-tree search engine has found the symbol table node - * which contains the requested symbol if the symbol exists. - * This function should examine that node for the symbol and - * return information about the symbol through the UDATA - * structure which contains the symbol name on function - * entry. + * Purpose: The B-tree search engine has found the symbol table node + * which contains the requested symbol if the symbol exists. + * This function should examine that node for the symbol and + * return information about the symbol through the UDATA + * structure which contains the symbol name on function + * entry. * - * If the operation flag in UDATA is H5G_OPER_FIND, then - * the entry is copied from the symbol table to the UDATA - * entry field. Otherwise the entry is copied from the - * UDATA entry field to the symbol table. + * If the operation flag in UDATA is H5G_OPER_FIND, then + * the entry is copied from the symbol table to the UDATA + * entry field. Otherwise the entry is copied from the + * UDATA entry field to the symbol table. * - * Return: Success: Non-negative (TRUE/FALSE) if found and data - * returned through the UDATA pointer. + * Return: Success: Non-negative (TRUE/FALSE) if found and data + * returned through the UDATA pointer. * - * Failure: Negative if not found. + * Failure: Negative if not found. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 23 1997 * *------------------------------------------------------------------------- */ @@ -519,13 +520,13 @@ static htri_t H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { - H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; - H5G_node_t *sn = NULL; - unsigned lt = 0, idx = 0, rt; - int cmp = 1; - const char *s; - const char *base; /* Base of heap */ - htri_t ret_value = TRUE; /* Return value */ + H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; + H5G_node_t *sn = NULL; + unsigned lt = 0, idx = 0, rt; + int cmp = 1; + const char *s; + const char *base; /* Base of heap */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -540,7 +541,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED * Load the symbol table node for exclusive access. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") /* Get base address of heap */ base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); @@ -551,14 +552,16 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED */ rt = sn->nsyms; while(lt < rt && cmp) { - idx = (lt + rt) / 2; - s = base + sn->entry[idx].name_off; - cmp = HDstrcmp(udata->common.name, s); - - if (cmp < 0) - rt = idx; - else - lt = idx + 1; + idx = (lt + rt) / 2; + + if((s = (const char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") + cmp = HDstrcmp(udata->common.name, s); + + if (cmp < 0) + rt = idx; + else + lt = idx + 1; } /* end while */ if(cmp) @@ -570,43 +573,41 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED done: if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_found() */ /*------------------------------------------------------------------------- - * Function: H5G_node_insert + * Function: H5G_node_insert * - * Purpose: The B-tree insertion engine has found the symbol table node - * which should receive the new symbol/address pair. This - * function adds it to that node unless it already existed. + * Purpose: The B-tree insertion engine has found the symbol table node + * which should receive the new symbol/address pair. This + * function adds it to that node unless it already existed. * - * If the node has no room for the symbol then the node is - * split into two nodes. The original node contains the - * low values and the new node contains the high values. - * The new symbol table entry is added to either node as - * appropriate. When a split occurs, this function will - * write the maximum key of the low node to the MID buffer - * and return the address of the new node. + * If the node has no room for the symbol then the node is + * split into two nodes. The original node contains the + * low values and the new node contains the high values. + * The new symbol table entry is added to either node as + * appropriate. When a split occurs, this function will + * write the maximum key of the low node to the MID buffer + * and return the address of the new node. * - * If the new key is larger than RIGHT then update RIGHT - * with the new key. + * If the new key is larger than RIGHT then update RIGHT + * with the new key. * - * Return: Success: An insertion command for the caller, one of - * the H5B_INS_* constants. The address of the - * new node, if any, is returned through the - * NEW_NODE_P argument. NEW_NODE_P might not be - * initialized if the return value is - * H5B_INS_NOOP. + * Return: Success: An insertion command for the caller, one of + * the H5B_INS_* constants. The address of the + * new node, if any, is returned through the + * NEW_NODE_P argument. NEW_NODE_P might not be + * initialized if the return value is H5B_INS_NOOP. * - * Failure: H5B_INS_ERROR, NEW_NODE_P might not be - * initialized. + * Failure: H5B_INS_ERROR, NEW_NODE_P might not be initialized. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 24 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 24 1997 * *------------------------------------------------------------------------- */ @@ -617,18 +618,18 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p) { - H5G_node_key_t *md_key = (H5G_node_key_t *) _md_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; - H5G_bt_ins_t *udata = (H5G_bt_ins_t *) _udata; - H5G_node_t *sn = NULL, *snrt = NULL; - unsigned sn_flags = H5AC__NO_FLAGS_SET, snrt_flags = H5AC__NO_FLAGS_SET; - const char *s; - const char *base; /* Base of heap */ - unsigned lt = 0, rt; /* Binary search cntrs */ - int cmp = 1, idx = -1; - H5G_node_t *insert_into = NULL; /*node that gets new entry*/ - H5G_entry_t ent; /* Entry to insert in node */ - H5B_ins_t ret_value = H5B_INS_ERROR; + H5G_node_key_t *md_key = (H5G_node_key_t *) _md_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; + H5G_bt_ins_t *udata = (H5G_bt_ins_t *) _udata; + H5G_node_t *sn = NULL, *snrt = NULL; + unsigned sn_flags = H5AC__NO_FLAGS_SET, snrt_flags = H5AC__NO_FLAGS_SET; + const char *s; + const char *base; /* Base of heap */ + unsigned lt = 0, rt; /* Binary search cntrs */ + int cmp = 1, idx = -1; + H5G_node_t *insert_into = NULL; /*node that gets new entry*/ + H5G_entry_t ent; /* Entry to insert in node */ + H5B_ins_t ret_value = H5B_INS_ERROR; FUNC_ENTER_NOAPI_NOINIT @@ -646,7 +647,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, * Load the symbol node. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_WRITE))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* Get base address of heap */ base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); @@ -657,85 +658,86 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, */ rt = sn->nsyms; while(lt < rt) { - idx = (int)((lt + rt) / 2); - s = base + sn->entry[idx].name_off; + idx = (int)((lt + rt) / 2); + if((s = (const char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") /* Check if symbol is already present */ - if(0 == (cmp = HDstrcmp(udata->common.name, s))) + if(0 == (cmp = HDstrcmp(udata->common.name, s))) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5B_INS_ERROR, "symbol is already present in symbol table") - if (cmp < 0) - rt = (unsigned)idx; - else - lt = (unsigned)(idx + 1); + if (cmp < 0) + rt = (unsigned)idx; + else + lt = (unsigned)(idx + 1); } /* end while */ idx += cmp > 0 ? 1 : 0; /* Convert link information & name to symbol table entry */ if(H5G__ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, udata->lnk, udata->obj_type, udata->crt_info, &ent) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") + HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") /* Determine where to place entry in node */ if(sn->nsyms >= 2 * H5F_SYM_LEAF_K(f)) { - /* - * The node is full. Split it into a left and right - * node and return the address of the new right node (the - * left node is at the same address as the original node). - */ - ret_value = H5B_INS_RIGHT; - - /* The right node */ - if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node") - - if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, f, H5AC_WRITE))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node") - - HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), - H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); - snrt->nsyms = H5F_SYM_LEAF_K(f); + /* + * The node is full. Split it into a left and right + * node and return the address of the new right node (the + * left node is at the same address as the original node). + */ + ret_value = H5B_INS_RIGHT; + + /* The right node */ + if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node") + + if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, f, H5AC_WRITE))) + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node") + + HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), + H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); + snrt->nsyms = H5F_SYM_LEAF_K(f); snrt_flags |= H5AC__DIRTIED_FLAG; - /* The left node */ - HDmemset(sn->entry + H5F_SYM_LEAF_K(f), 0, - H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); - sn->nsyms = H5F_SYM_LEAF_K(f); + /* The left node */ + HDmemset(sn->entry + H5F_SYM_LEAF_K(f), 0, + H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); + sn->nsyms = H5F_SYM_LEAF_K(f); sn_flags |= H5AC__DIRTIED_FLAG; - /* The middle key */ - md_key->offset = sn->entry[sn->nsyms - 1].name_off; + /* The middle key */ + md_key->offset = sn->entry[sn->nsyms - 1].name_off; - /* Where to insert the new entry? */ - if(idx <= (int)H5F_SYM_LEAF_K(f)) { - insert_into = sn; - if(idx == (int)H5F_SYM_LEAF_K(f)) - md_key->offset = ent.name_off; - } /* end if */ + /* Where to insert the new entry? */ + if(idx <= (int)H5F_SYM_LEAF_K(f)) { + insert_into = sn; + if(idx == (int)H5F_SYM_LEAF_K(f)) + md_key->offset = ent.name_off; + } /* end if */ else { - idx -= H5F_SYM_LEAF_K(f); - insert_into = snrt; - if(idx == (int)H5F_SYM_LEAF_K(f)) { - rt_key->offset = ent.name_off; - *rt_key_changed = TRUE; - } /* end if */ - } /* end else */ + idx -= H5F_SYM_LEAF_K(f); + insert_into = snrt; + if(idx == (int)H5F_SYM_LEAF_K(f)) { + rt_key->offset = ent.name_off; + *rt_key_changed = TRUE; + } /* end if */ + } /* end else */ } /* end if */ else { - /* Where to insert the new entry? */ - ret_value = H5B_INS_NOOP; + /* Where to insert the new entry? */ + ret_value = H5B_INS_NOOP; sn_flags |= H5AC__DIRTIED_FLAG; - insert_into = sn; - if(idx == (int)sn->nsyms) { - rt_key->offset = ent.name_off; - *rt_key_changed = TRUE; - } /* end if */ + insert_into = sn; + if(idx == (int)sn->nsyms) { + rt_key->offset = ent.name_off; + *rt_key_changed = TRUE; + } /* end if */ } /* end else */ /* Move entries down to make room for new entry */ HDassert(idx >= 0); HDmemmove(insert_into->entry + idx + 1, insert_into->entry + idx, - (insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t)); + (insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t)); /* Copy new entry into table */ H5G__ent_copy(&(insert_into->entry[idx]), &ent, H5_COPY_SHALLOW); @@ -745,56 +747,56 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, done: if(snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, snrt_flags) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_insert() */ /*------------------------------------------------------------------------- - * Function: H5G_node_remove + * Function: H5G_node_remove * - * Purpose: The B-tree removal engine has found the symbol table node - * which should contain the name which is being removed. This - * function removes the name from the symbol table and - * decrements the link count on the object to which the name - * points. + * Purpose: The B-tree removal engine has found the symbol table node + * which should contain the name which is being removed. This + * function removes the name from the symbol table and + * decrements the link count on the object to which the name + * points. * - * If the udata->name parameter is set to NULL, then remove - * all entries in this symbol table node. This only occurs - * during the deletion of the entire group, so don't bother - * freeing individual name entries in the local heap, the group's - * symbol table removal code will just free the entire local - * heap eventually. Do reduce the link counts for each object - * however. + * If the udata->name parameter is set to NULL, then remove + * all entries in this symbol table node. This only occurs + * during the deletion of the entire group, so don't bother + * freeing individual name entries in the local heap, the group's + * symbol table removal code will just free the entire local + * heap eventually. Do reduce the link counts for each object + * however. * - * Return: Success: If all names are removed from the symbol - * table node then H5B_INS_REMOVE is returned; - * otherwise H5B_INS_NOOP is returned. + * Return: Success: If all names are removed from the symbol + * table node then H5B_INS_REMOVE is returned; + * otherwise H5B_INS_NOOP is returned. * - * Failure: H5B_INS_ERROR + * Failure: H5B_INS_ERROR * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, September 24, 1998 * *------------------------------------------------------------------------- */ static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, - hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, - void *_udata/*in,out*/, void *_rt_key/*in,out*/, - hbool_t *rt_key_changed/*out*/) + hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, + void *_udata/*in,out*/, void *_rt_key/*in,out*/, + hbool_t *rt_key_changed/*out*/) { - H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; - H5G_bt_rm_t *udata = (H5G_bt_rm_t *)_udata; - H5G_node_t *sn = NULL; - unsigned sn_flags = H5AC__NO_FLAGS_SET; - unsigned lt = 0, rt, idx = 0; - int cmp = 1; - H5B_ins_t ret_value = H5B_INS_ERROR; + H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; + H5G_bt_rm_t *udata = (H5G_bt_rm_t *)_udata; + H5G_node_t *sn = NULL; + unsigned sn_flags = H5AC__NO_FLAGS_SET; + unsigned lt = 0, rt, idx = 0; + int cmp = 1; + H5B_ins_t ret_value = H5B_INS_ERROR; FUNC_ENTER_NOAPI_NOINIT @@ -807,7 +809,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, /* Load the symbol table */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_WRITE))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* "Normal" removal of a single entry from the symbol table node */ if(udata->common.name != NULL) { @@ -824,7 +826,8 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, const char *s; /* Pointer to string in local heap */ idx = (lt + rt) / 2; - s = base + sn->entry[idx].name_off; + if((s = H5HL_offset_into(udata->common.heap, sn->entry[idx].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table name") cmp = HDstrcmp(udata->common.name, s); if(cmp < 0) rt = idx; @@ -846,7 +849,8 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, lnk.cset = H5T_CSET_ASCII; if(sn->entry[idx].type == H5G_CACHED_SLINK) { lnk.type = H5L_TYPE_SOFT; - lnk.u.soft.name = (char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].cache.slink.lval_offset); + if(NULL == (lnk.u.soft.name = (char *)H5HL_offset_into(udata->common.heap, sn->entry[idx].cache.slink.lval_offset))) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get link name") } /* end if */ else { lnk.type = H5L_TYPE_HARD; @@ -960,22 +964,22 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, done: if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_node_remove() */ /*------------------------------------------------------------------------- - * Function: H5G__node_iterate + * Function: H5G__node_iterate * - * Purpose: This function gets called during a group iterate operation. + * Purpose: This function gets called during a group iterate operation. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 24 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 24 1997 * *------------------------------------------------------------------------- */ @@ -983,11 +987,11 @@ int H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { - H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; - H5G_node_t *sn = NULL; - H5G_entry_t *ents; /* Pointer to entries in this node */ - unsigned u; /* Local index variable */ - int ret_value = H5_ITER_CONT; + H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; + H5G_node_t *sn = NULL; + H5G_entry_t *ents; /* Pointer to entries in this node */ + unsigned u; /* Local index variable */ + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1000,7 +1004,7 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h /* Protect the symbol table node & local heap while we iterate over entries */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* * Iterate over the symbol table node entries. @@ -1013,7 +1017,8 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h const char *name; /* Pointer to link name in heap */ /* Get the pointer to the name of the link in the heap */ - name = (const char *)H5HL_offset_into(udata->heap, ents[u].name_off); + if((name = (const char *)H5HL_offset_into(udata->heap, ents[u].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table node name") HDassert(name); /* Convert the entry to a link */ @@ -1043,15 +1048,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__node_iterate() */ - /*------------------------------------------------------------------------- - * Function: H5G__node_sumup + * Function: H5G__node_sumup * - * Purpose: This function gets called during a group iterate operation + * Purpose: This function gets called during a group iterate operation * to return total number of members in the group. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Nov 20, 2002 @@ -1060,11 +1064,11 @@ done: */ int H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *num_objs = (hsize_t *)_udata; - H5G_node_t *sn = NULL; - int ret_value = H5_ITER_CONT; + H5G_node_t *sn = NULL; + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1077,7 +1081,7 @@ H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, had /* Find the object node and add the number of symbol entries. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") *num_objs += sn->nsyms; @@ -1090,12 +1094,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5G__node_by_idx + * Function: H5G__node_by_idx * - * Purpose: This function gets called during a group iterate operation + * Purpose: This function gets called during a group iterate operation * to return object name by giving idx. * - * Return: 0 if object isn't found in this node; 1 if object is found; + * Return: 0 if object isn't found in this node; 1 if object is found; * Negative on failure * * Programmer: Raymond Lu @@ -1105,11 +1109,11 @@ done: */ int H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { - H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; - H5G_node_t *sn = NULL; - int ret_value = H5_ITER_CONT; + H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; + H5G_node_t *sn = NULL; + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1122,7 +1126,7 @@ H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, ha /* Get a pointer to the symbol table node */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node"); + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node"); /* Find the node, locate the object symbol table entry and retrieve the name */ if(udata->idx >= udata->num_objs && udata->idx < (udata->num_objs + sn->nsyms)) { @@ -1151,12 +1155,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5G__node_init + * Function: H5G__node_init * - * Purpose: This function gets called during a file opening to initialize + * Purpose: This function gets called during a file opening to initialize * global information about group B-tree nodes for file. * - * Return: Non-negative on success + * Return: Non-negative on success * Negative on failure * * Programmer: Quincey Koziol @@ -1167,9 +1171,9 @@ done: herr_t H5G__node_init(H5F_t *f) { - H5B_shared_t *shared; /* Shared B-tree node info */ - size_t sizeof_rkey; /* Size of raw (disk) key */ - herr_t ret_value = SUCCEED; /* Return value */ + H5B_shared_t *shared; /* Shared B-tree node info */ + size_t sizeof_rkey; /* Size of raw (disk) key */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1181,14 +1185,14 @@ H5G__node_init(H5F_t *f) /* Allocate & initialize global info for the shared structure */ if(NULL == (shared = H5B_shared_new(f, H5B_SNODE, sizeof_rkey))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info") + HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info") /* Set up the "local" information for this file's groups */ - /* */ + /* */ /* Make shared B-tree info reference counted */ if(H5F_SET_GRP_BTREE_SHARED(f, H5RC_create(shared, H5B_shared_free)) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1196,12 +1200,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_close + * Function: H5G_node_close * - * Purpose: This function gets called during a file close to shutdown + * Purpose: This function gets called during a file close to shutdown * global information about group B-tree nodes for file. * - * Return: Non-negative on success + * Return: Non-negative on success * Negative on failure * * Programmer: Quincey Koziol @@ -1227,12 +1231,12 @@ H5G_node_close(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5G__node_copy + * Function: H5G__node_copy * - * Purpose: This function gets called during a group iterate operation + * Purpose: This function gets called during a group iterate operation * to copy objects of this node into a new location. * - * Return: 0(zero) on success/Negative on failure + * Return: 0(zero) on success/Negative on failure * * Programmer: Peter Cao * Sept 10, 2005 @@ -1241,7 +1245,7 @@ H5G_node_close(const H5F_t *f) */ int H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) + const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_cpy_t *udata = (H5G_bt_it_cpy_t *)_udata; const H5O_loc_t *src_oloc = udata->src_oloc; @@ -1260,7 +1264,7 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* load the symbol table into memory from the source file */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* get the base address of the heap */ if(NULL == (heap = H5HL_protect(f, dxpl_id, udata->src_heap_addr, H5AC_READ))) @@ -1292,7 +1296,8 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Get pointer to link value in local heap */ - link_name = (char *)H5HL_offset_into(heap, tmp_src_ent.cache.slink.lval_offset); + if((link_name = (char *)H5HL_offset_into(heap, tmp_src_ent.cache.slink.lval_offset)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name") /* Check if the object pointed by the soft link exists in the source file */ if(H5G_loc_info(&grp_loc, link_name, FALSE, &oinfo, H5P_DEFAULT, dxpl_id) >= 0) { @@ -1342,7 +1347,8 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* Construct link information for eventual insertion */ lnk.type = H5L_TYPE_SOFT; - lnk.u.soft.name = (char *)H5HL_offset_into(heap, src_ent->cache.slink.lval_offset); + if((lnk.u.soft.name = (char *)H5HL_offset_into(heap, src_ent->cache.slink.lval_offset)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name") } /* else if */ else HDassert(0 && "Unknown entry type"); @@ -1354,8 +1360,9 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* lnk.name = name; */ /* This will be set in callback */ /* Determine name of source object */ - name = (const char *)H5HL_offset_into(heap, src_ent->name_off); - HDassert(name); + if((name = (const char *)H5HL_offset_into(heap, src_ent->name_off)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get source object name") + HDassert(name); /* Insert the new object in the destination file's group */ /* (Don't increment the link count - that's already done above for hard links) */ @@ -1377,15 +1384,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5G__node_build_table + * Function: H5G__node_build_table * - * Purpose: B-link tree callback for building table of links + * Purpose: B-link tree callback for building table of links * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Nov 19 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Nov 19 2006 * *------------------------------------------------------------------------- */ @@ -1393,10 +1400,10 @@ int H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { - H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; - H5G_node_t *sn = NULL; /* Symbol table node */ - unsigned u; /* Local index variable */ - int ret_value = H5_ITER_CONT; + H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; + H5G_node_t *sn = NULL; /* Symbol table node */ + unsigned u; /* Local index variable */ + int ret_value = H5_ITER_CONT; FUNC_ENTER_PACKAGE @@ -1412,7 +1419,7 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke * because we're about to call an application function. */ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check if the link table needs to be extended */ if((udata->ltable->nlinks + sn->nsyms) >= udata->alloc_nlinks) { @@ -1431,7 +1438,8 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke size_t linkno; /* Link allocated */ /* Get pointer to link's name in the heap */ - name = (const char *)H5HL_offset_into(udata->heap, sn->entry[u].name_off); + if((name = (const char *)H5HL_offset_into(udata->heap, sn->entry[u].name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table link name") HDassert(name); /* Determine the link to operate on in the table */ @@ -1465,8 +1473,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t H5_ATTR_UNUSED addr, - const void H5_ATTR_UNUSED *_rt_key, void *_udata) +H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATTR_UNUSED *_lt_key, + haddr_t H5_ATTR_UNUSED addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *stab_size = (hsize_t *)_udata; /* User data */ @@ -1483,16 +1491,16 @@ H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATT /*------------------------------------------------------------------------- - * Function: H5G_node_debug + * Function: H5G_node_debug * - * Purpose: Prints debugging information about a symbol table node - * or a B-tree node for a symbol table B-tree. + * Purpose: Prints debugging information about a symbol table node + * or a B-tree node for a symbol table B-tree. * - * Return: 0(zero) on success/Negative on failure + * Return: 0(zero) on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 4 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 4 1997 * *------------------------------------------------------------------------- */ @@ -1500,10 +1508,10 @@ herr_t H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth, haddr_t heap_addr) { - H5G_node_t *sn = NULL; - H5HL_t *heap = NULL; - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + H5G_node_t *sn = NULL; + H5HL_t *heap = NULL; + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1530,8 +1538,8 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, H5E_clear_stack(NULL); /* discard that error */ udata.heap = heap; - if(H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); + if(H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); } /* end if */ else { fprintf(stream, "%*sSymbol Table Node...\n", indent, ""); @@ -1564,7 +1572,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, done: if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") + HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") diff --git a/src/H5Gstab.c b/src/H5Gstab.c index f9a8884..01dbdbc 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -707,11 +707,12 @@ done: static herr_t H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) { - H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; + H5G_bt_it_gnbi_t *udata = (H5G_bt_it_gnbi_t *)_udata; size_t name_off; /* Offset of name in heap */ const char *name; /* Pointer to name string in heap */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(ent); @@ -719,12 +720,16 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) /* Get name offset in heap */ name_off = ent->name_off; - name = (const char *)H5HL_offset_into(udata->heap, name_off); + + if((name = (const char *)H5HL_offset_into(udata->heap, name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") + HDassert(name); udata->name = H5MM_strdup(name); HDassert(udata->name); - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_stab_get_name_by_idx_cb */ @@ -941,7 +946,8 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) HDassert(udata && udata->heap); /* Get a pointer to the link name */ - name = (const char *)H5HL_offset_into(udata->heap, ent->name_off); + if((name = (const char *)H5HL_offset_into(udata->heap, ent->name_off)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") HDassert(name); /* Convert the entry to a link */ diff --git a/src/H5HL.c b/src/H5HL.c index b731647..01ace76 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -533,17 +533,18 @@ done: void * H5HL_offset_into(const H5HL_t *heap, size_t offset) { - /* - * We need to have called some other function before this to get a - * valid heap pointer. So, this can remain "FUNC_ENTER_NOAPI_NOINIT" - */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + void *ret_value = NULL; + + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ HDassert(heap); - HDassert(offset < heap->dblk_size); + if(offset >= heap->dblk_size) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, NULL, "unable to offset into local heap data block") + ret_value = heap->dblk_image + offset; - FUNC_LEAVE_NOAPI(heap->dblk_image + offset) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5HL_offset_into() */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 1de3059..c4b1d96 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -67,17 +67,17 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ /*------------------------------------------------------------------------- - * Function: H5O_efl_decode + * Function: H5O_efl_decode * * Purpose: Decode an external file list message and return a pointer to - * the message (and some other data). + * the message (and some other data). * - * Return: Success: Ptr to a new message struct. + * Return: Success: Ptr to a new message struct. * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke - * Tuesday, November 25, 1997 + * Tuesday, November 25, 1997 * * Modification: * Raymond Lu @@ -90,12 +90,12 @@ static void * H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { - H5O_efl_t *mesg = NULL; - int version; - const char *s = NULL; - H5HL_t *heap; - size_t u; /* Local index variable */ - void *ret_value; /* Return value */ + H5O_efl_t *mesg = NULL; + int version; + const char *s = NULL; + H5HL_t *heap; + size_t u; /* Local index variable */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -104,12 +104,12 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, HDassert(p); if(NULL == (mesg = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Version */ version = *p++; if(version != H5O_EFL_VERSION) - HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message") + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message") /* Reserved */ p += 3; @@ -141,24 +141,25 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, /* Decode the file list */ mesg->slot = (H5O_efl_entry_t *)H5MM_calloc(mesg->nalloc * sizeof(H5O_efl_entry_t)); if(NULL == mesg->slot) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") for(u = 0; u < mesg->nused; u++) { - /* Name */ - H5F_DECODE_LENGTH (f, p, mesg->slot[u].name_offset); + /* Name */ + H5F_DECODE_LENGTH (f, p, mesg->slot[u].name_offset); - s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset); - HDassert(s && *s); - mesg->slot[u].name = H5MM_xstrdup (s); + if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") + HDassert(s && *s); + mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); - /* File offset */ - H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset); + /* File offset */ + H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset); - /* Size */ - H5F_DECODE_LENGTH (f, p, mesg->slot[u].size); + /* Size */ + H5F_DECODE_LENGTH (f, p, mesg->slot[u].size); } /* end for */ if(H5HL_unprotect(heap) < 0) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 154fed9..8e2c48b 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -103,6 +103,7 @@ endif () # -------------------------------------------------------------------- set (HDF5_REFERENCE_TEST_FILES bad_compound.h5 + bad_offset.h5 be_data.h5 be_extlink1.h5 be_extlink2.h5 @@ -1016,6 +1017,7 @@ if (HDF5_BUILD_GENERATORS) # generator executables set (H5_GENERATORS + gen_bad_offset gen_bad_ohdr gen_bogus gen_cross diff --git a/test/Makefile.am b/test/Makefile.am index 7fbccdd..7c55e5b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -67,7 +67,7 @@ endif BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_idx \ gen_new_array gen_new_fill gen_new_group gen_new_mtime gen_new_super \ gen_noencoder gen_nullspace gen_udlinks space_overflow gen_sizes_lheap \ - gen_file_image + gen_file_image gen_bad_offset if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) diff --git a/test/bad_offset.h5 b/test/bad_offset.h5 new file mode 100644 index 0000000..6500ffe Binary files /dev/null and b/test/bad_offset.h5 differ diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c new file mode 100644 index 0000000..2be4af1 --- /dev/null +++ b/test/gen_bad_offset.c @@ -0,0 +1,112 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Generate an HDF5 file for testing H5FFV-10216 + */ +#include "h5test.h" + +#define TESTFILE "bad_offset.h5" +#define GRP1 "group1" +#define GRP2 "group2" +#define DSET "dsetA" +#define SOFT1 "soft_one" +#define SOFT2 "soft_two" + + + +/*------------------------------------------------------------------------- + * Function: main + * Generate an HDF5 file with groups, datasets and symbolic links. + * + * After this file is generated, write bad offset values to + * the heap at 3 locations in the file: + * (A) Open the file: + * fd = HDopen(TESTFILE, O_RDWR, 0663); + * (B) Position the file at: + * (1) HDlseek(fd, (HDoff_t)880, SEEK_SET); + * "/group1/group2": replace heap offset "8" by bad offset + * (2) HDlseek(fd, (HDoff_t)1512, SEEK_SET); + * "/dsetA": replace name offset into private heap "72" by bad offset + * (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET); + * /soft_one: replace link value offset in the scratch pad "32" by bad offset + * (C) Write the bad offset value to the file: + * write(fd, &val, sizeof(val)); + * + * Note: if the groups/datasets/symbolic links are changed in the file, + * the above locations need to be adjusted accordingly. + * + * Return: EXIT_SUCCESS/EXIT_FAILURE + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + hid_t fid = -1, gid1 = -1, gid2 = -1; /* File and group IDs */ + hid_t did = -1, sid = -1; /* Dataset and dataspace IDs */ + + /* Create the test file */ + if((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Create two groups */ + if((gid1 = H5Gcreate2(fid, GRP1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if((gid2 = H5Gcreate2(gid1, GRP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close the groups */ + if(H5Gclose(gid1) < 0) + FAIL_STACK_ERROR + if(H5Gclose(gid2) < 0) + FAIL_STACK_ERROR + + /* Create soft links to the groups */ + if(H5Lcreate_soft("/group1", fid, SOFT1, H5P_DEFAULT, H5P_DEFAULT) < 0) + FAIL_STACK_ERROR + if(H5Lcreate_soft("/group1/group2", fid, SOFT2, H5P_DEFAULT, H5P_DEFAULT) < 0) + FAIL_STACK_ERROR + + /* Create a dataset */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + /* Close the dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close the file */ + if(H5Fclose(fid) < 0) + FAIL_STACK_ERROR + + return EXIT_SUCCESS; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid1); + H5Gclose(gid2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); + } H5E_END_TRY; + + return EXIT_FAILURE; +} /* end main() */ + diff --git a/test/tmisc.c b/test/tmisc.c index 9766816..980c9ea 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -323,6 +323,11 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset #define MISC31_PROPNAME "misc31_prop" #define MISC31_DTYPENAME "dtype" +/* Definitions for misc. test #33 */ +/* Note that this test file is generated by "gen_bad_offset.c" */ +/* and bad offset values are written to that file for testing */ +#define MISC33_FILE "bad_offset.h5" + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -5423,6 +5428,55 @@ test_misc32(void) } /* end test_misc32() */ +/**************************************************************** +** +** test_misc33(): Test for H5FFV-10216 +** --verify that H5HL_offset_into() returns error if the +** input parameter "offset" exceeds heap data block size. +** --case (1), (2), (3) are scenarios that will traverse to the +** the 3 locations in the file having bad offset values to +** the heap. (See description in gen_bad_offset.c) +** +****************************************************************/ +static void +test_misc33(void) +{ + hid_t fid = -1; /* File ID */ + const char *testfile = H5_get_srcdir_filename(MISC33_FILE); /* Corrected test file name */ + H5O_info_t oinfo; /* Structure for object metadata information */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing that bad offset into the heap returns error")); + + /* Open the test file */ + fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* Case (1) */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_name(fid, "/soft_two", &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Oget_info_by_name"); + + /* Case (2) */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_name(fid, "/dsetA", &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Oget_info_by_name"); + + /* Case (3) */ + H5E_BEGIN_TRY { + ret = H5Oget_info_by_name(fid, "/soft_one", &oinfo, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Oget_info_by_name"); + + /* Close the file */ + ret = H5Fclose(fid); + CHECK(fid, FAIL, "H5Fclose"); + +} /* end test_misc33() */ + /**************************************************************** ** @@ -5471,6 +5525,7 @@ test_misc(void) test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ test_misc32(); /* Test filter memory allocation functions */ + test_misc33(); /* ??? */ } /* test_misc() */ -- cgit v0.12 From 38194b496d9a868de21c6bcc8bda3bf30690712e Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 23 Aug 2017 16:23:09 -0500 Subject: Modifications based on comments from pull request review (1) Remove unnecessary asserts (2) Add code to insert bad offset values to the test file in gen_bad_offset.c --- src/H5Glink.c | 21 ++++++++++++++------- src/H5Gnode.c | 43 ++++++++----------------------------------- src/H5Gstab.c | 6 ++---- src/H5Oefl.c | 3 ++- test/bad_offset.h5 | Bin 3312 -> 3312 bytes test/gen_bad_offset.c | 41 ++++++++++++++++++++++++++++++++++++++--- test/tmisc.c | 2 +- 7 files changed, 65 insertions(+), 51 deletions(-) diff --git a/src/H5Glink.c b/src/H5Glink.c index fe49458..255add0 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -224,6 +224,7 @@ herr_t H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, const char *name) { + hbool_t dup_soft = FALSE; /* xstrdup the symbolic link name or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -238,19 +239,21 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, lnk->cset = H5F_DEFAULT_CSET; lnk->corder = 0; lnk->corder_valid = FALSE; /* Creation order not valid for this link */ - lnk->name = H5MM_xstrdup(name); - HDassert(lnk->name); + if((lnk->name = H5MM_xstrdup(name)) == NULL) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to duplicate link name") /* Object is a symbolic or hard link */ if(ent->type == H5G_CACHED_SLINK) { const char *s; /* Pointer to link value */ if((s = (const char *)H5HL_offset_into(heap, ent->cache.slink.lval_offset)) == NULL) - HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") - HDassert(s); + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get symbolic link name") /* Copy the link value */ - lnk->u.soft.name = H5MM_xstrdup(s); + if((lnk->u.soft.name = H5MM_xstrdup(s)) == NULL) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to duplicate symbolic link name") + + dup_soft = TRUE; /* Set link type */ lnk->type = H5L_TYPE_SOFT; @@ -264,8 +267,12 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, } /* end else */ done: - if(ret_value < 0 && lnk->name) - H5MM_xfree(lnk->name); + if(ret_value < 0) { + if(lnk->name) + H5MM_xfree(lnk->name); + if(ent->type == H5G_CACHED_SLINK && dup_soft) + H5MM_xfree(lnk->u.soft.name); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__ent_to_link() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 7de9ec9..2c4b840 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -35,7 +35,7 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functionsi */ +#include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -396,7 +396,6 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; const char *s1, *s2; - const char *base; /* Base of heap */ int ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -406,10 +405,6 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) HDassert(lt_key); HDassert(rt_key); - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->heap, (size_t)0); - HDassert(base); - /* Get pointers to string names */ if((s1 = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") @@ -458,7 +453,6 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; const char *s; - const char *base; /* Base of heap */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -468,10 +462,6 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) HDassert(lt_key); HDassert(rt_key); - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->heap, (size_t)0); - HDassert(base); - /* left side */ if((s = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get key name") @@ -525,7 +515,6 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED unsigned lt = 0, idx = 0, rt; int cmp = 1; const char *s; - const char *base; /* Base of heap */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -543,10 +532,6 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); - HDassert(base); - /* * Binary search. */ @@ -624,7 +609,6 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5G_node_t *sn = NULL, *snrt = NULL; unsigned sn_flags = H5AC__NO_FLAGS_SET, snrt_flags = H5AC__NO_FLAGS_SET; const char *s; - const char *base; /* Base of heap */ unsigned lt = 0, rt; /* Binary search cntrs */ int cmp = 1, idx = -1; H5G_node_t *insert_into = NULL; /*node that gets new entry*/ @@ -649,10 +633,6 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC_WRITE))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); - HDassert(base); - /* * Where does the new symbol get inserted? We use a binary search. */ @@ -815,10 +795,6 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, if(udata->common.name != NULL) { H5O_link_t lnk; /* Constructed link for replacement */ size_t link_name_len; /* Length of string in local heap */ - const char *base; /* Base of heap */ - - /* Get base address of heap */ - base = (const char *)H5HL_offset_into(udata->common.heap, (size_t)0); /* Find the name with a binary search */ rt = sn->nsyms; @@ -1019,7 +995,6 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h /* Get the pointer to the name of the link in the heap */ if((name = (const char *)H5HL_offset_into(udata->heap, ents[u].name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table node name") - HDassert(name); /* Convert the entry to a link */ if(H5G__ent_to_link(&lnk, udata->heap, &ents[u], name) < 0) @@ -1362,7 +1337,6 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd /* Determine name of source object */ if((name = (const char *)H5HL_offset_into(heap, src_ent->name_off)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get source object name") - HDassert(name); /* Insert the new object in the destination file's group */ /* (Don't increment the link count - that's already done above for hard links) */ @@ -1440,7 +1414,6 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke /* Get pointer to link's name in the heap */ if((name = (const char *)H5HL_offset_into(udata->heap, sn->entry[u].name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get symbol table link name") - HDassert(name); /* Determine the link to operate on in the table */ linkno = udata->ltable->nlinks++; @@ -1542,29 +1515,29 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); } /* end if */ else { - fprintf(stream, "%*sSymbol Table Node...\n", indent, ""); - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + HDfprintf(stream, "%*sSymbol Table Node...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Dirty:", sn->cache_info.is_dirty ? "Yes" : "No"); - fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Size of Node (in bytes):", (unsigned)sn->node_size); - fprintf(stream, "%*s%-*s %u of %u\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u of %u\n", indent, "", fwidth, "Number of Symbols:", sn->nsyms, (unsigned)(2 * H5F_SYM_LEAF_K(f))); indent += 3; fwidth = MAX(0, fwidth - 3); for(u = 0; u < sn->nsyms; u++) { - fprintf(stream, "%*sSymbol %u:\n", indent - 3, "", u); + HDfprintf(stream, "%*sSymbol %u:\n", indent - 3, "", u); if(heap) { const char *s = (const char *)H5HL_offset_into(heap, sn->entry[u].name_off); if(s) - fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", s); + HDfprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", s); } /* end if */ else - fprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Warning: Invalid heap address given, name not displayed!"); + HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Warning: Invalid heap address given, name not displayed!"); H5G__ent_debug(sn->entry + u, stream, indent, fwidth, heap); } /* end for */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 01dbdbc..0eb7b0b 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -724,9 +724,8 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) if((name = (const char *)H5HL_offset_into(udata->heap, name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") - HDassert(name); - udata->name = H5MM_strdup(name); - HDassert(udata->name); + if((udata->name = H5MM_strdup(name)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to duplicate symbol table link name") done: FUNC_LEAVE_NOAPI(ret_value) @@ -948,7 +947,6 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) /* Get a pointer to the link name */ if((name = (const char *)H5HL_offset_into(udata->heap, ent->name_off)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get symbol table link name") - HDassert(name); /* Convert the entry to a link */ if(H5G__ent_to_link(udata->lnk, udata->heap, ent, name) < 0) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index c4b1d96..26ac63f 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -151,7 +151,8 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") - HDassert(s && *s); + if(*s == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name") mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); diff --git a/test/bad_offset.h5 b/test/bad_offset.h5 index 6500ffe..231dca2 100644 Binary files a/test/bad_offset.h5 and b/test/bad_offset.h5 differ diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c index 2be4af1..82e94cd 100644 --- a/test/gen_bad_offset.c +++ b/test/gen_bad_offset.c @@ -27,9 +27,9 @@ /*------------------------------------------------------------------------- * Function: main - * Generate an HDF5 file with groups, datasets and symbolic links. * - * After this file is generated, write bad offset values to + * Generate an HDF5 file with groups, datasets and symbolic links. + * After the file is generated, write bad offset values to * the heap at 3 locations in the file: * (A) Open the file: * fd = HDopen(TESTFILE, O_RDWR, 0663); @@ -40,7 +40,7 @@ * "/dsetA": replace name offset into private heap "72" by bad offset * (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET); * /soft_one: replace link value offset in the scratch pad "32" by bad offset - * (C) Write the bad offset value to the file: + * (C) Write the bad offset value to the file for (1), (2) and (3): * write(fd, &val, sizeof(val)); * * Note: if the groups/datasets/symbolic links are changed in the file, @@ -55,6 +55,8 @@ main(void) { hid_t fid = -1, gid1 = -1, gid2 = -1; /* File and group IDs */ hid_t did = -1, sid = -1; /* Dataset and dataspace IDs */ + int fd = -1; /* File descriptor */ + int64_t val = 999; /* Bad offset value */ /* Create the test file */ if((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -96,6 +98,39 @@ main(void) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + /* + * Write bad offset values at 3 locations in the file + */ + + /* Open the file */ + if((fd = HDopen(TESTFILE, O_RDWR, 0663)) < 0) + FAIL_STACK_ERROR + + /* Position the file for /group1/group2: replace heap offset "8" by bad offset */ + if(HDlseek(fd, (HDoff_t)880, SEEK_SET) < 0) + FAIL_STACK_ERROR + /* Write the bad offset value to the file */ + if(HDwrite(fd, &val, sizeof(val)) < 0) + FAIL_STACK_ERROR + + /* Position the file for /dsetA: replace name offset into private heap "72" by bad offset */ + if(HDlseek(fd, (HDoff_t)1512, SEEK_SET) < 0) + FAIL_STACK_ERROR + /* Write the bad offset value to the file */ + if(HDwrite(fd, &val, sizeof(val)) < 0) + FAIL_STACK_ERROR + + /* Position the file for /soft_one: replace link value offset in the scratch pad "32" by bad offset */ + if(HDlseek(fd, (HDoff_t)1616, SEEK_SET) < 0) + FAIL_STACK_ERROR + /* Write the bad offset value to the file */ + if(HDwrite(fd, &val, sizeof(val)) < 0) + FAIL_STACK_ERROR + + /* Close the file */ + if(HDclose(fd) < 0) + FAIL_STACK_ERROR + return EXIT_SUCCESS; error: diff --git a/test/tmisc.c b/test/tmisc.c index 980c9ea..aae1a99 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5525,7 +5525,7 @@ test_misc(void) test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ test_misc32(); /* Test filter memory allocation functions */ - test_misc33(); /* ??? */ + test_misc33(); /* Test to verify that H5HL_offset_into() returns error if offset exceeds heap block */ } /* test_misc() */ -- cgit v0.12 From 00c572cd6a75406dc0f45cbadf775015e6e6f105 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 24 Aug 2017 11:42:35 -0500 Subject: Fix for daily test failure Fix for the compilation error from the PGI compiler. --- src/H5Oefl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 26ac63f..218d250 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -151,7 +151,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "unable to get external file name") - if(*s == NULL) + if(*s == (char)NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "invalid external file name") mesg->slot[u].name = H5MM_xstrdup (s); HDassert(mesg->slot[u].name); -- cgit v0.12 From d7c76e3aacd6f5966725516b0049f62e2efea586 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 6 Sep 2017 01:51:06 -0500 Subject: Add info for release notes --- release_docs/RELEASE.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 269c19e..9deaf48 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -121,7 +121,14 @@ Bug Fixes since HDF5-1.8.19 Library ------- - - None + - Fix H5HL_offset_into() + + (1) Fix H5HL_offset_into() to return error when offset exceeds heap data + block size. + (2) Fix other places in the library that call this routine to detect + error routine. + + (HDFFV-10216, VC, 2017/09/05) Parallel Library -- cgit v0.12 From 60ed478b7502d2f48080b0f7c9b67fb96c2ce4d0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Sep 2017 09:17:18 -0500 Subject: Fix extra whitespace in usage() text --- tools/h5repack/h5repack_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index a8c8475..1d09e20 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -170,16 +170,16 @@ static void usage(const char *prog) { PRINTVALSTREAM(rawoutstream, " Chunked layout, with a layout size of 20x10, to objects dset1 and dset2\n"); PRINTVALSTREAM(rawoutstream, " and remove filters to objects dset3, dset4, dset5\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "4) h5repack -L -c 10 -s 20:dtype file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "4) h5repack -L -c 10 -s 20:dtype file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Using latest file format with maximum compact group size of 10 and\n"); PRINTVALSTREAM(rawoutstream, " and minimum shared datatype size of 20\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); - PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,0,1,9 file1 file2 \n"); + PRINTVALSTREAM(rawoutstream, "6) h5repack -f UD=307,0,1,9 file1 file2\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " Add bzip2 filter to all datasets\n"); PRINTVALSTREAM(rawoutstream, "\n"); -- cgit v0.12 From 8b910ce2d626d6cd03efb92db3b9fe008d163323 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Sep 2017 09:57:39 -0500 Subject: HDFFV-10276 restore argument spacing --- tools/h5repack/h5repack_filters.c | 40 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index ac3aa3c..f265b8c 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -32,11 +32,11 @@ * *------------------------------------------------------------------------- */ -static int aux_find_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ +static int aux_find_obj(const char *name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj) /* (OUT) info about object to filter */ { - char *pdest; + char *pdest; int result; unsigned int i; @@ -69,9 +69,9 @@ static int aux_find_obj(const char* name, /* object name from traverse list */ * *------------------------------------------------------------------------- */ -static int aux_assign_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ +static int aux_assign_obj(const char *name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj) /* (OUT) info about object to filter */ { int idx, i; @@ -181,26 +181,22 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ * * Return: 0 success, -1 an error occured * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 19, 2003 - * *------------------------------------------------------------------------- */ -int apply_filters(const char* name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t *dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int *has_filter) /* (OUT) object NAME has a filter */ +int apply_filters(const char *name, /* object name from traverse list */ + int rank, /* rank of dataset */ + hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t *options, /* repack options */ + int *has_filter) /* (OUT) object NAME has a filter */ { - int nfilters; /* number of filters in DCPL */ - hsize_t chsize[64]; /* chunk size in elements */ + int nfilters; /* number of filters in DCPL */ + hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; - int i; - pack_info_t obj; + int i; + pack_info_t obj; *has_filter = 0; -- cgit v0.12 From a57f039a6aae04b8f91955e92ddbaa74cc78fc2b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Sep 2017 11:00:27 -0500 Subject: HDFFV-9774 Add enable-error-stack to h5diff --- MANIFEST | 12 + release_docs/RELEASE.txt | 11 +- tools/h5copy/h5copy.c | 100 +++---- tools/h5diff/CMakeTests.cmake | 109 ++++++++ tools/h5diff/h5diff_common.c | 440 ++++++++++++++---------------- tools/h5diff/h5diff_main.c | 33 ++- tools/h5diff/ph5diff_main.c | 5 +- tools/h5diff/testfiles/h5diff_10.txt | 2 + tools/h5diff/testfiles/h5diff_454_ERR.err | 4 + tools/h5diff/testfiles/h5diff_454_ERR.txt | 6 + tools/h5diff/testfiles/h5diff_455_ERR.err | 4 + tools/h5diff/testfiles/h5diff_455_ERR.txt | 6 + tools/h5diff/testfiles/h5diff_457_ERR.err | 4 + tools/h5diff/testfiles/h5diff_457_ERR.txt | 6 + tools/h5diff/testfiles/h5diff_458_ERR.err | 4 + tools/h5diff/testfiles/h5diff_458_ERR.txt | 6 + tools/h5diff/testfiles/h5diff_459_ERR.err | 4 + tools/h5diff/testfiles/h5diff_600.txt | 2 + tools/h5diff/testfiles/h5diff_601_ERR.err | 4 + tools/h5diff/testfiles/h5diff_601_ERR.txt | 6 + tools/h5diff/testfiles/h5diff_603.txt | 2 + tools/h5diff/testfiles/h5diff_606.txt | 2 + tools/h5diff/testfiles/h5diff_612.txt | 2 + tools/h5diff/testfiles/h5diff_615.txt | 2 + tools/h5diff/testfiles/h5diff_621.txt | 2 + tools/h5diff/testfiles/h5diff_622.txt | 2 + tools/h5diff/testfiles/h5diff_623.txt | 2 + tools/h5diff/testfiles/h5diff_624.txt | 2 + 28 files changed, 482 insertions(+), 302 deletions(-) create mode 100644 tools/h5diff/testfiles/h5diff_454_ERR.err create mode 100644 tools/h5diff/testfiles/h5diff_454_ERR.txt create mode 100644 tools/h5diff/testfiles/h5diff_455_ERR.err create mode 100644 tools/h5diff/testfiles/h5diff_455_ERR.txt create mode 100644 tools/h5diff/testfiles/h5diff_457_ERR.err create mode 100644 tools/h5diff/testfiles/h5diff_457_ERR.txt create mode 100644 tools/h5diff/testfiles/h5diff_458_ERR.err create mode 100644 tools/h5diff/testfiles/h5diff_458_ERR.txt create mode 100644 tools/h5diff/testfiles/h5diff_459_ERR.err create mode 100644 tools/h5diff/testfiles/h5diff_601_ERR.err create mode 100644 tools/h5diff/testfiles/h5diff_601_ERR.txt diff --git a/MANIFEST b/MANIFEST index 16900d2..6abf375 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1821,6 +1821,8 @@ ./tools/h5diff/testfiles/h5diff_63.txt ./tools/h5diff/testfiles/h5diff_600.txt ./tools/h5diff/testfiles/h5diff_601.txt +./tools/h5diff/testfiles/h5diff_601_ERR.err +./tools/h5diff/testfiles/h5diff_601_ERR.txt ./tools/h5diff/testfiles/h5diff_603.txt ./tools/h5diff/testfiles/h5diff_604.txt ./tools/h5diff/testfiles/h5diff_605.txt @@ -1927,11 +1929,21 @@ ./tools/h5diff/testfiles/h5diff_452.txt ./tools/h5diff/testfiles/h5diff_453.txt ./tools/h5diff/testfiles/h5diff_454.txt +./tools/h5diff/testfiles/h5diff_454_ERR.err +./tools/h5diff/testfiles/h5diff_454_ERR.txt ./tools/h5diff/testfiles/h5diff_455.txt +./tools/h5diff/testfiles/h5diff_455_ERR.err +./tools/h5diff/testfiles/h5diff_455_ERR.txt ./tools/h5diff/testfiles/h5diff_456.txt ./tools/h5diff/testfiles/h5diff_457.txt +./tools/h5diff/testfiles/h5diff_457_ERR.err +./tools/h5diff/testfiles/h5diff_457_ERR.txt ./tools/h5diff/testfiles/h5diff_458.txt +./tools/h5diff/testfiles/h5diff_458_ERR.err +./tools/h5diff/testfiles/h5diff_458_ERR.txt ./tools/h5diff/testfiles/h5diff_459.txt +./tools/h5diff/testfiles/h5diff_459_ERR.err +./tools/h5diff/testfiles/h5diff_459_ERR.txt ./tools/h5diff/testfiles/h5diff_465.txt ./tools/h5diff/testfiles/h5diff_466.txt ./tools/h5diff/testfiles/h5diff_467.txt diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9f344dc..51169a6 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -72,7 +72,16 @@ New Features Tools ----- - - None + - h5diff + + h5diff has new option enable-error-stack. + + Updated h5diff with the --enable-error-stack argument, which + enables the display of the hdf5 error stack. This completes the + improvement to the main tools; h5copy, h5diff, h5dump, h5ls and + h5repack. + + (ADB - 2017/08/30, HDFFV-9774) High-Level APIs diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 390b93e..1d15d12 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -14,8 +14,6 @@ #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" -#include -#include /* Name of tool */ #define PROGRAMNAME "h5copy" @@ -103,6 +101,8 @@ usage (void) PRINTVALSTREAM(rawoutstream, " -p, --parents No error if existing, make parent groups as needed\n"); PRINTVALSTREAM(rawoutstream, " -v, --verbose Print information about OBJECTS and OPTIONS\n"); PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); + PRINTVALSTREAM(rawoutstream, " Prints messages from the HDF5 error stack as they occur.\n"); PRINTVALSTREAM(rawoutstream, " -f, --flag Flag type\n\n"); PRINTVALSTREAM(rawoutstream, " Flag type is one of the following strings:\n\n"); PRINTVALSTREAM(rawoutstream, " shallow Copy only immediate members for groups\n\n"); @@ -161,36 +161,28 @@ static int parse_flag(const char* s_flag, unsigned *flag) { unsigned fla=0; - if (HDstrcmp(s_flag,"shallow")==0) - { + if (HDstrcmp(s_flag, "shallow") == 0) { fla = H5O_COPY_SHALLOW_HIERARCHY_FLAG; } - else if (HDstrcmp(s_flag,"soft")==0) - { + else if (HDstrcmp(s_flag, "soft") == 0) { fla = H5O_COPY_EXPAND_SOFT_LINK_FLAG; } - else if (HDstrcmp(s_flag,"ext")==0) - { + else if (HDstrcmp(s_flag, "ext") == 0) { fla = H5O_COPY_EXPAND_EXT_LINK_FLAG; } - else if (HDstrcmp(s_flag,"ref")==0) - { + else if (HDstrcmp(s_flag, "ref") == 0) { fla = H5O_COPY_EXPAND_REFERENCE_FLAG; } - else if (HDstrcmp(s_flag,"noattr")==0) - { + else if (HDstrcmp(s_flag, "noattr") == 0) { fla = H5O_COPY_WITHOUT_ATTR_FLAG; } - else if (HDstrcmp(s_flag,"allflags")==0) - { + else if (HDstrcmp(s_flag, "allflags") == 0) { fla = H5O_COPY_ALL; } - else if (HDstrcmp(s_flag,"nullmsg")==0) - { + else if (HDstrcmp(s_flag, "nullmsg") == 0) { fla = H5O_COPY_PRESERVE_NULL_FLAG; } - else - { + else { error_msg("Error in input flag\n"); return -1; } @@ -249,25 +241,21 @@ main (int argc, const char *argv[]) HDmemset(&linkinfo, 0, sizeof(h5tool_link_info_t)); /* Check for no command line parameters */ - if(argc == 1) - { + if(argc == 1) { usage(); leave(EXIT_FAILURE); } /* end if */ /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) - { - switch ((char)opt) - { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch ((char)opt) { case 'd': oname_dst = HDstrdup(opt_arg); break; case 'f': /* validate flag */ - if (parse_flag(opt_arg,&flag)<0) - { + if (parse_flag(opt_arg, &flag) < 0) { usage(); leave(EXIT_FAILURE); } @@ -318,29 +306,25 @@ main (int argc, const char *argv[]) * check for missing file/object names *-------------------------------------------------------------------------*/ - if (fname_src==NULL) - { + if (fname_src==NULL) { error_msg("Input file name missing\n"); usage(); leave(EXIT_FAILURE); } - if (fname_dst==NULL) - { + if (fname_dst==NULL) { error_msg("Output file name missing\n"); usage(); leave(EXIT_FAILURE); } - if (oname_src==NULL) - { + if (oname_src==NULL) { error_msg("Source object name missing\n"); usage(); leave(EXIT_FAILURE); } - if (oname_dst==NULL) - { + if (oname_dst==NULL) { error_msg("Destination object name missing\n"); usage(); leave(EXIT_FAILURE); @@ -369,8 +353,7 @@ main (int argc, const char *argv[]) /*------------------------------------------------------------------------- * test for error in opening input file *-------------------------------------------------------------------------*/ - if (fid_src==-1) - { + if (fid_src==-1) { error_msg("Could not open input file <%s>...Exiting\n", fname_src); leave(EXIT_FAILURE); } @@ -388,8 +371,7 @@ main (int argc, const char *argv[]) /*------------------------------------------------------------------------- * test for error in opening output file *-------------------------------------------------------------------------*/ - if (fid_dst==-1) - { + if (fid_dst==-1) { error_msg("Could not open output file <%s>...Exiting\n", fname_dst); leave(EXIT_FAILURE); } @@ -398,12 +380,10 @@ main (int argc, const char *argv[]) * print some info *-------------------------------------------------------------------------*/ - if (verbose) - { + if (verbose) { printf("Copying file <%s> and object <%s> to file <%s> and object <%s>\n", fname_src, oname_src, fname_dst, oname_dst); if (flag) { - HDassert(str_flag); printf("Using %s flag\n", str_flag); } } @@ -418,8 +398,7 @@ main (int argc, const char *argv[]) HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pcreate failed"); /* set options for object copy */ - if (flag) - { + if (flag) { if ( H5Pset_copy_object(ocpl_id, flag) < 0) HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Pset_copy_object failed"); } @@ -442,24 +421,21 @@ main (int argc, const char *argv[]) if(verbose) printf("%s: Creating parent groups\n", h5tools_getprogname()); } /* end if */ - else /* error, if parent groups doesn't already exist in destination file */ - { + else { + /* error, if parent groups doesn't already exist in destination file */ size_t i, len; len = HDstrlen(oname_dst); /* check if all the parents groups exist. skip root group */ - for (i = 1; i < len; i++) - { - if ('/'==oname_dst[i]) - { + for (i = 1; i < len; i++) { + if ('/'==oname_dst[i]) { char *str_ptr; str_ptr = (char *)HDcalloc(i + 1, sizeof(char)); HDstrncpy(str_ptr, oname_dst, i); str_ptr[i]='\0'; - if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) - { + if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) { error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); HDfree(str_ptr); HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lexists failed"); @@ -477,15 +453,15 @@ main (int argc, const char *argv[]) linkinfo.opt.msg_mode = 1; li_ret = H5tools_get_symlink_info(fid_src, oname_src, &linkinfo, 1); - if (li_ret == 0) /* dangling link */ - { + if (li_ret == 0) { + /* dangling link */ if(H5Lcopy(fid_src, oname_src, fid_dst, oname_dst, H5P_DEFAULT, H5P_DEFAULT) < 0) HGOTO_ERROR(EXIT_FAILURE, H5E_tools_min_id_g, "H5Lcopy failed"); } - else /* valid link */ - { + else { + /* valid link */ if (H5Ocopy(fid_src, /* Source file or group identifier */ oname_src, /* Name of the source object to be copied */ fid_dst, /* Destination file or group identifier */ @@ -520,13 +496,13 @@ done: if (linkinfo.trg_path) HDfree(linkinfo.trg_path); - H5E_BEGIN_TRY { - H5Pclose(ocpl_id); - H5Pclose(lcpl_id); - H5Fclose(fid_src); - H5Fclose(fid_dst); - } H5E_END_TRY; + H5E_BEGIN_TRY { + H5Pclose(ocpl_id); + H5Pclose(lcpl_id); + H5Fclose(fid_src); + H5Fclose(fid_dst); + } H5E_END_TRY; - leave(ret_value); + leave(ret_value); } diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index aa620ef..4570e95 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -141,11 +141,21 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_452.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_453.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454_ERR.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454_ERR.err ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455_ERR.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455_ERR.err ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_456.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457_ERR.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457_ERR.err ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458_ERR.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458_ERR.err ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459_ERR.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459_ERR.err ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_465.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_466.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_467.txt @@ -201,6 +211,8 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_63.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601_ERR.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601_ERR.err ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_604.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_605.txt @@ -344,6 +356,38 @@ endif () endmacro () + macro (ADD_H5_ERR_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME H5DIFF_ERR-${resultfile} COMMAND $ --enable-error-stack ${ARGN}) + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT ${resultcode} STREQUAL "0") + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WILL_FAIL "true") + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + else () + add_test ( + NAME H5DIFF_ERR-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_MASK_ERROR=true" + -D "TEST_APPEND=EXIT CODE:" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5DIFF_ERR-${resultfile}") + endmacro () + macro (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) @@ -423,6 +467,53 @@ endif () endmacro () + macro (ADD_H5_UD_ERR_TEST testname resultcode resultfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DIFF_UD_ERR-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}_ERR.out + testfiles/${resultfile}_ERR.out.err + ) + if (${resultcode} STREQUAL "2") + add_test ( + NAME H5DIFF_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_MASK_ERROR=true" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5DIFF_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}_ERR.txt" + -D "TEST_MASK_ERROR=true" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5DIFF_UD_ERR-${testname} PROPERTIES DEPENDS H5DIFF_UD_ERR-${testname}-clearall-objects) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -637,16 +728,26 @@ h5diff_453.out.err h5diff_454.out h5diff_454.out.err + h5diff_454_ERR.out + h5diff_454_ERR.out.err h5diff_455.out h5diff_455.out.err + h5diff_455_ERR.out + h5diff_455_ERR.out.err h5diff_456.out h5diff_456.out.err h5diff_457.out h5diff_457.out.err + h5diff_457_ERR.out + h5diff_457_ERR.out.err h5diff_458.out h5diff_458.out.err + h5diff_458_ERR.out + h5diff_458_ERR.out.err h5diff_459.out h5diff_459.out.err + h5diff_459_ERR.out + h5diff_459_ERR.out.err h5diff_465.out h5diff_465.out.err h5diff_466.out @@ -751,6 +852,8 @@ h5diff_600.out.err h5diff_601.out h5diff_601.out.err + h5diff_601_ERR.out + h5diff_601_ERR.out.err h5diff_603.out h5diff_603.out.err h5diff_604.out @@ -989,6 +1092,7 @@ ADD_H5_TEST (h5diff_600 1 ${FILE1}) # 6.1: Check if non-exist object name is specified ADD_H5_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj) +ADD_H5_ERR_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj) # ############################################################################## # # -d @@ -1288,21 +1392,26 @@ ADD_H5_TEST (h5diff_453 2 --follow-symlinks -v --no-dangling-links ${FILE13} $ # dangling link found for soft links (obj to obj) ADD_H5_TEST (h5diff_454 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) +ADD_H5_ERR_TEST (h5diff_454 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) # dangling link found for soft links (obj to obj) Both dangle links ADD_H5_TEST (h5diff_455 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) +ADD_H5_ERR_TEST (h5diff_455 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) # dangling link found for ext links (FILE to FILE) ADD_H5_TEST (h5diff_456 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15}) # dangling link found for ext links (obj to obj). target file exist ADD_H5_TEST (h5diff_457 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) +ADD_H5_ERR_TEST (h5diff_457 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) # dangling link found for ext links (obj to obj). target file NOT exist ADD_H5_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) +ADD_H5_ERR_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) # dangling link found for ext links (obj to obj). Both dangle links ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) +ADD_H5_ERR_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) # dangling link --follow-symlinks (obj vs obj) # (HDFFV-7836) diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index f87fdf2..e4696c0 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -11,23 +11,21 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" #include "h5diff.h" #include "h5diff_common.h" #include "h5tools.h" #include "h5tools_utils.h" -static int check_n_input( const char* ); -static int check_p_input( const char* ); -static 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*); /* * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVrv:qn:d:p:Nc"; +static const char *s_opts = "hVrv:qn:d:p:NcelxE:S"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -43,6 +41,7 @@ static struct long_options l_opts[] = { { "follow-symlinks", no_arg, 'l' }, { "no-dangling-links", no_arg, 'x' }, { "exclude-path", require_arg, 'E' }, + { "enable-error-stack", no_arg, 'S' }, { NULL, 0, '\0' } }; @@ -62,8 +61,7 @@ static void check_options(diff_opt_t* options) /* check between -d , -p, --use-system-epsilon. * These options are mutually exclusive. */ - if ((options->d + options->p + options->use_system_epsilon) > 1) - { + if ((options->d + options->p + options->use_system_epsilon) > 1) { printf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); printf("use no more than one.\n"); printf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME); @@ -112,75 +110,79 @@ void parse_command_line(int argc, exclude_head = NULL; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) - { - switch ((char)opt) - { + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + switch ((char)opt) { default: usage(); h5diff_exit(EXIT_FAILURE); + case 'h': usage(); h5diff_exit(EXIT_SUCCESS); + case 'V': print_version(h5tools_getprogname()); h5diff_exit(EXIT_SUCCESS); + case 'v': options->m_verbose = 1; /* This for loop is for handling style like * -v, -v1, --verbose, --verbose=1. */ - for (i = 1; i < argc; i++) - { + for (i = 1; i < argc; i++) { /* * short opt */ - if (!strcmp (argv[i], "-v")) /* no arg */ - { + if (!strcmp (argv[i], "-v")) { /* no arg */ opt_ind--; options->m_verbose_level = 0; break; - } - else if (!strncmp (argv[i], "-v", (size_t)2)) - { + } + else if (!strncmp (argv[i], "-v", (size_t)2)) { options->m_verbose_level = atoi(&argv[i][2]); break; - } + } /* * long opt */ - if (!strcmp (argv[i], "--verbose")) /* no arg */ - { + if (!strcmp (argv[i], "--verbose")) { /* no arg */ options->m_verbose_level = 0; break; - } - else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') - { + } + else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') { options->m_verbose_level = atoi(&argv[i][10]); break; } } break; + case 'q': /* use quiet mode; supress the message "0 differences found" */ options->m_quiet = 1; break; + case 'r': options->m_report = 1; break; + case 'l': options->follow_links = TRUE; break; + case 'x': options->no_dangle_links = 1; break; + + case 'S': + enable_error_stack = TRUE; + break; + case 'E': options->exclude_path = 1; /* create linked list of excluding objects */ - if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) - { + if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) { printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); } @@ -190,13 +192,11 @@ void parse_command_line(int argc, exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; - if (NULL == exclude_head) - { + if (NULL == exclude_head) { exclude_head = exclude_node; exclude_head->next = NULL; } - else - { + else { while(NULL != exclude_prev->next) exclude_prev=exclude_prev->next; @@ -204,46 +204,40 @@ void parse_command_line(int argc, exclude_prev->next = exclude_node; } break; + case 'd': options->d=1; - if ( check_d_input( opt_arg )==-1) - { - printf("<-d %s> is not a valid option\n", opt_arg ); + if (check_d_input(opt_arg) == - 1) { + printf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->delta = atof( opt_arg ); + options->delta = atof(opt_arg); /* -d 0 is the same as default */ - if (options->delta == 0) - options->d=0; - + if (H5_DBL_ABS_EQUAL(options->delta, (double)0.0F)) + options->d=0; break; case 'p': - options->p=1; - if ( check_p_input( opt_arg )==-1) - { - printf("<-p %s> is not a valid option\n", opt_arg ); + if (check_p_input(opt_arg) == -1) { + printf("<-p %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->percent = atof( opt_arg ); + options->percent = atof(opt_arg); /* -p 0 is the same as default */ - if (options->percent == 0) - options->p = 0; - + if (H5_DBL_ABS_EQUAL(options->percent, (double)0.0F)) + options->p = 0; break; case 'n': - options->n=1; - if ( check_n_input( opt_arg )==-1) - { - printf("<-n %s> is not a valid option\n", opt_arg ); + if ( check_n_input(opt_arg) == -1) { + printf("<-n %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } @@ -272,8 +266,7 @@ void parse_command_line(int argc, options->exclude = exclude_head; /* check for file names to be processed */ - if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) - { + if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { error_msg("missing file names\n"); usage(); h5diff_exit(EXIT_FAILURE); @@ -283,18 +276,15 @@ void parse_command_line(int argc, *fname2 = argv[ opt_ind + 1 ]; *objname1 = argv[ opt_ind + 2 ]; - if ( *objname1 == NULL ) - { + if (*objname1 == NULL) { *objname2 = NULL; return; } - if ( argv[ opt_ind + 3 ] != NULL) - { + if (argv[ opt_ind + 3 ] != NULL) { *objname2 = argv[ opt_ind + 3 ]; } - else - { + else { *objname2 = *objname1; } @@ -312,20 +302,17 @@ void parse_command_line(int argc, void print_info(diff_opt_t* options) { - if (options->m_quiet || options->err_stat ) + if (options->m_quiet || options->err_stat) return; - if (options->cmn_objs==0) - { + if (options->cmn_objs == 0) { printf("No common objects found. Files are not comparable.\n"); if (!options->m_verbose) printf("Use -v for a list of objects.\n"); } - if (options->not_cmp==1) - { - if ( options->m_list_not_cmp == 0 ) - { + if (options->not_cmp == 1) { + if (options->m_list_not_cmp == 0) { printf("--------------------------------\n"); printf("Some objects are not comparable\n"); printf("--------------------------------\n"); @@ -334,10 +321,7 @@ void parse_command_line(int argc, else printf("Use -c for a list of objects.\n"); } - - } - } /*------------------------------------------------------------------------- @@ -357,22 +341,20 @@ void parse_command_line(int argc, * *------------------------------------------------------------------------- */ -static int +H5_ATTR_PURE static int check_n_input( const char *str ) { unsigned i; char c; - for ( i = 0; i < strlen(str); i++) - { + for (i = 0; i < strlen(str); i++) { c = str[i]; - if ( i==0 ) - { - if ( c < 49 || c > 57 ) /* ascii values between 1 and 9 */ + if (i == 0) { + if (c < 49 || c > 57) /* ascii values between 1 and 9 */ return -1; } else - if ( c < 48 || c > 57 ) /* 0 also */ + if (c < 48 || c > 57) /* 0 also */ return -1; } return 1; @@ -402,11 +384,11 @@ check_p_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (strlen(str)>2 && str[0]=='0' && str[1]=='x') + if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x=atof(str); - if (x<0) + x = atof(str); + if (x < 0) return -1; return 1; @@ -436,11 +418,11 @@ check_d_input( const char *str ) the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ - if (strlen(str)>2 && str[0]=='0' && str[1]=='x') + if (strlen(str) > 2 && str[0] == '0' && str[1] == 'x') return -1; - x=atof(str); - if (x <0) + x = atof(str); + if (x < 0) return -1; return 1; @@ -458,151 +440,153 @@ check_d_input( const char *str ) void usage(void) { - printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]\n"); - printf(" file1 File name of the first HDF5 file\n"); - printf(" file2 File name of the second HDF5 file\n"); - printf(" [obj1] Name of an HDF5 object, in absolute path\n"); - printf(" [obj2] Name of an HDF5 object, in absolute path\n"); - printf("\n"); - printf(" OPTIONS\n"); - printf(" -h, --help\n"); - printf(" Print a usage message and exit.\n"); - printf(" -V, --version\n"); - printf(" Print version number and exit.\n"); - printf(" -r, --report\n"); - printf(" Report mode. Print differences.\n"); - printf(" -v --verbose\n"); - printf(" Verbose mode. Print differences information and list of objects.\n"); - printf(" -vN --verbose=N\n"); - printf(" Verbose mode with level. Print differences and list of objects.\n"); - printf(" Level of detail depends on value of N:\n"); - printf(" 0 : Identical to '-v' or '--verbose'.\n"); - printf(" 1 : All level 0 information plus one-line attribute\n"); - printf(" status summary.\n"); - printf(" 2 : All level 1 information plus extended attribute\n"); - printf(" status report.\n"); - printf(" -q, --quiet\n"); - printf(" Quiet mode. Do not produce output.\n"); - printf(" --follow-symlinks\n"); - printf(" Follow symbolic links (soft links and external links and compare the)\n"); - printf(" links' target objects.\n"); - printf(" If symbolic link(s) with the same name exist in the files being\n"); - printf(" compared, then determine whether the target of each link is an existing\n"); - printf(" object (dataset, group, or named datatype) or the link is a dangling\n"); - printf(" link (a soft or external link pointing to a target object that does\n"); - printf(" not yet exist).\n"); - printf(" - If both symbolic links are dangling links, they are treated as being\n"); - printf(" the same; by default, h5diff returns an exit code of 0.\n"); - printf(" If, however, --no-dangling-links is used with --follow-symlinks,\n"); - printf(" this situation is treated as an error and h5diff returns an\n"); - printf(" exit code of 2.\n"); - printf(" - If only one of the two links is a dangling link,they are treated as\n"); - printf(" being different and h5diff returns an exit code of 1.\n"); - printf(" If, however, --no-dangling-links is used with --follow-symlinks,\n"); - printf(" this situation is treated as an error and h5diff returns an\n"); - printf(" exit code of 2.\n"); - printf(" - If both symbolic links point to existing objects, h5diff compares the\n"); - printf(" two objects.\n"); - printf(" If any symbolic link specified in the call to h5diff does not exist,\n"); - printf(" h5diff treats it as an error and returns an exit code of 2.\n"); - printf(" --no-dangling-links\n"); - printf(" Must be used with --follow-symlinks option; otherwise, h5diff shows\n"); - printf(" error message and returns an exit code of 2.\n"); - printf(" Check for any symbolic links (soft links or external links) that do not\n"); - printf(" resolve to an existing object (dataset, group, or named datatype).\n"); - printf(" If any dangling link is found, this situation is treated as an error\n"); - printf(" and h5diff returns an exit code of 2.\n"); - printf(" -c, --compare\n"); - printf(" List objects that are not comparable\n"); - printf(" -N, --nan\n"); - printf(" Avoid NaNs detection\n"); - printf(" -n C, --count=C\n"); - printf(" Print differences up to C. C must be a positive integer.\n"); - printf(" -d D, --delta=D\n"); - printf(" Print difference if (|a-b| > D). D must be a positive number. Where a\n"); - printf(" is the data point value in file1 and b is the data point value in file2.\n"); - printf(" Can not use with '-p' or '--use-system-epsilon'.\n"); - printf(" -p R, --relative=R\n"); - printf(" Print difference if (|(a-b)/b| > R). R must be a positive number. Where a\n"); - printf(" is the data point value in file1 and b is the data point value in file2.\n"); - printf(" Can not use with '-d' or '--use-system-epsilon'.\n"); - printf(" --use-system-epsilon\n"); - printf(" Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a\n"); - printf(" is the data point value in file1 and b is the data point value in file2.\n"); - printf(" If the system epsilon is not defined,one of the following predefined\n"); - printf(" values will be used:\n"); - printf(" FLT_EPSILON = 1.19209E-07 for floating-point type\n"); - printf(" DBL_EPSILON = 2.22045E-16 for double precision type\n"); - printf(" Can not use with '-p' or '-d'.\n"); - printf(" --exclude-path \"path\"\n"); - printf(" Exclude the specified path to an object when comparing files or groups.\n"); - printf(" If a group is excluded, all member objects will also be excluded.\n"); - printf(" The specified path is excluded wherever it occurs.\n"); - printf(" This flexibility enables the same option to exclude either objects that\n"); - printf(" exist only in one file or common objects that are known to differ.\n"); - printf("\n"); - printf(" When comparing files, \"path\" is the absolute path to the excluded;\n"); - printf(" object; when comparing groups, \"path\" is similar to the relative\n"); - printf(" path from the group to the excluded object. This \"path\" can be\n"); - printf(" taken from the first section of the output of the --verbose option.\n"); - printf(" For example, if you are comparing the group /groupA in two files and\n"); - printf(" you want to exclude /groupA/groupB/groupC in both files, the exclude\n"); - printf(" option would read as follows:\n"); - printf(" --exclude-path \"/groupB/groupC\"\n"); - printf("\n"); - printf(" If there are multiple paths to an object, only the specified path(s)\n"); - printf(" will be excluded; the comparison will include any path not explicitly\n"); - printf(" excluded.\n"); - printf(" This option can be used repeatedly to exclude multiple paths.\n"); - printf("\n"); - - printf(" Modes of output:\n"); - printf(" Default mode: print the number of differences found and where they occured\n"); - printf(" -r Report mode: print the above plus the differences\n"); - printf(" -v Verbose mode: print the above plus a list of objects and warnings\n"); - printf(" -q Quiet mode: do not print output\n"); - - printf("\n"); - - printf(" File comparison:\n"); - printf(" If no objects [obj1[ obj2]] are specified, the h5diff comparison proceeds as\n"); - printf(" a comparison of the two files' root groups. That is, h5diff first compares\n"); - printf(" the names of root group members, generates a report of root group objects\n"); - printf(" that appear in only one file or in both files, and recursively compares\n"); - printf(" common objects.\n"); - printf("\n"); - - printf(" Object comparison:\n"); - printf(" 1) Groups\n"); - printf(" First compares the names of member objects (relative path, from the\n"); - printf(" specified group) and generates a report of objects that appear in only\n"); - printf(" one group or in both groups. Common objects are then compared recursively.\n"); - printf(" 2) Datasets\n"); - printf(" Array rank and dimensions, datatypes, and data values are compared.\n"); - printf(" 3) Datatypes\n"); - printf(" The comparison is based on the return value of H5Tequal.\n"); - printf(" 4) Symbolic links\n"); - printf(" The paths to the target objects are compared.\n"); - printf(" (The option --follow-symlinks overrides the default behavior when\n"); - printf(" symbolic links are compared.).\n"); - printf("\n"); - - printf(" Exit code:\n"); - printf(" 0 if no differences, 1 if differences found, 2 if error\n"); - printf("\n"); - printf(" Examples of use:\n"); - printf(" 1) h5diff file1 file2 /g1/dset1 /g1/dset2\n"); - printf(" Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2\n"); - printf("\n"); - printf(" 2) h5diff file1 file2 /g1/dset1\n"); - printf(" Compares object '/g1/dset1' in both files\n"); - printf("\n"); - printf(" 3) h5diff file1 file2\n"); - printf(" Compares all objects in both files\n"); - printf("\n"); - printf(" Notes:\n"); - printf(" file1 and file2 can be the same file.\n"); - printf(" Use h5diff file1 file1 /g1/dset1 /g1/dset2 to compare\n"); - printf(" '/g1/dset1' and '/g1/dset2' in the same file\n"); - printf("\n"); + PRINTVALSTREAM(rawoutstream, "usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]\n"); + PRINTVALSTREAM(rawoutstream, " file1 File name of the first HDF5 file\n"); + PRINTVALSTREAM(rawoutstream, " file2 File name of the second HDF5 file\n"); + PRINTVALSTREAM(rawoutstream, " [obj1] Name of an HDF5 object, in absolute path\n"); + PRINTVALSTREAM(rawoutstream, " [obj2] Name of an HDF5 object, in absolute path\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " OPTIONS\n"); + PRINTVALSTREAM(rawoutstream, " -h, --help\n"); + PRINTVALSTREAM(rawoutstream, " Print a usage message and exit.\n"); + PRINTVALSTREAM(rawoutstream, " -V, --version\n"); + PRINTVALSTREAM(rawoutstream, " Print version number and exit.\n"); + PRINTVALSTREAM(rawoutstream, " -r, --report\n"); + PRINTVALSTREAM(rawoutstream, " Report mode. Print differences.\n"); + PRINTVALSTREAM(rawoutstream, " -v --verbose\n"); + PRINTVALSTREAM(rawoutstream, " Verbose mode. Print differences information and list of objects.\n"); + PRINTVALSTREAM(rawoutstream, " -vN --verbose=N\n"); + PRINTVALSTREAM(rawoutstream, " Verbose mode with level. Print differences and list of objects.\n"); + PRINTVALSTREAM(rawoutstream, " Level of detail depends on value of N:\n"); + PRINTVALSTREAM(rawoutstream, " 0 : Identical to '-v' or '--verbose'.\n"); + PRINTVALSTREAM(rawoutstream, " 1 : All level 0 information plus one-line attribute\n"); + PRINTVALSTREAM(rawoutstream, " status summary.\n"); + PRINTVALSTREAM(rawoutstream, " 2 : All level 1 information plus extended attribute\n"); + PRINTVALSTREAM(rawoutstream, " status report.\n"); + PRINTVALSTREAM(rawoutstream, " -q, --quiet\n"); + PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n"); + PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n"); + PRINTVALSTREAM(rawoutstream, " Prints messages from the HDF5 error stack as they occur.\n"); + PRINTVALSTREAM(rawoutstream, " --follow-symlinks\n"); + PRINTVALSTREAM(rawoutstream, " Follow symbolic links (soft links and external links and compare the)\n"); + PRINTVALSTREAM(rawoutstream, " links' target objects.\n"); + PRINTVALSTREAM(rawoutstream, " If symbolic link(s) with the same name exist in the files being\n"); + PRINTVALSTREAM(rawoutstream, " compared, then determine whether the target of each link is an existing\n"); + PRINTVALSTREAM(rawoutstream, " object (dataset, group, or named datatype) or the link is a dangling\n"); + PRINTVALSTREAM(rawoutstream, " link (a soft or external link pointing to a target object that does\n"); + PRINTVALSTREAM(rawoutstream, " not yet exist).\n"); + PRINTVALSTREAM(rawoutstream, " - If both symbolic links are dangling links, they are treated as being\n"); + PRINTVALSTREAM(rawoutstream, " the same; by default, h5diff returns an exit code of 0.\n"); + PRINTVALSTREAM(rawoutstream, " If, however, --no-dangling-links is used with --follow-symlinks,\n"); + PRINTVALSTREAM(rawoutstream, " this situation is treated as an error and h5diff returns an\n"); + PRINTVALSTREAM(rawoutstream, " exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " - If only one of the two links is a dangling link,they are treated as\n"); + PRINTVALSTREAM(rawoutstream, " being different and h5diff returns an exit code of 1.\n"); + PRINTVALSTREAM(rawoutstream, " If, however, --no-dangling-links is used with --follow-symlinks,\n"); + PRINTVALSTREAM(rawoutstream, " this situation is treated as an error and h5diff returns an\n"); + PRINTVALSTREAM(rawoutstream, " exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " - If both symbolic links point to existing objects, h5diff compares the\n"); + PRINTVALSTREAM(rawoutstream, " two objects.\n"); + PRINTVALSTREAM(rawoutstream, " If any symbolic link specified in the call to h5diff does not exist,\n"); + PRINTVALSTREAM(rawoutstream, " h5diff treats it as an error and returns an exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " --no-dangling-links\n"); + PRINTVALSTREAM(rawoutstream, " Must be used with --follow-symlinks option; otherwise, h5diff shows\n"); + PRINTVALSTREAM(rawoutstream, " error message and returns an exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " Check for any symbolic links (soft links or external links) that do not\n"); + PRINTVALSTREAM(rawoutstream, " resolve to an existing object (dataset, group, or named datatype).\n"); + PRINTVALSTREAM(rawoutstream, " If any dangling link is found, this situation is treated as an error\n"); + PRINTVALSTREAM(rawoutstream, " and h5diff returns an exit code of 2.\n"); + PRINTVALSTREAM(rawoutstream, " -c, --compare\n"); + PRINTVALSTREAM(rawoutstream, " List objects that are not comparable\n"); + PRINTVALSTREAM(rawoutstream, " -N, --nan\n"); + PRINTVALSTREAM(rawoutstream, " Avoid NaNs detection\n"); + PRINTVALSTREAM(rawoutstream, " -n C, --count=C\n"); + PRINTVALSTREAM(rawoutstream, " Print differences up to C. C must be a positive integer.\n"); + PRINTVALSTREAM(rawoutstream, " -d D, --delta=D\n"); + PRINTVALSTREAM(rawoutstream, " Print difference if (|a-b| > D). D must be a positive number. Where a\n"); + PRINTVALSTREAM(rawoutstream, " is the data point value in file1 and b is the data point value in file2.\n"); + PRINTVALSTREAM(rawoutstream, " Can not use with '-p' or '--use-system-epsilon'.\n"); + PRINTVALSTREAM(rawoutstream, " -p R, --relative=R\n"); + PRINTVALSTREAM(rawoutstream, " Print difference if (|(a-b)/b| > R). R must be a positive number. Where a\n"); + PRINTVALSTREAM(rawoutstream, " is the data point value in file1 and b is the data point value in file2.\n"); + PRINTVALSTREAM(rawoutstream, " Can not use with '-d' or '--use-system-epsilon'.\n"); + PRINTVALSTREAM(rawoutstream, " --use-system-epsilon\n"); + PRINTVALSTREAM(rawoutstream, " Print difference if (|a-b| > EPSILON), EPSILON is system defined value. Where a\n"); + PRINTVALSTREAM(rawoutstream, " is the data point value in file1 and b is the data point value in file2.\n"); + PRINTVALSTREAM(rawoutstream, " If the system epsilon is not defined,one of the following predefined\n"); + PRINTVALSTREAM(rawoutstream, " values will be used:\n"); + PRINTVALSTREAM(rawoutstream, " FLT_EPSILON = 1.19209E-07 for floating-point type\n"); + PRINTVALSTREAM(rawoutstream, " DBL_EPSILON = 2.22045E-16 for double precision type\n"); + PRINTVALSTREAM(rawoutstream, " Can not use with '-p' or '-d'.\n"); + PRINTVALSTREAM(rawoutstream, " --exclude-path \"path\"\n"); + PRINTVALSTREAM(rawoutstream, " Exclude the specified path to an object when comparing files or groups.\n"); + PRINTVALSTREAM(rawoutstream, " If a group is excluded, all member objects will also be excluded.\n"); + PRINTVALSTREAM(rawoutstream, " The specified path is excluded wherever it occurs.\n"); + PRINTVALSTREAM(rawoutstream, " This flexibility enables the same option to exclude either objects that\n"); + PRINTVALSTREAM(rawoutstream, " exist only in one file or common objects that are known to differ.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " When comparing files, \"path\" is the absolute path to the excluded;\n"); + PRINTVALSTREAM(rawoutstream, " object; when comparing groups, \"path\" is similar to the relative\n"); + PRINTVALSTREAM(rawoutstream, " path from the group to the excluded object. This \"path\" can be\n"); + PRINTVALSTREAM(rawoutstream, " taken from the first section of the output of the --verbose option.\n"); + PRINTVALSTREAM(rawoutstream, " For example, if you are comparing the group /groupA in two files and\n"); + PRINTVALSTREAM(rawoutstream, " you want to exclude /groupA/groupB/groupC in both files, the exclude\n"); + PRINTVALSTREAM(rawoutstream, " option would read as follows:\n"); + PRINTVALSTREAM(rawoutstream, " --exclude-path \"/groupB/groupC\"\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " If there are multiple paths to an object, only the specified path(s)\n"); + PRINTVALSTREAM(rawoutstream, " will be excluded; the comparison will include any path not explicitly\n"); + PRINTVALSTREAM(rawoutstream, " excluded.\n"); + PRINTVALSTREAM(rawoutstream, " This option can be used repeatedly to exclude multiple paths.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " Modes of output:\n"); + PRINTVALSTREAM(rawoutstream, " Default mode: print the number of differences found and where they occured\n"); + PRINTVALSTREAM(rawoutstream, " -r Report mode: print the above plus the differences\n"); + PRINTVALSTREAM(rawoutstream, " -v Verbose mode: print the above plus a list of objects and warnings\n"); + PRINTVALSTREAM(rawoutstream, " -q Quiet mode: do not print output\n"); + + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " File comparison:\n"); + PRINTVALSTREAM(rawoutstream, " If no objects [obj1[ obj2]] are specified, the h5diff comparison proceeds as\n"); + PRINTVALSTREAM(rawoutstream, " a comparison of the two files' root groups. That is, h5diff first compares\n"); + PRINTVALSTREAM(rawoutstream, " the names of root group members, generates a report of root group objects\n"); + PRINTVALSTREAM(rawoutstream, " that appear in only one file or in both files, and recursively compares\n"); + PRINTVALSTREAM(rawoutstream, " common objects.\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " Object comparison:\n"); + PRINTVALSTREAM(rawoutstream, " 1) Groups\n"); + PRINTVALSTREAM(rawoutstream, " First compares the names of member objects (relative path, from the\n"); + PRINTVALSTREAM(rawoutstream, " specified group) and generates a report of objects that appear in only\n"); + PRINTVALSTREAM(rawoutstream, " one group or in both groups. Common objects are then compared recursively.\n"); + PRINTVALSTREAM(rawoutstream, " 2) Datasets\n"); + PRINTVALSTREAM(rawoutstream, " Array rank and dimensions, datatypes, and data values are compared.\n"); + PRINTVALSTREAM(rawoutstream, " 3) Datatypes\n"); + PRINTVALSTREAM(rawoutstream, " The comparison is based on the return value of H5Tequal.\n"); + PRINTVALSTREAM(rawoutstream, " 4) Symbolic links\n"); + PRINTVALSTREAM(rawoutstream, " The paths to the target objects are compared.\n"); + PRINTVALSTREAM(rawoutstream, " (The option --follow-symlinks overrides the default behavior when\n"); + PRINTVALSTREAM(rawoutstream, " symbolic links are compared.).\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + + PRINTVALSTREAM(rawoutstream, " Exit code:\n"); + PRINTVALSTREAM(rawoutstream, " 0 if no differences, 1 if differences found, 2 if error\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Examples of use:\n"); + PRINTVALSTREAM(rawoutstream, " 1) h5diff file1 file2 /g1/dset1 /g1/dset2\n"); + PRINTVALSTREAM(rawoutstream, " Compares object '/g1/dset1' in file1 with '/g1/dset2' in file2\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " 2) h5diff file1 file2 /g1/dset1\n"); + PRINTVALSTREAM(rawoutstream, " Compares object '/g1/dset1' in both files\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " 3) h5diff file1 file2\n"); + PRINTVALSTREAM(rawoutstream, " Compares all objects in both files\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " Notes:\n"); + PRINTVALSTREAM(rawoutstream, " file1 and file2 can be the same file.\n"); + PRINTVALSTREAM(rawoutstream, " Use h5diff file1 file1 /g1/dset1 /g1/dset2 to compare\n"); + PRINTVALSTREAM(rawoutstream, " '/g1/dset1' and '/g1/dset2' in the same file\n"); + PRINTVALSTREAM(rawoutstream, "\n"); } diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 6b9004b..8dab3b4 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include #include "H5private.h" #include "h5diff.h" #include "h5diff_common.h" @@ -72,6 +69,10 @@ int main(int argc, const char *argv[]) { int ret; + H5E_auto2_t func; + H5E_auto2_t tools_func; + void *edata; + void *tools_edata; const char *fname1 = NULL; const char *fname2 = NULL; const char *objname1 = NULL; @@ -82,21 +83,34 @@ int main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + /* Initialize h5tools lib */ h5tools_init(); + /* Disable tools error reporting */ + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + /*------------------------------------------------------------------------- * process the command-line *------------------------------------------------------------------------- */ parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + if (enable_error_stack) { + H5Eset_auto2(H5E_DEFAULT, func, edata); + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + } + /*------------------------------------------------------------------------- * do the diff *------------------------------------------------------------------------- */ - nfound = h5diff(fname1,fname2,objname1,objname2,&options); + nfound = h5diff(fname1, fname2, objname1, objname2, &options); print_info(&options); @@ -106,17 +120,17 @@ int main(int argc, const char *argv[]) *------------------------------------------------------------------------- */ - ret = (nfound == 0 ? 0 : 1 ); + ret = (nfound == 0 ? 0 : 1); /* if graph difference return 1 for differences */ - if ( options.contents == 0 ) + if (options.contents == 0) ret = 1; /* and return 2 for error */ if (options.err_stat) ret = 2; - return ret; + h5diff_exit(ret); } /*------------------------------------------------------------------------- @@ -135,8 +149,11 @@ int main(int argc, const char *argv[]) * *------------------------------------------------------------------------- */ -void h5diff_exit(int status) +H5_ATTR_NORETURN void +h5diff_exit(int status) { + h5tools_close(); + HDexit(status); } diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index bfeb408..89efc39 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -11,9 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include #include "H5private.h" #include "h5diff.h" #include "ph5diff.h" @@ -319,6 +316,8 @@ void h5diff_exit(int status) status = EXIT_SUCCESS; /* Reset exit status, since some mpiexec commands generate output on failure status */ } + h5tools_close(); + /* Always exit(0), since MPI implementations do weird stuff when they * receive a non-zero exit value. - QAK */ diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index 0a0ee22..11ad800 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -23,6 +23,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_454_ERR.err b/tools/h5diff/testfiles/h5diff_454_ERR.err new file mode 100644 index 0000000..8fa1718 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_454_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_454_ERR.txt b/tools/h5diff/testfiles/h5diff_454_ERR.txt new file mode 100644 index 0000000..de25a69 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_454_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_455_ERR.err b/tools/h5diff/testfiles/h5diff_455_ERR.err new file mode 100644 index 0000000..8fa1718 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_455_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_455_ERR.txt b/tools/h5diff/testfiles/h5diff_455_ERR.txt new file mode 100644 index 0000000..de25a69 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_455_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_457_ERR.err b/tools/h5diff/testfiles/h5diff_457_ERR.err new file mode 100644 index 0000000..8fa1718 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_457_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_457_ERR.txt b/tools/h5diff/testfiles/h5diff_457_ERR.txt new file mode 100644 index 0000000..6594c9a --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_457_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_458_ERR.err b/tools/h5diff/testfiles/h5diff_458_ERR.err new file mode 100644 index 0000000..8fa1718 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_458_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_458_ERR.txt b/tools/h5diff/testfiles/h5diff_458_ERR.txt new file mode 100644 index 0000000..9a09c17 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_458_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_459_ERR.err b/tools/h5diff/testfiles/h5diff_459_ERR.err new file mode 100644 index 0000000..8fa1718 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_459_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt index 4362711..f3b346a 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -23,6 +23,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_601_ERR.err b/tools/h5diff/testfiles/h5diff_601_ERR.err new file mode 100644 index 0000000..f9a7212 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_601_ERR.err @@ -0,0 +1,4 @@ +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: Object could not be found + major: Failure in tools library + minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_601_ERR.txt b/tools/h5diff/testfiles/h5diff_601_ERR.txt new file mode 100644 index 0000000..b58124a --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_601_ERR.txt @@ -0,0 +1,6 @@ +Object could not be found in +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: Object could not be found + major: Failure in tools library + minor: error in function +EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt index 9ab3204..0d6b474 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt index afe0e72..94f44e8 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt index 97a1747..7f83c64 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt index 78770f0..3cfe6b9 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt index b2a5881..9c34945 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt index 66a3025..2b2df2f 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt index f9258d1..3e80438 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt index 57a4ddd..7a2f585 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -24,6 +24,8 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] status report. -q, --quiet Quiet mode. Do not produce output. + --enable-error-stack + Prints messages from the HDF5 error stack as they occur. --follow-symlinks Follow symbolic links (soft links and external links and compare the) links' target objects. -- cgit v0.12 From 0b070ae114172588756d2c8732ccb7c89eb08ab6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Sep 2017 12:36:26 -0500 Subject: HDFFV-10282 refactor out assert calls in tools --- tools/h5dump/h5dump.c | 184 ++++++++------- tools/h5dump/h5dump_ddl.c | 204 ++++++++--------- tools/h5dump/h5dump_xml.c | 457 +++++++++++++++++++------------------- tools/h5jam/h5jam.c | 10 +- tools/h5jam/h5unjam.c | 48 ++-- tools/h5ls/h5ls.c | 33 ++- tools/h5repack/h5repack.c | 5 - tools/h5repack/h5repack_copy.c | 3 +- tools/h5repack/h5repack_filters.c | 36 +-- tools/h5repack/h5repack_refs.c | 8 +- tools/lib/h5diff_dset.c | 12 +- tools/lib/h5diff_util.c | 7 +- tools/lib/h5tools.c | 41 ++-- tools/lib/h5tools_ref.c | 43 ++-- tools/lib/h5tools_type.c | 2 - tools/lib/h5tools_utils.c | 18 +- tools/lib/h5trav.c | 32 ++- 17 files changed, 568 insertions(+), 575 deletions(-) diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index ced5b36..80e653a 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -10,8 +10,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "h5dump.h" #include "h5dump_ddl.h" @@ -719,93 +717,100 @@ parse_mask_list(const char *h_list) const char *ptr = NULL; /* sanity check */ - HDassert(h_list); + if(h_list) { + HDmemset(packed_mask,0,sizeof(packed_mask)); + + packed_bits_num = 0; + /* scan in pair of offset,length separated by commas. */ + ptr = h_list; + while (*ptr) { + /* scan for an offset which is an unsigned int */ + if (!HDisdigit(*ptr)) { + error_msg("Bad mask list(%s)\n", h_list); + return FAIL; + } + soffset_value = HDatoi(ptr); + offset_value = (unsigned)soffset_value; + if (soffset_value < 0 || offset_value >= PACKED_BITS_SIZE_MAX) { + error_msg("Packed Bit offset value(%d) must be between 0 and %u\n", + soffset_value, (unsigned)(PACKED_BITS_SIZE_MAX - 1)); + return FAIL; + } - HDmemset(packed_mask,0,sizeof(packed_mask)); + /* skip to end of integer */ + while (HDisdigit(*++ptr)) + ; + /* Look for the common separator */ + if (*ptr++ != ',') { + error_msg("Bad mask list(%s), missing expected comma separator.\n", h_list); + return FAIL; + } - packed_bits_num = 0; - /* scan in pair of offset,length separated by commas. */ - ptr = h_list; - while (*ptr) { - /* scan for an offset which is an unsigned int */ - if (!HDisdigit(*ptr)) { - error_msg("Bad mask list(%s)\n", h_list); - return FAIL; - } - soffset_value = HDatoi(ptr); - offset_value = (unsigned)soffset_value; - if (soffset_value < 0 || offset_value >= PACKED_BITS_SIZE_MAX) { - error_msg("Packed Bit offset value(%d) must be between 0 and %u\n", - soffset_value, (unsigned)(PACKED_BITS_SIZE_MAX - 1)); - return FAIL; - } + /* scan for a length which is a positive int */ + if (!HDisdigit(*ptr)) { + error_msg("Bad mask list(%s)\n", h_list); + return FAIL; + } + slength_value = HDatoi(ptr); + if (slength_value <= 0) { + error_msg("Packed Bit length value(%d) must be positive.\n", slength_value); + return FAIL; + } + length_value = (unsigned)slength_value; + if ((offset_value + length_value) > PACKED_BITS_SIZE_MAX) { + error_msg("Packed Bit offset+length value(%u) too large. Max is %u\n", + offset_value+length_value, (unsigned)PACKED_BITS_SIZE_MAX); + return FAIL; + } - /* skip to end of integer */ - while (HDisdigit(*++ptr)) - ; - /* Look for the common separator */ - if (*ptr++ != ',') { - error_msg("Bad mask list(%s), missing expected comma separator.\n", h_list); - return FAIL; - } + /* skip to end of int */ + while (HDisdigit(*++ptr)) + ; - /* scan for a length which is a positive int */ - if (!HDisdigit(*ptr)) { - error_msg("Bad mask list(%s)\n", h_list); - return FAIL; - } - slength_value = HDatoi(ptr); - if (slength_value <= 0) { - error_msg("Packed Bit length value(%d) must be positive.\n", slength_value); - return FAIL; + /* store the offset,length pair */ + if (packed_bits_num >= PACKED_BITS_MAX) { + /* too many requests */ + error_msg("Too many masks requested (max. %d). Mask list(%s)\n", PACKED_BITS_MAX, h_list); + return FAIL; + } + packed_offset[packed_bits_num] = offset_value; + packed_length[packed_bits_num] = length_value; + /* create the bit mask by left shift 1's by length, then negate it. */ + /* After packed_mask is calculated, packed_length is not needed but */ + /* keep it for debug purpose. */ + temp_mask = ~0ULL; + if(length_value < (int)(8 *sizeof(unsigned long long))) { + temp_mask = temp_mask << length_value; + packed_mask[packed_bits_num] = ~temp_mask; + } + else + packed_mask[packed_bits_num] = temp_mask; + packed_bits_num++; + + /* skip a possible comma separator */ + if (*ptr == ',') { + if (!(*++ptr)) { + /* unexpected end of string */ + error_msg("Bad mask list(%s), unexpected end of string.\n", h_list); + return FAIL; + } + } } - length_value = (unsigned)slength_value; - if ((offset_value + length_value) > PACKED_BITS_SIZE_MAX) { - error_msg("Packed Bit offset+length value(%u) too large. Max is %u\n", - offset_value+length_value, (unsigned)PACKED_BITS_SIZE_MAX); + if(packed_bits_num > PACKED_BITS_MAX) { + error_msg("Maximum number of packed bits exceeded\n"); return FAIL; } - - /* skip to end of int */ - while (HDisdigit(*++ptr)) - ; - - /* store the offset,length pair */ - if (packed_bits_num >= PACKED_BITS_MAX) { - /* too many requests */ - error_msg("Too many masks requested (max. %d). Mask list(%s)\n", PACKED_BITS_MAX, h_list); + if (packed_bits_num == 0) { + /* got no masks! */ + error_msg("Bad mask list(%s)\n", h_list); return FAIL; } - packed_offset[packed_bits_num] = offset_value; - packed_length[packed_bits_num] = length_value; - /* create the bit mask by left shift 1's by length, then negate it. */ - /* After packed_mask is calculated, packed_length is not needed but */ - /* keep it for debug purpose. */ - temp_mask = ~0ULL; - if(length_value < (int)(8 *sizeof(unsigned long long))) { - temp_mask = temp_mask << length_value; - packed_mask[packed_bits_num] = ~temp_mask; - } - else - packed_mask[packed_bits_num] = temp_mask; - packed_bits_num++; - - /* skip a possible comma separator */ - if (*ptr == ',') { - if (!(*++ptr)) { - /* unexpected end of string */ - error_msg("Bad mask list(%s), unexpected end of string.\n", h_list); - return FAIL; - } - } + return SUCCEED; } - HDassert(packed_bits_num <= PACKED_BITS_MAX); - if (packed_bits_num == 0) { - /* got no masks! */ - error_msg("Bad mask list(%s)\n", h_list); + else { + error_msg("Bad mask list argument\n"); return FAIL; } - return SUCCEED; } @@ -1696,13 +1701,18 @@ h5_fileaccess(void) HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - for (mt=H5FD_MEM_DEFAULT; mt 0); - *prfx = (char *)HDcalloc(prfx_len, 1); + if(prfx_len > 0) + *prfx = (char *)HDcalloc(prfx_len, 1); + else + error_msg("unable to allocate prefix buffer\n"); } diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index ecfd82a..8dc96ce 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -10,8 +10,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" #include "h5tools.h" @@ -249,17 +247,19 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR /* Keep copy of prefix before iterating into group */ old_prefix = HDstrdup(prefix); - HDassert(old_prefix); + if (old_prefix) { + /* Append group name to prefix */ + add_prefix(&prefix, &prefix_len, name); - /* Append group name to prefix */ - add_prefix(&prefix, &prefix_len, name); + /* Iterate into group */ + dump_function_table->dump_group_function(obj, name); - /* Iterate into group */ - dump_function_table->dump_group_function(obj, name); - - /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); - HDfree(old_prefix); + /* Restore old prefix name */ + HDstrcpy(prefix, old_prefix); + HDfree(old_prefix); + } + else + error_msg("warning: null prefix\n"); /* Close group */ H5Gclose(obj); @@ -388,131 +388,137 @@ dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ATTR switch(linfo->type) { case H5L_TYPE_SOFT: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - ctx.need_prefix = TRUE; - - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s \"%s\" %s", - h5tools_dump_header_format->softlinkbegin, name, - h5tools_dump_header_format->softlinkblockbegin); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - - ctx.indent_level++; - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get link value\n"); + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else { - /* print the value of a soft link */ - /* Standard DDL: no modification */ ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "LINKTARGET \"%s\"", targbuf); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->softlinkbegin, name, + h5tools_dump_header_format->softlinkblockbegin); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } - ctx.indent_level--; + ctx.indent_level++; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + /* print the value of a soft link */ + /* Standard DDL: no modification */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - if(HDstrlen(h5tools_dump_header_format->softlinkblockend)) { - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); - if(HDstrlen(h5tools_dump_header_format->softlinkend)) - h5tools_str_append(&buffer, " "); - } - if(HDstrlen(h5tools_dump_header_format->softlinkend)) - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "LINKTARGET \"%s\"", targbuf); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } - HDfree(targbuf); - break; + ctx.indent_level--; - case H5L_TYPE_EXTERNAL: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->softlinkblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); + if(HDstrlen(h5tools_dump_header_format->softlinkend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->softlinkend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s \"%s\" %s", - h5tools_dump_header_format->extlinkbegin, name, - h5tools_dump_header_format->extlinkblockbegin); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + HDfree(targbuf); + } + break; - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - indentation(dump_indent); - error_msg("unable to get external link value\n"); + case H5L_TYPE_EXTERNAL: + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } /* end if */ + } else { - const char *filename; - const char *targname; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->extlinkbegin, name, + h5tools_dump_header_format->extlinkblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { indentation(dump_indent); - error_msg("unable to unpack external link value\n"); + error_msg("unable to get external link value\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } /* end if */ else { - ctx.indent_level++; + const char *filename; + const char *targname; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + indentation(dump_indent); + error_msg("unable to unpack external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + ctx.indent_level++; - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "TARGETFILE \"%s\"", filename); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "TARGETFILE \"%s\"", filename); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "TARGETPATH \"%s\"", targname); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* dump the external link */ - dump_extlink(group, name, targname); - ctx.indent_level--; + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "TARGETPATH \"%s\"", targname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + + /* dump the external link */ + dump_extlink(group, name, targname); + ctx.indent_level--; + } /* end else */ } /* end else */ - } /* end else */ - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - if(HDstrlen(h5tools_dump_header_format->extlinkblockend)) { - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->extlinkblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); + if(HDstrlen(h5tools_dump_header_format->extlinkend)) + h5tools_str_append(&buffer, " "); + } if(HDstrlen(h5tools_dump_header_format->extlinkend)) - h5tools_str_append(&buffer, " "); - } - if(HDstrlen(h5tools_dump_header_format->extlinkend)) - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(targbuf); + HDfree(targbuf); + } break; case H5L_TYPE_ERROR: case H5L_TYPE_MAX: - HDassert(0); - /* fall through */ case H5L_TYPE_HARD: default: ctx.need_prefix = TRUE; @@ -1062,7 +1068,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) case H5T_NO_CLASS: case H5T_NCLASSES: default: - HDassert(0); + error_msg("invalid H5TCLASS type\n"); break; } /* end switch */ } /* for(u=0; uudlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 089419b..76819f0 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -197,18 +197,22 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ char *old_prefix; /* Pointer to previous prefix */ /* Keep copy of prefix before iterating into group */ - old_prefix = HDstrdup(prefix); - HDassert(old_prefix); - - /* Append group name to prefix */ - add_prefix(&prefix, &prefix_len, name); + if((old_prefix = HDstrdup(prefix)) == NULL) { + error_msg("unable to allocate buffer\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + /* Append group name to prefix */ + add_prefix(&prefix, &prefix_len, name); - /* Iterate into group */ - dump_function_table->dump_group_function(obj, name); + /* Iterate into group */ + dump_function_table->dump_group_function(obj, name); - /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); - HDfree(old_prefix); + /* Restore old prefix name */ + HDstrcpy(prefix, old_prefix); + HDfree(old_prefix); + } /* Close group */ H5Gclose(obj); @@ -359,161 +363,167 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void H5_ switch(linfo->type) { case H5L_TYPE_SOFT: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get link value\n"); + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } else { - /* print the value of a soft link */ - /* XML */ - char linkxid[100]; - char parentxid[100]; - char targetxid[100]; - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_name = xml_escape_the_name(name); - char *t_targbuf = xml_escape_the_name(targbuf); - char *t_obj_path = xml_escape_the_name(obj_path); - char *t_link_path; - int res; - - t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1); - if(targbuf[0] == '/') - HDstrcpy(t_link_path, targbuf); + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } else { - HDstrcpy(t_link_path, prefix); - HDstrcat(HDstrcat(t_link_path, "/"), targbuf); - } /* end else */ + /* print the value of a soft link */ + /* XML */ + char linkxid[100]; + char parentxid[100]; + char targetxid[100]; + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_name = xml_escape_the_name(name); + char *t_targbuf = xml_escape_the_name(targbuf); + char *t_obj_path = xml_escape_the_name(obj_path); + char *t_link_path; + int res; - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); + t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1); + if(targbuf[0] == '/') + HDstrcpy(t_link_path, targbuf); + else { + HDstrcpy(t_link_path, prefix); + HDstrcat(HDstrcat(t_link_path, "/"), targbuf); + } /* end else */ - /* Try to create an OBJ-XID for the object pointed to */ - res = xml_name_to_XID(t_link_path, targetxid, (int)sizeof(targetxid), 0); - if (res == 0) { - /* target obj found */ - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetPath=\"%s\" TargetObj=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - t_targbuf, /* TargetPath */ - targetxid, /* TargetObj */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } - else { - /* dangling link -- omit from xml attributes */ - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Try to create an OBJ-XID for the object pointed to */ + res = xml_name_to_XID(t_link_path, targetxid, (int)sizeof(targetxid), 0); + if (res == 0) { + /* target obj found */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetPath=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - t_targbuf, /* TargetPath */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetPath=\"%s\" TargetObj=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + t_targbuf, /* TargetPath */ + targetxid, /* TargetObj */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } + else { + /* dangling link -- omit from xml attributes */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetPath=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + t_targbuf, /* TargetPath */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_targbuf); + HDfree(t_obj_path); + HDfree(t_link_path); } - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_targbuf); - HDfree(t_obj_path); - HDfree(t_link_path); + HDfree(targbuf); } - - HDfree(targbuf); break; case H5L_TYPE_EXTERNAL: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get external link value\n"); + if((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; - } /* end if */ + } else { - const char *filename; - const char *targname; - - if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { - error_msg("unable to unpack external link value\n"); + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get external link value\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; } /* end if */ else { - char linkxid[100]; - char parentxid[100]; - char *t_name = xml_escape_the_name(name); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_obj_path = xml_escape_the_name(obj_path); - char *t_filename = xml_escape_the_name(filename); - char *t_targname = xml_escape_the_name(targname); + const char *filename; + const char *targname; - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + error_msg("unable to unpack external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + char linkxid[100]; + char parentxid[100]; + char *t_name = xml_escape_the_name(name); + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_obj_path = xml_escape_the_name(obj_path); + char *t_filename = xml_escape_the_name(filename); + char *t_targname = xml_escape_the_name(targname); - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, (int)sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, (int)sizeof(parentxid), 1); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sExternalLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetFilename=\"%s\" " - "TargetPath=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - filename, /* TargetFilename */ - targname, /* TargetPath*/ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_filename); - HDfree(t_targname); - HDfree(t_obj_path); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sExternalLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetFilename=\"%s\" " + "TargetPath=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + filename, /* TargetFilename */ + targname, /* TargetPath*/ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_filename); + HDfree(t_targname); + HDfree(t_obj_path); + } /* end else */ } /* end else */ - } /* end else */ - HDfree(targbuf); + HDfree(targbuf); + } break; case H5L_TYPE_ERROR: case H5L_TYPE_MAX: - HDassert(0); - /* fall through */ case H5L_TYPE_HARD: default: { @@ -673,7 +683,6 @@ xml_escape_the_name(const char *str) for (i = 0; i < len; i++) { size_t esc_len; - HDassert(ncp_len); if (*cp == '\'') { HDstrncpy(ncp, apos, ncp_len); esc_len = HDstrlen(apos); @@ -767,7 +776,6 @@ xml_escape_the_string(const char *str, int slen) for (i = 0; i < len; i++) { size_t esc_len; - HDassert(ncp_len); if (*cp == '\\') { *ncp++ = '\\'; *ncp = *cp; @@ -1513,8 +1521,6 @@ xml_print_datatype(hid_t type, unsigned in_group) case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -1967,22 +1973,26 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED * sset, for (i = 0; i < ndims; i++) nelmts *= size[i]; - buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); - HDassert(buf); - - if (H5Aread(obj_id, p_type, buf) >= 0) { - h5tools_context_t datactx; - HDmemset(&datactx, 0, sizeof(datactx)); - datactx.need_prefix = TRUE; - datactx.indent_level = ctx.indent_level; - datactx.cur_column = ctx.cur_column; - status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + if((buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type))))) == NULL) { + error_msg("unable to allocate buffer\n"); + h5tools_setstatus(EXIT_FAILURE); + status = FAIL; } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + else { + if (H5Aread(obj_id, p_type, buf) >= 0) { + h5tools_context_t datactx; + HDmemset(&datactx, 0, sizeof(datactx)); + datactx.need_prefix = TRUE; + datactx.indent_level = ctx.indent_level; + datactx.cur_column = ctx.cur_column; + status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + } + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - HDfree(buf); + HDfree(buf); + } } H5Tclose(p_type); H5Sclose(space); @@ -2238,8 +2248,6 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED break; case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); @@ -3671,8 +3679,6 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ case H5T_STRING: case H5T_REFERENCE: default: @@ -3811,91 +3817,95 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s /* Print information about storage layout */ if (H5D_CHUNKED == H5Pget_layout(dcpl)) { - maxdims = H5Sget_simple_extent_ndims(space); - HDassert(maxdims >= 0); - chsize = (hsize_t *)HDmalloc((size_t)maxdims * sizeof(hsize_t)); - ctx.indent_level++; - dump_indent += COL; + if((maxdims = H5Sget_simple_extent_ndims(space)) < 0) { + error_msg("unable to get maxdims\n"); + h5tools_setstatus(EXIT_FAILURE); + } + else { + chsize = (hsize_t *)HDmalloc((size_t)maxdims * sizeof(hsize_t)); + ctx.indent_level++; + dump_indent += COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level++; - dump_indent += COL; + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.indent_level++; + dump_indent += COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sChunkedLayout ", xmlnsprefix); - ndims = H5Pget_chunk(dcpl, maxdims, chsize); - h5tools_str_append(&buffer, "Ndims=\"%d\">", ndims); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sChunkedLayout ", xmlnsprefix); + ndims = H5Pget_chunk(dcpl, maxdims, chsize); + h5tools_str_append(&buffer, "Ndims=\"%d\">", ndims); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level++; - dump_indent += COL; + ctx.indent_level++; + dump_indent += COL; - for (i = 0; i < ndims; i++) { + for (i = 0; i < ndims; i++) { + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />", xmlnsprefix, chsize[i]); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + } ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); /* Render the element */ h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />", xmlnsprefix, chsize[i]); + h5tools_str_append(&buffer, "<%sRequiredFilter>", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - } - - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "<%sRequiredFilter>", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level++; - dump_indent += COL; - check_filters(dcpl); - ctx.indent_level--; - dump_indent -= COL; + ctx.indent_level++; + dump_indent += COL; + check_filters(dcpl); + ctx.indent_level--; + dump_indent -= COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level--; - dump_indent -= COL; + ctx.indent_level--; + dump_indent -= COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level--; - dump_indent -= COL; + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.indent_level--; + dump_indent -= COL; - ctx.need_prefix = TRUE; - h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "", xmlnsprefix); - h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - ctx.indent_level--; - dump_indent -= COL; - HDfree(chsize); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); + ctx.indent_level--; + dump_indent -= COL; + HDfree(chsize); + } } else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl)) { ctx.indent_level++; @@ -3983,8 +3993,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s h5tools_str_append(&buffer, "FillIfSet"); break; case H5D_FILL_TIME_ERROR: - HDassert(0); - /* fall through */ default: h5tools_str_append(&buffer, "?"); break; @@ -4004,8 +4012,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s break; case H5D_ALLOC_TIME_DEFAULT: case H5D_ALLOC_TIME_ERROR: - HDassert(0); - /* fall through */ default: h5tools_str_append(&buffer, "?"); break; @@ -4232,9 +4238,6 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED * s break; case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert(0); - /* fall through */ - default: ctx.need_prefix = TRUE; h5tools_simple_prefix(rawoutstream, outputformat, &ctx, (hsize_t)0, 0); diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index b15a18f..269ca89 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -76,13 +76,13 @@ usage (const char *prog) HDfprintf (stdout, "Adds user block to front of an HDF5 file and creates a new concatenated file.\n"); HDfprintf (stdout, "\n"); - HDfprintf (stdout, + HDfprintf (stdout, "OPTIONS\n"); - HDfprintf (stdout, + HDfprintf (stdout, " -i in_file.h5 Specifies the input HDF5 file.\n"); - HDfprintf (stdout, + HDfprintf (stdout, " -u in_user_file Specifies the file to be inserted into the user block.\n"); - HDfprintf (stdout, + HDfprintf (stdout, " Can be any file format except an HDF5 format.\n"); HDfprintf (stdout, " -o out_file.h5 Specifies the output HDF5 file.\n"); @@ -389,7 +389,7 @@ main (int argc, const char *argv[]) HDfree (input_file); if(output_file) HDfree (output_file); - + if(ufid >= 0) HDclose (ufid); if(h5fid >= 0) diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 8f6b686..4cc0c70 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -135,28 +135,28 @@ static int parse_command_line(int argc, const char *argv[]) { int opt = FALSE; - + /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch((char)opt) { case 'o': output_file = HDstrdup(opt_arg); - if (output_file) - h5tools_set_data_output_file(output_file, 1); - break; + if (output_file) + h5tools_set_data_output_file(output_file, 1); + break; case 'i': input_file = HDstrdup(opt_arg); - if (input_file) - h5tools_set_input_file(input_file, 1); - break;; + if (input_file) + h5tools_set_input_file(input_file, 1); + break;; case 'u': ub_file = HDstrdup(opt_arg); - if (ub_file) - h5tools_set_output_file(ub_file, 1); - else - rawoutstream = stdout; + if (ub_file) + h5tools_set_output_file(ub_file, 1); + else + rawoutstream = stdout; break; case 'd': @@ -182,7 +182,7 @@ parse_command_line(int argc, const char *argv[]) } return EXIT_SUCCESS; - + done: if(input_file) HDfree(input_file); @@ -242,7 +242,7 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - + testval = H5Fis_hdf5(input_file); if (testval <= 0) { @@ -305,7 +305,7 @@ main(int argc, const char *argv[]) error_msg("unable to open output HDF5 file \"%s\"\n", input_file); h5tools_setstatus(EXIT_FAILURE); goto done; - } + } /* copy from 0 to 'usize - 1' into ufid */ if (!do_delete) { @@ -323,18 +323,18 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } - + done: if(input_file) HDfree(input_file); - + if(output_file) HDfree(output_file); - + if(ub_file) { HDfree(ub_file); } - + h5tools_close(); return h5tools_getstatus(); @@ -374,7 +374,7 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much ) else bytes_in = how_much; - /* Seek to correct position in input file */ + /* Seek to correct position in input file */ HDfseek(infid, from, SEEK_SET); /* Read data to buffer */ @@ -396,11 +396,11 @@ copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much ) to += bytes_read; /* Write nchars bytes to output file */ - bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); - if(bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */ - ret_value = -1; - goto done; - } /* end if */ + bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); + if(bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */ + ret_value = -1; + goto done; + } /* end if */ } /* end while */ done: diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index a58b96b..e81a8eb 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1618,9 +1618,9 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain if(space_type != H5S_NULL && space_type != H5S_NO_CLASS) { if(hexdump_g) - p_type = H5Tcopy(type); + p_type = H5Tcopy(type); else - p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); + p_type = H5Tget_native_type(type, H5T_DIR_DEFAULT); if(p_type >= 0) { /* VL data special information */ @@ -1630,23 +1630,22 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain if (h5tools_detect_vlen(p_type) == TRUE) vl_data = TRUE; - temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); - HDassert(temp_need == (hsize_t)((size_t)temp_need)); + temp_need = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); need = (size_t)temp_need; - buf = HDmalloc(need); - HDassert(buf); - if(H5Aread(attr, p_type, buf) >= 0) { - ctx.need_prefix = TRUE; - ctx.indent_level = 2; - ctx.cur_column = (size_t)curr_pos; - h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); - } + if((buf = HDmalloc(need)) != NULL) { + if(H5Aread(attr, p_type, buf) >= 0) { + ctx.need_prefix = TRUE; + ctx.indent_level = 2; + ctx.cur_column = (size_t)curr_pos; + h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); + } - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - HDfree(buf); + HDfree(buf); + } H5Tclose(p_type); } /* end if */ } @@ -1847,7 +1846,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) } /* end if */ break; default: - HDassert(0); + h5tools_str_append(&buffer, "layout information not available"); break; } /* Print total raw storage size */ diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 0ab5404..c8ff98e 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -11,10 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include -#include - #include "H5private.h" #include "h5repack.h" #include "h5tools.h" @@ -265,7 +261,6 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, /* Check if this type is the one requested */ if (oinfo.addr == dt->addr_in) { - HDassert(!dt_ret); dt_ret = dt; } /* end if */ } /* end if */ diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index b41f7be..93612e2 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -725,7 +725,6 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, switch (travt->objs[i].type) { case H5TRAV_TYPE_UNKNOWN: - HDassert(0); break; /*------------------------------------------------------------------------- @@ -1429,7 +1428,6 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t size int infid = -1, outfid = -1; /* File descriptors */ /* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */ - HDassert(size > 0); /* Open files */ if ((infid = HDopen(infile, O_RDONLY, 0)) < 0) @@ -1527,6 +1525,7 @@ void print_user_block(const char *filename, hid_t fid) /* open file */ if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { + error_msg("failed to open file\n"); HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed"); } diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index f265b8c..88178f6 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -32,11 +32,11 @@ * *------------------------------------------------------------------------- */ -static int aux_find_obj(const char *name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj) /* (OUT) info about object to filter */ +static int aux_find_obj(const char* name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { - char *pdest; + char *pdest; int result; unsigned int i; @@ -69,9 +69,9 @@ static int aux_find_obj(const char *name, /* object name from traverse list * *------------------------------------------------------------------------- */ -static int aux_assign_obj(const char *name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj) /* (OUT) info about object to filter */ +static int aux_assign_obj(const char* name, /* object name from traverse list */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { int idx, i; @@ -184,19 +184,19 @@ static int aux_assign_obj(const char *name, /* object name from traverse list *------------------------------------------------------------------------- */ -int apply_filters(const char *name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t *dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int *has_filter) /* (OUT) object NAME has a filter */ +int apply_filters(const char* name, /* object name from traverse list */ + int rank, /* rank of dataset */ + hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t *options, /* repack options */ + int *has_filter) /* (OUT) object NAME has a filter */ { - int nfilters; /* number of filters in DCPL */ - hsize_t chsize[64]; /* chunk size in elements */ + int nfilters; /* number of filters in DCPL */ + hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; - int i; - pack_info_t obj; + int i; + pack_info_t obj; *has_filter = 0; diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 89d0f76..4220091 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -189,8 +189,7 @@ int do_copy_refobjs(hid_t fidin, /* create the reference, -1 parameter for objects */ if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); - if(options->verbose) - { + if(options->verbose) { printf(FORMAT_OBJ,"dset",travt->objs[i].name ); printf("object <%s> object reference created to <%s>\n", travt->objs[i].name, @@ -278,8 +277,7 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); if(H5Sclose(region_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); - if(options->verbose) - { + if(options->verbose) { printf(FORMAT_OBJ,"dset",travt->objs[i].name ); printf("object <%s> region reference created to <%s>\n", travt->objs[i].name, @@ -320,8 +318,6 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); } /* end else */ - HDassert(dset_out != FAIL); - /*------------------------------------------------------------------------- * copy referenced objects in attributes *------------------------------------------------------------------------- diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 1ac3d79..cf8b537 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -352,7 +352,6 @@ hsize_t diff_datasetid( hid_t did1, nelmts2 *= dims2[i]; h5diffdebug3("nelmts: %ld - %ld\n", nelmts1, nelmts2); - HDassert(nelmts1 == nelmts2); if(tclass != H5T_ARRAY) { /*----------------------------------------------------------------- @@ -453,7 +452,6 @@ hsize_t diff_datasetid( hid_t did1, size = 1; sm_size[i - 1] = MIN(dadims[i - 1], size); sm_nbytes *= sm_size[i - 1]; - HDassert(sm_nbytes > 0); } /* end for */ /* malloc return code should be verified. @@ -463,10 +461,10 @@ hsize_t diff_datasetid( hid_t did1, * that fails to address freeing other objects created here. * E.g., sm_space. */ - sm_buf1 = HDmalloc((size_t)sm_nbytes); - HDassert(sm_buf1); - sm_buf2 = HDmalloc((size_t)sm_nbytes); - HDassert(sm_buf2); + if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) + goto error; + if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) + goto error; sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); @@ -676,7 +674,6 @@ int diff_can_type( hid_t f_tid1, /* file data type */ * check for non supported classes *------------------------------------------------------------------------- */ - HDassert(tclass1 == tclass2); switch (tclass1) { case H5T_TIME: if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { @@ -748,7 +745,6 @@ int diff_can_type( hid_t f_tid1, /* file data type */ * check for different dimensions *------------------------------------------------------------------------- */ - HDassert(rank1 == rank2); for(i = 0; i - * Thursday, July 23, 1998 - * * Purpose: A library for displaying the values of a dataset in a human * readable format. */ -#include -#include - #include "h5tools.h" #include "h5tools_dump.h" #include "h5tools_ref.h" @@ -40,7 +34,7 @@ FILE *rawinstream = NULL; /* should initialize to stdin but gcc moa FILE *rawoutstream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawerrorstream = NULL; /* should initialize to stderr but gcc moans about it */ int bin_output; /* binary output */ -int bin_form; /* binary form */ +int bin_form = 0; /* binary form, default NATIVE */ int region_output; /* region output */ int oid_output; /* oid output */ int data_output; /* data output */ @@ -1289,13 +1283,13 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) int i; unsigned j; - HDassert(ctx->ndims); - - ctx->acc[ctx->ndims - 1] = 1; - for (i = ((int)ctx->ndims - 2); i >= 0; i--) - ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; - for (j = 0; j < ctx->ndims; j++) - ctx->pos[j] = 0; + if(ctx->ndims > 0) { + ctx->acc[ctx->ndims - 1] = 1; + for (i = ((int)ctx->ndims - 2); i >= 0; i--) + ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; + for (j = 0; j < ctx->ndims; j++) + ctx->pos[j] = 0; + } } /*------------------------------------------------------------------------- @@ -1416,13 +1410,17 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t memb = H5Tget_super(tid); ndims = H5Tget_array_ndims(tid); H5Tget_array_dims2(tid, dims); - HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); - - /* calculate the number of array elements */ - for (k = 0, nelmts = 1; k < ndims; k++) { - temp_nelmts = nelmts; - temp_nelmts *= dims[k]; - nelmts = (size_t) temp_nelmts; + if(ndims >= 1 && ndims <= H5S_MAX_RANK) { + /* calculate the number of array elements */ + for (k = 0, nelmts = 1; k < ndims; k++) { + temp_nelmts = nelmts; + temp_nelmts *= dims[k]; + nelmts = (size_t) temp_nelmts; + } + } + else { + H5Tclose(memb); + H5E_THROW(FAIL, H5E_tools_min_id_g, "calculate the number of array elements failed"); } for (block_index = 0; block_index < block_nelmts; block_index++) { @@ -1647,7 +1645,6 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, ndims = (unsigned)sndims; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 16a949d..6153f0c 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -107,19 +107,21 @@ static int init_ref_path_table(void) { /* Sanity check */ - HDassert(thefile > 0); - - /* Create skip list to store reference path information */ - if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, NULL))==NULL) + if(thefile > 0) { + /* Create skip list to store reference path information */ + if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, NULL))==NULL) + return (-1); + + /* Iterate over objects in this file */ + if(h5trav_visit(thefile, "/", TRUE, TRUE, init_ref_path_cb, NULL, NULL) < 0) { + error_msg("unable to construct reference path table\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + + return(0); + } + else return (-1); - - /* Iterate over objects in this file */ - if(h5trav_visit(thefile, "/", TRUE, TRUE, init_ref_path_cb, NULL, NULL) < 0) { - error_msg("unable to construct reference path table\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - - return(0); } /*------------------------------------------------------------------------- @@ -212,16 +214,17 @@ ref_path_table_put(const char *path, haddr_t objno) { ref_path_node_t *new_node; - HDassert(ref_path_table); - HDassert(path); - - if((new_node = (ref_path_node_t *)HDmalloc(sizeof(ref_path_node_t))) == NULL) - return(-1); + if(ref_path_table && path) { + if((new_node = (ref_path_node_t *)HDmalloc(sizeof(ref_path_node_t))) == NULL) + return(-1); - new_node->objno = objno; - new_node->path = HDstrdup(path); + new_node->objno = objno; + new_node->path = HDstrdup(path); - return(H5SL_insert(ref_path_table, new_node, &(new_node->objno))); + return(H5SL_insert(ref_path_table, new_node, &(new_node->objno))); + } + else + return (-1); } /* diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index ae7160b..ee58ccb 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -92,7 +92,6 @@ h5tools_get_little_endian_type(hid_t tid) case H5T_NO_CLASS: case H5T_NCLASSES: default: - HDassert(0); break; } /* end switch */ @@ -179,7 +178,6 @@ h5tools_get_big_endian_type(hid_t tid) case H5T_NO_CLASS: case H5T_NCLASSES: default: - HDassert(0); break; } /* end switch */ diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 4084be0..60d7732 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -12,20 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling - * Tuesday, 6. March 2001 - */ - -/* * Portions of this work are derived from _Obfuscated C and Other Mysteries_, * by Don Libes, copyright (c) 1993 by John Wiley & Sons, Inc. */ -#include -#include -#include -#include - #include "h5tools.h" #include "h5tools_utils.h" #include "H5private.h" @@ -618,7 +608,6 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - HDassert(0); break; } /* end switch */ @@ -787,8 +776,11 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ } /* end if */ /* trg_path must be freed out of this function when finished using */ - link_info->trg_path = (char*)HDcalloc(link_info->linfo.u.val_size, sizeof(char)); - HDassert(link_info->trg_path); + if((link_info->trg_path = (char*)HDcalloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { + if(link_info->opt.msg_mode == 1) + parallel_print("Warning: unable to allocate buffer for <%s>\n",linkpath); + goto out; + } /* end if */ /* get link value */ if(H5Lget_val(file_id, linkpath, (void *)link_info->trg_path, link_info->linfo.u.val_size, H5P_DEFAULT) < 0) { diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index df5ba5c..079a4ea 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -557,7 +557,7 @@ trav_info_free(trav_info_t *info) if(info) { /* Free visited symbolic links path and file (if alloc) */ - for(u=0; u < info->symlink_visited.nused; u++) + for(u=0; u < info->symlink_visited.nused; u++) { if (info->symlink_visited.objs[u].file) HDfree(info->symlink_visited.objs[u].file); @@ -789,8 +789,6 @@ trav_table_addlink(trav_table_t *table, haddr_t objno, const char *path) return; } /* end for */ } /* end for */ - - HDassert(0 && "object not in table?!?"); } @@ -1017,7 +1015,7 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, /* Finish printing line about object */ printf("\n"); if(trav_verbosity > 0) - H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, + H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, &op_data, H5P_DEFAULT); } else @@ -1051,12 +1049,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) case H5L_TYPE_SOFT: if(linfo->u.val_size > 0) { char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1); - HDassert(targbuf); - - if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) - targbuf[0] = 0; - printf(" %-10s %s -> %s\n", "link", path, targbuf); - HDfree(targbuf); + if(targbuf) { + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; + printf(" %-10s %s -> %s\n", "link", path, targbuf); + HDfree(targbuf); + } } /* end if */ else printf(" %-10s %s ->\n", "link", path); @@ -1069,13 +1067,13 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) const char *objname = NULL; targbuf = (char*)HDmalloc(linfo->u.val_size + 1); - HDassert(targbuf); - - if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) - targbuf[0] = 0; - if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) - printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); - HDfree(targbuf); + if(targbuf) { + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + HDfree(targbuf); + } } /* end if */ else printf(" %-10s %s ->\n", "ext link", path); -- cgit v0.12 From ffaa6249eaaaac0f6c221b0eaa135f33d8298830 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 Sep 2017 11:56:49 -0500 Subject: HDFFV-9774 Fix merge typo --- tools/h5diff/h5diff_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index e4696c0..84c6be2 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -230,8 +230,9 @@ void parse_command_line(int argc, options->percent = atof(opt_arg); /* -p 0 is the same as default */ - if (H5_DBL_ABS_EQUAL(options->percent, (double)0.0F)) - options->p = 0; + if (options->percent == 0) + options->p = 0; + break; case 'n': @@ -341,7 +342,7 @@ void parse_command_line(int argc, * *------------------------------------------------------------------------- */ -H5_ATTR_PURE static int +static int check_n_input( const char *str ) { unsigned i; -- cgit v0.12 From c0d6729ab079686b69c2797cc15fb0f3bc788600 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 Sep 2017 13:41:03 -0500 Subject: Add missing test file --- tools/h5diff/testfiles/h5diff_459_ERR.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tools/h5diff/testfiles/h5diff_459_ERR.txt diff --git a/tools/h5diff/testfiles/h5diff_459_ERR.txt b/tools/h5diff/testfiles/h5diff_459_ERR.txt new file mode 100644 index 0000000..6594c9a --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_459_ERR.txt @@ -0,0 +1,6 @@ +Warning: is a dangling link. +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + major: Failure in tools library + minor: error in function +EXIT CODE: 2 -- cgit v0.12 From b15011a59af9e70eb06865234f8f0dacab34aa0f Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 7 Sep 2017 15:59:49 -0500 Subject: Fix for HDFFV-9947 Fix to return error when encoding dataspace selection exceeds 32 bit integer limit. --- src/H5Shyper.c | 55 +++++++++++++++++++++++---------- src/H5Spkg.h | 3 ++ src/H5Spoint.c | 24 +++++++++++++-- test/th5s.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 160 insertions(+), 19 deletions(-) diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 32f6200..09d450f 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -2071,21 +2071,53 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) { const H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */ hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary hyperslab counts */ - hsize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */ - hsize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */ - hsize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */ - hsize_t temp_off; /* Offset in a given dimension */ + hsize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */ + hsize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */ + hsize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */ + hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds */ + hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounds */ + hsize_t temp_off; /* Offset in a given dimension */ uint8_t *lenp; /* pointer to length location for later storage */ uint32_t len = 0; /* number of bytes used */ hsize_t block_count; /* block counter for regular hyperslabs */ unsigned fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned ndims; /* Rank of the dataspace */ int done; /* Whether we are done with the iteration */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT HDassert(space); + /* Set some convienence values */ + ndims = space->extent.rank; + fast_dim = ndims - 1; + diminfo=space->select.sel_info.hslab->opt_diminfo; + + /* Calculate the # of blocks */ + if(H5S_hyper_is_regular(space)) { + /* Check each dimension */ + for(block_count = 1, u = 0; u < ndims; u++) + block_count *= diminfo[u].count; + } /* end if */ + else + /* Spin through hyperslab spans */ + block_count = H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst); + + /* Get bounding box */ + if(H5S_hyper_bounds(space, bounds_start, bounds_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") + + /* Determine whether the number of blocks or the high bounds in the selection exceed (2^32 - 1) */ + if(block_count > H5S_UINT32_MAX) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid number of blocks in selection") + else { + for(u = 0; u < ndims; u++) + if(bounds_end[u] > H5S_UINT32_MAX) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid hyperslab selection") + } + /* Store the preamble information */ UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ UINT32ENCODE(buf, (uint32_t)1); /* Store the version number */ @@ -2101,15 +2133,6 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) if(space->select.sel_info.hslab->diminfo_valid) { unsigned u; /* Local counting variable */ - /* Set some convienence values */ - ndims = space->extent.rank; - fast_dim = ndims - 1; - diminfo=space->select.sel_info.hslab->opt_diminfo; - - /* Check each dimension */ - for(block_count = 1, u = 0; u < ndims; u++) - block_count *= diminfo[u].count; - /* Encode number of hyperslabs */ H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); UINT32ENCODE(buf, (uint32_t)block_count); @@ -2188,7 +2211,6 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) } /* end if */ else { /* Encode number of hyperslabs */ - block_count = H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst); H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); UINT32ENCODE(buf, (uint32_t)block_count); len+=4; @@ -2204,7 +2226,8 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_hyper_serialize() */ diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 2fa872b..0597994 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -46,6 +46,9 @@ * and 'size' callbacks for places to change when updating this. */ #define H5O_SDSPACE_VERSION_LATEST H5O_SDSPACE_VERSION_2 +/* Maximum values for uint16_t and uint32_t */ +#define H5S_UINT16_MAX 65535 /* 2^16 - 1 */ +#define H5S_UINT32_MAX 4294967295 /* 2^32 - 1 */ /* * Dataspace extent information diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 36684ea..e1dbb4d 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -821,12 +821,29 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) H5S_pnt_node_t *curr; /* Point information nodes */ uint8_t *lenp; /* pointer to length location for later storage */ uint32_t len=0; /* number of bytes used */ - unsigned u; /* local counting variable */ + unsigned u; /* local counting variable */ + hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounding box */ + hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounding box */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT HDassert(space); + /* Get bounding box for the selection */ + HDmemset(bounds_end, 0, sizeof(bounds_end)); + if(H5S_point_bounds(space, bounds_start, bounds_end) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds") + + /* Determine whether the number of points or the high bounds in the selection exceed (2^32 - 1) */ + if(space->select.num_elem > H5S_UINT32_MAX) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid number of points in selection") + else { + for(u = 0; u < space->extent.rank; u++) + if(bounds_end[u] > H5S_UINT32_MAX) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid points selection") + } + /* Store the preamble information */ UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ UINT32ENCODE(buf, (uint32_t)1); /* Store the version number */ @@ -858,7 +875,8 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_point_serialize() */ diff --git a/test/th5s.c b/test/th5s.c index 98be156..c56f0cc 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1317,6 +1317,102 @@ test_h5s_encode(void) /**************************************************************** ** +** test_h5s_encode_exceed32(): +** Verify that encoding selection that exceeds (2^32 - 1) +** (32 bit integer limit) will return error. +** See HDFFV-9947 and the RFC for "H5Sencode/H5Sdecode Format Change" +** +****************************************************************/ +static void +test_h5s_encode_exceed32(void) +{ + hid_t sid; /* Dataspace ID */ + size_t hyper_buf_size=0, pt_buf_size=0; /* Buffer size for H5Sencode */ + unsigned char *hyper_buf=NULL, *pt_buf=NULL; /* Buffers for H5Sencode */ + hsize_t numparticles = 8388608; + unsigned num_dsets = 513; + hsize_t total_particles = numparticles * num_dsets; + hsize_t vdsdims[1] = {total_particles}; + hsize_t start, count, block; /* Hyperslab selection specification */ + hsize_t coord[4]; /* Coordinates for point selection */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Dataspace Encoding Exceeding 32 bits integer limit\n")); + + /*------------------------------------------------------------------------- + * Test encoding and decoding of simple dataspace and hyperslab selection. + *------------------------------------------------------------------------- + */ + + /* Create dataspace */ + sid = H5Screate_simple(1, vdsdims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + start = 0; + block = total_particles; /* 4303355904 (exceeds 2^32) */ + count = 1; + + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, NULL, &count, &block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Encode data space in a buffer */ + ret = H5Sencode(sid, NULL, &hyper_buf_size); + CHECK(ret, FAIL, "H5Sencode"); + + /* Allocate buffer */ + if(hyper_buf_size > 0) { + hyper_buf = (unsigned char*)HDcalloc((size_t)1, hyper_buf_size); + CHECK(hyper_buf, NULL, "HDcalloc"); + } + + /* H5Sencode should fail because block exceeds (2^32 - 1) */ + H5E_BEGIN_TRY { + ret = H5Sencode(sid, hyper_buf, &hyper_buf_size); + } H5E_END_TRY + VERIFY(ret, FAIL, "H5Sencode"); + + /*------------------------------------------------------------------------- + * Test encoding and decoding of simple dataspace and points selection. + *------------------------------------------------------------------------- + */ + + /* Select points in dataspace */ + coord[0] = 5; + coord[1] = 15; + coord[2] = 4294967296; /* 2^32 */ + coord[3] = 19; + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)4, coord); + CHECK(ret, FAIL, "H5Sselect_elements"); + + /* Encode data space in a buffer */ + ret = H5Sencode(sid, NULL, &pt_buf_size); + CHECK(ret, FAIL, "H5Sencode"); + + /* Allocate buffer */ + if(pt_buf_size > 0) + pt_buf = (unsigned char*)HDcalloc((size_t)1, pt_buf_size); + + /* H5Sencode should fail because coord[2] exceeds (2^32 - 1) */ + H5E_BEGIN_TRY { + ret = H5Sencode(sid, pt_buf, &pt_buf_size); + } H5E_END_TRY + VERIFY(ret, FAIL, "H5Sencode"); + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + + /* Free the buffers */ + if(hyper_buf) + HDfree(hyper_buf); + if(pt_buf) + HDfree(pt_buf); + +} /* test_h5s_encode_exceed32() */ + +/**************************************************************** +** ** test_h5s_scalar_write(): Test scalar H5S (dataspace) writing code. ** ****************************************************************/ @@ -2384,6 +2480,7 @@ test_h5s(void) test_h5s_null(); /* Test Null dataspace H5S code */ test_h5s_zero_dim(); /* Test dataspace with zero dimension size */ test_h5s_encode(); /* Test encoding and decoding */ + test_h5s_encode_exceed32(); /* Testing encoding when selection exceeds 32 bits limit */ test_h5s_scalar_write(); /* Test scalar H5S writing code */ test_h5s_scalar_read(); /* Test scalar H5S reading code */ -- cgit v0.12 From 7285fb801daf0e350b7ecbac13e6edc8a6fc75bb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 Sep 2017 12:25:06 -0500 Subject: HDFFV-9774 Add missing error commands --- tools/lib/h5diff.c | 283 +++++++--------- tools/lib/h5diff_array.c | 797 +++++++++++++++++----------------------------- tools/lib/h5tools_error.h | 8 + 3 files changed, 418 insertions(+), 670 deletions(-) diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 20b5136..d5d0dee 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include - #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" @@ -451,32 +449,27 @@ static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata) { - trav_info_t *tinfo = (trav_info_t *)udata; - diff_opt_t *opts = (diff_opt_t *)tinfo->opts; - int ret; + int ret_value = 0; + trav_info_t *tinfo = (trav_info_t *)udata; + diff_opt_t *opts = (diff_opt_t *)tinfo->opts; h5tool_link_info_t lnk_info; - const char *ext_fname; - const char *ext_path; + const char *ext_fname; + const char *ext_path; /* init linkinfo struct */ HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); - if (!opts->follow_links) - { + if (!opts->follow_links) { trav_info_visit_lnk(path, linfo, tinfo); goto done; } - switch(linfo->type) - { + switch(linfo->type) { case H5L_TYPE_SOFT: - ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links); - /* error */ - if (ret < 0) + if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) goto done; /* no dangling link option given and detect dangling link */ - else if (ret == 0) - { + else if (ret_value == 0) { tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) @@ -493,22 +486,18 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, goto done; if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, - trav_grp_objs,trav_grp_symlinks, tinfo) < 0) - { + trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - goto done; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } break; case H5L_TYPE_EXTERNAL: - ret = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links); - /* error */ - if (ret < 0) + if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) goto done; /* no dangling link option given and detect dangling link */ - else if (ret == 0) - { + else if (ret_value == 0) { tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) @@ -528,11 +517,10 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, goto done; if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, - trav_grp_objs,trav_grp_symlinks, tinfo) < 0) - { + trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - goto done; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents\n"); } break; @@ -542,7 +530,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, default: parallel_print("Error: Invalid link type\n"); opts->err_stat = 1; - goto done; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Invalid link type"); break; } /* end of switch */ @@ -571,8 +559,9 @@ hsize_t h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, - diff_opt_t *options) + diff_opt_t *opts) { + int ret_value = 0; hid_t file1_id = (-1); hid_t file2_id = (-1); char filenames[2][MAX_FILENAME]; @@ -614,10 +603,10 @@ hsize_t h5diff(const char *fname1, /*------------------------------------------------------------------------- * check invalid combination of options *-----------------------------------------------------------------------*/ - if(!is_valid_options(options)) - goto out; + if(!is_valid_options(opts)) + goto done; - options->cmn_objs = 1; /* eliminate warning */ + opts->cmn_objs = 1; /* eliminate warning */ /*------------------------------------------------------------------------- * open the files first; if they are not valid, no point in continuing @@ -628,20 +617,18 @@ hsize_t h5diff(const char *fname1, H5E_BEGIN_TRY { /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) - { + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + goto done; } /* end if */ /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) - { + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + goto done; } /* end if */ /* enable error reporting */ } H5E_END_TRY; @@ -655,15 +642,13 @@ hsize_t h5diff(const char *fname1, h5difftrace("trav_info_init initialized\n"); /* if any object is specified */ - if (objname1) - { + if (objname1) { /* make the given object1 fullpath, start with "/" */ - if (HDstrncmp(objname1, "/", 1)) - { + if (HDstrncmp(objname1, "/", 1)) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj1fullname, "/%s", objname1) < 0) - goto out; + goto done; #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2); @@ -675,12 +660,11 @@ hsize_t h5diff(const char *fname1, obj1fullname = HDstrdup(objname1); /* make the given object2 fullpath, start with "/" */ - if (HDstrncmp(objname2, "/", 1)) - { + if (HDstrncmp(objname2, "/", 1)) { #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj2fullname, "/%s", objname2) < 0) - goto out; + goto done; #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2); @@ -695,24 +679,21 @@ hsize_t h5diff(const char *fname1, * check if obj1 is root, group, single object or symlink */ h5difftrace("h5diff check if obj1 is root, group, single object or symlink\n"); - if(!HDstrcmp(obj1fullname, "/")) - { + if(!HDstrcmp(obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } - else - { + else { /* check if link itself exist */ - if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) - { + if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ - if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) - { + if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj1fullname); - goto out; + H5TOOLS_INFO(H5E_tools_min_id_g, "Unable to get link info\n"); + goto done; } info1_lp = info1_obj; @@ -720,18 +701,16 @@ hsize_t h5diff(const char *fname1, /* * check the type of specified path for hard and symbolic links */ - if(src_linfo1.type == H5L_TYPE_HARD) - { + if(src_linfo1.type == H5L_TYPE_HARD) { size_t idx; /* optional data pass */ - info1_obj->opts = (diff_opt_t*)options; + info1_obj->opts = (diff_opt_t*)opts; - if(H5Oget_info_by_name(file1_id, obj1fullname, &oinfo1, H5P_DEFAULT) < 0) - { + if(H5Oget_info_by_name(file1_id, obj1fullname, &oinfo1, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj1type = (h5trav_type_t)oinfo1.type; trav_info_add(info1_obj, obj1fullname, obj1type); @@ -739,13 +718,11 @@ hsize_t h5diff(const char *fname1, info1_obj->paths[idx].objno = oinfo1.addr; info1_obj->paths[idx].fileno = oinfo1.fileno; } - else if (src_linfo1.type == H5L_TYPE_SOFT) - { + else if (src_linfo1.type == H5L_TYPE_SOFT) { obj1type = H5TRAV_TYPE_LINK; trav_info_add(info1_obj, obj1fullname, obj1type); } - else if (src_linfo1.type == H5L_TYPE_EXTERNAL) - { + else if (src_linfo1.type == H5L_TYPE_EXTERNAL) { obj1type = H5TRAV_TYPE_UDLINK; trav_info_add(info1_obj, obj1fullname, obj1type); } @@ -755,24 +732,20 @@ hsize_t h5diff(const char *fname1, * check if obj2 is root, group, single object or symlink */ h5difftrace("h5diff check if obj2 is root, group, single object or symlink\n"); - if(!HDstrcmp(obj2fullname, "/")) - { + if(!HDstrcmp(obj2fullname, "/")) { obj2type = H5TRAV_TYPE_GROUP; } - else - { + else { /* check if link itself exist */ - if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) - { + if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ - if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) - { + if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj2fullname); - goto out; + goto done; } info2_lp = info2_obj; @@ -780,18 +753,16 @@ hsize_t h5diff(const char *fname1, /* * check the type of specified path for hard and symbolic links */ - if(src_linfo2.type == H5L_TYPE_HARD) - { + if(src_linfo2.type == H5L_TYPE_HARD) { size_t idx; /* optional data pass */ - info2_obj->opts = (diff_opt_t*)options; + info2_obj->opts = (diff_opt_t*)opts; - if(H5Oget_info_by_name(file2_id, obj2fullname, &oinfo2, H5P_DEFAULT) < 0) - { + if(H5Oget_info_by_name(file2_id, obj2fullname, &oinfo2, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj2type = (h5trav_type_t)oinfo2.type; trav_info_add(info2_obj, obj2fullname, obj2type); @@ -799,21 +770,18 @@ hsize_t h5diff(const char *fname1, info2_obj->paths[idx].objno = oinfo2.addr; info2_obj->paths[idx].fileno = oinfo2.fileno; } - else if (src_linfo2.type == H5L_TYPE_SOFT) - { + else if (src_linfo2.type == H5L_TYPE_SOFT) { obj2type = H5TRAV_TYPE_LINK; trav_info_add(info2_obj, obj2fullname, obj2type); } - else if (src_linfo2.type == H5L_TYPE_EXTERNAL) - { + else if (src_linfo2.type == H5L_TYPE_EXTERNAL) { obj2type = H5TRAV_TYPE_UDLINK; trav_info_add(info2_obj, obj2fullname, obj2type); } } } /* if no object specified */ - else - { + else { h5difftrace("h5diff no object specified\n"); /* set root group */ obj1fullname = (char*)HDstrdup("/"); @@ -824,16 +792,15 @@ hsize_t h5diff(const char *fname1, /* get any symbolic links info */ - l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, options->follow_links); - l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, options->follow_links); + l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, opts->follow_links); + l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, opts->follow_links); /*--------------------------------------------- * check for following symlinks */ - if (options->follow_links) - { + if (opts->follow_links) { /* pass how to handle printing warning to linkinfo option */ - if(print_warn(options)) + if(print_warn(opts)) trg_linfo1.opt.msg_mode = trg_linfo2.opt.msg_mode = 1; /*------------------------------- @@ -841,37 +808,31 @@ hsize_t h5diff(const char *fname1, */ h5difftrace("h5diff check symbolic link (object1)\n"); /* dangling link */ - if (l_ret1 == 0) - { + if (l_ret1 == 0) { h5difftrace("h5diff ... dangling link\n"); - if (options->no_dangle_links) - { - /* treat dangling link is error */ - if(options->m_verbose) + if (opts->no_dangle_links) { + /* treat dangling link as error */ + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); } - else - { - if(options->m_verbose) + else { + if(opts->m_verbose) parallel_print("obj1 <%s> is a dangling link.\n", obj1fullname); - if (l_ret1 != 0 || l_ret2 != 0) - { + if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto out; + goto done; } } } - else if(l_ret1 < 0) /* fail */ - { + else if(l_ret1 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } - else if(l_ret1 != 2) /* symbolic link */ - { + else if(l_ret1 != 2) { /* symbolic link */ obj1type = (h5trav_type_t)trg_linfo1.trg_type; h5difftrace("h5diff ... ... trg_linfo1.trg_type == H5L_TYPE_HARD\n"); if (info1_lp != NULL) { @@ -890,37 +851,31 @@ hsize_t h5diff(const char *fname1, */ h5difftrace("h5diff check symbolic link (object2)\n"); /* dangling link */ - if (l_ret2 == 0) - { + if (l_ret2 == 0) { h5difftrace("h5diff ... dangling link\n"); - if (options->no_dangle_links) - { - /* treat dangling link is error */ - if(options->m_verbose) + if (opts->no_dangle_links) { + /* treat dangling link as error */ + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); } - else - { - if(options->m_verbose) + else { + if(opts->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); - if (l_ret1 != 0 || l_ret2 != 0) - { + if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto out; + goto done; } } } - else if(l_ret2 < 0) /* fail */ - { + else if(l_ret2 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); } - else if(l_ret2 != 2) /* symbolic link */ - { + else if(l_ret2 != 2) { /* symbolic link */ obj2type = (h5trav_type_t)trg_linfo2.trg_type; if (info2_lp != NULL) { size_t idx = info2_lp->nused - 1; @@ -941,32 +896,29 @@ hsize_t h5diff(const char *fname1, * comparing details of same objects. */ - if(!(options->m_verbose || options->m_report)) - { - h5difftrace("h5diff NOT (options->m_verbose || options->m_report)\n"); + if(!(opts->m_verbose || opts->m_report)) { + h5difftrace("h5diff NOT (opts->m_verbose || opts->m_report)\n"); /* if no danglink links */ if ( l_ret1 > 0 && l_ret2 > 0 ) if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname)!=0) - goto out; + goto done; } both_objs_grp = (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP); - if (both_objs_grp) - { + if (both_objs_grp) { h5difftrace("h5diff both_objs_grp TRUE\n"); /* * traverse group1 */ trav_info_init(fname1, file1_id, &info1_grp); /* optional data pass */ - info1_grp->opts = (diff_opt_t*)options; + info1_grp->opts = (diff_opt_t*)opts; if(h5trav_visit(file1_id, obj1fullname, TRUE, TRUE, - trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) - { + trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); } info1_lp = info1_grp; @@ -975,25 +927,22 @@ hsize_t h5diff(const char *fname1, */ trav_info_init(fname2, file2_id, &info2_grp); /* optional data pass */ - info2_grp->opts = (diff_opt_t*)options; + info2_grp->opts = (diff_opt_t*)opts; if(h5trav_visit(file2_id, obj2fullname, TRUE, TRUE, - trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) - { + trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - options->err_stat = 1; - goto out; - } /* end if */ + opts->err_stat = 1; + HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + } /* end if */ info2_lp = info2_grp; } #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { + if(g_Parallel) { int i; - if((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) - { + if((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) { HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ @@ -1009,13 +958,12 @@ hsize_t h5diff(const char *fname1, /* process the objects */ build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp, - &match_list, options); - if (both_objs_grp) - { + &match_list, opts); + if (both_objs_grp) { /*------------------------------------------------------ * print the list */ - if(options->m_verbose) + if(opts->m_verbose) { unsigned u; @@ -1026,8 +974,7 @@ hsize_t h5diff(const char *fname1, else parallel_print("file1 file2\n"); parallel_print("---------------------------------------\n"); - for(u = 0; u < match_list->nobjs; u++) - { + for(u = 0; u < match_list->nobjs; u++) { char c1, c2; c1 = (match_list->objs[u].flags[0]) ? 'x' : ' '; c2 = (match_list->objs[u].flags[1]) ? 'x' : ' '; @@ -1038,9 +985,9 @@ hsize_t h5diff(const char *fname1, } nfound = diff_match(file1_id, obj1fullname, info1_lp, file2_id, obj2fullname, info2_lp, - match_list, options); + match_list, opts); -out: +done: #ifdef H5_HAVE_PARALLEL if(g_Parallel) /* All done at this point, let tasks know that they won't be needed */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 6480cf6..0140e64 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -97,27 +97,27 @@ static hbool_t not_comparable; #define PER(A,B) { \ - per = -1; \ - not_comparable = FALSE; \ - both_zero = FALSE; \ - if(0 == (A) && 0 == (B)) \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if(0 == (A) && 0 == (B)) \ both_zero = TRUE; \ - if(0 != (A)) \ + if(0 != (A)) \ per = (double)ABS((double)((B) - (A)) / (double)(A)); \ - else \ + else \ not_comparable = TRUE; \ } #define PER_UNSIGN(TYPE,A,B) { \ - per = -1; \ - not_comparable = FALSE; \ - both_zero = FALSE; \ - if((A) == 0 && (B) == 0) \ + per = -1; \ + not_comparable = FALSE; \ + both_zero = FALSE; \ + if((A) == 0 && (B) == 0) \ both_zero = TRUE; \ - if((A) != 0) \ + if((A) != 0) \ per = ABS((double)((TYPE)((B) - (A))) / (double)(A)) ; \ - else \ + else \ not_comparable = TRUE; \ } @@ -154,7 +154,7 @@ static void h5diff_print_char(char ch); static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, - hsize_t i, + hsize_t index, int rank, hsize_t *dims, hsize_t *acc, @@ -385,13 +385,13 @@ hsize_t diff_array( void *_mem1, hid_t container1_id, hid_t container2_id) /* dataset where the reference came from*/ { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ size_t size; /* size of datum */ unsigned char *mem1 = (unsigned char*)_mem1; unsigned char *mem2 = (unsigned char*)_mem2; - hsize_t acc[32]; /* accumulator position */ - hsize_t pos[32]; /* matrix position */ - int ph=1; /* print header */ + hsize_t acc[32]; /* accumulator position */ + hsize_t pos[32]; /* matrix position */ + int ph = 1; /* print header */ hsize_t i; int j; mcomp_t members; @@ -399,7 +399,7 @@ hsize_t diff_array( void *_mem1, h5difftrace("diff_array start\n"); /* get the size. */ - size = H5Tget_size( m_type ); + size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); /* Fast comparison first for atomic type by memcmp(). @@ -407,22 +407,19 @@ hsize_t diff_array( void *_mem1, * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && - type_class != H5T_COMPOUND && - type_class != H5T_STRING && - type_class != H5T_VLEN && - HDmemcmp(mem1, mem2, size*nelmts)==0) + type_class != H5T_COMPOUND && + type_class != H5T_STRING && + type_class != H5T_VLEN && + HDmemcmp(mem1, mem2, size*nelmts) == 0) return 0; - if ( rank > 0 ) - { - - acc[rank-1]=1; - for(j=(rank-2); j>=0; j--) - { - acc[j]=acc[j+1]*dims[j+1]; + if (rank > 0) { + acc[rank-1] = 1; + for(j = (rank-2); j >= 0; j--) { + acc[j] = acc[j+1] * dims[j+1]; } - for ( j = 0; j < rank; j++) - pos[j]=0; + for (j = 0; j < rank; j++) + pos[j] = 0; } switch (type_class) @@ -441,37 +438,37 @@ hsize_t diff_array( void *_mem1, case H5T_FLOAT: if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) - nfound=diff_float(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) - nfound=diff_double(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); -#if H5_SIZEOF_LONG_DOUBLE !=0 + nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); +#if H5_SIZEOF_LONG_DOUBLE != 0 else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) - nfound=diff_ldouble(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); #endif break; case H5T_INTEGER: if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) - nfound=diff_schar(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) - nfound=diff_uchar(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) - nfound=diff_short(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) - nfound=diff_ushort(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_INT)) - nfound=diff_int(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UINT)) - nfound=diff_uint(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LONG)) - nfound=diff_long(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) - nfound=diff_ulong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) - nfound=diff_llong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) - nfound=diff_ullong(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); + nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); break; @@ -490,25 +487,16 @@ hsize_t diff_array( void *_mem1, case H5T_REFERENCE: HDmemset(&members, 0, sizeof (mcomp_t)); get_member_types(m_type, &members); - for ( i = 0; i < nelmts; i++) - { - nfound+=diff_datum( - mem1 + i * size, - mem2 + i * size, /* offset */ + for (i = 0; i < nelmts; i++) { + nfound += diff_datum( + mem1 + i * size, mem2 + i * size, m_type, - i, - rank, - dims, - acc, - pos, + i, rank, dims, acc, pos, options, - name1, - name2, - container1_id, - container2_id, + name1, name2, + container1_id, container2_id, &ph, &members); - if (options->n && nfound>=options->count) - { + if (options->n && nfound >= options->count) { close_member_types(&members); return nfound; } @@ -560,7 +548,7 @@ hsize_t diff_array( void *_mem1, static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, - hsize_t i, + hsize_t index, int rank, hsize_t *dims, hsize_t *acc, @@ -584,19 +572,19 @@ static hsize_t diff_datum(void *_mem1, unsigned nmembs; unsigned j; hsize_t nelmts; - size_t size=0; + size_t size = 0; hbool_t iszero1; hbool_t iszero2; hid_t obj1_id; hid_t obj2_id; - hsize_t nfound=0; /* differences found */ - int ret=0; /* check return error */ + hsize_t nfound = 0; /* differences found */ + int ret = 0; /* check return error */ float f1, f2; double per; hbool_t both_zero; h5difftrace("diff_datum start\n"); - type_size = H5Tget_size( m_type ); + type_size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); /* Fast comparison first for atomic type by memcmp(). @@ -604,10 +592,10 @@ static hsize_t diff_datum(void *_mem1, * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && - type_class != H5T_COMPOUND && - type_class != H5T_STRING && - type_class != H5T_VLEN && - HDmemcmp(mem1, mem2, type_size)==0) + type_class != H5T_COMPOUND && + type_class != H5T_STRING && + type_class != H5T_VLEN && + HDmemcmp(mem1, mem2, type_size) == 0) return 0; switch (H5Tget_class(m_type)) @@ -629,25 +617,17 @@ static hsize_t diff_datum(void *_mem1, nmembs = members->n; - for (j = 0; j < nmembs; j++) - { - offset = members->offsets[j]; + for (j = 0; j < nmembs; j++) { + offset = members->offsets[j]; memb_type = members->ids[j]; - nfound+=diff_datum( - mem1 + offset, - mem2 + offset, + nfound += diff_datum( + mem1 + offset, mem2 + offset, memb_type, - i, - rank, - dims, - acc, - pos, + index, rank, dims, acc, pos, options, - obj1, - obj2, - container1_id, - container2_id, + obj1, obj2, + container1_id, container2_id, ph, members->m[j]); } break; @@ -739,43 +719,28 @@ static hsize_t diff_datum(void *_mem1, } /* check for NULL pointer for string */ - if(s!=NULL) { + if(s != NULL) { /* try fast compare first */ - if(HDmemcmp(s1, s2, size)==0) { + if(HDmemcmp(s1, s2, size) == 0) { if(size1 != size2) if(print_data(options)) - for (u=size; uerr_stat=1; + if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1)) < 0) + ret = -1; + if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2)) < 0) + ret = -1; + if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) + ret = -1; + if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) + ret = -1; + + if (ret == -1) { + options->err_stat = 1; return 0; } - nfound = diff_region(obj1_id,obj2_id,region1_id,region2_id,options); - + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, options); H5Oclose(obj1_id); H5Oclose(obj2_id); H5Sclose(region1_id); H5Sclose(region2_id); - }/*dataset reference*/ - /*------------------------------------------------------------------------- * H5T_STD_REF_OBJ * Object references. get the type and OID of the referenced object *------------------------------------------------------------------------- */ - else if (type_size == H5R_OBJ_REF_BUF_SIZE) - { + else if (type_size == H5R_OBJ_REF_BUF_SIZE) { H5O_type_t obj1_type; H5O_type_t obj2_type; @@ -1028,8 +937,7 @@ static hsize_t diff_datum(void *_mem1, } /* end if */ /* check object type */ - if(obj1_type != obj2_type) - { + if(obj1_type != obj2_type) { parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); options->not_cmp = 1; return 0; @@ -1042,39 +950,32 @@ static hsize_t diff_datum(void *_mem1, if(ret == -1) { options->err_stat = 1; return 0; - } /* end if */ + } /* compare */ if(obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid(obj1_id, - obj2_id, - NULL, - NULL, + nfound = diff_datasetid( + obj1_id, obj2_id, + NULL, NULL, options); else { if(options->m_verbose) - parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", - obj1, obj2); + parallel_print( + "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", obj1, obj2); options->not_cmp = 1; } H5Oclose(obj1_id); H5Oclose(obj2_id); - }/*object reference*/ - }/*is zero*/ - - break; /*------------------------------------------------------------------------- * H5T_VLEN *------------------------------------------------------------------------- */ - case H5T_VLEN: - /* get the VL sequences's base datatype for each element */ memb_type = H5Tget_super(m_type); size = H5Tget_size(memb_type); @@ -1085,421 +986,313 @@ static hsize_t diff_datum(void *_mem1, for (j = 0; j < nelmts; j++) nfound += diff_datum( ((char *)(((hvl_t *)mem1)->p)) + j * size, - ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ + ((char *)(((hvl_t *)mem2)->p)) + j * size, memb_type, - i, /* index position */ - rank, - dims, - acc, - pos, + i, rank, dims, acc, pos, options, - obj1, - obj2, - container1_id, - container2_id, + obj1, obj2, + container1_id, container2_id, ph, members); H5Tclose(memb_type); - break; - - /*------------------------------------------------------------------------- * H5T_INTEGER *------------------------------------------------------------------------- */ - case H5T_INTEGER: type_sign = H5Tget_sign(m_type); - /*------------------------------------------------------------------------- * H5T_NATIVE_SCHAR *------------------------------------------------------------------------- */ - if (type_size==1 && type_sign!=H5T_SGN_NONE) - { + if (type_size == 1 && type_sign != H5T_SGN_NONE) { char temp1_char; char temp2_char; - HDassert(type_size==sizeof(char)); + HDassert(type_size == sizeof(char)); HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_char-temp2_char) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_char-temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_char,temp2_char); + else if (!options->d && options->p) { + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char,ABS(temp1_char-temp2_char),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_char,temp2_char); + else if (options->d && options->p) { + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char,ABS(temp1_char-temp2_char),per); - } - nfound++; + else if (per > options->percent && ABS(temp1_char - temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } + nfound++; + } } - else if (temp1_char != temp2_char) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_char != temp2_char) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - } /*H5T_NATIVE_SCHAR*/ /*------------------------------------------------------------------------- * H5T_NATIVE_UCHAR *------------------------------------------------------------------------- */ - else if (type_size==1 && type_sign==H5T_SGN_NONE) - { + else if (type_size == 1 && type_sign == H5T_SGN_NONE) { unsigned char temp1_uchar; unsigned char temp2_uchar; - HDassert(type_size==sizeof(unsigned char)); + HDassert(type_size == sizeof(unsigned char)); HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_uchar, temp2_uchar) > options->delta) { + if ( print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); + else if (!options->d && options->p) { + PER_UNSIGN(signed char,temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); + else if (options->d && options->p) { + PER_UNSIGN(signed char,temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_uchar, temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } + nfound++; + } } - else if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - } /*H5T_NATIVE_UCHAR*/ - /*------------------------------------------------------------------------- * H5T_NATIVE_SHORT *------------------------------------------------------------------------- */ - - else if (type_size==2 && type_sign!=H5T_SGN_NONE) - { + else if (type_size == 2 && type_sign != H5T_SGN_NONE) { short temp1_short; short temp2_short; - HDassert(type_size==sizeof(short)); + HDassert(type_size == sizeof(short)); HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_short-temp2_short) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_short - temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { + else if (!options->d && options->p) { PER(temp1_short,temp2_short); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short,ABS(temp1_short-temp2_short),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { + else if ( options->d && options->p) { PER(temp1_short,temp2_short); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short,ABS(temp1_short-temp2_short),per); - } - nfound++; + else if (per > options->percent && ABS(temp1_short - temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } + nfound++; + } } - else if (temp1_short != temp2_short) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_short != temp2_short) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - - } /*H5T_NATIVE_SHORT*/ /*------------------------------------------------------------------------- * H5T_NATIVE_USHORT *------------------------------------------------------------------------- */ - - else if (type_size==2 && type_sign==H5T_SGN_NONE) - { + else if (type_size == 2 && type_sign == H5T_SGN_NONE) { unsigned short temp1_ushort; unsigned short temp2_ushort; - HDassert(type_size==sizeof(short)); + HDassert(type_size == sizeof(short)); HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) - { - - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if ( PDIFF(temp1_ushort, temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); + else if (!options->d && options->p) { + PER_UNSIGN(signed short,temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); + else if (options->d && options->p) { + PER_UNSIGN(signed short,temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_ushort, temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } + nfound++; + } } - else if (temp1_ushort != temp2_ushort) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_ushort != temp2_ushort) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 136c5ed..a556b0a 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -62,6 +62,14 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; /* + * H5TOOLS_INFO macro, used to facilitate error reporting . The arguments are the major + * error number, the minor error number, and a description of the error. + */ +#define H5TOOLS_INFO(min_id, str) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, str); \ +} + +/* * HERROR macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ -- cgit v0.12 From 186289d819784b2e893b231c79b22d14e371d9be Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 Sep 2017 16:46:59 -0500 Subject: HDFFV-9774 Fix code merge --- tools/lib/h5diff_array.c | 5502 ++++++++++++++++++---------------------------- 1 file changed, 2158 insertions(+), 3344 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 0140e64..29d1746 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -17,7 +17,6 @@ #include "h5diff.h" #include "ph5diff.h" - /*------------------------------------------------------------------------- * printf formatting *------------------------------------------------------------------------- @@ -66,9 +65,8 @@ #define LLI_FORMAT_P_NOTCOMP "%-15" H5_PRINTF_LL_WIDTH "d %-15" H5_PRINTF_LL_WIDTH "d %-15" H5_PRINTF_LL_WIDTH "d not comparable\n" #define ULLI_FORMAT_P_NOTCOMP "%-15" H5_PRINTF_LL_WIDTH "u %-15" H5_PRINTF_LL_WIDTH "u %-15" H5_PRINTF_LL_WIDTH "d not comparable\n" - /* if system EPSILON is defined, use the system EPSILON; otherwise, use - constants that are close to most EPSILON values */ + constants that are close to most EPSILON values */ #ifndef FLT_EPSILON #define FLT_EPSILON 1.19209E-07 @@ -78,7 +76,6 @@ #define DBL_EPSILON 2.22045E-16 #endif - /*------------------------------------------------------------------------- * -p relative error formula * @@ -108,7 +105,6 @@ static hbool_t not_comparable; not_comparable = TRUE; \ } - #define PER_UNSIGN(TYPE,A,B) { \ per = -1; \ not_comparable = FALSE; \ @@ -121,210 +117,108 @@ static hbool_t not_comparable; not_comparable = TRUE; \ } - #define PDIFF(a,b) (((b) > (a)) ? ((b) - (a)) : ((a) -(b))) -typedef struct mcomp_t -{ - unsigned n; /* number of members */ - hid_t *ids; /* member type id */ - size_t *offsets; - struct mcomp_t **m; /* members */ -}mcomp_t; - +typedef struct mcomp_t { + unsigned n; /* number of members */ + hid_t *ids; /* member type id */ + size_t *offsets; + struct mcomp_t **m; /* members */ +} mcomp_t; /*------------------------------------------------------------------------- * local prototypes *------------------------------------------------------------------------- */ -static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id,hid_t region1_id, hid_t region2_id, diff_opt_t *options); +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, + hid_t region2_id, diff_opt_t *options); static hbool_t all_zero(const void *_mem, size_t size); -static int ull2float(unsigned long long ull_value, float *f_value); -static hsize_t character_compare(char *mem1,char *mem2,hsize_t i,unsigned u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); -static hsize_t character_compare_opt(unsigned char *mem1,unsigned char *mem2,hsize_t i,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph); +static int ull2float(unsigned long long ull_value, float *f_value); +static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, unsigned u, + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, + diff_opt_t *options, const char *obj1, const char *obj2, int *ph); +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, + hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, + diff_opt_t *options, const char *obj1, const char *obj2, int *ph); static hbool_t equal_float(float value, float expected, diff_opt_t *options); static hbool_t equal_double(double value, double expected, diff_opt_t *options); #if H5_SIZEOF_LONG_DOUBLE !=0 static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options); #endif static int print_data(diff_opt_t *options); -static void print_pos(int *ph,int pp,hsize_t curr_pos,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); -static void print_char_pos(int *ph,int pp,hsize_t curr_pos,unsigned u,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 ); +static void print_pos(int *ph, int pp, hsize_t curr_pos, hsize_t *acc, + hsize_t *pos, int rank, hsize_t *dims, const char *obj1, const char *obj2); +static void print_char_pos(int *ph, int pp, hsize_t curr_pos, unsigned u, + hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, const char *obj1, const char *obj2); static void h5diff_print_char(char ch); -static hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t index, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members); /*compound members */ -static hsize_t diff_float(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_double(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); +static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, + diff_opt_t *options, const char *obj1, const char *obj2, + hid_t container1_id, hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members); /*compound members */ +static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); #if H5_SIZEOF_LONG_DOUBLE !=0 static hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); #endif -static hsize_t diff_schar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_short(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_ushort(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_int(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_uint(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_long(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_ulong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_llong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); -static hsize_t diff_ullong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph); - +static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); +static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph); /*------------------------------------------------------------------------- * NaN detection @@ -337,13 +231,11 @@ typedef enum dtype_t FLT_FLOAT, FLT_DOUBLE, FLT_LDOUBLE -} dtype_t; +}dtype_t; #else -typedef enum dtype_t -{ - FLT_FLOAT, - FLT_DOUBLE +typedef enum dtype_t { + FLT_FLOAT, FLT_DOUBLE } dtype_t; #endif @@ -356,8 +248,6 @@ static hbool_t my_isnan(dtype_t type, void *val); static void get_member_types(hid_t tid, mcomp_t *members); static void close_member_types(mcomp_t *members); - - /*------------------------------------------------------------------------- * Function: diff_array * @@ -372,30 +262,31 @@ static void close_member_types(mcomp_t *members); *------------------------------------------------------------------------- */ -hsize_t diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - diff_opt_t *options, - const char *name1, - const char *name2, - hid_t m_type, - hid_t container1_id, - hid_t container2_id) /* dataset where the reference came from*/ +hsize_t diff_array( + void *_mem1, + void *_mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + diff_opt_t *options, + const char *name1, + const char *name2, + hid_t m_type, + hid_t container1_id, + hid_t container2_id) /* dataset where the reference came from*/ { - hsize_t nfound = 0; /* number of differences found */ - size_t size; /* size of datum */ - unsigned char *mem1 = (unsigned char*)_mem1; - unsigned char *mem2 = (unsigned char*)_mem2; - hsize_t acc[32]; /* accumulator position */ - hsize_t pos[32]; /* matrix position */ - int ph = 1; /* print header */ - hsize_t i; - int j; - mcomp_t members; - H5T_class_t type_class; + hsize_t nfound = 0; /* number of differences found */ + size_t size; /* size of datum */ + unsigned char *mem1 = (unsigned char*) _mem1; + unsigned char *mem2 = (unsigned char*) _mem2; + hsize_t acc[32]; /* accumulator position */ + hsize_t pos[32]; /* matrix position */ + int ph = 1; /* print header */ + hsize_t i; + int j; + mcomp_t members; + H5T_class_t type_class; h5difftrace("diff_array start\n"); /* get the size. */ @@ -407,23 +298,22 @@ hsize_t diff_array( void *_mem1, * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && - type_class != H5T_COMPOUND && - type_class != H5T_STRING && - type_class != H5T_VLEN && - HDmemcmp(mem1, mem2, size*nelmts) == 0) + type_class != H5T_COMPOUND && + type_class != H5T_STRING && + type_class != H5T_VLEN && + HDmemcmp(mem1, mem2, size*nelmts) == 0) return 0; if (rank > 0) { - acc[rank-1] = 1; - for(j = (rank-2); j >= 0; j--) { - acc[j] = acc[j+1] * dims[j+1]; + acc[rank - 1] = 1; + for (j = (rank - 2); j >= 0; j--) { + acc[j] = acc[j + 1] * dims[j + 1]; } for (j = 0; j < rank; j++) pos[j] = 0; } - switch (type_class) - { + switch (type_class) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: @@ -431,11 +321,10 @@ hsize_t diff_array( void *_mem1, HDassert(0); break; - /*------------------------------------------------------------------------- - * float and integer atomic types - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * float and integer atomic types + *------------------------------------------------------------------------- + */ case H5T_FLOAT: if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); @@ -443,12 +332,11 @@ hsize_t diff_array( void *_mem1, nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); #if H5_SIZEOF_LONG_DOUBLE != 0 else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) - nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); #endif break; case H5T_INTEGER: - if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) @@ -469,14 +357,12 @@ hsize_t diff_array( void *_mem1, nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); - break; /*------------------------------------------------------------------------- * Other types than float and integer *------------------------------------------------------------------------- */ - case H5T_COMPOUND: case H5T_STRING: case H5T_BITFIELD: @@ -485,17 +371,11 @@ hsize_t diff_array( void *_mem1, case H5T_ARRAY: case H5T_VLEN: case H5T_REFERENCE: - HDmemset(&members, 0, sizeof (mcomp_t)); + HDmemset(&members, 0, sizeof(mcomp_t)); get_member_types(m_type, &members); for (i = 0; i < nelmts; i++) { - nfound += diff_datum( - mem1 + i * size, mem2 + i * size, - m_type, - i, rank, dims, acc, pos, - options, - name1, name2, - container1_id, container2_id, - &ph, &members); + nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, options, + name1, name2, container1_id, container2_id, &ph, &members); if (options->n && nfound >= options->count) { close_member_types(&members); return nfound; @@ -545,43 +425,44 @@ hsize_t diff_array( void *_mem1, * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ -static hsize_t diff_datum(void *_mem1, - void *_mem2, - hid_t m_type, - hsize_t index, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t container1_id, - hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members) /*compound members */ +static hsize_t diff_datum( + void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t index, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph, /*print header */ + mcomp_t *members) /*compound members */ { - unsigned char *mem1 = (unsigned char*)_mem1; - unsigned char *mem2 = (unsigned char*)_mem2; - unsigned u; - hid_t memb_type; - size_t type_size; - H5T_sign_t type_sign; - H5T_class_t type_class; - size_t offset; - unsigned nmembs; - unsigned j; - hsize_t nelmts; - size_t size = 0; - hbool_t iszero1; - hbool_t iszero2; - hid_t obj1_id; - hid_t obj2_id; - hsize_t nfound = 0; /* differences found */ - int ret = 0; /* check return error */ - float f1, f2; - double per; - hbool_t both_zero; + unsigned char *mem1 = (unsigned char*) _mem1; + unsigned char *mem2 = (unsigned char*) _mem2; + unsigned u; + hid_t memb_type; + size_t type_size; + H5T_sign_t type_sign; + H5T_class_t type_class; + size_t offset; + unsigned nmembs; + unsigned j; + hsize_t nelmts; + size_t size = 0; + hbool_t iszero1; + hbool_t iszero2; + hid_t obj1_id; + hid_t obj2_id; + hsize_t nfound = 0; /* differences found */ + int ret = 0; /* check return error */ + float f1, f2; + double per; + hbool_t both_zero; h5difftrace("diff_datum start\n"); type_size = H5Tget_size(m_type); @@ -592,14 +473,13 @@ static hsize_t diff_datum(void *_mem1, * by the condition, but it gives more clarity for code planning */ if (type_class != H5T_REFERENCE && - type_class != H5T_COMPOUND && - type_class != H5T_STRING && - type_class != H5T_VLEN && - HDmemcmp(mem1, mem2, type_size) == 0) + type_class != H5T_COMPOUND && + type_class != H5T_STRING && + type_class != H5T_VLEN && + HDmemcmp(mem1, mem2, type_size) == 0) return 0; - switch (H5Tget_class(m_type)) - { + switch (H5Tget_class(m_type)) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: @@ -607,60 +487,53 @@ static hsize_t diff_datum(void *_mem1, HDassert(0); break; - /*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ case H5T_COMPOUND: h5difftrace("diff_datum H5T_COMPOUND\n"); nmembs = members->n; - for (j = 0; j < nmembs; j++) { offset = members->offsets[j]; memb_type = members->ids[j]; - nfound += diff_datum( - mem1 + offset, mem2 + offset, - memb_type, - index, rank, dims, acc, pos, - options, - obj1, obj2, - container1_id, container2_id, - ph, members->m[j]); + nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members->m[j]); } break; - /*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ case H5T_STRING: h5difftrace("diff_datum H5T_STRING\n"); { - char *s = NULL; - char *sx = NULL; - char *s1 = NULL; - char *s2 = NULL; - size_t size1; - size_t size2; - size_t sizex; - size_t size_mtype = H5Tget_size(m_type); - H5T_str_t pad = H5Tget_strpad(m_type); + char *s = NULL; + char *sx = NULL; + char *s1 = NULL; + char *s2 = NULL; + size_t size1; + size_t size2; + size_t sizex; + size_t size_mtype = H5Tget_size(m_type); + H5T_str_t pad = H5Tget_strpad(m_type); /* if variable length string */ - if(H5Tis_variable_str(m_type)) { + if (H5Tis_variable_str(m_type)) { h5difftrace("diff_datum H5T_STRING variable\n"); /* Get pointer to first string */ s1 = *(char**) mem1; - if(s1) + if (s1) size1 = HDstrlen(s1); else size1 = 0; /* Get pointer to second string */ s2 = *(char**) mem2; - if(s2) + if (s2) size2 = HDstrlen(s2); else size2 = 0; @@ -669,7 +542,7 @@ static hsize_t diff_datum(void *_mem1, h5difftrace("diff_datum H5T_STRING null term\n"); /* Get pointer to first string */ s1 = (char*) mem1; - if(s1) + if (s1) size1 = HDstrlen(s1); else size1 = 0; @@ -677,7 +550,7 @@ static hsize_t diff_datum(void *_mem1, size1 = size_mtype; /* Get pointer to second string */ s2 = (char*) mem2; - if(s2) + if (s2) size2 = HDstrlen(s2); else size2 = 0; @@ -686,10 +559,10 @@ static hsize_t diff_datum(void *_mem1, } else { /* Get pointer to first string */ - s1 = (char *)mem1; + s1 = (char *) mem1; size1 = size_mtype; /* Get pointer to second string */ - s2 = (char *)mem2; + s2 = (char *) mem2; size2 = size_mtype; } @@ -699,13 +572,11 @@ static hsize_t diff_datum(void *_mem1, * of length of strings. * For now mimic the previous way. */ - h5diffdebug2("diff_datum string size:%d\n",size1); - h5diffdebug2("diff_datum string size:%d\n",size2); - if(size1 != size2) { + if (size1 != size2) { h5difftrace("diff_datum string sizes\n"); nfound++; } - if(size1 < size2) { + if (size1 < size2) { size = size1; s = s1; sizex = size2; @@ -719,45 +590,30 @@ static hsize_t diff_datum(void *_mem1, } /* check for NULL pointer for string */ - if(s != NULL) { + if (s != NULL) { /* try fast compare first */ - if(HDmemcmp(s1, s2, size) == 0) { - if(size1 != size2) - if(print_data(options)) + if (HDmemcmp(s1, s2, size) == 0) { + if (size1 != size2) + if (print_data(options)) for (u = size; u < sizex; u++) - character_compare( - s1 + u, s2 + u, - index, u, rank, dims, acc, pos, - options, - obj1, obj2, - ph); + character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); } else for (u = 0; u < size; u++) - nfound += character_compare( - s1 + u, s2 + u, - i, u, rank, dims, acc, pos, - options, - obj1, obj2, - ph); + nfound += character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); } /* end check for NULL pointer for string */ } break; - /*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ case H5T_BITFIELD: h5difftrace("diff_datum H5T_BITFIELD\n"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt( - mem1 + u, mem2 + u, - i, rank, dims, acc, pos, - options, - obj1, obj2, - ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); break; /*------------------------------------------------------------------------- @@ -768,18 +624,13 @@ static hsize_t diff_datum(void *_mem1, h5difftrace("diff_datum H5T_OPAQUE\n"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt( - mem1 + u, mem2 + u, - i, rank, dims, acc, pos, - options, - obj1, obj2, - ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); break; - /*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ case H5T_ENUM: /* For enumeration types we compare the names instead of the * integer values. For each pair of elements being @@ -788,10 +639,10 @@ static hsize_t diff_datum(void *_mem1, */ { h5difftrace("diff_datum H5T_ENUM\n"); - char enum_name1[1024]; - char enum_name2[1024]; - herr_t err1; - herr_t err2; + char enum_name1[1024]; + char enum_name2[1024]; + herr_t err1; + herr_t err2; /* disable error reporting */ H5E_BEGIN_TRY { @@ -799,44 +650,39 @@ static hsize_t diff_datum(void *_mem1, * it is set to an error string for later output. */ err1 = H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1); - if(err1 < 0) + if (err1 < 0) HDsnprintf(enum_name1, sizeof(enum_name1), "**INVALID VALUE**"); err2 = H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2); - if(err2 < 0) + if (err2 < 0) HDsnprintf(enum_name2, sizeof(enum_name2), "**INVALID VALUE**"); /* One or more bad enum values */ - if(err1 < 0 || err2 < 0) { + if (err1 < 0 || err2 < 0) { /* If the two values cannot be converted to a string * (probably due to them being invalid enum values), * don't attempt to convert them - just report errors. */ nfound += 1; if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } } else { /* Both enum values were valid */ - if (HDstrcmp(enum_name1, enum_name2) != 0){ + if (HDstrcmp(enum_name1, enum_name2) != 0) { nfound = 1; if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); } } else { for (u = 0; u < type_size; u++) - nfound+=character_compare_opt( - mem1 + u, mem2 + u, - i, rank, dims, acc, pos, - options, - obj1, obj2, - ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); } } /* enable error reporting */ @@ -844,58 +690,52 @@ static hsize_t diff_datum(void *_mem1, } break; - /*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ case H5T_ARRAY: - { - hsize_t adims[H5S_MAX_RANK]; - int ndims; - - /* get the array's base datatype for each element */ - memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); - ndims = H5Tget_array_ndims(m_type); - H5Tget_array_dims2(m_type, adims); - HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); - - /* calculate the number of array elements */ - for (u = 0, nelmts = 1; u < (unsigned)ndims; u++) - nelmts *= adims[u]; - for (u = 0; u < nelmts; u++) { - nfound += diff_datum( - mem1 + u * size, mem2 + u * size, - memb_type, - i, rank, dims, acc, pos, - options, - obj1, obj2, - container1_id, container2_id, - ph, members); + { + hsize_t adims[H5S_MAX_RANK]; + int ndims; + + /* get the array's base datatype for each element */ + memb_type = H5Tget_super(m_type); + size = H5Tget_size(memb_type); + ndims = H5Tget_array_ndims(m_type); + H5Tget_array_dims2(m_type, adims); + HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); + + /* calculate the number of array elements */ + for (u = 0, nelmts = 1; u < (unsigned) ndims; u++) + nelmts *= adims[u]; + for (u = 0; u < nelmts; u++) { + nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); + } + H5Tclose(memb_type); } - H5Tclose(memb_type); - } - break; + break; - /*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ case H5T_REFERENCE: - iszero1=all_zero(_mem1, H5Tget_size(m_type)); - iszero2=all_zero(_mem2, H5Tget_size(m_type)); + iszero1 = all_zero(_mem1, H5Tget_size(m_type)); + iszero2 = all_zero(_mem2, H5Tget_size(m_type)); if (iszero1 != iszero2) { return 1; } else if (!iszero1 && !iszero2) { - /*------------------------------------------------------------------------- - * H5T_STD_REF_DSETREG - * Dataset region reference - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_STD_REF_DSETREG + * Dataset region reference + *------------------------------------------------------------------------- + */ if (type_size == H5R_DSET_REG_REF_BUF_SIZE) { - hid_t region1_id; - hid_t region2_id; + hid_t region1_id; + hid_t region2_id; if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1)) < 0) ret = -1; @@ -918,50 +758,49 @@ static hsize_t diff_datum(void *_mem1, H5Sclose(region2_id); }/*dataset reference*/ - /*------------------------------------------------------------------------- - * H5T_STD_REF_OBJ - * Object references. get the type and OID of the referenced object - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_STD_REF_OBJ + * Object references. get the type and OID of the referenced object + *------------------------------------------------------------------------- + */ else if (type_size == H5R_OBJ_REF_BUF_SIZE) { - H5O_type_t obj1_type; - H5O_type_t obj2_type; + H5O_type_t obj1_type; + H5O_type_t obj2_type; - if(H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) + if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) ret = -1; - if(H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) + if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) ret = -1; - if(ret == -1) { + if (ret == -1) { options->err_stat = 1; return 0; } /* end if */ /* check object type */ - if(obj1_type != obj2_type) { - parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); + if (obj1_type != obj2_type) { + parallel_print( + "Different object types referenced: <%s> and <%s>", obj1, obj2); options->not_cmp = 1; return 0; } - if((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0) + if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0) ret = -1; - if((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0) + if ((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0) ret = -1; - if(ret == -1) { + if (ret == -1) { options->err_stat = 1; return 0; } /* compare */ - if(obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid( - obj1_id, obj2_id, - NULL, NULL, - options); + if (obj1_type == H5O_TYPE_DATASET) + nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, options); else { - if(options->m_verbose) + if (options->m_verbose) parallel_print( - "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", obj1, obj2); + "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", + obj1, obj2); options->not_cmp = 1; } @@ -971,45 +810,38 @@ static hsize_t diff_datum(void *_mem1, }/*is zero*/ break; - /*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ case H5T_VLEN: /* get the VL sequences's base datatype for each element */ memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); + size = H5Tget_size(memb_type); /* get the number of sequence elements */ - nelmts = ((hvl_t *)mem1)->len; + nelmts = ((hvl_t *) mem1)->len; for (j = 0; j < nelmts; j++) - nfound += diff_datum( - ((char *)(((hvl_t *)mem1)->p)) + j * size, - ((char *)(((hvl_t *)mem2)->p)) + j * size, - memb_type, - i, rank, dims, acc, pos, - options, - obj1, obj2, - container1_id, container2_id, - ph, members); + nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, + rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); H5Tclose(memb_type); break; - /*------------------------------------------------------------------------- - * H5T_INTEGER - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_INTEGER + *------------------------------------------------------------------------- + */ case H5T_INTEGER: type_sign = H5Tget_sign(m_type); - /*------------------------------------------------------------------------- - * H5T_NATIVE_SCHAR - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_NATIVE_SCHAR + *------------------------------------------------------------------------- + */ if (type_size == 1 && type_sign != H5T_SGN_NONE) { - char temp1_char; - char temp2_char; + char temp1_char; + char temp2_char; HDassert(type_size == sizeof(char)); HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); @@ -1017,7 +849,7 @@ static hsize_t diff_datum(void *_mem1, if (options->d && !options->p) { if (ABS(temp1_char-temp2_char) > options->delta) { if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1030,7 +862,7 @@ static hsize_t diff_datum(void *_mem1, if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1038,7 +870,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } @@ -1051,7 +883,7 @@ static hsize_t diff_datum(void *_mem1, if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1059,7 +891,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent && ABS(temp1_char - temp2_char) > options->delta) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } @@ -1068,7 +900,7 @@ static hsize_t diff_datum(void *_mem1, } else if (temp1_char != temp2_char) { if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } @@ -1076,13 +908,13 @@ static hsize_t diff_datum(void *_mem1, } } /*H5T_NATIVE_SCHAR*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_UCHAR - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_NATIVE_UCHAR + *------------------------------------------------------------------------- + */ else if (type_size == 1 && type_sign == H5T_SGN_NONE) { - unsigned char temp1_uchar; - unsigned char temp2_uchar; + unsigned char temp1_uchar; + unsigned char temp2_uchar; HDassert(type_size == sizeof(unsigned char)); HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); @@ -1090,8 +922,8 @@ static hsize_t diff_datum(void *_mem1, /* -d and !-p */ if (options->d && !options->p) { if (PDIFF(temp1_uchar, temp2_uchar) > options->delta) { - if ( print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1100,11 +932,11 @@ static hsize_t diff_datum(void *_mem1, } /* !-d and -p */ else if (!options->d && options->p) { - PER_UNSIGN(signed char,temp1_uchar, temp2_uchar); + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1112,7 +944,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -1121,11 +953,11 @@ static hsize_t diff_datum(void *_mem1, } /* -d and -p */ else if (options->d && options->p) { - PER_UNSIGN(signed char,temp1_uchar, temp2_uchar); + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1133,7 +965,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent && PDIFF(temp1_uchar, temp2_uchar) > options->delta) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } @@ -1142,7 +974,7 @@ static hsize_t diff_datum(void *_mem1, } else if (temp1_uchar != temp2_uchar) { if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } @@ -1150,13 +982,13 @@ static hsize_t diff_datum(void *_mem1, } } /*H5T_NATIVE_UCHAR*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_SHORT - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_NATIVE_SHORT + *------------------------------------------------------------------------- + */ else if (type_size == 2 && type_sign != H5T_SGN_NONE) { - short temp1_short; - short temp2_short; + short temp1_short; + short temp2_short; HDassert(type_size == sizeof(short)); HDmemcpy(&temp1_short, mem1, sizeof(short)); @@ -1165,7 +997,7 @@ static hsize_t diff_datum(void *_mem1, if (options->d && !options->p) { if (ABS(temp1_short - temp2_short) > options->delta) { if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1174,11 +1006,11 @@ static hsize_t diff_datum(void *_mem1, } /* !-d and -p */ else if (!options->d && options->p) { - PER(temp1_short,temp2_short); + PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1186,7 +1018,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } @@ -1194,12 +1026,12 @@ static hsize_t diff_datum(void *_mem1, } } /* -d and -p */ - else if ( options->d && options->p) { - PER(temp1_short,temp2_short); + else if (options->d && options->p) { + PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1207,7 +1039,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent && ABS(temp1_short - temp2_short) > options->delta) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } @@ -1216,7 +1048,7 @@ static hsize_t diff_datum(void *_mem1, } else if (temp1_short != temp2_short) { if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } @@ -1224,22 +1056,22 @@ static hsize_t diff_datum(void *_mem1, } } /*H5T_NATIVE_SHORT*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_USHORT - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_NATIVE_USHORT + *------------------------------------------------------------------------- + */ else if (type_size == 2 && type_sign == H5T_SGN_NONE) { - unsigned short temp1_ushort; - unsigned short temp2_ushort; + unsigned short temp1_ushort; + unsigned short temp2_ushort; HDassert(type_size == sizeof(short)); HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ if (options->d && !options->p) { - if ( PDIFF(temp1_ushort, temp2_ushort) > options->delta) { + if (PDIFF(temp1_ushort, temp2_ushort) > options->delta) { if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1248,11 +1080,11 @@ static hsize_t diff_datum(void *_mem1, } /* !-d and -p */ else if (!options->d && options->p) { - PER_UNSIGN(signed short,temp1_ushort, temp2_ushort); + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1260,7 +1092,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } @@ -1269,11 +1101,11 @@ static hsize_t diff_datum(void *_mem1, } /* -d and -p */ else if (options->d && options->p) { - PER_UNSIGN(signed short,temp1_ushort, temp2_ushort); + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1281,7 +1113,7 @@ static hsize_t diff_datum(void *_mem1, } else if (per > options->percent && PDIFF(temp1_ushort, temp2_ushort) > options->delta) { if (print_data(options)) { - print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } @@ -1290,7 +1122,7 @@ static hsize_t diff_datum(void *_mem1, } else if (temp1_ushort != temp2_ushort) { if (print_data(options)) { - print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } @@ -1298,494 +1130,373 @@ static hsize_t diff_datum(void *_mem1, } } /*H5T_NATIVE_USHORT*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_INT - *------------------------------------------------------------------------- - */ - - else if (type_size==4 && type_sign!=H5T_SGN_NONE) - { - int temp1_int; - int temp2_int; - HDassert(type_size==sizeof(int)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_INT + *------------------------------------------------------------------------- + */ + else if (type_size == 4 && type_sign != H5T_SGN_NONE) { + int temp1_int; + int temp2_int; + HDassert(type_size == sizeof(int)); HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_int-temp2_int) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_int-temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_int,temp2_int); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER(temp1_int, temp2_int); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int,ABS(temp1_int-temp2_int),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_int,temp2_int); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER(temp1_int, temp2_int); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int,ABS(temp1_int-temp2_int),per); - } - nfound++; + else if (per > options->percent && ABS(temp1_int - temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } + nfound++; + } } - else if (temp1_int != temp2_int) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_int != temp2_int) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } } /*H5T_NATIVE_INT*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_UINT - *------------------------------------------------------------------------- - */ - - else if (type_size==4 && type_sign==H5T_SGN_NONE) - { - unsigned int temp1_uint; - unsigned int temp2_uint; - HDassert(type_size==sizeof(int)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_UINT + *------------------------------------------------------------------------- + */ + else if (type_size == 4 && type_sign == H5T_SGN_NONE) { + unsigned int temp1_uint; + unsigned int temp2_uint; + HDassert(type_size == sizeof(int)); HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_uint,temp2_uint) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_uint, temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed int,temp1_uint,temp2_uint); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed int,temp1_uint,temp2_uint); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed int, temp1_uint, temp2_uint); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(UI_FORMAT_P,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } + nfound++; + } } - else if (temp1_uint != temp2_uint) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_uint != temp2_uint) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(UI_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } } /*H5T_NATIVE_UINT*/ - - /*------------------------------------------------------------------------- - * H5T_NATIVE_LONG - *------------------------------------------------------------------------- - */ - - else if (type_size==8 && type_sign!=H5T_SGN_NONE) - { - long temp1_long; - long temp2_long; - HDassert(type_size==sizeof(long)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_LONG + *------------------------------------------------------------------------- + */ + else if (type_size == 8 && type_sign != H5T_SGN_NONE) { + long temp1_long; + long temp2_long; + HDassert(type_size == sizeof(long)); HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_long-temp2_long) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_long,temp2_long); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER(temp1_long, temp2_long); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long, - ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long,ABS(temp1_long-temp2_long),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_long,temp2_long); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER(temp1_long, temp2_long); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long, - ABS(temp1_long-temp2_long), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } + nfound++; + } } - else if (temp1_long != temp2_long) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_long != temp2_long) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } } /*H5T_NATIVE_LONG*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_ULONG - *------------------------------------------------------------------------- - */ - - else if (type_size==8 && type_sign==H5T_SGN_NONE) - { - unsigned long temp1_ulong; - unsigned long temp2_ulong; - HDassert(type_size==sizeof(unsigned long)); + /*------------------------------------------------------------------------- + * H5T_NATIVE_ULONG + *------------------------------------------------------------------------- + */ + else if (type_size == 8 && type_sign == H5T_SGN_NONE) { + unsigned long temp1_ulong; + unsigned long temp2_ulong; + HDassert(type_size == sizeof(unsigned long)); HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_ulong, temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - - else - - if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULI_FORMAT_P,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong),per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } + nfound++; + } } - else if (temp1_ulong != temp2_ulong) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_ulong != temp2_ulong) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - - - } /*H5T_NATIVE_ULONG*/ + } /*H5T_NATIVE_ULONG*/ /*------------------------------------------------------------------------- - * H5T_NATIVE_LLONG - *------------------------------------------------------------------------- - */ - - else if (type_size==8 && type_sign!=H5T_SGN_NONE) - { - long long temp1_llong; - long long temp2_llong; - HDassert(type_size==sizeof(long long)); + * H5T_NATIVE_LLONG + *------------------------------------------------------------------------- + */ + else if (type_size == 8 && type_sign != H5T_SGN_NONE) { + long long temp1_llong; + long long temp2_llong; + HDassert(type_size == sizeof(long long)); HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); /* -d and !-p */ - if (options->d && !options->p) - { - if (ABS(temp1_llong-temp2_llong) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (ABS(temp1_llong-temp2_llong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER(temp1_llong,temp2_llong); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER(temp1_llong, temp2_llong); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - PER(temp1_llong,temp2_llong); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER(temp1_llong, temp2_llong); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else - - if ( per > options->percent && ABS(temp1_llong-temp2_llong) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong),per); - } - nfound++; + else if (per > options->percent + && ABS(temp1_llong-temp2_llong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } + nfound++; + } } - else if (temp1_llong != temp2_llong) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_llong != temp2_llong) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } @@ -1793,761 +1504,566 @@ static hsize_t diff_datum(void *_mem1, } /*H5T_NATIVE_LLONG*/ /*------------------------------------------------------------------------- - * H5T_NATIVE_ULLONG - *------------------------------------------------------------------------- - */ + * H5T_NATIVE_ULLONG + *------------------------------------------------------------------------- + */ - else if (type_size==8 && type_sign==H5T_SGN_NONE) - { - unsigned long long temp1_ullong; - unsigned long long temp2_ullong; - HDassert(type_size==sizeof(unsigned long long)); + else if (type_size == 8 && type_sign == H5T_SGN_NONE) { + unsigned long long temp1_ullong; + unsigned long long temp2_ullong; + HDassert(type_size == sizeof(unsigned long long)); HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long)options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); + parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - ull2float(temp1_ullong,&f1); - ull2float(temp2_ullong,&f2); - PER(f1,f2); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); + parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } nfound++; - } - - else + } - if ( per > options->percent ) - { + else if (per > options->percent) { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong),per); } + nfound++; + } } /* -d and -p */ - else if ( options->d && options->p) - { - ull2float(temp1_ullong,&f1); - ull2float(temp2_ullong,&f2); - PER(f1,f2); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); + + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); + parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } nfound++; - } - - else - - if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long)options->delta ) - { - - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + } + else if (per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong),per); } + nfound++; + } } - else if (temp1_ullong != temp2_ullong) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_ullong != temp2_ullong) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); + parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } nfound++; } } /*H5T_NATIVE_ULLONG*/ - break; /* H5T_INTEGER class */ - - /*------------------------------------------------------------------------- - * H5T_FLOAT - *------------------------------------------------------------------------- - */ - + /*------------------------------------------------------------------------- + * H5T_FLOAT + *------------------------------------------------------------------------- + */ case H5T_FLOAT: - - - - /*------------------------------------------------------------------------- - * H5T_NATIVE_FLOAT - *------------------------------------------------------------------------- - */ - if (type_size==4) - { + /*------------------------------------------------------------------------- + * H5T_NATIVE_FLOAT + *------------------------------------------------------------------------- + */ + if (type_size == 4) { float temp1_float; float temp2_float; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; - HDassert(type_size==sizeof(float)); + HDassert(type_size == sizeof(float)); HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); /* logic for detecting NaNs is different with options -d, -p and no options */ - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (options->d && !options->p) - { - - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } - /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - if (ABS(temp1_float-temp2_float) > (float)options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + if (ABS(temp1_float-temp2_float) > (float) options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,(double)temp1_float,(double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; - } } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - PER(temp1_float,temp2_float); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent && (double)ABS(temp1_float-temp2_float) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; - } } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - - else if ( options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } - /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_float,temp2_float); + /* both not NaN, do the comparison */ + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; - } } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_float(temp1_float,temp2_float,options)==FALSE) - { - - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else if (equal_float(temp1_float, temp2_float, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } } /*H5T_NATIVE_FLOAT*/ - /*------------------------------------------------------------------------- - * H5T_NATIVE_DOUBLE - *------------------------------------------------------------------------- - */ - - else if (type_size==8) - { + /*------------------------------------------------------------------------- + * H5T_NATIVE_DOUBLE + *------------------------------------------------------------------------- + */ + else if (type_size == 8) { double temp1_double; double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; - HDassert(type_size==sizeof(double)); + HDassert(type_size == sizeof(double)); HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /* logic for detecting NaNs is different with options -d, -p and no options */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (options->d && !options->p) - { - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /* logic for detecting NaNs is different with options -d, -p and no options */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } } /* options->d && !options->p */ - - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && - ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && + ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_double(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else if (equal_double(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /*H5T_NATIVE_DOUBLE*/ -#if H5_SIZEOF_LONG_DOUBLE !=0 - +#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE - /*------------------------------------------------------------------------- - * H5T_NATIVE_LDOUBLE - *------------------------------------------------------------------------- - */ - - else if (type_size==8) - { + /*------------------------------------------------------------------------- + * H5T_NATIVE_LDOUBLE + *------------------------------------------------------------------------- + */ + else if (type_size == H5_SIZEOF_LONG_DOUBLE) { long double temp1_double; long double temp2_double; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; - + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; HDassert(type_size == sizeof(long double)); HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - /* logic for detecting NaNs is different with options -d, -p and no options */ - - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ - if (options->d && !options->p) - { + /* logic for detecting NaNs is different with options -d, -p and no options */ - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ + if (options->d && !options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /* NaN */ /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } - - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - + if (!isnan1 && !isnan2) { PER(temp1_double,temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* NaN */ /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if ( options->d && options->p) { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - + if ( !isnan1 && !isnan2) { PER(temp1_double,temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && - ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LD_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* NaN */ /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else if (equal_ldouble(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LD_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /*H5T_NATIVE_LDOUBLE*/ -#endif /* H5_SIZEOF_LONG_DOUBLE */ - - +#endif /* H5_SIZEOF_LONG_DOUBLE */ break; /* H5T_FLOAT class */ @@ -2555,7 +2071,7 @@ static hsize_t diff_datum(void *_mem1, h5difftrace("diff_datum finish\n"); return nfound; - } +} /*------------------------------------------------------------------------- * Function: all_zero @@ -2567,12 +2083,11 @@ static hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ -static hbool_t all_zero(const void *_mem, size_t size) -{ - const unsigned char *mem = (const unsigned char *)_mem; +static hbool_t all_zero(const void *_mem, size_t size) { + const unsigned char *mem = (const unsigned char *) _mem; - while(size-- > 0) - if(mem[size]) + while (size-- > 0) + if (mem[size]) return FALSE; return TRUE; @@ -2589,22 +2104,18 @@ static hbool_t all_zero(const void *_mem, size_t size) */ static -void print_region_block(int i, hsize_t *ptdata, int ndims) -{ +void print_region_block(int i, hsize_t *ptdata, int ndims) { int j; parallel_print(" "); for (j = 0; j < ndims; j++) - parallel_print("%s%lu", j ? "," : " (", - (unsigned long)ptdata[i * 2 * ndims + j]); + parallel_print("%s%lu", j ? "," : " (", (unsigned long) ptdata[i * 2 * ndims + j]); for (j = 0; j < ndims; j++) - parallel_print("%s%lu", j ? "," : ")-(", - (unsigned long)ptdata[i * 2 * ndims + j + ndims]); + parallel_print("%s%lu", j ? "," : ")-(", (unsigned long) ptdata[i * 2 * ndims + j + ndims]); parallel_print(")"); } - /*------------------------------------------------------------------------- * Function: print_points * @@ -2616,14 +2127,12 @@ void print_region_block(int i, hsize_t *ptdata, int ndims) */ static -void print_points(int i, hsize_t *ptdata, int ndims) -{ +void print_points(int i, hsize_t *ptdata, int ndims) { int j; parallel_print(" "); for (j = 0; j < ndims; j++) - parallel_print("%s%lu", j ? "," : "(", - (unsigned long)(ptdata[i * ndims + j])); + parallel_print("%s%lu", j ? "," : "(", (unsigned long) (ptdata[i * ndims + j])); parallel_print(")"); } @@ -2638,62 +2147,61 @@ void print_points(int i, hsize_t *ptdata, int ndims) *------------------------------------------------------------------------- */ -static -hsize_t diff_region(hid_t obj1_id, - hid_t obj2_id, - hid_t region1_id, - hid_t region2_id, - diff_opt_t *options) +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *options) { - hssize_t nblocks1, npoints1; - hssize_t nblocks2, npoints2; - hsize_t alloc_size; - hsize_t *ptdata1; - hsize_t *ptdata2; - int ndims1; - int ndims2; - int i, j; - hsize_t nfound_b = 0; /* block differences found */ - hsize_t nfound_p = 0; /* point differences found */ + hssize_t nblocks1, npoints1; + hssize_t nblocks2, npoints2; + hsize_t alloc_size; + hsize_t *ptdata1; + hsize_t *ptdata2; + int ndims1; + int ndims2; + int i, j; + hsize_t nfound_b = 0; /* block differences found */ + hsize_t nfound_p = 0; /* point differences found */ ndims1 = H5Sget_simple_extent_ndims(region1_id); ndims2 = H5Sget_simple_extent_ndims(region2_id); /* - * These two functions fail if the region does not have blocks or points, - * respectively. They do not currently know how to translate from one to - * the other. - */ - H5E_BEGIN_TRY { - nblocks1 = H5Sget_select_hyper_nblocks(region1_id); - nblocks2 = H5Sget_select_hyper_nblocks(region2_id); + * These two functions fail if the region does not have blocks or points, + * respectively. They do not currently know how to translate from one to + * the other. + */ + H5E_BEGIN_TRY + { + nblocks1 = H5Sget_select_hyper_nblocks(region1_id); + nblocks2 = H5Sget_select_hyper_nblocks(region2_id); - npoints1 = H5Sget_select_elem_npoints(region1_id); - npoints2 = H5Sget_select_elem_npoints(region2_id); - } H5E_END_TRY; + npoints1 = H5Sget_select_elem_npoints(region1_id); + npoints2 = H5Sget_select_elem_npoints(region2_id); + }H5E_END_TRY; - if(nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { + if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { options->not_cmp = 1; return 0; } /*------------------------------------------------------------------------- - * compare block information - *------------------------------------------------------------------------- - */ - if(nblocks1 > 0) { + * compare block information + *------------------------------------------------------------------------- + */ + if (nblocks1 > 0) { HDassert(ndims1 > 0); - alloc_size = (hsize_t)nblocks1 * (unsigned)ndims1 * 2 * sizeof(ptdata1[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 + * sizeof(ptdata1[0]); + HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); + ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); + H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, + (hsize_t) nblocks1, ptdata1); - ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); + ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2); + H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0, + (hsize_t) nblocks2, ptdata2); for (i = 0; i < nblocks1; i++) { /* start coordinates and opposite corner */ @@ -2702,14 +2210,13 @@ hsize_t diff_region(hid_t obj1_id, start1 = ptdata1[i * 2 * ndims1 + j]; start2 = ptdata2[i * 2 * ndims1 + j]; - end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; - end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; + end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; + end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; if (start1 != start2 || end1 != end2) nfound_b++; } } - /* print differences if found */ if (nfound_b && options->m_verbose) { H5O_info_t oi1, oi2; @@ -2718,8 +2225,9 @@ hsize_t diff_region(hid_t obj1_id, H5Oget_info(obj2_id, &oi2); parallel_print("Referenced dataset %lu %lu\n", - (unsigned long)oi1.addr, (unsigned long)oi2.addr); - parallel_print("------------------------------------------------------------\n"); + (unsigned long) oi1.addr, (unsigned long) oi2.addr); + parallel_print( + "------------------------------------------------------------\n"); parallel_print("Region blocks\n"); for (i = 0; i < nblocks1; i++) { @@ -2735,47 +2243,50 @@ hsize_t diff_region(hid_t obj1_id, } /*------------------------------------------------------------------------- - * compare point information - *------------------------------------------------------------------------- - */ - if(npoints1 > 0) { - alloc_size = (hsize_t)npoints1 * (unsigned)ndims1 * sizeof(ptdata1[0]); - HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + * compare point information + *------------------------------------------------------------------------- + */ + if (npoints1 > 0) { + alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 + * sizeof(ptdata1[0]); + HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size); - H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); - H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); + ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, + (hsize_t) npoints1, ptdata1); - ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size); - H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); - H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); + ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0, + (hsize_t) npoints2, ptdata2); - for(i = 0; i < npoints1; i++) { + for (i = 0; i < npoints1; i++) { hsize_t pt1, pt2; - for(j = 0; j < ndims1; j++) { + for (j = 0; j < ndims1; j++) { pt1 = ptdata1[i * ndims1 + j]; pt2 = ptdata2[i * ndims1 + j]; - if(pt1 != pt2) + if (pt1 != pt2) nfound_p++; } } - if(nfound_p && options->m_verbose) { + if (nfound_p && options->m_verbose) { parallel_print("Region points\n"); - for(i = 0; i < npoints1; i++) { + for (i = 0; i < npoints1; i++) { hsize_t pt1, pt2; - int diff_data = 0; + int diff_data = 0; - for(j = 0; j < ndims1; j++) { + for (j = 0; j < ndims1; j++) { pt1 = ptdata1[i * ndims1 + j]; pt2 = ptdata2[i * ndims1 + j]; - if(pt1 != pt2) { + if (pt1 != pt2) { diff_data = 1; break; } } - if(diff_data) { + if (diff_data) { parallel_print("point #%d", i); print_points(i, ptdata1, ndims1); print_points(i, ptdata2, ndims1); @@ -2784,7 +2295,6 @@ hsize_t diff_region(hid_t obj1_id, } } - #if defined (H5DIFF_DEBUG) for (i = 0; i < npoints1; i++) { int j; @@ -2792,8 +2302,8 @@ hsize_t diff_region(hid_t obj1_id, parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); for (j = 0; j < ndims1; j++) - parallel_print("%s%lu", j ? "," : "(", - (unsigned long)(ptdata1[i * ndims1 + j])); + parallel_print("%s%lu", j ? "," : "(", + (unsigned long)(ptdata1[i * ndims1 + j])); parallel_print(")"); } @@ -2803,12 +2313,11 @@ hsize_t diff_region(hid_t obj1_id, HDfree(ptdata2); } - nfound_b = nfound_b / (unsigned)ndims1; - nfound_p = nfound_p / (unsigned)ndims1; + nfound_b = nfound_b / (unsigned) ndims1; + nfound_p = nfound_p / (unsigned) ndims1; return (nfound_p + nfound_b); } - /*------------------------------------------------------------------------- * Function: character_compare * @@ -2819,33 +2328,18 @@ hsize_t diff_region(hid_t obj1_id, *------------------------------------------------------------------------- */ -static -hsize_t character_compare(char *mem1, - char *mem2, - hsize_t i, - unsigned u, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) -{ - hsize_t nfound=0; /* differences found */ - char temp1_uchar; - char temp2_uchar; +static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, unsigned u, + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { + hsize_t nfound = 0; /* differences found */ + char temp1_uchar; + char temp2_uchar; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); - if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_char_pos(ph,0,i,u,acc,pos,rank,dims,obj1,obj2); + if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_char_pos(ph, 0, i, u, acc, pos, rank, dims, obj1, obj2); parallel_print(" "); h5diff_print_char(temp1_uchar); parallel_print(" "); @@ -2859,7 +2353,6 @@ hsize_t character_compare(char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: character_compare_opt * @@ -2870,23 +2363,13 @@ hsize_t character_compare(char *mem1, *------------------------------------------------------------------------- */ -static hsize_t character_compare_opt(unsigned char *mem1, - unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) -{ - hsize_t nfound=0; /* differences found */ - unsigned char temp1_uchar; - unsigned char temp2_uchar; - double per; - hbool_t both_zero; +static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, + hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { + hsize_t nfound = 0; /* differences found */ + unsigned char temp1_uchar; + unsigned char temp2_uchar; + double per; + hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2894,66 +2377,52 @@ static hsize_t character_compare_opt(unsigned char *mem1, h5difftrace("character_compare_opt start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + if (options->d && !options->p) { + if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } } /* !-d and -p */ - else if (!options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (!options->d && options->p) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } /* -d and -p */ - else if ( options->d && options->p) - { - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); - if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,i,acc,pos,rank,dims,obj1,obj2); + else if (options->d && options->p) { + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); + if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar),per); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } nfound++; } } - else if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + else if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; - } - h5difftrace("character_compare_opt finish\n"); + } h5difftrace("character_compare_opt finish\n"); return nfound; - } - /*------------------------------------------------------------------------- * Function: diff_float * @@ -2963,273 +2432,210 @@ static hsize_t character_compare_opt(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_float(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - float temp1_float; - float temp2_float; - hsize_t i; - double per; - hbool_t both_zero; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hsize_t nfound = 0; /* number of differences found */ + float temp1_float; + float temp2_float; + hsize_t i; + double per; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_float start\n"); - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - if ((double)ABS(temp1_float-temp2_float) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if ((double) ABS(temp1_float - temp2_float) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( (!isnan1 && !isnan2)) - { - - PER(temp1_float,temp2_float); + if ((!isnan1 && !isnan2)) { + PER(temp1_float, temp2_float); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_FLOAT,&temp1_float); - isnan2 = my_isnan(FLT_FLOAT,&temp2_float); + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_FLOAT, &temp1_float); + isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { + if (!isnan1 && !isnan2) { + PER(temp1_float, temp2_float); - PER(temp1_float,temp2_float); - - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - - else - - if ( per > options->percent && (double)ABS(temp1_float - temp2_float) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P, (double)temp1_float, (double)temp2_float, - (double)ABS(temp1_float - temp2_float), - (double)ABS(1 - temp2_float / temp1_float)); - } - nfound++; + else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, + (double) ABS(temp1_float - temp2_float), (double) ABS(1 - temp2_float / temp1_float)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - if (equal_float(temp1_float,temp2_float,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (equal_float(temp1_float, temp2_float, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT, (double)temp1_float, (double)temp2_float, (double)ABS(temp1_float - temp2_float)); + parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - mem1+=sizeof(float); - mem2+=sizeof(float); - if (options->n && nfound>=options->count) + mem1 += sizeof(float); + mem2 += sizeof(float); + if (options->n && nfound >= options->count) return nfound; - } /* nelmts */ - - - - - } h5difftrace("diff_float finish\n"); return nfound; } - /*------------------------------------------------------------------------- * Function: diff_double * @@ -3239,279 +2645,209 @@ static hsize_t diff_float(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_double(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - double temp1_double; - double temp2_double; - hsize_t i; - double per; - hbool_t both_zero; - hbool_t isnan1 = FALSE; - hbool_t isnan2 = FALSE; + hsize_t nfound = 0; /* number of differences found */ + double temp1_double; + double temp2_double; + hsize_t i; + double per; + hbool_t both_zero; + hbool_t isnan1 = FALSE; + hbool_t isnan2 = FALSE; h5difftrace("diff_double start\n"); - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_DOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_DOUBLE,&temp2_double); + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else - { - - - - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - - if (equal_double(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (equal_double(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1+=sizeof(double); - mem2+=sizeof(double); - if (options->n && nfound>=options->count) + mem1 += sizeof(double); + mem2 += sizeof(double); + if (options->n && nfound >= options->count) return nfound; - } /* nelmts */ - - - - - } h5difftrace("diff_double finish\n"); return nfound; } - - - - /*------------------------------------------------------------------------- * Function: diff_ldouble * @@ -3524,20 +2860,20 @@ static hsize_t diff_double(unsigned char *mem1, #if H5_SIZEOF_LONG_DOUBLE !=0 static hsize_t diff_ldouble(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) + unsigned char *mem2, + hsize_t nelmts, + hsize_t hyper_start, + int rank, + hsize_t *dims, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound=0; /* number of differences found */ long double temp1_double; long double temp2_double; hsize_t i; @@ -3548,245 +2884,183 @@ static hsize_t diff_ldouble(unsigned char *mem1, h5difftrace("diff_ldouble start\n"); - /*------------------------------------------------------------------------- - * -d and !-p - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * -d and !-p + *------------------------------------------------------------------------- + */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for ( i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - if (ABS(temp1_double-temp2_double) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (!isnan1 && !isnan2) { + if (ABS(temp1_double-temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - /*------------------------------------------------------------------------- - * !-d and -p - *------------------------------------------------------------------------- - */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * !-d and -p + *------------------------------------------------------------------------- + */ + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + /*------------------------------------------------------------------------- + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, + ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); } + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - - } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) - return nfound; - } /* i */ - } - - /*------------------------------------------------------------------------- - * -d and -p - *------------------------------------------------------------------------- - */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + } + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) + return nfound; + } /* i */ + } + /*------------------------------------------------------------------------- + * -d and -p + *------------------------------------------------------------------------- + */ + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - if ( options->do_nans ) - { - isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); - isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); + * detect NaNs + *------------------------------------------------------------------------- + */ + if (options->do_nans) { + isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); + isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) - { - - PER(temp1_double,temp2_double); + if (!isnan1 && !isnan2) { + PER(temp1_double, temp2_double); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT_P_NOTCOMP,temp1_double,temp2_double, - ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - else - - if ( per > options->percent && ABS(temp1_double-temp2_double) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(F_FORMAT_P,temp1_double,temp2_double, - ABS(temp1_double-temp2_double), - ABS(1-temp2_double/temp1_double)); - } - nfound++; + else if (per > options->percent && ABS(temp1_double - temp2_double) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); } - + nfound++; + } } /* only one is NaN, assume difference */ - else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; - } - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) return nfound; } /* i */ } - - /*------------------------------------------------------------------------- - * no -d and -p - *------------------------------------------------------------------------- - */ - else - { - - - - for ( i = 0; i < nelmts; i++) - { + /*------------------------------------------------------------------------- + * no -d and -p + *------------------------------------------------------------------------- + */ + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - - if (equal_ldouble(temp1_double,temp2_double,options)==FALSE) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); + parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - - mem1+=sizeof(long double); - mem2+=sizeof(long double); - if (options->n && nfound>=options->count) + mem1 += sizeof(long double); + mem2 += sizeof(long double); + if (options->n && nfound >= options->count) return nfound; - } /* nelmts */ - - - - - } h5difftrace("diff_ldouble finish\n"); @@ -3794,11 +3068,6 @@ static hsize_t diff_ldouble(unsigned char *mem1, } #endif /* H5_SIZEOF_LONG_DOUBLE */ - - - - - /*------------------------------------------------------------------------- * Function: diff_schar * @@ -3808,171 +3077,125 @@ static hsize_t diff_ldouble(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_schar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - char temp1_char; - char temp2_char; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + char temp1_char; + char temp2_char; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_schar start\n"); - /* -d and !-p */ - if (options->d && !options->p) - { - - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (ABS(temp1_char-temp2_char) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_char-temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } } - /* !-d and -p */ - else if (!options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - PER(temp1_char,temp2_char); + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char, - ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char, - ABS(temp1_char-temp2_char), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } } - /* -d and -p */ - else if ( options->d && options->p) - { - - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - PER(temp1_char,temp2_char); + PER(temp1_char, temp2_char); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_char,temp2_char, - ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_char-temp2_char) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_char,temp2_char, - ABS(temp1_char-temp2_char), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_char-temp2_char) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } - } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (temp1_char != temp2_char) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_char != temp2_char) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_char,temp2_char,ABS(temp1_char-temp2_char)); + parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - mem1+=sizeof(char); - mem2+=sizeof(char); - if (options->n && nfound>=options->count) + mem1 += sizeof(char); + mem2 += sizeof(char); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_schar finish\n"); return nfound; } - - /*------------------------------------------------------------------------- * Function: diff_uchar * @@ -3982,159 +3205,118 @@ static hsize_t diff_schar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_uchar(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_uchar start\n"); - /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } } - /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } } - /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); + PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uchar,temp2_uchar, - PDIFF(temp1_uchar,temp2_uchar), - per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - if (temp1_uchar != temp2_uchar) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_uchar != temp2_uchar) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uchar,temp2_uchar,PDIFF(temp1_uchar,temp2_uchar)); + parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - mem1+=sizeof(unsigned char); - mem2+=sizeof(unsigned char); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned char); + mem2 += sizeof(unsigned char); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_uchar finish\n"); @@ -4150,155 +3332,116 @@ static hsize_t diff_uchar(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_short(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - short temp1_short; - short temp2_short; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + short temp1_short; + short temp2_short; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_short start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - if (ABS(temp1_short-temp2_short) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_short-temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } } - /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - PER(temp1_short,temp2_short); + PER(temp1_short, temp2_short); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short, - ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short, - ABS(temp1_short-temp2_short), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } } - /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - PER(temp1_short,temp2_short); + PER(temp1_short, temp2_short); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_short,temp2_short, - ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_short-temp2_short) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_short,temp2_short, - ABS(temp1_short-temp2_short), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_short-temp2_short) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - if (temp1_short != temp2_short) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_short != temp2_short) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_short,temp2_short,ABS(temp1_short-temp2_short)); + parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - mem1+=sizeof(short); - mem2+=sizeof(short); - if (options->n && nfound>=options->count) + mem1 += sizeof(short); + mem2 += sizeof(short); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -4307,7 +3450,6 @@ static hsize_t diff_short(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_ushort * @@ -4317,163 +3459,125 @@ static hsize_t diff_short(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_ushort(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ushort start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_ushort,temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); + PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_ushort,temp2_ushort, - PDIFF(temp1_ushort,temp2_ushort), - per); - } - nfound++; + else if (per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - if (temp1_ushort != temp2_ushort) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_ushort != temp2_ushort) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_ushort,temp2_ushort,PDIFF(temp1_ushort,temp2_ushort)); + parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - mem1+=sizeof(unsigned short); - mem2+=sizeof(unsigned short); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned short); + mem2 += sizeof(unsigned short); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_ushort finish\n"); return nfound; } - /*------------------------------------------------------------------------- * Function: diff_int * @@ -4483,163 +3587,124 @@ static hsize_t diff_ushort(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_int(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - int temp1_int; - int temp2_int; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + int temp1_int; + int temp2_int; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_int start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - if (ABS(temp1_int-temp2_int) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_int-temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - PER(temp1_int,temp2_int); + PER(temp1_int, temp2_int); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int, - ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int, - ABS(temp1_int-temp2_int), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - PER(temp1_int,temp2_int); + PER(temp1_int, temp2_int); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_int,temp2_int, - ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_int-temp2_int) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_int,temp2_int, - ABS(temp1_int-temp2_int), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_int-temp2_int) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - if (temp1_int != temp2_int) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_int != temp2_int) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_int,temp2_int,ABS(temp1_int-temp2_int)); + parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - mem1+=sizeof(int); - mem2+=sizeof(int); - if (options->n && nfound>=options->count) + mem1 += sizeof(int); + mem2 += sizeof(int); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } h5difftrace("diff_int finish\n"); - return nfound; } - /*------------------------------------------------------------------------- * Function: diff_uint * @@ -4649,151 +3714,117 @@ static hsize_t diff_int(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_uint(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - unsigned int temp1_uint; - unsigned int temp2_uint; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + unsigned int temp1_uint; + unsigned int temp2_uint; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_uint start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - if ( PDIFF(temp1_uint,temp2_uint) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_uint,temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - PER_UNSIGN(signed int,temp1_uint,temp2_uint); + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint, - PDIFF(temp1_uint,temp2_uint), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - PER_UNSIGN(signed int,temp1_uint,temp2_uint); + PER_UNSIGN(signed int, temp1_uint, temp2_uint); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT_P_NOTCOMP,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(I_FORMAT_P,temp1_uint,temp2_uint, - PDIFF(temp1_uint,temp2_uint), - per); - } - nfound++; + else if (per > options->percent + && PDIFF(temp1_uint,temp2_uint) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - if (temp1_uint != temp2_uint) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_uint != temp2_uint) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(I_FORMAT,temp1_uint,temp2_uint,PDIFF(temp1_uint,temp2_uint)); + parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - mem1+=sizeof(unsigned int); - mem2+=sizeof(unsigned int); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned int); + mem2 += sizeof(unsigned int); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -4802,7 +3833,6 @@ static hsize_t diff_uint(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_long * @@ -4812,166 +3842,126 @@ static hsize_t diff_uint(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_long(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - long temp1_long; - long temp2_long; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + long temp1_long; + long temp2_long; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_long start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - if (ABS(temp1_long-temp2_long) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - PER(temp1_long,temp2_long); + PER(temp1_long, temp2_long); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long, - ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long, - ABS(temp1_long-temp2_long), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - PER(temp1_long,temp2_long); + PER(temp1_long, temp2_long); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT_P_NOTCOMP,temp1_long,temp2_long, - ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_long-temp2_long) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_long,temp2_long, - ABS(temp1_long-temp2_long), - per); - } - nfound++; + else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - if (temp1_long != temp2_long) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_long != temp2_long) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_long,temp2_long,ABS(temp1_long-temp2_long)); + parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - mem1+=sizeof(long); - mem2+=sizeof(long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long); + mem2 += sizeof(long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ - } h5difftrace("diff_long finish\n"); return nfound; } - /*------------------------------------------------------------------------- * Function: diff_ulong * @@ -4981,155 +3971,120 @@ static hsize_t diff_long(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_ulong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - unsigned long temp1_ulong; - unsigned long temp2_ulong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + unsigned long temp1_ulong; + unsigned long temp2_ulong; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ulong start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_ulong,temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_ulong,temp2_ulong, - PDIFF(temp1_ulong,temp2_ulong), - per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); + PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(ULI_FORMAT_P_NOTCOMP,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LI_FORMAT_P,temp1_ulong,temp2_ulong, - PDIFF(temp1_ulong,temp2_ulong), - per); - } - nfound++; + else if (per > options->percent + && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - if (temp1_ulong != temp2_ulong) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_ulong != temp2_ulong) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LI_FORMAT,temp1_ulong,temp2_ulong,PDIFF(temp1_ulong,temp2_ulong)); + parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - mem1+=sizeof(unsigned long); - mem2+=sizeof(unsigned long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long); + mem2 += sizeof(unsigned long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -5138,7 +4093,6 @@ static hsize_t diff_ulong(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_llong * @@ -5148,147 +4102,117 @@ static hsize_t diff_ulong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_llong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) - +static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, + hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - long long temp1_llong; - long long temp2_llong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + long long temp1_llong; + long long temp2_llong; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_llong start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - if (ABS( temp1_llong-temp2_llong) > options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (ABS( temp1_llong-temp2_llong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - PER(temp1_llong,temp2_llong); + PER(temp1_llong, temp2_llong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); - } - nfound++; + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong),per); - } - nfound++; - } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) - return nfound; + nfound++; + } + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); + } + nfound++; + } + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) + return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - PER(temp1_llong,temp2_llong); + PER(temp1_llong, temp2_llong); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT_P_NOTCOMP,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else - if ( per > options->percent && ABS(temp1_llong-temp2_llong) > options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(LLI_FORMAT_P,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong),per); - } - nfound++; + else if (per > options->percent + && ABS(temp1_llong-temp2_llong) > options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - if (temp1_llong != temp2_llong) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_llong != temp2_llong) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); - parallel_print(LLI_FORMAT,temp1_llong,temp2_llong,ABS(temp1_llong-temp2_llong)); + parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - mem1+=sizeof(long long); - mem2+=sizeof(long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(long long); + mem2 += sizeof(long long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -5297,7 +4221,6 @@ static hsize_t diff_llong(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: diff_ullong * @@ -5307,152 +4230,122 @@ static hsize_t diff_llong(unsigned char *mem1, * *------------------------------------------------------------------------- */ -static hsize_t diff_ullong(unsigned char *mem1, - unsigned char *mem2, - hsize_t nelmts, - hsize_t hyper_start, - int rank, - hsize_t *dims, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2, - int *ph) +static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, + hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ - unsigned long long temp1_ullong; - unsigned long long temp2_ullong; - hsize_t i; - float f1, f2; - double per; - hbool_t both_zero; + hsize_t nfound = 0; /* number of differences found */ + unsigned long long temp1_ullong; + unsigned long long temp2_ullong; + hsize_t i; + float f1, f2; + double per; + hbool_t both_zero; h5difftrace("diff_ullong start\n"); /* -d and !-p */ - if (options->d && !options->p) - { - for ( i = 0; i < nelmts; i++) - { + if (options->d && !options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (!options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - ull2float(temp1_ullong,&f1); - ull2float(temp2_ullong,&f2); - PER(f1,f2); + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else - if ( per > options->percent ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + else if (per > options->percent) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } } /* -d and -p */ - else if ( options->d && options->p) - { - for ( i = 0; i < nelmts; i++) - { + else if (options->d && options->p) { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - ull2float(temp1_ullong,&f1); - ull2float(temp2_ullong,&f2); - PER(f1,f2); + ull2float(temp1_ullong, &f1); + ull2float(temp2_ullong, &f2); + PER(f1, f2); - if (not_comparable && !both_zero) /* not comparable */ - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (not_comparable && !both_zero) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else - if ( per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long)options->delta ) - { - if ( print_data(options) ) - { - print_pos(ph,1,hyper_start+i,acc,pos,rank,dims,obj1,obj2); - parallel_print(SPACES); - parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); - } - nfound++; + else if (per > options->percent + && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { + if (print_data(options)) { + print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + parallel_print(SPACES); + parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + nfound++; + } + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } } - else - { - for ( i = 0; i < nelmts; i++) - { + else { + for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - if (temp1_ullong != temp2_ullong) - { - if ( print_data(options) ) - { - print_pos(ph,0,hyper_start+i,acc,pos,rank,dims,obj1,obj2); + if (temp1_ullong != temp2_ullong) { + if (print_data(options)) { + print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - mem1+=sizeof(unsigned long long); - mem2+=sizeof(unsigned long long); - if (options->n && nfound>=options->count) + mem1 += sizeof(unsigned long long); + mem2 += sizeof(unsigned long long); + if (options->n && nfound >= options->count) return nfound; } /* nelmts */ } @@ -5461,7 +4354,6 @@ static hsize_t diff_ullong(unsigned char *mem1, return nfound; } - /*------------------------------------------------------------------------- * Function: ull2float * @@ -5475,49 +4367,46 @@ static hsize_t diff_ullong(unsigned char *mem1, *------------------------------------------------------------------------- */ static -int ull2float(unsigned long long ull_value, float *f_value) -{ - hid_t dxpl_id; - unsigned char *buf = NULL; - size_t src_size; - size_t dst_size; +int ull2float(unsigned long long ull_value, float *f_value) { + hid_t dxpl_id; + unsigned char *buf = NULL; + size_t src_size; + size_t dst_size; h5difftrace("ull2float start\n"); - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) + if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - buf = (unsigned char*)HDcalloc((size_t)1, MAX(src_size, dst_size)); - if(!buf) + buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size)); + if (!buf) goto error; HDmemcpy(buf, &ull_value, src_size); /* do conversion */ - if(H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t)1, buf, NULL, dxpl_id)<0) + if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t) 1, buf, NULL, dxpl_id) < 0) goto error; HDmemcpy(f_value, buf, dst_size); - if(buf) - HDfree(buf); - h5difftrace("ull2float finish\n"); + if (buf) + HDfree(buf);h5difftrace("ull2float finish\n"); return 0; error: - H5E_BEGIN_TRY { + H5E_BEGIN_TRY + { H5Pclose(dxpl_id); - } H5E_END_TRY; - if(buf) - HDfree(buf); - h5difftrace("ull2float errored\n"); + }H5E_END_TRY; + if (buf) + HDfree(buf);h5difftrace("ull2float errored\n"); return -1; } - /*------------------------------------------------------------------------- * Function: equal_double * @@ -5529,26 +4418,21 @@ error: * *------------------------------------------------------------------------- */ -static -hbool_t equal_double(double value, double expected, diff_opt_t *options) -{ +static hbool_t equal_double(double value, double expected, diff_opt_t *options) { h5difftrace("equal_double start\n"); - if ( options->do_nans ) - { - + if (options->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = my_isnan(FLT_DOUBLE,&value); - hbool_t isnan2 = my_isnan(FLT_DOUBLE,&expected); + hbool_t isnan1 = my_isnan(FLT_DOUBLE, &value); + hbool_t isnan2 = my_isnan(FLT_DOUBLE, &expected); /*------------------------------------------------------------------------- * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if ( isnan1 && isnan2 ) - { + if (isnan1 && isnan2) { return TRUE; } @@ -5556,8 +4440,7 @@ hbool_t equal_double(double value, double expected, diff_opt_t *options) * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) - { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { return FALSE; } } @@ -5588,31 +4471,27 @@ static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options) { h5difftrace("equal_ldouble start\n"); - if ( options->do_nans ) - { - + if (options->do_nans) { /*------------------------------------------------------------------------- - * detect NaNs - *------------------------------------------------------------------------- - */ - hbool_t isnan1 = my_isnan(FLT_LDOUBLE,&value); - hbool_t isnan2 = my_isnan(FLT_LDOUBLE,&expected); + * detect NaNs + *------------------------------------------------------------------------- + */ + hbool_t isnan1 = my_isnan(FLT_LDOUBLE, &value); + hbool_t isnan2 = my_isnan(FLT_LDOUBLE, &expected); /*------------------------------------------------------------------------- - * we consider NaN == NaN to be true - *------------------------------------------------------------------------- - */ - if ( isnan1 && isnan2 ) - { + * we consider NaN == NaN to be true + *------------------------------------------------------------------------- + */ + if (isnan1 && isnan2) { return TRUE; } /*------------------------------------------------------------------------- - * one is a NaN, do not compare but assume difference - *------------------------------------------------------------------------- - */ - if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) - { + * one is a NaN, do not compare but assume difference + *------------------------------------------------------------------------- + */ + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { return FALSE; } } @@ -5621,7 +4500,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio return TRUE; if (options->use_system_epsilon) { - if ( ABS( (value-expected) ) < DBL_EPSILON) + if (ABS((value-expected)) < DBL_EPSILON) return TRUE; } h5difftrace("equal_ldouble finish\n"); @@ -5631,7 +4510,6 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio #endif /* #if H5_SIZEOF_LONG_DOUBLE !=0 */ - /*------------------------------------------------------------------------- * Function: equal_float * @@ -5643,35 +4521,29 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio * *------------------------------------------------------------------------- */ -static -hbool_t equal_float(float value, float expected, diff_opt_t *options) -{ +static hbool_t equal_float(float value, float expected, diff_opt_t *options) { h5difftrace("equal_float start\n"); - if ( options->do_nans ) - { - + if (options->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - hbool_t isnan1 = my_isnan(FLT_FLOAT,&value); - hbool_t isnan2 = my_isnan(FLT_FLOAT,&expected); + hbool_t isnan1 = my_isnan(FLT_FLOAT, &value); + hbool_t isnan2 = my_isnan(FLT_FLOAT, &expected); /*------------------------------------------------------------------------- - * we consider NaN == NaN to be true - *------------------------------------------------------------------------- - */ - if ( isnan1 && isnan2 ) - { + * we consider NaN == NaN to be true + *------------------------------------------------------------------------- + */ + if (isnan1 && isnan2) { return TRUE; } /*------------------------------------------------------------------------- - * one is a NaN, do not compare but assume difference - *------------------------------------------------------------------------- - */ - if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) ) - { + * one is a NaN, do not compare but assume difference + *------------------------------------------------------------------------- + */ + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { return FALSE; } } @@ -5689,8 +4561,6 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) } - - /*------------------------------------------------------------------------- * Function: my_isnan * @@ -5707,81 +4577,68 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) * *------------------------------------------------------------------------- */ -static hbool_t -my_isnan(dtype_t type, void *val) -{ +static hbool_t my_isnan(dtype_t type, void *val) { hbool_t retval = FALSE; char s[256]; h5difftrace("my_isnan start\n"); - if (FLT_FLOAT==type) - { + if (FLT_FLOAT == type) { float x; HDmemcpy(&x, val, sizeof(float)); - retval = (x!=x); + retval = (x != x); } - else if (FLT_DOUBLE==type) - { + else if (FLT_DOUBLE == type) { double x; HDmemcpy(&x, val, sizeof(double)); - retval = (x!=x); + retval = (x != x); } -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - else if (FLT_LDOUBLE==type) - { +#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 + else if (FLT_LDOUBLE == type) { long double x; HDmemcpy(&x, val, sizeof(long double)); retval = (x!=x); } #endif - else - { + else { return FALSE; } - /* + /* * Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if * the result contains a NaN string. */ - if (!retval) - { - if (FLT_FLOAT==type) - { + if (!retval) { + if (FLT_FLOAT == type) { float x; HDmemcpy(&x, val, sizeof(float)); - HDsnprintf(s, sizeof(s), "%g", (double)x); + HDsnprintf(s, sizeof(s), "%g", (double) x); } - else if (FLT_DOUBLE==type) - { + else if (FLT_DOUBLE == type) { double x; HDmemcpy(&x, val, sizeof(double)); HDsnprintf(s, sizeof(s), "%g", x); } -#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 - else if (FLT_LDOUBLE==type) - { +#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE != 0 + else if (FLT_LDOUBLE == type) { long double x; HDmemcpy(&x, val, sizeof(long double)); HDsnprintf(s, sizeof(s), "%Lg", x); } #endif - else - { + else { return FALSE; } - if ( HDstrstr(s, "NaN") || + if (HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || HDstrstr(s, "nan") || - HDstrstr(s, "-1.#IND") /* WIN32 */ - ) - { + HDstrstr(s, "-1.#IND")) { retval = TRUE; } } @@ -5791,7 +4648,6 @@ my_isnan(dtype_t type, void *val) return retval; } - /*------------------------------------------------------------------------- * * Local functions @@ -5806,9 +4662,8 @@ my_isnan(dtype_t type, void *val) *------------------------------------------------------------------------- */ static -int print_data(diff_opt_t *options) -{ - return ( (options->m_report || options->m_verbose) && !options->m_quiet)?1:0; +int print_data(diff_opt_t *options) { + return ((options->m_report || options->m_verbose) && !options->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- @@ -5818,37 +4673,28 @@ int print_data(diff_opt_t *options) * *------------------------------------------------------------------------- */ - static -void print_header(int pp, /* print percentage */ - int rank, - hsize_t *dims, - const char *obj1, - const char *obj2 ) -{ +void print_header(int pp, /* print percentage */ + int rank, hsize_t *dims, const char *obj1, const char *obj2) { /* print header */ - parallel_print("%-16s","size:"); - print_dimensions (rank,dims); - parallel_print("%-11s",""); - print_dimensions (rank,dims); + parallel_print("%-16s", "size:"); + print_dimensions(rank, dims); + parallel_print("%-11s", ""); + print_dimensions(rank, dims); parallel_print("\n"); - if(pp) { - parallel_print("%-15s %-15s %-15s %-15s %-15s\n", - "position", - (obj1!=NULL) ? obj1 : " ", - (obj2!=NULL) ? obj2 : " ", - "difference", - "relative"); - parallel_print("------------------------------------------------------------------------\n"); + if (pp) { + parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", + (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", + "relative"); + parallel_print( + "------------------------------------------------------------------------\n"); } else { - parallel_print("%-15s %-15s %-15s %-20s\n", - "position", - (obj1!=NULL) ? obj1 : " ", - (obj2!=NULL) ? obj2 : " ", - "difference"); - parallel_print("------------------------------------------------------------\n"); + parallel_print("%-15s %-15s %-15s %-20s\n", "position", + (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference"); + parallel_print( + "------------------------------------------------------------\n"); } } @@ -5859,47 +4705,35 @@ void print_header(int pp, /* print percentage */ * *------------------------------------------------------------------------- */ - static -void print_pos( int *ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, - hsize_t *acc, - hsize_t *pos, - int rank, - hsize_t *dims, - const char *obj1, - const char *obj2 ) -{ +void print_pos(int *ph, /* print header */ + int pp, /* print percentage */ + hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, + const char *obj1, const char *obj2) { int i; /* print header */ - if ( *ph==1 ) - { - *ph=0; + if (*ph == 1) { + *ph = 0; print_header(pp, rank, dims, obj1, obj2); } /* end print header */ - for ( i = 0; i < rank; i++) - { - pos[i] = curr_pos/acc[i]; - curr_pos -= acc[i]*pos[i]; + for (i = 0; i < rank; i++) { + pos[i] = curr_pos / acc[i]; + curr_pos -= acc[i] * pos[i]; } - HDassert( curr_pos == 0 ); + HDassert(curr_pos == 0); - if ( rank > 0 ) - { - parallel_print("[ " ); - for ( i = 0; i < rank; i++) - { + if (rank > 0) { + parallel_print("[ "); + for (i = 0; i < rank; i++) { parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); parallel_print(" "); } - parallel_print("]" ); + parallel_print("]"); } - else - { + else { parallel_print(" "); } } @@ -5911,52 +4745,45 @@ void print_pos( int *ph, /* print header */ * *------------------------------------------------------------------------- */ - static -void print_char_pos( int *ph, /* print header */ - int pp, /* print percentage */ - hsize_t curr_pos, - unsigned u, - hsize_t *acc, - hsize_t *pos, - int rank, - hsize_t *dims, - const char *obj1, - const char *obj2 ) -{ +void print_char_pos( + int *ph, /* print header */ + int pp, /* print percentage */ + hsize_t curr_pos, + unsigned u, + hsize_t *acc, + hsize_t *pos, + int rank, + hsize_t *dims, + const char *obj1, + const char *obj2) { int i; /* print header */ - if ( *ph==1 ) - { - *ph=0; + if (*ph == 1) { + *ph = 0; print_header(pp, rank, dims, obj1, obj2); } /* end print header */ - for ( i = 0; i < rank; i++) - { - pos[i] = curr_pos/acc[i]; - curr_pos -= acc[i]*pos[i]; + for (i = 0; i < rank; i++) { + pos[i] = curr_pos / acc[i]; + curr_pos -= acc[i] * pos[i]; } - HDassert( curr_pos == 0 ); - - parallel_print("[ " ); - if ( rank > 0 ) - { + HDassert(curr_pos == 0); - for ( i = 0; i < rank; i++) - { + parallel_print("[ "); + if (rank > 0) { + for (i = 0; i < rank; i++) { parallel_print(HSIZE_T_FORMAT, (unsigned long long)pos[i]); parallel_print(" "); } } - else - { - parallel_print("%u", (unsigned)u); + else { + parallel_print("%zu", u); } - parallel_print("]" ); + parallel_print("]"); } /*------------------------------------------------------------------------- @@ -5966,16 +4793,13 @@ void print_char_pos( int *ph, /* print header */ * *------------------------------------------------------------------------- */ -static void h5diff_print_char(char ch) -{ - - switch (ch) - { +static void h5diff_print_char(char ch) { + switch (ch) { case '"': parallel_print("\\\""); break; case '\\': - parallel_print( "\\\\"); + parallel_print("\\\\"); break; case '\b': parallel_print("\\b"); @@ -5994,53 +4818,47 @@ static void h5diff_print_char(char ch) break; default: if (isprint(ch)) - parallel_print( "%c", ch); + parallel_print("%c", ch); else - parallel_print( "\\%03o", ch); - + parallel_print("\\%03o", ch); break; } } - /*------------------------------------------------------------------------- * XCAO, 11/10/2010 * added to improve performance for compound datasets * set up compound datatype structures. */ -static void get_member_types(hid_t tid, mcomp_t *members) -{ +static void get_member_types(hid_t tid, mcomp_t *members) { int tclass; unsigned u; - if (tid <=0 || !members) + if (tid <= 0 || !members) return; tclass = H5Tget_class(tid); - if (tclass == H5T_ARRAY || tclass == H5T_VLEN) - { + if (tclass == H5T_ARRAY || tclass == H5T_VLEN) { hid_t base_tid = H5Tget_super(tid); get_member_types(base_tid, members); H5Tclose(base_tid); } - else if (tclass == H5T_COMPOUND) - { - int nmembs; + else if (tclass == H5T_COMPOUND) { + int nmembs; nmembs = H5Tget_nmembers(tid); - if(nmembs <= 0) + if (nmembs <= 0) return; - members->n = (unsigned)nmembs; + members->n = (unsigned) nmembs; - members->ids = (hid_t *)HDcalloc((size_t)members->n, sizeof(hid_t)); - members->offsets = (size_t *)HDcalloc((size_t)members->n, sizeof(size_t)); - members->m = (mcomp_t **)HDcalloc((size_t)members->n, sizeof(mcomp_t *)); + members->ids = (hid_t *) HDcalloc((size_t )members->n, sizeof(hid_t)); + members->offsets = (size_t *) HDcalloc((size_t )members->n, sizeof(size_t)); + members->m = (mcomp_t **) HDcalloc((size_t )members->n, sizeof(mcomp_t *)); - for(u = 0; u < members->n; u++) - { - members->ids[u] = H5Tget_member_type( tid, u ); - members->offsets[u] = H5Tget_member_offset( tid, u ); - members->m[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); + for (u = 0; u < members->n; u++) { + members->ids[u] = H5Tget_member_type(tid, u); + members->offsets[u] = H5Tget_member_offset(tid, u); + members->m[u] = (mcomp_t *) HDmalloc(sizeof(mcomp_t)); HDmemset(members->m[u], 0, sizeof(mcomp_t)); get_member_types(members->ids[u], members->m[u]); } @@ -6048,7 +4866,6 @@ static void get_member_types(hid_t tid, mcomp_t *members) return; - } /*------------------------------------------------------------------------- @@ -6056,17 +4873,14 @@ static void get_member_types(hid_t tid, mcomp_t *members) * added to improve performance for compound datasets * clean and close compound members. */ -static void close_member_types(mcomp_t *members) -{ +static void close_member_types(mcomp_t *members) { unsigned u; - if (!members || members->n<=0 || !members->ids) + if (!members || members->n <= 0 || !members->ids) return; - for(u = 0; u < members->n; u++) - { - if(members->m[u]) - { + for (u = 0; u < members->n; u++) { + if (members->m[u]) { close_member_types(members->m[u]); HDfree(members->m[u]); } -- cgit v0.12 From 46d5032d84e3a88a86767d3533c62c2ec41b8e8a Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 10 Sep 2017 20:54:42 -0500 Subject: Snapshot version 1.8 release 20 (snap4) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index f585d8d..a70e26f 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap4 currently under development +HDF5 version 1.8.20-snap5 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 1174e9b..2305317 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap4, currently under development" +PROJECT_NUMBER = "1.8.20-snap5, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 846fed2..c16cb16 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap4") +set (CTEST_SOURCE_VERSEXT "-snap5") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index 7338294..01c5780 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap4], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap5], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 51169a6..5b21e77 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap4 currently under development +HDF5 version 1.8.20-snap5 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 90ffb73..8872de0 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap4" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap5" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap4" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap5" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From e12411c48048d8a802ee0adb6fd3a57692a10919 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Sep 2017 09:24:49 -0500 Subject: Test program generation should default off --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08a65c4..f50d951 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -486,6 +486,9 @@ if (MAKE_SYSTEM) set (CFG_INIT "") endif () +# Do not generate test programs by default +option (HDF5_BUILD_GENERATORS "Build Test Generators" OFF) + #----------------------------------------------------------------------------- # Add some definitions for Debug Builds #----------------------------------------------------------------------------- -- cgit v0.12 From 321268049c3a5d167f26f8b6a6222277c2aa78b3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Sep 2017 15:14:53 -0500 Subject: Remove cache sets for defaults, cleanup cmake files --- CMakeFilters.cmake | 17 +++++++---------- CMakeInstallation.cmake | 4 ++-- CMakeLists.txt | 2 +- UserMacros.cmake | 2 +- config/cmake/HDF5Macros.cmake | 2 +- config/cmake/HDFCompilerFlags.cmake | 2 +- config/cmake/cacheinit.cmake | 34 +++------------------------------- config/cmake/mccacheinit.cmake | 32 +++----------------------------- config/cmake/scripts/CTestScript.cmake | 2 +- release_docs/INSTALL_CMake.txt | 27 ++++++++------------------- 10 files changed, 28 insertions(+), 96 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 15144f9..804b16b 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -8,13 +8,13 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# include (ExternalProject) -#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT SVN TGZ)" "NO") -set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)") -set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) -if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +#option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO") +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)") +set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") @@ -22,9 +22,6 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT set (ZLIB_BRANCH ${ZLIB_GIT_BRANCH}) set (SZIP_URL ${SZIP_GIT_URL} CACHE STRING "Path to szip git repository") set (SZIP_BRANCH ${SZIP_GIT_BRANCH}) - elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - set (ZLIB_URL ${ZLIB_SVN_URL} CACHE STRING "Path to zlib Subversion repository") - set (SZIP_URL ${SZIP_SVN_URL} CACHE STRING "Path to szip Subversion repository") elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (NOT TGZPATH) set (TGZPATH ${HDF5_SOURCE_DIR}) @@ -61,7 +58,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) else () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) set (H5_HAVE_FILTER_DEFLATE 1) set (H5_HAVE_ZLIB_H 1) @@ -111,7 +108,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT) set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) else () - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) set (H5_HAVE_FILTER_SZIP 1) set (H5_HAVE_SZLIB_H 1) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index a16368f..96e4f0d 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# include (CMakePackageConfigHelpers) #----------------------------------------------------------------------------- @@ -460,7 +460,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") if (HDF5_PACKAGE_EXTLIBS) - if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) if (WIN32) set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;ALL;/") diff --git a/CMakeLists.txt b/CMakeLists.txt index f50d951..eeae1b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -651,7 +651,7 @@ endif () #----------------------------------------------------------------------------- add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) -if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) if (BUILD_SHARED_LIBS) diff --git a/UserMacros.cmake b/UserMacros.cmake index 615be3d..c578c91 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ######################################################## # Include file for user options ######################################################## diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index ba1fb40..f08349e 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #------------------------------------------------------------------------------- macro (H5_SET_LIB_OPTIONS libtarget libname libtype) set (LIB_OUT_NAME "${libname}") diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 4ea8702..5f71f33 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 98a2a23..d37c339 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -21,7 +21,7 @@ set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) -set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) +set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE) set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) @@ -29,42 +29,14 @@ set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) -set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - -set (ALLOW_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - -set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - -set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - -set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) -set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - -set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - -set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) - -set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) -set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - -set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - -set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) - set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) -set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - -set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - -set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) -set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) +set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index defb2ff..725777d 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # This is the CMakeCache file. ######################## @@ -33,46 +33,20 @@ set (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) set (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) -set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) - set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) -set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - -set (ALLOW_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - -set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - -set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - -set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) -set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - -set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - set (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE) -set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - -set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - -set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - -set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) - -set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - set (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE) -set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) -set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) +set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 3bfc8b4..3cb9a5e 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 2505578..58169fc 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -249,7 +249,7 @@ IV. Further considerations ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8."X" product requires a minimum CMake version 3.1.0. + web site. The HDF5 1.8."X" product requires a minimum CMake version 3.2.2. 2. If you plan to use Zlib or Szip: A. Download the binary packages and install them in a central location. @@ -261,7 +261,7 @@ IV. Further considerations -DSZIP_INCLUDE_DIR:PATH=some_location/include where "some_location" is the full path to the extlibs folder. - B. Use source packages from an SVN server by adding the following CMake + B. Use source packages from an GIT server by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT" ZLIB_GIT_URL:STRING="http://some_location/zlib" @@ -398,28 +398,14 @@ These five steps are described in detail below. set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) - set (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) set (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) set (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) set (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) - set (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - set (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - set (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - set (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - set (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) set (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) - set (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - set (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - set (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) - set (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - set (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - set (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - set (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + set (HDF5_ENABLE_ALL_WARNINGS ON CACHE BOOL "Enable all warnings" FORCE) set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" FORCE) - set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT SVN TGZ)" FORCE) - set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT SVN TGZ) + set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE) + set_property (CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) @@ -575,6 +561,7 @@ if (HDF5_BUILD_FORTRAN) HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON ---------------- HDF5 Advanced Options --------------------- +ALLOW_UNSUPPORTED "Allow unsupported combinations of configure options" OFF HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON HDF5_Enable_Instrument "Instrument The library" OFF @@ -587,6 +574,8 @@ HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF HDF5_ENABLE_TRACE "Enable API tracing capability" OFF HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF +HDF5_GENERATE_HEADERS "Rebuild Generated Files" OFF +HDF5_BUILD_GENERATORS "Build Test Generators" OFF HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF -- cgit v0.12 From f97cd0310642c36135be2ab4e99657cce5fb2ccd Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 17 Sep 2017 20:52:28 -0500 Subject: Snapshot version 1.8 release 20 (snap5) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index a70e26f..3cc088b 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap5 currently under development +HDF5 version 1.8.20-snap6 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 2305317..ade4ac1 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap5, currently under development" +PROJECT_NUMBER = "1.8.20-snap6, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index c16cb16..8999949 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap5") +set (CTEST_SOURCE_VERSEXT "-snap6") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index 01c5780..abfbb38 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap5], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap6], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f8136b9..93fac38 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap5 currently under development +HDF5 version 1.8.20-snap6 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 8872de0..05e5165 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap5" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap6" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap5" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap6" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From c3791263681e318f1115b860c2df20684129a710 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 19 Sep 2017 16:03:23 -0500 Subject: reconfigure needed after commit of test/Makefile.am on 8/22/2017. Snap version in configure file was incorrect due to merges. reconfigure changed comments in H5LTparse.c and .h. --- configure | 22 ++++---- hl/src/H5LTparse.c | 144 ++++++++++++++++++++++++++--------------------------- hl/src/H5LTparse.h | 4 +- test/Makefile.in | 52 +++++++++++-------- 4 files changed, 116 insertions(+), 106 deletions(-) diff --git a/configure b/configure index c30de32..1f6b4da 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap2. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap6. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-snap2' -PACKAGE_STRING='HDF5 1.8.20-snap2' +PACKAGE_VERSION='1.8.20-snap6' +PACKAGE_STRING='HDF5 1.8.20-snap6' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,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.8.20-snap2 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-snap6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-snap2:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-snap6:";; esac cat <<\_ACEOF @@ -1745,7 +1745,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-snap2 +HDF5 configure 1.8.20-snap6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2682,7 +2682,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.8.20-snap2, which was +It was created by HDF5 $as_me 1.8.20-snap6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3553,7 +3553,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-snap2' + VERSION='1.8.20-snap6' cat >>confdefs.h <<_ACEOF @@ -29313,7 +29313,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-snap2 +HDF5 config.lt 1.8.20-snap6 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31373,7 +31373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-snap2, which was +This file was extended by HDF5 $as_me 1.8.20-snap6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31439,7 +31439,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-snap2 +HDF5 config.status 1.8.20-snap6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 2a0f267..16a0bcf 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 2af0172..7481a45 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/test/Makefile.in b/test/Makefile.in index d2de02d..a064197 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -189,7 +189,7 @@ am__EXEEXT_3 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_new_super$(EXEEXT) gen_noencoder$(EXEEXT) \ gen_nullspace$(EXEEXT) gen_udlinks$(EXEEXT) \ space_overflow$(EXEEXT) gen_sizes_lheap$(EXEEXT) \ - gen_file_image$(EXEEXT) + gen_file_image$(EXEEXT) gen_bad_offset$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) accum_SOURCES = accum.c accum_OBJECTS = accum.$(OBJEXT) @@ -299,6 +299,10 @@ freespace_SOURCES = freespace.c freespace_OBJECTS = freespace.$(OBJEXT) freespace_LDADD = $(LDADD) freespace_DEPENDENCIES = libh5test.la $(LIBHDF5) +gen_bad_offset_SOURCES = gen_bad_offset.c +gen_bad_offset_OBJECTS = gen_bad_offset.$(OBJEXT) +gen_bad_offset_LDADD = $(LDADD) +gen_bad_offset_DEPENDENCIES = libh5test.la $(LIBHDF5) gen_bad_ohdr_SOURCES = gen_bad_ohdr.c gen_bad_ohdr_OBJECTS = gen_bad_ohdr.$(OBJEXT) gen_bad_ohdr_LDADD = $(LDADD) @@ -518,16 +522,16 @@ SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ dsets.c dt_arith.c dtransform.c dtypes.c efc.c enum.c \ err_compat.c error_test.c extend.c external.c fheap.c \ file_image.c fillval.c filter_fail.c flush1.c flush2.c \ - freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ - gen_deflate.c gen_file_image.c gen_filters.c gen_idx.c \ - gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ - gen_new_super.c gen_noencoder.c gen_nullspace.c \ - gen_sizes_lheap.c gen_udlinks.c getname.c gheap.c hyperslab.c \ - istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ - ntypes.c objcopy.c ohdr.c plugin.c pool.c reserved.c \ - set_extent.c space_overflow.c stab.c tcheck_version.c \ - $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \ - unregister.c vfd.c + freespace.c gen_bad_offset.c gen_bad_ohdr.c gen_bogus.c \ + gen_cross.c gen_deflate.c gen_file_image.c gen_filters.c \ + gen_idx.c gen_new_array.c gen_new_fill.c gen_new_group.c \ + gen_new_mtime.c gen_new_super.c gen_noencoder.c \ + gen_nullspace.c gen_sizes_lheap.c gen_udlinks.c getname.c \ + gheap.c hyperslab.c istore.c lheap.c links.c links_env.c mf.c \ + mount.c mtime.c ntypes.c objcopy.c ohdr.c plugin.c pool.c \ + reserved.c set_extent.c space_overflow.c stab.c \ + tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ + $(ttsafe_SOURCES) unlink.c unregister.c vfd.c DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ $(am__libdynlib2_la_SOURCES_DIST) \ $(am__libdynlib3_la_SOURCES_DIST) \ @@ -537,15 +541,16 @@ DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ dt_arith.c dtransform.c dtypes.c efc.c enum.c err_compat.c \ error_test.c extend.c external.c fheap.c file_image.c \ fillval.c filter_fail.c flush1.c flush2.c freespace.c \ - gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \ - gen_file_image.c gen_filters.c gen_idx.c gen_new_array.c \ - gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \ - gen_noencoder.c gen_nullspace.c gen_sizes_lheap.c \ - gen_udlinks.c getname.c gheap.c hyperslab.c istore.c lheap.c \ - links.c links_env.c mf.c mount.c mtime.c ntypes.c objcopy.c \ - ohdr.c plugin.c pool.c reserved.c set_extent.c \ - space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ - testmeta.c $(ttsafe_SOURCES) unlink.c unregister.c vfd.c + gen_bad_offset.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ + gen_deflate.c gen_file_image.c gen_filters.c gen_idx.c \ + gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ + gen_new_super.c gen_noencoder.c gen_nullspace.c \ + gen_sizes_lheap.c gen_udlinks.c getname.c gheap.c hyperslab.c \ + istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ + ntypes.c objcopy.c ohdr.c plugin.c pool.c reserved.c \ + set_extent.c space_overflow.c stab.c tcheck_version.c \ + $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \ + unregister.c vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -1116,7 +1121,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api \ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_idx \ gen_new_array gen_new_fill gen_new_group gen_new_mtime gen_new_super \ gen_noencoder gen_nullspace gen_udlinks space_overflow gen_sizes_lheap \ - gen_file_image + gen_file_image gen_bad_offset @HAVE_SHARED_CONDITIONAL_FALSE@@NOT_UNAME_CYGWIN_TRUE@noinst_LTLIBRARIES = libh5test.la @HAVE_SHARED_CONDITIONAL_TRUE@@NOT_UNAME_CYGWIN_TRUE@noinst_LTLIBRARIES = libh5test.la libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la @@ -1380,6 +1385,10 @@ freespace$(EXEEXT): $(freespace_OBJECTS) $(freespace_DEPENDENCIES) $(EXTRA_frees @rm -f freespace$(EXEEXT) $(AM_V_CCLD)$(LINK) $(freespace_OBJECTS) $(freespace_LDADD) $(LIBS) +gen_bad_offset$(EXEEXT): $(gen_bad_offset_OBJECTS) $(gen_bad_offset_DEPENDENCIES) $(EXTRA_gen_bad_offset_DEPENDENCIES) + @rm -f gen_bad_offset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gen_bad_offset_OBJECTS) $(gen_bad_offset_LDADD) $(LIBS) + gen_bad_ohdr$(EXEEXT): $(gen_bad_ohdr_OBJECTS) $(gen_bad_ohdr_DEPENDENCIES) $(EXTRA_gen_bad_ohdr_DEPENDENCIES) @rm -f gen_bad_ohdr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen_bad_ohdr_OBJECTS) $(gen_bad_ohdr_LDADD) $(LIBS) @@ -1586,6 +1595,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freespace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bad_offset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bad_ohdr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bogus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_cross.Po@am__quote@ -- cgit v0.12 From 5938c06235616127a111043c5b49e6076144dfc2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 4 Oct 2017 09:00:09 -0500 Subject: Fix VS2012 declare error --- tools/lib/h5diff_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 29d1746..1d53ec7 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -637,8 +637,8 @@ static hsize_t diff_datum( * compared, we convert both bit patterns to their corresponding * enumeration constant and do a string comparison */ + h5difftrace("diff_datum H5T_ENUM\n"); { - h5difftrace("diff_datum H5T_ENUM\n"); char enum_name1[1024]; char enum_name2[1024]; herr_t err1; -- cgit v0.12 From e0140506abdcf9fb643f2d0a3b25f74b3e3d36e0 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 4 Oct 2017 14:09:10 -0500 Subject: Miscellaneous code cleanup Description: - Added a single page html file, C2Cppfunction_map.mht, that shows the current mapping of C APIs to C++ member functions. This page can be reached from the main page of the C++ reference manual. - Updated doxygen config file: C2Cppfunction_map.mht to HTML_EXTRA_FILES. - Miscellaneous improvements in comments, including updating URLs. - Removed deprecated H5Location and H5Object constructors that take an existing ID. --- c++/src/C2Cppfunction_map.mht | 35293 ++++++++++++++++++++++++++++++++++++++++ c++/src/H5AtomType.cpp | 6 +- c++/src/H5CommonFG.cpp | 12 +- c++/src/H5CppDoc.h | 29 +- c++/src/H5DataSet.cpp | 2 +- c++/src/H5DataSpace.cpp | 8 +- c++/src/H5DataType.cpp | 2 +- c++/src/H5DcreatProp.cpp | 10 +- c++/src/H5DxferProp.cpp | 4 +- c++/src/H5FaccProp.cpp | 24 +- c++/src/H5FcreatProp.cpp | 10 +- c++/src/H5File.cpp | 2 +- c++/src/H5Library.cpp | 4 +- c++/src/H5Location.cpp | 4 +- c++/src/H5OcreatProp.cpp | 8 +- c++/src/H5StrType.cpp | 2 +- c++/src/cpp_doc_config | 3 +- 17 files changed, 35360 insertions(+), 63 deletions(-) create mode 100644 c++/src/C2Cppfunction_map.mht diff --git a/c++/src/C2Cppfunction_map.mht b/c++/src/C2Cppfunction_map.mht new file mode 100644 index 0000000..d87fbd6 --- /dev/null +++ b/c++/src/C2Cppfunction_map.mht @@ -0,0 +1,35293 @@ +MIME-Version: 1.0 +Content-Type: multipart/related; boundary="----=_NextPart_01D32FBF.F2FA1110" + +This document is a Single File Web Page, also known as a Web Archive file. If you are seeing this message, your browser or editor doesn't support Web Archive files. Please download a browser that supports Web Archive, such as Windows® Internet Explorer®. + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map.htm +Content-Transfer-Encoding: quoted-printable +Content-Type: text/html; charset="windows-1252" + + + + + + + + + + + + + + + + + + + +
+ +

C++ API Wrappers of HDF5 C Functi= +ons

+ +

 

+ +

Shaded rows are in 1.10 versions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

C Function

+
+

C++ + Wrapper

+
+

1.8

+
+

1.10

+
+

Comment

+
+

H5Acreate2

+
+

Attribute H5Location::createAttribute( const char* name, const + DataType& data_type, const DataSpace& data_space, const PropList&= +amp; + create_plist =3D PropList::DEFAULT)

+
+

x

+
+

 

+
+

Old model kept for backward compatibility

+
+

Attribute H5Location::createAttribute( const H5std_string& na= +me, + const DataType& data_type, const DataSpace& data_space, const + PropList& create_plist =3D PropList::DEFAULT)

+
+

x

+
+

 

+
+

Old model kept for backward compatibility

+
+

Attribute H5Object::createAttribute( const char* name, const + DataType& data_type, const DataSpace& data_space, const PropList&= +amp; + create_plist =3D PropList::DEFAULT)

+
+

 

+
+

x

+
+

Revised model

+
+

Attribute H5Object::createAttribute( const H5std_string& name, + const DataType& data_type, const DataSpace& data_space, const + PropList& create_plist =3D PropList::DEFAULT)

+
+

 

+
+

x

+
+

Revised model

+
+

H5Acreate_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aopen

+
+

Attribute H5Location::openAttribute( const char* name )

+
+

x

+
+

 

+
+

 

+
+

Attribute H5Location::openAttribute( const H5std_string& name= + )

+
+

x

+
+

 

+
+

 

+
+

Attribute H5Object::openAttribute( const char* name )

+
+

 

+
+

x

+
+

 

+
+

Attribute H5Object::openAttribute( const H5std_string& name )= +

+
+

 

+
+

x

+
+

 

+
+

H5Aopen_by_idx

+

H5Aopen_by_idx

+
+

Attribute H5Location::openAttribute( const unsigned int idx )

+
+

x

+
+

 

+
+

 

+
+

Attribute H5Object::openAttribute( const unsigned int idx )

+
+

 

+
+

x

+
+

 

+
+

H5Aopen_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Awrite

+
+

void Attribute::write( const DataType& mem_type, const void *= +buf + )

+
+

 

+
+

 

+
+

 

+
+

void Attribute::write(const DataType& mem_type, const + H5std_string& strg) const

+
+

 

+
+

 

+
+

 

+
+

H5Aread

+
+

void Attribute::read( const DataType& mem_type, void *buf ) +

+

 

+
+

 

+
+

 

+
+

void Attribute::read(const DataType& mem_type, H5std_string&a= +mp; + strg)

+
+

 

+
+

 

+
+

 

+
+

H5Aclose

+
+

void Attribute::close()

+
+

 

+
+

 

+
+

 

+
+

Attribute::~Attribute()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_space

+
+

DataSpace Attribute::getSpace()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_type

+
+

DataType AbstractDs::getDataType()

+
+

 

+
+

 

+
+

 

+
+

ArrayType AbstractDs::getArrayType()

+
+

 

+
+

 

+
+

 

+
+

CompType AbstractDs::getCompType()

+
+

 

+
+

 

+
+

 

+
+

EnumType AbstractDs::getEnumType()

+
+

 

+
+

 

+
+

 

+
+

IntType AbstractDs::getIntType()

+
+

 

+
+

 

+
+

 

+
+

FloatType AbstractDs::getFloatType()

+
+

 

+
+

 

+
+

 

+
+

StrType AbstractDs::getStrType()

+
+

 

+
+

 

+
+

 

+
+

VarLenType AbstractDs::getVarLenType()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_create_plist

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_name

+
+

ssize_t Attribute::getName(char* attr_name, size_t buf_size)

+
+

 

+
+

 

+
+

 

+
+

H5std_string Attribute::getName()

+
+

 

+
+

 

+
+

 

+
+

H5std_string Attribute::getName(size_t len) const

+
+

 

+
+

 

+
+

 

+
+

ssize_t Attribute::getName(H5std_string& attr_name, size_t le= +n)

+
+

 

+
+

 

+
+

 

+
+

ssize_t Attribute::getName( size_t len, H5std_string& attr_na= +me )

+
+

 

+
+

 

+
+

 

+
+

H5Aget_name_by_idx

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_storage_size

+
+

hsize_t Attribute::getStorageSize()

+
+

 

+
+

 

+
+

 

+
+

H5Aget_info

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_info_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aget_info_by_idx

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Arename

+
+

void H5Location::renameAttr(const char* oldname, const char* newn= +ame)

+
+

x

+
+

 

+
+

 

+
+

void H5Object::renameAttr(const char* oldname, const char* newnam= +e)

+
+

 

+
+

x

+
+

 

+
+

H5Arename_by_name

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Aiterate2

+
+

int H5Location::iterateAttrs( attr_operator_t user_op, unsigned + *_idx, void *op_data )

+
+

x

+
+

 

+
+

 

+
+

int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_i= +dx, + void *op_data )

+
+

 

+
+

x

+
+

 

+
+

H5Aiterate_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Adelete

+
+

void H5Location::removeAttr( const char* name )

+
+

x

+
+

 

+
+

 

+
+

void H5Object::removeAttr( const char* name )

+
+

 

+
+

x

+
+

 

+
+

H5Adelete_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Adelete_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Aexists

+
+

bool H5Location::attrExists(const char* name)

+
+

x

+
+

 

+
+

 

+
+

bool H5Object::attrExists(const char* name)

+
+

 

+
+

x

+
+

 

+
+

H5Aexists_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Dcreate2

+
+

DataSet CommonFG::createDataSet( const char* name, const + DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

x

+
+

 

+
+

 

+
+

DataSet CommonFG::createDataSet( const H5std_string& name, co= +nst + DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

x

+
+

 

+
+

 

+
+

DataSet H5Location::createDataSet( const char* name, const + DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

 

+
+

x

+
+

 

+
+

DataSet H5Location::createDataSet( const H5std_string& name, + const DataType& data_type, const DataSpace& data_space, const + DSetCreatPropList& create_plist )

+
+

 

+
+

x

+
+

 

+
+

H5Dcreate_anon

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Dopen2

+
+

DataSet CommonFG::openDataSet( const char* name )

+
+

x

+
+

 

+
+

 

+
+

DataSet CommonFG::openDataSet( const H5std_string& name)

+
+

x

+
+

 

+
+

 

+
+

DataSet H5Location::openDataSet( const char* name )

+
+

 

+
+

x

+
+

 

+
+

DataSet H5Location::openDataSet( const H5std_string& name)

+
+

 

+
+

x

+
+

 

+
+

H5Dclose

+
+

void DataSet::close()

+
+

 

+
+

 

+
+

 

+
+

DataSet destructor

+
+

 

+
+

 

+
+

 

+
+

H5Dget_space

+
+

DataSpace DataSet::getSpace()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_space_status

+
+

void DataSet::getSpaceStatus(H5D_space_status_t& status)

+
+

 

+
+

 

+
+

 

+
+

H5Dget_type

+
+

DataType AbstractDs::getDataType()

+
+

 

+
+

 

+
+

 

+
+

ArrayType AbstractDs::getArrayType()

+
+

 

+
+

 

+
+

 

+
+

CompType AbstractDs::getCompType()

+
+

 

+
+

 

+
+

 

+
+

EnumType AbstractDs::getEnumType()

+
+

 

+
+

 

+
+

 

+
+

IntType AbstractDs::getIntType()

+
+

 

+
+

 

+
+

 

+
+

FloatType AbstractDs::getFloatType()

+
+

 

+
+

 

+
+

 

+
+

StrType AbstractDs::getStrType()

+
+

 

+
+

 

+
+

 

+
+

VarLenType AbstractDs::getVarLenType()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_create_plist

+
+

DSetCreatPropList DataSet::getCreatePlist()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_access_plist

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Dget_storage_size

+
+

hsize_t DataSet::getStorageSize()

+
+

 

+
+

 

+
+

 

+
+

H5Dget_offset

+
+

haddr_t DataSet::getOffset()

+
+

 

+
+

 

+
+

 

+
+

H5Dread

+
+

void DataSet::read( void* buf, const DataType& mem_type, const + DataSpace& mem_space, const DataSpace& file_space, const + DSetMemXferPropList& xfer_plist )

+
+

 

+
+

 

+
+

 

+
+

void DataSet::read(H5std_string& strg, const DataType& + mem_type, const DataSpace& mem_space, const DataSpace& file_space, + const DSetMemXferPropList& xfer_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Dwrite

+
+

void DataSet::write( const void* buf, const DataType& mem_typ= +e, + const DataSpace& mem_space, const DataSpace& file_space, const + DSetMemXferPropList& xfer_plist )

+
+

 

+
+

 

+
+

 

+
+

void DataSet::write( const H5std_string& strg, const + DataType& mem_type, const DataSpace& mem_space, const DataSpace&a= +mp; + file_space, const DSetMemXferPropList& xfer_plist )

+
+

 

+
+

 

+
+

 

+
+

H5Diterate

+
+

int DataSet::iterateElems( void* buf, const DataType& type, c= +onst + DataSpace& space, H5D_operator_t op, void* op_data )

+
+

 

+
+

 

+
+

 

+
+

H5Dvlen_reclaim

+
+

void DataSet::vlenReclaim(const DataType& type, const + DataSpace& space, const DSetMemXferPropList& xfer_plist, void* bu= +f )

+
+

 

+
+

 

+
+

Remove this one

+
+

void DataSet::vlenReclaim(void* buf, const DataType& type, co= +nst + DataSpace& space, const DSetMemXferPropList& xfer_plist)

+
+

 

+
+

 

+
+

Better prototype

+
+

H5Dvlen_get_buf_size

+
+

hsize_t DataSet::getVlenBufSize(const DataType& type, const + DataSpace& space)

+
+

 

+
+

 

+
+

 

+
+

H5Dfill

+
+

void DataSet::fillMemBuf(const void *fill, const DataType& + fill_type, void *buf, const DataType& buf_type, const DataSpace& + space)

+
+

 

+
+

 

+
+

 

+
+

void DataSet::fillMemBuf(void *buf, const DataType& buf_type, + const DataSpace& space

+
+

 

+
+

 

+
+

 

+
+

H5Dset_extent

+
+

void DataSet::extend( const hsize_t* size )

+
+

 

+
+

 

+
+

 

+
+

H5Dscatter

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Dgather

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Ddebug

+
+

no

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Eregister_class

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eunregister_class

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eclose_msg

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ecreate_msg

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ecreate_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eget_current_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eclose_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eget_class_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eset_current_stack

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Epush2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Epop

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Eprint2

+
+

void Exception::printErrorStack(FILE* stream, hid_t err_stack)

+
+

 

+
+

 

+
+

 

+
+

H5Ewalk2

+
+

void Exception::walkErrorStack( H5E_direction_t direction, + H5E_walk2_t func, void* client_data )

+
+

 

+
+

 

+
+

 

+
+

H5Eget_auto2

+
+

void Exception::getAutoPrint( H5E_auto2_t& func, void** + client_data )

+
+

 

+
+

 

+
+

 

+
+

H5Eset_auto2

+
+

void Exception::setAutoPrint( H5E_auto2_t& func, void* + client_data )

+
+

 

+
+

 

+
+

 

+
+

H5Eclear2

+
+

void Exception::clearErrorStack()

+
+

 

+
+

 

+
+

 

+
+

H5Eauto_is_v2

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Eget_msg

+
+

H5std_string Exception::getMajorString( hid_t err_major )

+
+

 

+
+

 

+
+

 

+
+

H5std_string Exception::getMinorString( hid_t err_minor )

+
+

 

+
+

 

+
+

 

+
+

H5Eget_num

+
+

no

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_core

+
+

void FileAccPropList::setCore (size_t increment, hbool_t + backing_store)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_core

+
+

void FileAccPropList::getCore (size_t& increment, hbool_t& + backing_store)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_direct

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_direct

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_family_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_family

+
+

void FileAccPropList::setFamily( hsize_t memb_size, const FileAcc= +PropList& + memb_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_family

+
+

void FileAccPropList::getFamily(hsize_t& memb_size, + FileAccPropList& memb_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_log

+
+

void FileAccPropList::setLog(const char *logfile, unsigned flags, + size_t buf_size)

+
+

 

+
+

 

+
+

 

+
+

H5FD_multi_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_multi

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fapl_multi

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_split

+
+

void FileAccPropList::setSplit(const FileAccPropList& meta_pl= +ist, + const FileAccPropList& raw_plist, const char* meta_ext, const char* + raw_ext )

+
+

 

+
+

 

+
+

 

+
+

void FileAccPropList::setSplit(FileAccPropList& meta_plist, + FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext= + )

+
+

 

+
+

 

+
+

 

+
+

void FileAccPropList::setSplit(const FileAccPropList& meta_pl= +ist, + const FileAccPropList& raw_plist, const H5std_string& meta_ext, c= +onst + H5std_string& raw_ext )

+
+

 

+
+

 

+
+

 

+
+

void FileAccPropList::setSplit(FileAccPropList& meta_plist, + FileAccPropList& raw_plist, const H5std_string& meta_ext, const + H5std_string& raw_ext )

+
+

 

+
+

 

+
+

 

+
+

H5FD_log_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_core_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_direct_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5FDregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDunregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDopen

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDclose

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDcmp

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDquery

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDalloc

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDfree

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDget_eoa

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDset_eoa

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDget_eof

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDget_vfd_handle

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDread

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDwrite

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDflush

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FDtruncate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5FD_sec2_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_sec2

+
+

void FileAccPropList::setSec2()

+
+

 

+
+

 

+
+

 

+
+

H5FD_stdio_init

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_stdio

+
+

void FileAccPropList::setStdio()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fapl_windows

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fis_hdf5

+
+

bool H5File::isHdf5(const char* name)

+
+

 

+
+

 

+
+

 

+
+

H5Fcreate

+
+

H5File::H5File( const char* name, unsigned int flags, const + FileCreatPropList& create_plist, const FileAccPropList& access_pl= +ist + )

+
+

 

+
+

 

+
+

 

+
+

H5File::H5File( const H5std_string& name, unsigned int flags, + const FileCreatPropList& create_plist, const FileAccPropList& + access_plist )

+
+

 

+
+

 

+
+

 

+
+

H5Fopen

+
+

H5File::H5File( const char* name, unsigned int flags, const + FileCreatPropList& create_plist, const FileAccPropList& access_pl= +ist + )

+
+

 

+
+

 

+
+

 

+
+

H5File::H5File( const H5std_string& name, unsigned int flags, + const FileCreatPropList& create_plist, const FileAccPropList& + access_plist )

+
+

 

+
+

 

+
+

 

+
+

void H5File::openFile(const char* name, unsigned int flags, const + FileAccPropList& access_plist)

+
+

 

+
+

 

+
+

 

+
+

H5Freopen

+
+

void H5File::reOpen()

+
+

 

+
+

 

+
+

 

+
+

H5Fflush

+
+

void H5Location::flush(H5F_scope_t scope)

+
+

 

+
+

 

+
+

 

+
+

void Attribute::flush(H5F_scope_t scope)

+
+

 

+
+

 

+
+

 

+
+

H5Fclose

+
+

void H5File::close()

+
+

 

+
+

 

+
+

 

+
+

H5File destructor

+
+

 

+
+

 

+
+

 

+
+

H5Fget_create_plist

+
+

FileCreatPropList H5File::getCreatePlist()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_access_plist

+
+

FileAccPropList H5File::getAccessPlist()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_intent

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_obj_count

+
+

ssize_t H5File::getObjCount(unsigned types)

+
+

 

+
+

 

+
+

 

+
+

ssize_t H5File::getObjCount()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_obj_ids

+
+

void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t + *oid_list)

+
+

 

+
+

 

+
+

 

+
+

H5Fget_vfd_handle

+
+

void H5File::getVFDHandle(const FileAccPropList& fapl, void + **file_handle)

+
+

 

+
+

 

+
+

 

+
+

void H5File::getVFDHandle(void **file_handle)

+
+

 

+
+

 

+
+

 

+
+

H5Fmount

+
+

void CommonFG::mount(const char* name, const H5File& child, c= +onst + PropList& plist )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::mount(const char* name, H5File& child, + PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::mount(const H5std_string& name, const H5File&a= +mp; + child, const PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::mount(const H5std_string& name, H5File& ch= +ild, + PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

H5Funmount

+
+

void CommonFG::unmount( const char* name )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::unmount( const H5std_string& name )

+
+

 

+
+

 

+
+

 

+
+

H5Fget_freespace

+
+

hssize_t H5File::getFreeSpace()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_filesize

+
+

hsize_t H5File::getFileSize()

+
+

 

+
+

 

+
+

 

+
+

H5Fget_file_image

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fset_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_mdc_hit_rate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_mdc_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Freset_mdc_hit_rate_stats

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_name

+
+

H5std_string H5Location::getFileName()

+
+

 

+
+

 

+
+

 

+
+

H5std_string Attribute::getFileName()

+
+

 

+
+

 

+
+

Will be retired

+
+

H5Fget_info2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fget_free_sections

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Fclear_elink_file_cache

+
+

no

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Gcreate2

+
+

Group CommonFG::createGroup( const char* name, size_t size_hint )= +

+
+

x

+
+

 

+
+

 

+
+

Group CommonFG::createGroup( const H5std_string& name, size_t + size_hint )

+
+

x

+
+

 

+
+

 

+
+

 

+
+

Group H5Location::createGroup( const char* name, size_t size_hint= + )

+
+

 

+
+

x

+
+

 

+
+

Group H5Location::createGroup( const H5std_string& name, size= +_t + size_hint )

+
+

 

+
+

x

+
+

 

+
+

H5Gcreate_anon

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gopen2

+
+

Group CommonFG::openGroup( const char* name )

+
+

x

+
+

 

+
+

 

+
+

Group CommonFG::openGroup( const H5std_string& name )

+
+

x

+
+

 

+
+

 

+
+

Group H5Location::openGroup( const char* name )

+
+

 

+
+

x

+
+

 

+
+

Group H5Location::openGroup( const H5std_string& name )

+
+

 

+
+

x

+
+

 

+
+

H5Gget_create_plist

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_info

+
+

hsize_t CommonFG::getNumObjs()

+
+

x

+
+

 

+
+

 

+
+

hsize_t H5Location::getNumObjs()

+
+

 

+
+

x

+
+

Moved to Group in 1.10.2

+
+

hsize_t Group::getNumObjs()

+
+

 

+
+

x

+
+

 

+
+

H5Gget_info_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_info_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gclose

+
+

void Group::close()

+
+

 

+
+

 

+
+

 

+
+

Group destructor

+
+

 

+
+

 

+
+

 

+
+

H5Glink

+
+

Deprecated

+
+

 

+
+

 

+
+

 

+
+

H5Glink2

+
+

Deprecated

+
+

 

+
+

 

+
+

 

+
+

H5Gmove

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gmove2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gunlink

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_hard

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_soft

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_linkval

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gset_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gget_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Giterate

+
+

int CommonFG::iterateElems( const char* name, int *idx, H5G_itera= +te_t + op , void* op_data )

+
+

 

+
+

 

+
+

 

+
+

int CommonFG::iterateElems( const H5std_string& name, int *id= +x, + H5G_iterate_t op , void* op_data )

+
+

 

+
+

 

+
+

 

+
+

H5Gget_num_objs

+
+

no

+
+

 

+
+

 

+
+

 

+
+

H5Gg= +et_objinfo

+
+

void CommonFG::getObjinfo( const char* name, hbool_t follow_link, + H5G_stat_t& statbuf )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::getObjinfo( const H5std_string& name, hbool_t + follow_link, H5G_stat_t& statbuf )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::getObjinfo( const char* name, H5G_stat_t& stat= +buf + )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::getObjinfo( const H5std_string& name, + H5G_stat_t& statbuf )

+
+

 

+
+

 

+
+

 

+
+

H5Gget_objname_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Gg= +et_objtype_by_idx

+
+

H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx)

+
+

 

+
+

 

+
+

 

+
+

H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, char* type_name)= +

+
+

 

+
+

 

+
+

 

+
+

H5G_obj_t CommonFG::getObjTypeByIdx(hsize_t idx, H5std_string& + type_name)

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Iregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iobject_verify

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iremove_verify

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iget_type

+
+

H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

H5Iget_file_id

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iget_name

+
+

ssize_t H5Object::getObjName(char *obj_name, size_t buf_size)

+
+

 

+
+

 

+
+

 

+
+

H5std_string H5Object::getObjName()

+
+

 

+
+

 

+
+

 

+
+

ssize_t H5Object::getObjName(H5std_string& obj_name, size_t l= +en)

+
+

 

+
+

 

+
+

 

+
+

H5Iinc_ref

+
+

void IdComponent::incRefCount(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

void IdComponent::incRefCount()

+
+

 

+
+

 

+
+

 

+
+

H5Idec_ref

+
+

void IdComponent::decRefCount(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

void IdComponent::decRefCount()

+
+

 

+
+

 

+
+

 

+
+

H5Iget_ref

+
+

int IdComponent::getCounter(const hid_t obj_id)

+
+

 

+
+

 

+
+

 

+
+

int IdComponent::getCounter()

+
+

 

+
+

 

+
+

 

+
+

H5Iregister_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iclear_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Idestroy_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iinc_type_ref

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Idec_type_ref

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iget_type_ref

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Isearch

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Inmembers

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Itype_exists

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Iis_valid

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Lmove

+
+

void CommonFG::move( const char* src, const char* dst )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::move( const H5std_string& src, const + H5std_string& dst )

+
+

 

+
+

 

+
+

 

+
+

H5Lcopy

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_hard

+

H5Lcreate_soft

+
+

void CommonFG::link( H5L_type_t link_type, const char* curr_name, + const char* new_name )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::link( H5L_type_t link_type, const H5std_string& + curr_name, const H5std_string& new_name )

+
+

 

+
+

 

+
+

 

+
+

H5Ldelete

+
+

void CommonFG::unlink( const char* name )

+
+

 

+
+

 

+
+

 

+
+

void CommonFG::unlink( const H5std_string& name )

+
+

 

+
+

 

+
+

 

+
+

H5Ldelete_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lget_val

+
+

H5std_string CommonFG::getLinkval( const char* name, size_t size = +)

+
+

x

+
+

 

+
+

 

+
+

H5std_string CommonFG::getLinkval( const H5std_string& name, + size_t size )

+
+

x

+
+

 

+
+

 

+
+

H5std_string H5Location::getLinkval( const char* name, size_t siz= +e )

+
+

 

+
+

x

+
+

 

+
+

H5std_string H5Location::getLinkval( const H5std_string& name, + size_t size )

+
+

 

+
+

x

+
+

 

+
+

H5Lget_val_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lexists

+
+

bool H5Location::nameExists(const char* name, const + LinkAccPropList& lapl)

+
+

 

+
+

 

+
+

 

+
+

bool H5Location::nameExists(const H5std_string& name, const + LinkAccPropList& lapl)

+
+

 

+
+

 

+
+

 

+
+

H5Lget_info

+
+

Only used in getLinkval; need to replace H5Gget_objinfo occurrenc= +es

+
+

 

+
+

 

+
+

 

+
+

H5Lget_info_by_idx

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Lget_name_by_idx

+
+

H5std_string CommonFG::getObjnameByIdx(hsize_t idx)

+
+

x

+
+

 

+
+

 

+
+

ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t + size)

+
+

x

+
+

 

+
+

 

+
+

ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& + name, size_t size)

+
+

x

+
+

 

+
+

 

+
+

H5std_string H5Location::getObjnameByIdx(hsize_t idx)

+
+

 

+
+

x

+
+

 

+
+

ssize_t H5Location::getObjnameByIdx(hsize_t idx, char* name, size= +_t + size)

+
+

 

+
+

x

+
+

 

+
+

ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& + name, size_t size)

+
+

 

+
+

x

+
+

 

+
+

H5Literate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Literate_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lvisit

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lvisit_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_ud

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lunregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lis_registered

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lunpack_elink_val

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Lcreate_external

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Oopen

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oopen_by_addr

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oopen_by_idx

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oexists_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_info_by_name

+
+

H5O_type_t CommonFG::childObjType(const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t CommonFG::childObjType(const H5std_string& objname= +)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t H5Location::childObjType(const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t H5Location::childObjType(const H5std_string& objna= +me)

+
+

 

+
+

 

+
+

 

+
+

H5Oget_info_by_idx

+
+

H5O_type_t CommonFG::childObjType(hsize_t index, H5_index_t + index_type, H5_iter_order_t order, const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t + index_type, H5_iter_order_t order, const char* objname)

+
+

 

+
+

 

+
+

 

+
+

H5Olink

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oincr_refcount

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Odecr_refcount

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ocopy

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oset_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oset_comment_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_comment

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oget_comment_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ovisit

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Ovisit_by_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Oclose

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5PLset_loading_state

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5PLget_loading_state

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pcreate_class

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_class_name

+
+

H5std_string PropList::getClassName()

+
+

 

+
+

 

+
+

 

+
+

H5Pcreate

+
+

PropList::PropList(const hid_t plist_id)

+
+

 

+
+

 

+
+

 

+
+

H5Pregister2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pinsert2

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset

+
+

void PropList::setProperty(const char* name, void* value)

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const char* name, const char* charptr)= +

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const char* name, H5std_string& st= +rg)

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const H5std_string& name, void* va= +lue)

+
+

 

+
+

 

+
+

 

+
+

void PropList::setProperty(const H5std_string& name, + H5std_string& strg)

+
+

 

+
+

 

+
+

 

+
+

H5Pexist

+
+

bool PropList::propExist(const char* name )

+
+

 

+
+

 

+
+

 

+
+

bool PropList::propExist(const H5std_string& name )

+
+

 

+
+

 

+
+

 

+
+

H5Pencode

+
+

void DataType::encode()

+
+

 

+
+

 

+
+

 

+
+

H5Pdecode

+
+

virtual DataType* DataType::decode()

+

virtual DataType* ArrayType::decode()

+

virtual DataType* CompType::decode()

+

virtual DataType* DataType::decode()

+

virtual DataType* EnumType::decode()

+

virtual DataType* FloatType::decode()

+

virtual DataType* IntType::decode()

+

virtual DataType* StrType::decode()

+

virtual DataType* VarLenType::decode()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_size

+
+

size_t PropList::getPropSize(const char *name)

+
+

 

+
+

 

+
+

 

+
+

size_t PropList::getPropSize(const H5std_string& name)

+
+

H5Pget_nprops

+
+

size_t PropList::getNumProps()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_class

+
+

hid_t PropList::getClass()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_class_parent

+
+

PropList PropList::getClassParent()

+
+

 

+
+

 

+
+

 

+
+

H5Pget

+
+

void PropList::getProperty(const char* name, void* value)

+
+

 

+
+

 

+
+

 

+
+

H5std_string PropList::getProperty(const char* name)

+
+

void PropList::getProperty(const H5std_string& name, void* va= +lue)

+
+

H5std_string PropList::getProperty(const H5std_string& name)<= +/p> +

+

H5Pequal

+
+

bool PropList::operator=3D=3D(const PropList& rhs)

+
+

 

+
+

 

+
+

 

+
+

H5Pisa_class

+
+

bool PropList::isAClass(const PropList& prop_class)

+
+

 

+
+

 

+
+

 

+
+

H5Piterate

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pcopy_prop

+
+

void PropList::copyProp(PropList& dest, const char *name)

+
+

 

+
+

 

+
+

 

+
+

void PropList::copyProp( PropList& dest, const H5std_string&a= +mp; + name )

+
+

void PropList::copyProp( PropList& dest, PropList& src, c= +onst + char *name )

+
+

void PropList::copyProp( PropList& dest, PropList& src, c= +onst + H5std_string& name )

+
+

H5Premove

+
+

void PropList::removeProp(const char *name)

+
+

 

+
+

 

+
+

 

+
+

void PropList::removeProp(const H5std_string& name)

+
+

H5Punregister

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pclose_class

+
+

void PropList::closeClass()

+
+

 

+
+

 

+
+

 

+
+

H5Pclose

+
+

void PropList::close()

+
+

 

+
+

 

+
+

 

+
+

PropList destructor

+
+

 

+
+

 

+
+

 

+
+

H5Pcopy

+
+

void PropList::copy( const PropList& like_plist )

+
+

 

+
+

 

+
+

 

+
+

H5Pset_attr_phase_change

+
+

void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact = +=3D 8, + unsigned min_dense =3D 6)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_attr_phase_change

+
+

void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compa= +ct, + unsigned& min_dense)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_attr_creation_order

+
+

void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Pget_attr_creation_order

+
+

unsigned ObjCreatPropList::getAttrCrtOrder()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_obj_track_times

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_obj_track_times

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pmodify_filter

+
+

void modifyFilter(H5Z_filter_t filter_id, unsigned int flags, siz= +e_t + cd_nelmts, const unsigned int cd_values[])

+
+

 

+
+

 

+
+

 

+
+

H5Pset_filter

+
+

void DSetCreatPropList::setFilter(H5Z_filter_t filter_id, unsigned + int flags,

+

        size_t cd_nelmts,= + const + unsigned int cd_values[])

+
+

 

+
+

 

+
+

 

+
+

H5Pget_nfilters

+
+

int DSetCreatPropList::getNfilters()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_filter2

+
+

H5Z_filter_t DSetCreatPropList::getFilter(int filter_number,

+

        unsigned int + &flags, size_t &cd_nelmts, unsigned int* cd_values,

+

        size_t namelen, c= +har + name[], unsigned int& filter_config)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_filter_by_id2

+
+

void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id,

+

        unsigned int + &flags, size_t &cd_nelmts, unsigned int* cd_values,

+

        size_t namelen, c= +har + name[], unsigned int &filter_config)

+
+

 

+
+

 

+
+

 

+
+

H5Pall_filters_avail

+
+

bool DSetCreatPropList::allFiltersAvail()

+
+

 

+
+

 

+
+

 

+
+

H5Premove_filter

+
+

void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_deflate

+
+

void DSetCreatPropList::setDeflate(int level)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fletcher32

+
+

void DSetCreatPropList::setFletcher32()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_userblock

+
+

void FileCreatPropList::setUserblock(hsize_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_userblock

+
+

hsize_t FileCreatPropList::getUserblock()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_sizes

+
+

void FileCreatPropList::setSizes(size_t sizeof_addr, size_t + sizeof_size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_sizes

+
+

void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t&= +amp; + sizeof_size)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_sym_k

+
+

void FileCreatPropList::setSymk(unsigned ik, unsigned lk)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_sym_k

+
+

void FileCreatPropList::getSymk(unsigned& ik, unsigned& l= +k)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_istore_k

+
+

void FileCreatPropList::setIstorek(unsigned ik)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_istore_k

+
+

unsigned FileCreatPropList::getIstorek()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shared_mesg_nindexes

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_shared_mesg_nindexes

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shared_mesg_index

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_shared_mesg_index

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shared_mesg_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_shared_mesg_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_file_space

+
+

void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t + strategy, hbool_t persist, hsize_t threshold)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_file_space

+
+

void + FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t& strate= +gy, + hbool_t& persist, hsize_t& threshold)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_alignment

+
+

void FileAccPropList::setAlignment(hsize_t threshold, hsize_t + alignment)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_alignment

+
+

void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t + &alignment)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_driver

+
+

void FileAccPropList::setDriver(hid_t new_driver_id, const void + *new_driver_info)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_driver

+
+

hid_t FileAccPropList::getDriver()

+
+

 

+
+

 

+
+

 

+
+

H5Pget_driver_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_family_offset

+
+

void FileAccPropList::setFamilyOffset(hsize_t offset)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_family_offset

+
+

hsize_t FileAccPropList::getFamilyOffset()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_multi_type

+
+

void FileAccPropList::setMultiType(H5FD_mem_t dtype)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_multi_type

+
+

H5FD_mem_t FileAccPropList::getMultiType()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_cache

+
+

void FileAccPropList::setCache(int mdc_nelmts, size_t rdcc_nelmts, + size_t rdcc_nbytes, double rdcc_w0)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_cache

+
+

void FileAccPropList::getCache(int& mdc_nelmts, size_t& + rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_mdc_config

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_gc_references

+
+

void FileAccPropList::setGcReferences(unsigned gc_ref)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_gc_references

+
+

unsigned FileAccPropList::getGcReferences()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fclose_degree

+
+

void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Pget_fclose_degree

+
+

H5F_close_degree_t FileAccPropList::getFcloseDegree()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_meta_block_size

+
+

void FileAccPropList::setMetaBlockSize(hsize_t &block_size) +

+

 

+
+

 

+
+

 

+
+

H5Pget_meta_block_size

+
+

hsize_t FileAccPropList::getMetaBlockSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_sieve_buf_size

+
+

void FileAccPropList::setSieveBufSize(size_t bufsize)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_sieve_buf_size

+
+

size_t FileAccPropList::getSieveBufSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_small_data_block_size

+
+

void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_small_data_block_size

+
+

hsize_t DSetMemXferPropList::getSmallDataBlockSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_libver_bounds

+
+

void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, + H5F_libver_t libver_high)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_libver_bounds

+
+

void FileAccPropList::getLibverBounds(H5F_libver_t& libver_lo= +w, H5F_libver_t& + libver_high)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_file_cache_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_file_cache_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_file_cache_size

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_file_image

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_file_image

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_file_image_callbacks

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_file_image_callbacks

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_core_write_tracking

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_core_write_tracking

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_layout

+
+

void DSetCreatPropList::setLayout(H5D_layout_t layout)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_layout

+
+

H5D_layout_t DSetCreatPropList::getLayout()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_chunk

+
+

void DSetCreatPropList::setChunk(int ndims, const hsize_t* dim) +

+

 

+
+

 

+
+

 

+
+

H5Pget_chunk

+
+

int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_external

+
+

void DSetCreatPropList::setExternal(const char* name, off_t offse= +t, + hsize_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_external_count

+
+

int DSetCreatPropList::getExternalCount

+
+

 

+
+

 

+
+

 

+
+

H5Pget_external

+
+

void DSetCreatPropList::getExternal(unsigned idx, size_t name_siz= +e, + char* name, off_t& offset, hsize_t& size)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_szip

+
+

void DSetCreatPropList::setSzip(unsigned int options_mask, unsign= +ed + int pixels_per_block)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_shuffle

+
+

void DSetCreatPropList::setShuffle()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_nbit

+
+

void DSetCreatPropList::setNbit()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_scaleoffset

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fill_value

+
+

void DSetCreatPropList::setFillValue(const DataType& fvalue_t= +ype, + const void* value)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fill_value

+
+

void DSetCreatPropList::getFillValue(const DataType& fvalue_t= +ype, + void* value)

+
+

 

+
+

 

+
+

 

+
+

H5Pfill_value_defined

+
+

H5D_fill_value_t DSetCreatPropList::isFillValueDefined()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_alloc_time

+
+

void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time)= +

+
+

 

+
+

 

+
+

 

+
+

H5Pget_alloc_time

+
+

H5D_alloc_time_t DSetCreatPropList::getAllocTime()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_fill_time

+
+

void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_fill_time

+
+

H5D_fill_time_t DSetCreatPropList::getFillTime()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_chunk_cache

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_chunk_cache

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_data_transform

+
+

void DSetMemXferPropList::setDataTransform(const char* expression= +)

+

void DSetMemXferPropList::setDataTransform(const H5std_string& + expression)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_data_transform

+
+

ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t + buf_size)

+

H5std_string DSetMemXferPropList::getDataTransform()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_buffer

+
+

void DSetMemXferPropList::setBuffer(size_t size, void* tconv, voi= +d* + bkg)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_buffer

+
+

size_t DSetMemXferPropList::getBuffer(void** tconv, void** bkg) +

+

 

+
+

 

+
+

 

+
+

H5Pset_preserve

+
+

void DSetMemXferPropList::setPreserve(bool status)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_preserve

+
+

bool DSetMemXferPropList::getPreserve()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_edc_check

+
+

void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check)

+
+

 

+
+

 

+
+

 

+
+

H5Z_EDC_t H5Pget_edc_check

+
+

H5Z_EDC_t DSetMemXferPropList::getEDCCheck()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_filter_callback

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_btree_ratios

+
+

void DSetMemXferPropList::setBtreeRatios(double left, double midd= +le, + double right)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_btree_ratios

+
+

void DSetMemXferPropList::getBtreeRatios(double& left, + double& middle, double& right)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_vlen_mem_manager

+
+

void DSetMemXferPropList::setVlenMemManager()

+

void DSetMemXferPropList::setVlenMemManager(H5MM_allocate_t + alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_vlen_mem_manager

+
+

void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& + alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_in= +fo)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_hyper_vector_size

+
+

void DSetMemXferPropList::setHyperVectorSize(size_t vector_size)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Pget_hyper_vector_size

+
+

size_t DSetMemXferPropList::getHyperVectorSize()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_type_conv_cb

+
+

void DSetMemXferPropList::setTypeConvCB(H5T_conv_except_func_t op, + void *user_data)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_type_conv_cb

+
+

void DSetMemXferPropList::getTypeConvCB(H5T_conv_except_func_t *o= +p, + void **user_data)

+
+

 

+
+

 

+
+

 

+
+

H5Pset_create_intermediate_group

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_create_intermediate_group

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_local_heap_size_hint

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_local_heap_size_hint

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_link_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_link_phase_change

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_est_link_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_est_link_info

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_link_creation_order

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_link_creation_order

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_char_encoding

+
+

ASAP

+
+

 

+
+

 

+
+

 

+
+

H5Pget_char_encoding

+
+

ASAP

+
+

 

+
+

 

+
+

 

+
+

H5Pset_nlinks

+
+

void LinkAccPropList::setNumLinks(size_t nlinks)

+
+

 

+
+

 

+
+

 

+
+

H5Pget_nlinks

+
+

size_t LinkAccPropList::getNumLinks()

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_prefix

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_prefix

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_fapl

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_fapl

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_acc_flags

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_acc_flags

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_elink_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_elink_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Pset_copy_object

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_copy_object

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Padd_merge_committed_dtype_path

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pfree_merge_committed_dtype_paths

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pset_mcdt_search_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Pget_mcdt_search_cb

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5open

+
+

void H5Library::open()

+
+

 

+
+

 

+
+

 

+
+

H5close

+
+

void H5Library::close()

+
+

 

+
+

 

+
+

 

+
+

H5dont_atexit

+
+

void H5Library::dontAtExit()

+
+

 

+
+

 

+
+

 

+
+

H5garbage_collect

+
+

void H5Library::garbageCollect()

+
+

 

+
+

 

+
+

 

+
+

H5set_free_list_limits

+
+

void H5Library::setFreeListLimits(int reg_global_lim, int reg_lis= +t_lim,

+

        int arr_global_li= +m, int + arr_list_lim, int blk_global_lim,

+

        int blk_list_lim)= +

+
+

 

+
+

 

+
+

 

+
+

H5get_libversion

+
+

void H5Library::getLibVersion(unsigned& majnum, unsigned& + minnum, unsigned& relnum)

+
+

 

+
+

 

+
+

 

+
+

H5check_version

+
+

void H5Library::checkVersion(unsigned majnum, unsigned minnum, + unsigned relnum)

+
+

 

+
+

 

+
+

 

+
+

H5free_memory

+
+

No wrapper

+
+

 

+
+

 

+
+

 

+
+

H5allocate_memory

+
+

No wrapper

+
+

 

+
+

 

+
+

 

+
+

H5resize_memory

+
+

No wrapper

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Rcreate

+
+

void H5Location::reference(void* ref, const char* name, const Dat= +aSpace& + dataspace, H5R_type_t ref_type)

+
+

 

+
+

 

+
+

 

+
+

void H5Location::reference(void* ref, const H5std_string& nam= +e, + const DataSpace& dataspace, H5R_type_t ref_type)

+
+

void H5Location::reference(void* ref, const char* name, H5R_type_t + ref_type)

+
+

void H5Location::reference(void* ref, const H5std_string& nam= +e, + H5R_type_t ref_type)

+
+

H5Rdereference2

+
+

DataSet::DataSet(const H5Location& loc, const void* ref, + H5R_type_t ref_type)

+

 

+
+

 

+
+

 

+
+

 

+
+

H5Rget_region

+
+

DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) +

+

 

+
+

 

+
+

 

+
+

H5Rget_obj_type2

+
+

H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_ty= +pe)

+
+

 

+
+

 

+
+

 

+
+

H5Rget_name

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Rg= +et_obj_type1

+
+

Should remove from code

+
+

 

+
+

 

+
+

 

+
+

H5Rd= +ereference1

+
+

Removed

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Screate

+
+

DataSpace::DataSpace(H5S_class_t type)

+
+

 

+
+

 

+
+

 

+
+

H5Screate_simple

+
+

DataSpace::DataSpace(int rank, const hsize_t * dims, const hsize_= +t * + maxdims)

+
+

 

+
+

 

+
+

 

+
+

H5Sset_extent_simple

+
+

void DataSpace::setExtentSimple(int rank, const hsize_t + *current_size, const hsize_t *maximum_size)

+
+

 

+
+

 

+
+

 

+
+

H5Scopy

+
+

void DataSpace::copy(const DataSpace& like_space)

+
+

 

+
+

 

+
+

 

+
+

H5Sclose

+
+

void DataSpace::close()

+
+

 

+
+

 

+
+

 

+
+

H5Sencode

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sdecode

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_npoints

+
+

hssize_t DataSpace::getSimpleExtentNpoints

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_ndims

+
+

int DataSpace::getSimpleExtentNdims ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_dims

+
+

int DataSpace::getSimpleExtentDims (hsize_t *dims, hsize_t *maxdi= +ms)

+
+

 

+
+

 

+
+

 

+
+

H5Sis_simple

+
+

bool DataSpace::isSimple ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_npoints

+
+

hssize_t DataSpace::getSelectNpoints ()

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_hyperslab

+
+

void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t + *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block= +)

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_elements

+
+

void DataSpace::selectElements (H5S_seloper_t op, const size_t nu= +m_elements, + const hsize_t *coord)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_simple_extent_type

+
+

H5S_class_t DataSpace::getSimpleExtentType ()

+
+

 

+
+

 

+
+

 

+
+

H5Sset_extent_none

+
+

void DataSpace::setExtentNone ()

+
+

 

+
+

 

+
+

 

+
+

H5Sextent_copy

+
+

void DataSpace::extentCopy (const DataSpace& dest_space)

+
+

 

+
+

 

+
+

 

+
+

H5Sextent_equal

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_all

+
+

void DataSpace::selectAll ()

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_none

+
+

void DataSpace::selectNone ()

+
+

 

+
+

 

+
+

 

+
+

H5Soffset_simple

+
+

void DataSpace::offsetSimple (const hssize_t* offset)

+
+

 

+
+

 

+
+

 

+
+

H5Sselect_valid

+
+

bool DataSpace::selectValid ()

+
+

 

+
+

 

+
+

 

+
+

H5Sis_regular_hyperslab

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sget_regular_hyperslab

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_hyper_nblocks

+
+

hssize_t DataSpace::getSelectHyperNblocks ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_elem_npoints

+
+

hssize_t DataSpace::getSelectElemNpoints ()

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_hyper_blocklist

+
+

void DataSpace::getSelectHyperBlocklist(hsize_t startblock, hsize= +_t + numblocks, hsize_t *buf)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_elem_pointlist

+
+

void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize= +_t + numpoints, hsize_t *buf)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_bounds

+
+

void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end)

+
+

 

+
+

 

+
+

 

+
+

H5Sget_select_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

H5Tcreate

+
+

DataType::DataType(const H5T_class_t type_class, size_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Tcopy

+
+

DataType::DataType(const PredType& pred_type)

+
+

 

+
+

 

+
+

 

+
+

void DataType::copy(const DataType& like_type)

+
+

 

+
+

 

+
+

 

+
+

void DataType::copy(const DataSet& dset)

+
+

 

+
+

 

+
+

 

+
+

H5Tclose

+
+

void DataType::close()

+
+

 

+
+

 

+
+

 

+
+

DataType destructor

+
+

 

+
+

 

+
+

 

+
+

H5Tequal

+
+

bool DataType::operator=3D=3D(const DataType& compared_type)<= +/p> +

+

 

+
+

 

+
+

 

+
+

H5Tlock

+
+

void DataType::lock()

+
+

 

+
+

 

+
+

 

+
+

H5Tcommit2

+
+

void DataType::commit(const H5Location& loc, const char* name= +)

+
+

 

+
+

 

+
+

 

+
+

void DataType::commit(const H5Location& loc, const + H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

H5Topen2

+
+

DataType CommonFG::openDataType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

DataType CommonFG::openDataType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

ArrayType CommonFG::openArrayType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

ArrayType CommonFG::openArrayType(const H5std_string& name) +

+

 

+
+

 

+
+

 

+
+

CompType CommonFG::openCompType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

CompType CommonFG::openCompType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

EnumType CommonFG::openEnumType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

EnumType CommonFG::openEnumType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

IntType CommonFG::openIntType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

IntType CommonFG::openIntType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

FloatType CommonFG::openFloatType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

FloatType CommonFG::openFloatType(const H5std_string& name) +

+

 

+
+

 

+
+

 

+
+

StrType CommonFG::openStrType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

StrType CommonFG::openStrType(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

VarLenType CommonFG::openVarLenType(const char* name)

+
+

 

+
+

 

+
+

 

+
+

VarLenType CommonFG::openVarLenType(const H5std_string& name)= +

+
+

 

+
+

 

+
+

 

+
+

H5Tcommit_anon

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Tget_create_plist

+
+

PropList DataType::getCreatePlist()

+
+

 

+
+

 

+
+

 

+
+

H5Tcommitted

+
+

bool DataType::committed()

+
+

 

+
+

 

+
+

 

+
+

H5Tencode

+
+

void DataType::encode()

+
+

 

+
+

 

+
+

 

+
+

H5Tdecode

+
+

virtual DataType* DataType::decode() const;

+

virtual DataType* ArrayType::decode() const;

+

virtual DataType* CompType::decode() const;

+

virtual DataType* DataType::decode() const;

+

virtual DataType* EnumType::decode() const;

+

virtual DataType* FloatType::decode() const;

+

virtual DataType* IntType::decode() const;

+

virtual DataType* StrType::decode() const;

+

virtual DataType* VarLenType::decode() const;

+
+

 

+
+

 

+
+

 

+
+

H5Tinsert

+
+

void CompType::insertMember(const H5std_string& name, size_t + offset, const DataType& new_member)

+
+

 

+
+

 

+
+

 

+
+

H5Tpack

+
+

void CompType::pack()

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_create

+
+

EnumType::EnumType(const IntType& data_type)

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_insert

+
+

void EnumType::insert(const char* name, void *value)

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_nameof

+
+

H5std_string EnumType::nameOf(void *value, size_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Tenum_valueof

+
+

void EnumType::valueOf(const char* name, void *value)

+
+

 

+
+

 

+
+

 

+
+

H5Tvlen_create

+
+

VarLenType::VarLenType(const DataType* base_type)

+
+

 

+
+

 

+
+

 

+
+

H5Tarray_create2

+
+

ArrayType::ArrayType(const DataType& base_type, int ndims, co= +nst + hsize_t* dims)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_array_ndims

+
+

int ArrayType::getArrayNDims()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_array_dims2

+
+

int ArrayType::getArrayDims(hsize_t* dims)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_tag

+
+

void DataType::setTag(const char* tag)

+
+

 

+
+

 

+
+

 

+
+

void DataType::setTag(const H5std_string& tag)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_tag

+
+

H5std_string DataType::getTag()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_super

+
+

DataType DataType::getSuper()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_class

+
+

H5T_class_t DataType::getClass()

+
+

 

+
+

 

+
+

 

+
+

H5Tdetect_class

+
+

bool DataType::detectClass(H5T_class_t cls)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_size

+
+

size_t DataType::getSize()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_order

+
+

H5T_order_t AtomType::getOrder()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_precision

+
+

size_t AtomType::getPrecision()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_offset

+
+

int AtomType::getOffset()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_pad

+
+

void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_sign

+
+

H5T_sign_t IntType::getSign()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_fields

+
+

void FloatType::getFields(size_t& spos, size_t& epos, + size_t& esize, size_t& mpos, size_t& msize)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_ebias

+
+

size_t FloatType::getEbias()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_norm

+
+

H5T_norm_t FloatType::getNorm(H5std_string& norm_string)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_inpad

+
+

H5T_pad_t FloatType::getInpad(H5std_string& pad_string)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_strpad

+
+

H5T_str_t StrType::getStrpad()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_nmembers

+
+

int CompType::getNmembers()

+
+

 

+
+

 

+
+

 

+
+

int EnumType::getNmembers()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_name

+
+

H5std_string CompType::getMemberName(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_index

+
+

int CompType::getMemberIndex(const char* name)

+
+

 

+
+

 

+
+

 

+
+

int CompType::getMemberIndex(const H5std_string& name)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_offset

+
+

size_t CompType::getMemberOffset(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_class

+
+

H5T_class_t CompType::getMemberClass(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_type

+
+

DataType CompType::getMemberDataType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

ArrayType CompType::getMemberArrayType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

CompType CompType::getMemberCompType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

EnumType CompType::getMemberEnumType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

IntType CompType::getMemberIntType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

FloatType CompType::getMemberFloatType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

StrType CompType::getMemberStrType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

VarLenType CompType::getMemberVarLenType(unsigned member_num)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_member_value

+
+

void EnumType::getMemberValue(unsigned memb_no, void *value)

+
+

 

+
+

 

+
+

 

+
+

H5Tget_cset

+
+

H5T_cset_t StrType::getCset()

+
+

 

+
+

 

+
+

 

+
+

H5Tis_variable_str

+
+

bool DataType::isVariableStr()

+
+

 

+
+

 

+
+

 

+
+

H5Tget_native_type

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Tset_size

+
+

void AtomType::setSize(size_t size)

+
+

 

+
+

 

+
+

 

+
+

void CompType::setSize(size_t size)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_order

+
+

void AtomType::setOrder(H5T_order_t order)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_precision

+
+

void AtomType::setPrecision(size_t precision)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_offset

+
+

void AtomType::setOffset(size_t offset)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_pad

+
+

void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_sign

+
+

void IntType::setSign(H5T_sign_t sign)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_fields

+
+

void FloatType::setFields(size_t spos, size_t epos, size_t esize, + size_t mpos, size_t msize)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_ebias

+
+

void FloatType::setEbias(size_t ebias)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_norm

+
+

void FloatType::setNorm(H5T_norm_t norm)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_inpad

+
+

void FloatType::setInpad(H5T_pad_t inpad)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_cset

+
+

void StrType::setCset(H5T_cset_t cset)

+
+

 

+
+

 

+
+

 

+
+

H5Tset_strpad

+
+

void StrType::setStrpad(H5T_str_t strpad)

+
+

 

+
+

 

+
+

 

+
+

H5Tregister

+
+

void DataType::registerFunc(H5T_pers_t pers, const char* name, co= +nst + DataType& dest, H5T_conv_t func)

+
+

 

+
+

 

+
+

 

+
+

H5Tunregister

+
+

void DataType::unregister(H5T_pers_t pers, const char* name, const + DataType& dest, H5T_conv_t func)

+
+

 

+
+

 

+
+

 

+
+

H5Tfind

+
+

H5T_conv_t DataType::find(const DataType& dest, H5T_cdata_t + **pcdata)

+
+

 

+
+

 

+
+

 

+
+

H5Tcompiler_conv

+
+

No

+
+

 

+
+

 

+
+

 

+
+

H5Tconvert

+
+

void DataType::convert(const DataType& dest, size_t nelmts, v= +oid + *buf, void *background, const PropList& plist)

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+

 

+
+ +

 

+ +

 

+ +
+ + + + + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map_files/themedata.thmx +Content-Transfer-Encoding: base64 +Content-Type: application/vnd.ms-officetheme + +UEsDBBQABgAIAAAAIQDp3g+//wAAABwCAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyRy07DMBBF +90j8g+UtSpyyQAgl6YLHjseifMDImSQWydiyp1X790zSVEKoIBZsLNkz954743K9Hwe1w5icp0qv +8kIrJOsbR12l3zdP2a1WiYEaGDxhpQ+Y9Lq+vCg3h4BJiZpSpXvmcGdMsj2OkHIfkKTS+jgCyzV2 +JoD9gA7NdVHcGOuJkTjjyUPX5QO2sB1YPe7l+Zgk4pC0uj82TqxKQwiDs8CS1Oyo+UbJFkIuyrkn +9S6kK4mhzVnCVPkZsOheZTXRNajeIPILjBLDsAyJX89nIBkt5r87nons29ZZbLzdjrKOfDZezE7B +/xRg9T/oE9PMf1t/AgAA//8DAFBLAwQUAAYACAAAACEApdan58AAAAA2AQAACwAAAF9yZWxzLy5y +ZWxzhI/PasMwDIfvhb2D0X1R0sMYJXYvpZBDL6N9AOEof2giG9sb69tPxwYKuwiEpO/3qT3+rov5 +4ZTnIBaaqgbD4kM/y2jhdj2/f4LJhaSnJQhbeHCGo3vbtV+8UNGjPM0xG6VItjCVEg+I2U+8Uq5C +ZNHJENJKRds0YiR/p5FxX9cfmJ4Z4DZM0/UWUtc3YK6PqMn/s8MwzJ5PwX+vLOVFBG43lExp5GKh +qC/jU72QqGWq1B7Qtbj51v0BAAD//wMAUEsDBBQABgAIAAAAIQBreZYWgwAAAIoAAAAcAAAAdGhl +bWUvdGhlbWUvdGhlbWVNYW5hZ2VyLnhtbAzMTQrDIBBA4X2hd5DZN2O7KEVissuuu/YAQ5waQceg +0p/b1+XjgzfO3xTVm0sNWSycBw2KZc0uiLfwfCynG6jaSBzFLGzhxxXm6XgYybSNE99JyHNRfSPV +kIWttd0g1rUr1SHvLN1euSRqPYtHV+jT9yniResrJgoCOP0BAAD//wMAUEsDBBQABgAIAAAAIQCq +UiXfxgYAAIsaAAAWAAAAdGhlbWUvdGhlbWUvdGhlbWUxLnhtbOxZXYvbRhR9L/Q/CL07/pL8scQb +bNnOttlNQuyk5HFsj63JjjRGM96NCYGSPBYKpWnpQwN960NpG0igL+mv2TalTSF/oXdGtjxjj7ub +JYWlZA2LNDr3zpl7r84dSZev3I+oc4QTTljccIuXCq6D4yEbkXjScG/3u7ma63CB4hGiLMYNd465 +e2X3ww8uox0R4gg7YB/zHdRwQyGmO/k8H8Iw4pfYFMdwbcySCAk4TSb5UYKOwW9E86VCoZKPEIld +J0YRuL0xHpMhdvrSpbu7dN6hcBoLLgeGNOlJ19iwUNjRYVEi+JwHNHGOEG24MM+IHffxfeE6FHEB +FxpuQf25+d3LebSzMKJii61m11V/C7uFweiwpOZMJoNsUs/zvUoz868AVGziOtVOpVPJ/CkAGg5h +pSkX3affqrfa/gKrgdJDi+92tV0uGnjNf3mDc9OXPwOvQKl/bwPf7QYQRQOvQCne38B7XrUUeAZe +gVJ8ZQNfLTTbXtXAK1BISXy4gS74lXKwXG0GGTO6Z4XXfa9bLS2cr1BQDVl1ySnGLBbbai1C91jS +BYAEUiRI7Ij5FI/REKo4QJQMEuLsk0kIhTdFMeMwXCgVuoUy/Jc/Tx2piKAdjDRryQuY8I0hycfh +w4RMRcP9GLy6GuTNyx/fvHzunDx6cfLol5PHj08e/Zw6Mqz2UDzRrV5//8XfTz91/nr+3esnX9nx +XMf//tNnv/36pR0IK12F4NXXz/548ezVN5//+cMTC7yZoIEO75MIc+c6PnZusQgWpkJgMseD5O0s ++iEiukUznnAUIzmLxX9HhAb6+hxRZMG1sBnBOwlIjA14dXbPINwLk5kgFo/XwsgAHjBGWyyxRuGa +nEsLc38WT+yTJzMddwuhI9vcAYqN/HZmU9BWYnMZhNigeZOiWKAJjrFw5DV2iLFldXcJMeJ6QIYJ +42wsnLvEaSFiDUmfDIxqWhntkQjyMrcRhHwbsTm447QYta26jY9MJNwViFrI9zE1wngVzQSKbC77 +KKJ6wPeRCG0ke/NkqOM6XECmJ5gypzPCnNtsbiSwXi3p10Be7Gk/oPPIRCaCHNp87iPGdGSbHQYh +iqY2bI/EoY79iB9CiSLnJhM2+AEz7xB5DnlA8dZ03yHYSPfpanAblFWntCoQeWWWWHJ5FTOjfntz +OkZYSQ0Iv6HnEYlPFfc1Wff/W1kHIX317VPLqi6qoDcTYr2j9tZkfBtuXbwDlozIxdfuNprFNzHc +LpsN7L10v5du938v3dvu53cv2CuNBvmWW8V0q6427tHWffuYUNoTc4r3udq6c+hMoy4MSjv1zIqz +57hpCIfyToYJDNwkQcrGSZj4hIiwF6Ip7O+LrnQy4QvXE+5MGYdtvxq2+pZ4OosO2Ch9XC0W5aNp +Kh4cidV4wc/G4VFDpOhKdfUIlrlXbCfqUXlJQNq+DQltMpNE2UKiuhyUQVIP5hA0Cwm1snfCom5h +UZPul6naYAHUsqzA1smBDVfD9T0wASN4okIUj2Se0lQvs6uS+S4zvS2YRgXAPmJZAatM1yXXrcuT +q0tL7QyZNkho5WaSUJFRPYyHaIQX1SlHz0LjbXNdX6XUoCdDoeaD0lrRqNb+jcV5cw1269pAY10p +aOwcN9xK2YeSGaJpwx3DYz8cRlOoHS63vIhO4N3ZUCTpDX8eZZkmXLQRD9OAK9FJ1SAiAicOJVHD +lcvP0kBjpSGKW7EEgnBhydVBVi4aOUi6mWQ8HuOh0NOujchIp6eg8KlWWK8q8/ODpSWbQbp74ejY +GdBZcgtBifnVogzgiHB4+1NMozki8DozE7JV/a01poXs6u8TVQ2l44hOQ7ToKLqYp3Al5RkddZbF +QDtbrBkCqoVk0QgHE9lg9aAa3TTrGimHrV33dCMZOU00Vz3TUBXZNe0qZsywbANrsTxfk9dYLUMM +mqZ3+FS61yW3vtS6tX1C1iUg4Fn8LF33DA1Bo7aazKAmGW/KsNTsxajZO5YLPIXaWZqEpvqVpdu1 +uGU9wjodDJ6r84PdetXC0Hi5r1SRVt899E8TbHAPxKMNL4FnVHCVSvjwkCDYEPXUniSVDbhF7ovF +rQFHziwhDfdBwW96QckPcoWa38l5Za+Qq/nNcq7p++Vixy8W2q3SQ2gsIoyKfvrNpQuvouh88eVF +jW98fYmWb9suDVmUZ+rrSl4RV19fiqXtX18cAqLzoFLq1sv1ViVXLze7Oa/dquXqQaWVa1eCarvb +DvxavfvQdY4U2GuWA6/SqeUqxSDIeZWCpF+r56peqdT0qs1ax2s+XGxjYOWpfCxiAeFVvHb/AQAA +//8DAFBLAwQUAAYACAAAACEADdGQn7YAAAAbAQAAJwAAAHRoZW1lL3RoZW1lL19yZWxzL3RoZW1l +TWFuYWdlci54bWwucmVsc4SPTQrCMBSE94J3CG9v07oQkSbdiNCt1AOE5DUNNj8kUeztDa4sCC6H +Yb6ZabuXnckTYzLeMWiqGgg66ZVxmsFtuOyOQFIWTonZO2SwYIKObzftFWeRSyhNJiRSKC4xmHIO +J0qTnNCKVPmArjijj1bkIqOmQci70Ej3dX2g8ZsBfMUkvWIQe9UAGZZQmv+z/TgaiWcvHxZd/lFB +c9mFBSiixszgI5uqTATKW7q6xN8AAAD//wMAUEsBAi0AFAAGAAgAAAAhAOneD7//AAAAHAIAABMA +AAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzXS54bWxQSwECLQAUAAYACAAAACEApdan58AA +AAA2AQAACwAAAAAAAAAAAAAAAAAwAQAAX3JlbHMvLnJlbHNQSwECLQAUAAYACAAAACEAa3mWFoMA +AACKAAAAHAAAAAAAAAAAAAAAAAAZAgAAdGhlbWUvdGhlbWUvdGhlbWVNYW5hZ2VyLnhtbFBLAQIt +ABQABgAIAAAAIQCqUiXfxgYAAIsaAAAWAAAAAAAAAAAAAAAAANYCAAB0aGVtZS90aGVtZS90aGVt +ZTEueG1sUEsBAi0AFAAGAAgAAAAhAA3RkJ+2AAAAGwEAACcAAAAAAAAAAAAAAAAA0AkAAHRoZW1l +L3RoZW1lL19yZWxzL3RoZW1lTWFuYWdlci54bWwucmVsc1BLBQYAAAAABQAFAF0BAADLCgAAAAA= + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map_files/colorschememapping.xml +Content-Transfer-Encoding: quoted-printable +Content-Type: text/xml + + + +------=_NextPart_01D32FBF.F2FA1110 +Content-Location: file:///C:/25114090/C2Cppfunction_map_files/filelist.xml +Content-Transfer-Encoding: quoted-printable +Content-Type: text/xml; charset="utf-8" + + + + + + + +------=_NextPart_01D32FBF.F2FA1110-- diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 4788b43..75180c5 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -174,7 +174,7 @@ size_t AtomType::getPrecision() const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPrecision(size_t precision) const @@ -194,7 +194,7 @@ void AtomType::setPrecision(size_t precision) const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset // Programmer Binh-Minh Ribler - 2000 // Modification // 12/05/00: due to C API change @@ -221,7 +221,7 @@ int AtomType::getOffset() const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setOffset(size_t offset) const diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index d802f08..684090f 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -247,8 +247,8 @@ DataSet CommonFG::openDataSet(const H5std_string& name) const /// specified location. /// For information on creating hard link and soft link, please /// refer to the C layer Reference Manual at: -/// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateHard and -/// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateSoft +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateHard and +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateSoft // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -328,7 +328,7 @@ void CommonFG::unlink(const H5std_string& name) const /// Exercise care in moving groups as it is possible to render /// data in a file inaccessible with Group::move. Please refer /// to the Group Interface in the HDF5 User's Guide for details at: -/// https://www.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm +/// https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -363,7 +363,7 @@ void CommonFG::move(const H5std_string& src, const H5std_string& dst) const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const @@ -1019,7 +1019,7 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) /// \li \c H5O_TYPE_DATASET /// \li \c H5O_TYPE_NAMED_DATATYPE /// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo ///\exception H5::FileIException or H5::GroupIException /// Exception will be thrown when: /// - an error returned by the C API @@ -1085,7 +1085,7 @@ H5O_type_t CommonFG::childObjType(const H5std_string& objname) const /// \li \c H5O_TYPE_DATASET /// \li \c H5O_TYPE_NAMED_DATATYPE /// Refer to the C API documentation for more details: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo ///\exception H5::FileIException or H5::GroupIException /// Exception will be thrown when: /// - an error returned by the C API diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 99f0724..bfab9cd 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -27,10 +27,10 @@ * The C++ API provides C++ wrappers for the HDF5 C Library. * * It is assumed that the user has knowledge of the - * + * * HDF5 file format and its components. * For more information on the HDF5 C Library, see the - * + * * HDF5 Software Documentation page. * * Because the HDF5 C Library maps very well to @@ -50,13 +50,16 @@ Dataspace Interface (H5S) DataSpace Datatype Interface (H5T) DataType and subclasses \endverbatim + * + * This + * table provides a map from the C APIs to the C++ member functions. *
* \section install_sec Installation * * The HDF5 C++ API is included with the HDF5 source code and can * be obtained from - * - * https://www.hdfgroup.org/HDF5/release/obtainsrc.html. + * + * https://support.hdfgroup.org/HDF5/release/obtainsrc.html. * * Please refer to the release_docs/INSTALL file under the top directory * of the HDF5 source code for information about installing, building, @@ -65,34 +68,34 @@ *
*/ -/// This example shows how to create datasets. +/// This example shows how to create datasets. ///\par ///\example create.cpp ///\par -/// This example shows how to write datasets. +/// This example shows how to write datasets. ///\example writedata.cpp ///\par -/// This example shows how to read datasets. +/// This example shows how to read datasets. ///\example readdata.cpp ///\par -/// This example shows how to create a compound datatype, -/// write an array which has the compound datatype to the file, -/// and read back fields' subsets. +/// This example shows how to create a compound datatype, +/// write an array which has the compound datatype to the file, +/// and read back fields' subsets. ///\example compound.cpp ///\par -/// This example shows how to work with extendible datasets. +/// This example shows how to work with extendible datasets. ///\example extend_ds.cpp ///\par -/// This example shows how to read data from a chunked dataset. +/// This example shows how to read data from a chunked dataset. ///\example chunks.cpp ///\par -/// This example shows how to work with groups. +/// This example shows how to work with groups. ///\example h5group.cpp #endif // __H5CppDoc_H diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index ded483b..14dd607 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -580,7 +580,7 @@ int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& spac /// For more information, please see the Description section in /// C layer Reference Manual at: ///\par -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::extend(const hsize_t* size) const diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index f0b8a07..b4fd431 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -473,7 +473,7 @@ hssize_t DataSpace::getSelectElemNpoints () const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const @@ -497,7 +497,7 @@ void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, h ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const @@ -523,7 +523,7 @@ void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const @@ -605,7 +605,7 @@ bool DataSpace::selectValid () const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block) const diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 5a6e3dd..6162bec 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -514,7 +514,7 @@ DataType DataType::getSuper() const ///\exception H5::DataTypeIException ///\par Description /// For more information, please see: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index dca846d..8e2468b 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -158,7 +158,7 @@ int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const ///\exception H5::PropListIException ///\par Description /// For information on valid layout types, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const @@ -234,7 +234,7 @@ void DSetCreatPropList::setDeflate(int level) const /// H5Z_FILTER_SZIP, for a dataset. For more information about /// SZIP and usage, please refer to the C layer Reference /// Manual at: -/// http://hdfgroup.org/HDF5/doc/RM_H5P.html#Property-SetSzip +/// https://support.hdfgroup.org/HDF5/doc/RM_H5P.html#Property-SetSzip // Programmer Binh-Minh Ribler - Jan, 2007 //-------------------------------------------------------------------------- void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const @@ -256,7 +256,7 @@ void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_p /// H5Z_FILTER_NBIT, for a dataset. For more information about /// Nbit compression, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit // Programmer Binh-Minh Ribler - Apr, 2016 //-------------------------------------------------------------------------- void DSetCreatPropList::setNbit() const @@ -284,7 +284,7 @@ void DSetCreatPropList::setNbit() const ///\par /// For information on setting fill value, please refer to the /// C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const @@ -535,7 +535,7 @@ bool DSetCreatPropList::allFiltersAvail() const ///\par Description /// Please refer to the Reference Manual of \c H5Pset_shuffle for /// details. -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 43ecf9b..da66ec6 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -436,7 +436,7 @@ void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** ///\exception H5::PropListIException ///\par Description /// For detail, please refer to the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const @@ -476,7 +476,7 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() const ///\par Description /// For information, please refer to the C layer Reference /// Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index bf48da8..a4781bc 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -125,7 +125,7 @@ void FileAccPropList::setStdio() const /// driver was set for the property list. The driver ID is /// only valid as long as the file driver remains registered. /// Valid driver identifiers can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -148,7 +148,7 @@ hid_t FileAccPropList::getDriver() const ///\par Description /// For a list of valid driver identifiers, please see the C /// layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const @@ -206,7 +206,7 @@ hsize_t FileAccPropList::getFamilyOffset() const ///\par Description /// For more details on the use of \c H5FD_CORE driver, please /// refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const @@ -310,7 +310,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const ///\exception H5::PropListIException ///\par Description /// Temporary - For information, please refer to: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit // Programmer: Binh-Minh Ribler - April, 2004 // Modification // Replaced the version without const parameter - Apr, 2014 @@ -374,7 +374,7 @@ size_t FileAccPropList::getSieveBufSize() const ///\exception H5::PropListIException ///\par Description /// For detail on data sieving, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSieveBufSize(size_t bufsize) const @@ -394,7 +394,7 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const ///\exception H5::PropListIException ///\par Description /// For more detail, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const @@ -434,7 +434,7 @@ hsize_t FileAccPropList::getMetaBlockSize() const ///\exception H5::PropListIException ///\par Description /// For detail on \a flags, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const @@ -491,7 +491,7 @@ void FileAccPropList::setSec2() const /// The parameter \a alignment must have a positive value. /// /// For detail on \a setting alignment, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setAlignment(hsize_t threshold, hsize_t alignment) const @@ -528,7 +528,7 @@ void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t &alignment) const ///\exception H5::PropListIException ///\par Description /// More details and valid values for \a dtype can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMultiType(H5FD_mem_t dtype) const @@ -547,7 +547,7 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const ///\exception H5::PropListIException ///\par Description /// More details and possible returned values can be found at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5FD_mem_t FileAccPropList::getMultiType() const @@ -648,7 +648,7 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() const ///\exception H5::PropListIException ///\par Description /// For detail on \a fapl, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setGcReferences(unsigned gc_ref) const @@ -699,7 +699,7 @@ unsigned FileAccPropList::getGcReferences() const /// \li \c H5F_LIBVER_LATEST (Default) /// /// For more details, please refer to -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds // Programmer: Binh-Minh Ribler - March, 2015 //-------------------------------------------------------------------------- void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 064d077..9cc4c88 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -173,7 +173,7 @@ hsize_t FileCreatPropList::getUserblock() const ///\par Description /// For information on setting sizes, please refer to the /// C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const @@ -213,7 +213,7 @@ void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const ///\exception H5::PropListIException ///\par Description /// For information, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const @@ -234,7 +234,7 @@ void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const ///\exception H5::PropListIException ///\par Description /// For information, please see -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const @@ -255,7 +255,7 @@ void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const ///\exception H5::PropListIException ///\par Description /// For information, please see the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setIstorek(unsigned ik) const @@ -275,7 +275,7 @@ void FileCreatPropList::setIstorek(unsigned ik) const ///\exception H5::PropListIException ///\par Description /// For information, please see -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 3509e33..395077d 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -71,7 +71,7 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer /// Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create // Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file // could not be caught in the applications. Added try block here // to catch then re-throw it. -BMR 2013/03/21 diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index d60312c..cedb74c 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -111,7 +111,7 @@ void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& reln ///\par Description /// For information about library version, please refer to /// the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) @@ -242,7 +242,7 @@ void H5Library::termH5cpp() /// Setting a value of -1 for a limit means no limit of that type. /// For more information on free list limits, please refer to C /// layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 3af9d10..ab09305 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -87,7 +87,7 @@ H5Location::H5Location() : IdComponent() {} Notes for H5A wrappers ====================== May, 2017 (1.8.19) - These H5A wrappers are copied from H5Object to prevent an attribute + These H5A wrappers are copied to H5Object to prevent an attribute id being passed in to H5A APIs. The original H5A wrapper functions here will be deprecated in future releases. @@ -218,7 +218,7 @@ Attribute H5Location::openAttribute(const unsigned int idx) const /// void (*)(H5::H5Location&, H5std_string, void*). /// For information, please refer to the C layer Reference Manual /// at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Location::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data) diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index af21663..afa8653 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -115,7 +115,7 @@ ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {} /// If \c max_compact is set to 0, dense storage will be used. /// For more detail about on attribute storage, please refer to the /// C layer Reference Manual at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_dense) const @@ -139,7 +139,7 @@ void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_den /// If \c max_compact is set to 0, dense storage will be used. /// For more detail about on attribute storage, please refer to the /// C layer Reference Manual at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const @@ -168,7 +168,7 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d /// mechanism to turn on attribute creation order tracking at object /// creation time and to build the index later. /// The C layer Reference Manual at can be found at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrCreationOrder +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrCreationOrder // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const @@ -190,7 +190,7 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const /// When no flag is set, i.e. crt_order_flags = 0, attribute /// creation order is neither tracked not indexed. /// The C layer Reference Manual at can be found at: -/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder // Programmer: Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- unsigned ObjCreatPropList::getAttrCrtOrder() const diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index e6534d9..ef63ccb 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -223,7 +223,7 @@ H5T_str_t StrType::getStrpad() const ///\exception H5::DataTypeIException ///\par Description /// For detail, please refer to the C layer Reference Manual at: -/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad +/// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void StrType::setStrpad(H5T_str_t strpad) const diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index ade4ac1..77e5fef 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -1150,7 +1150,8 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = ./header_files/help.jpg +HTML_EXTRA_FILES = ./header_files/help.jpg \ + ./C2Cppfunction_map.mht # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to -- cgit v0.12 From 5ce95205ca31db38e710ea55f97b3d0b28795ee4 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 4 Oct 2017 14:20:08 -0500 Subject: Added C2Cppfunction_map.mht --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 194e542..3f8725e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -409,6 +409,7 @@ ./c++/src/Makefile.am ./c++/src/Makefile.in ./c++/src/RM_stylesheet.css +./c++/src/C2Cppfunction_map.mht ./c++/src/cpp_doc_config ./c++/src/footer.html ./c++/src/h5c++.in -- cgit v0.12 From b1819710bc3ef8b03e453d177b9a8b308100d96d Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 5 Oct 2017 16:24:25 -0500 Subject: Adding new C++ wrappers Description: - Added wrappers for H5Tencode to class DataType and H5Tdecode to classes DataType and its subclasses. // Creates a binary object description of this datatype. void DataType::encode() // Returns the decoded type from the binary object description. virtual DataType* DataType::decode() const; virtual DataType* ArrayType::decode() const; virtual DataType* CompType::decode() const; virtual DataType* DataType::decode() const; virtual DataType* EnumType::decode() const; virtual DataType* FloatType::decode() const; virtual DataType* IntType::decode() const; virtual DataType* StrType::decode() const; virtual DataType* VarLenType::decode() const; - Replaced existing functions CommonFG::openXxxType with individual data type constructors, XxxType, to improve usability. Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5ArrayType.cpp | 59 +++++++++++++++++ c++/src/H5ArrayType.h | 8 +++ c++/src/H5Classes.h | 2 +- c++/src/H5CompType.cpp | 60 ++++++++++++++++- c++/src/H5CompType.h | 8 +++ c++/src/H5DataType.cpp | 169 +++++++++++++++++++++++++++++++++++++++++++++-- c++/src/H5DataType.h | 31 +++++++-- c++/src/H5EnumType.cpp | 59 +++++++++++++++++ c++/src/H5EnumType.h | 8 +++ c++/src/H5FloatType.cpp | 59 +++++++++++++++++ c++/src/H5FloatType.h | 8 +++ c++/src/H5IntType.cpp | 59 +++++++++++++++++ c++/src/H5IntType.h | 8 +++ c++/src/H5Location.cpp | 5 +- c++/src/H5Location.h | 77 ++++++++++++--------- c++/src/H5Object.cpp | 36 ++++++++++ c++/src/H5Object.h | 6 +- c++/src/H5StrType.cpp | 59 +++++++++++++++++ c++/src/H5StrType.h | 8 +++ c++/src/H5VarLenType.cpp | 59 +++++++++++++++++ c++/src/H5VarLenType.h | 11 +++ 21 files changed, 754 insertions(+), 45 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 6d2ca83..6be1a1f 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -70,6 +70,44 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) } //-------------------------------------------------------------------------- +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType instance by opening an HDF5 array datatype +/// given its name, provided as a C character string. +///\param loc - IN: Location of the type +///\param type_name - IN: Array type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openArrayType(const char*) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +ArrayType::ArrayType(const H5Location& loc, const char *type_name) : DataType() +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: ArrayType overloaded constructor +///\brief Creates an ArrayType instance by opening an HDF5 array datatype +/// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: Array type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openArrayType(const H5std_string&) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +ArrayType::ArrayType(const H5Location& loc, const H5std_string& type_name) : DataType() +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- // Function: ArrayType::operator= ///\brief Assignment operator ///\param rhs - IN: Reference to the existing array datatype @@ -99,6 +137,27 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs) } //-------------------------------------------------------------------------- +// Function: ArrayType::decode +///\brief Returns an ArrayType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* ArrayType::decode() const +{ + hid_t encoded_arrtype_id = H5I_INVALID_HID; + try { + encoded_arrtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + ArrayType *encoded_arrtype = new ArrayType; + encoded_arrtype->p_setId(encoded_arrtype_id); + return(encoded_arrtype); +} + +//-------------------------------------------------------------------------- // Function: ArrayType::getArrayNDims ///\brief Returns the number of dimensions for an array datatype. ///\return Number of dimensions diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 6de11f2..952aae1 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -28,9 +28,17 @@ class H5_DLLCPP ArrayType : public DataType { // specified base type. ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); + // Constructors that open an array datatype, given a location. + ArrayType(const H5Location& loc, const char* name); + ArrayType(const H5Location& loc, const H5std_string& name); + // Assignment operator ArrayType& operator=(const ArrayType& rhs); + // Returns an ArrayType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Returns the number of dimensions of this array datatype. int getArrayNDims() const; //int getArrayNDims(); // removed 1.8.18 and 1.10.1 diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h index 23bff29..6baa3d0 100644 --- a/c++/src/H5Classes.h +++ b/c++/src/H5Classes.h @@ -30,10 +30,10 @@ namespace H5 { class DataSpace; class AtomType; class PredType; - class EnumType; class IntType; class FloatType; class StrType; + class EnumType; class CompType; class AbstractDs; class DataSet; diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 16a7d2f..6d879bd 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -84,6 +84,65 @@ CompType::CompType(const DataSet& dataset) : DataType() } //-------------------------------------------------------------------------- +// Function: CompType overloaded constructor +///\brief Creates an CompType instance by opening an HDF5 compound +/// given its name, provided as a C character string. +///\param loc - IN: Location of the type +///\param type_name - IN: Compound type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openCompType(const char*) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +CompType::CompType(const H5Location& loc, const char *type_name) : DataType() +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: CompType overloaded constructor +///\brief Creates an CompType instance by opening an HDF5 compound +/// datatype given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: Compound type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openCompType(const H5std_string&) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +CompType::CompType(const H5Location& loc, const H5std_string& type_name) : DataType() +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: CompType::decode +///\brief Returns a CompType object via DataType* by decoding the +/// binary object description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* CompType::decode() const +{ + hid_t encoded_cmptype_id = H5I_INVALID_HID; + try { + encoded_cmptype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + CompType *encoded_cmptype = new CompType; + encoded_cmptype->p_setId(encoded_cmptype_id); + return(encoded_cmptype); +} + +//-------------------------------------------------------------------------- // Function: CompType::getNmembers ///\brief Returns the number of members in this compound datatype. ///\return Number of members @@ -155,7 +214,6 @@ int CompType::getMemberIndex(const H5std_string& name) const /// respect to the beginning of the compound data type datum. ///\param member_num - IN: Zero-based index of the member ///\return Byte offset -///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 // Description /// Members are stored in no particular order with numbers 0 diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index f6d77f4..3aabf55 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -43,6 +43,14 @@ class H5_DLLCPP CompType : public DataType { // Copy constructor - makes a copy of original object CompType(const CompType& original); + // Constructors that open a compound datatype, given a location. + CompType(const H5Location& loc, const char* name); + CompType(const H5Location& loc, const H5std_string& name); + + // Returns a CompType object via DataType* by decoding the binary + // object description of this type. + virtual DataType* decode() const; + // Returns the type class of the specified member of this compound // datatype. It provides to the user a way of knowing what type // to create another datatype of the same class diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 6162bec..ffa2a21 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -18,6 +18,7 @@ #endif #include +#include "H5private.h" // for HDcalloc #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -45,7 +46,7 @@ namespace H5 { ///\brief Default constructor: Creates a stub datatype // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} +DataType::DataType() : H5Object(), id(H5I_INVALID_HID), encoded_buf(NULL), buf_size(0) {} //-------------------------------------------------------------------------- // Function: DataType overloaded constructor @@ -60,7 +61,7 @@ DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {} // Removed second argument, "predefined", after changing to the // new ref counting mechanism that relies on C's ref counting. //-------------------------------------------------------------------------- -DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) +DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id), encoded_buf(NULL), buf_size(0) { incRefCount(); // increment number of references to this id } @@ -73,7 +74,7 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id) ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object() +DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object(), encoded_buf(NULL), buf_size(0) { // Call C routine to create the new datatype id = H5Tcreate(type_class, size); @@ -96,7 +97,7 @@ DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object() // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) : H5Object(), id(H5I_INVALID_HID) +DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) : H5Object(), encoded_buf(NULL), buf_size(0) { id = H5Location::p_dereference(loc.getId(), ref, ref_type, "constructor - by dereference"); } @@ -114,7 +115,7 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type) // Jul, 2008 // Added for application convenience. //-------------------------------------------------------------------------- -DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object() +DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object(), id(H5I_INVALID_HID), encoded_buf(NULL), buf_size(0) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, "constructor - by dereference"); } @@ -124,7 +125,7 @@ DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type) ///\brief Copy constructor: makes a copy of the original DataType object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -DataType::DataType(const DataType& original) : H5Object(), id(original.id) +DataType::DataType(const DataType& original) : H5Object(), id(original.id), encoded_buf(NULL), buf_size(0) { incRefCount(); // increment number of references to this id } @@ -142,7 +143,7 @@ DataType::DataType(const DataType& original) : H5Object(), id(original.id) // unnecessarily and will produce undefined behavior. // -BMR, Apr 2015 //-------------------------------------------------------------------------- -DataType::DataType(const PredType& pred_type) : H5Object() +DataType::DataType(const PredType& pred_type) : H5Object(), encoded_buf(NULL), buf_size(0) { // call C routine to copy the datatype id = H5Tcopy(pred_type.getId()); @@ -151,6 +152,44 @@ DataType::DataType(const PredType& pred_type) : H5Object() } //-------------------------------------------------------------------------- +// Function: DataType overloaded constructor +///\brief Creates a DataType instance by opening an HDF5 datatype given +/// its name as a char*. +///\param loc - IN: Location of the type +///\param type_name - IN: Datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openDataType(const char*) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +DataType::DataType(const H5Location& loc, const char *type_name) : H5Object(), encoded_buf(NULL), buf_size(0) +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: DataType overloaded constructor +///\brief Creates a DataType instance by opening an HDF5 datatype given +/// its name as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: Datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openDataType(const H5std_string&) +// to improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +DataType::DataType(const H5Location& loc, const H5std_string& type_name) : H5Object(), encoded_buf(NULL), buf_size(0) +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- // Function: DataType::copy ///\brief Copies an existing datatype to this datatype object ///\param like_type - IN: Datatype to be copied @@ -204,6 +243,102 @@ void DataType::copy(const DataSet& dset) } //-------------------------------------------------------------------------- +// Function: DataType::p_decode +// Purpose Returns an id of a type by decoding the binary object +/// description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +hid_t DataType::p_decode() const +{ + // Make sure that the buffer can be decoded + if (encoded_buf == NULL) + { + throw DataTypeIException("DataType::p_decode", "No encoded buffer"); + } + + // Call C function to decode the binary object description + hid_t encoded_dtype_id = H5Tdecode(encoded_buf); + + // If H5Tdecode fails, raise exception + if (encoded_dtype_id < 0) + { + throw DataTypeIException("DataType::p_decode", "H5Tdecode failed"); + } + else + { + return(encoded_dtype_id); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::decode +///\brief Returns a DataType instance by decoding the binary object +/// description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* DataType::decode() const +{ + hid_t encoded_dtype_id = H5I_INVALID_HID; + try { + encoded_dtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + DataType *encoded_dtype = new DataType; + encoded_dtype->p_setId(encoded_dtype_id); + return(encoded_dtype); +} + +//-------------------------------------------------------------------------- +// Function: DataType::encode +///\brief Creates a binary object description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +void DataType::encode() +{ + // Call H5Tencode passing in null to determine the size of the buffer + herr_t ret_value = H5Tencode(id, NULL, &buf_size); + if (ret_value < 0) + { + throw DataTypeIException("DataType::encode", "Failed to get buf_size"); + } + + // Allocate buffer and call C function again to encode + if (buf_size > 0) + { + encoded_buf = (unsigned char *)HDcalloc((size_t)1, buf_size); + ret_value = H5Tencode(id, encoded_buf, &buf_size); + if (ret_value < 0) + { + throw DataTypeIException("DataType::encode", "H5Tencode failed"); + } + } + else + { + throw DataTypeIException("DataType::encode", "Failed to allocate buffer for encoding"); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::hasBinaryDesc +///\brief Determines whether this datatype has a binary object +/// description. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +bool DataType::hasBinaryDesc() const +{ + if (encoded_buf != NULL) + return true; + else + return false; +} + +//-------------------------------------------------------------------------- // Function: DataType::operator= ///\brief Assignment operator ///\param rhs - IN: Reference to the existing datatype @@ -722,6 +857,26 @@ hid_t DataType::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- +// Function: DataType::p_opentype (private) +///\brief Opens an HDF5 datatype given its name +///\param loc - IN: Location of the type +///\param type_name - IN: Datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// This function was introduced in 1.8.20 to be used by the +// new XxxType constructors that open a datatype. -BMR, Sept 2017 +//-------------------------------------------------------------------------- +hid_t DataType::p_opentype(const H5Location& loc, const char *type_name) const +{ + // Call C function to open the named datatype at this location + hid_t ret_value = H5Topen2(loc.getId(), type_name, H5P_DEFAULT); + if (ret_value < 0) + throw DataTypeIException(inMemFunc("constructor"), "H5Topen2 failed"); + return(ret_value); +} + +//-------------------------------------------------------------------------- // Function: DataType::p_setId ///\brief Sets the identifier of this object to a new value. /// diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 8970a8d..5e10c20 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -36,6 +36,10 @@ class H5_DLLCPP DataType : public H5Object { // Creates a copy of a predefined type DataType(const PredType& pred_type); + // Opens a generic named datatype at a given location. + DataType(const H5Location& loc, const char* name); + DataType(const H5Location& loc, const H5std_string& name); + // Creates a datatype by way of dereference. DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT); DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT); @@ -49,6 +53,13 @@ class H5_DLLCPP DataType : public H5Object { // Copies the datatype of dset to this datatype object. void copy(const DataSet& dset); + // Returns a DataType instance by decoding the binary object + // description of this datatype. + virtual DataType* decode() const; + + // Creates a binary object description of this datatype. + void encode(); + // Returns the datatype class identifier. H5T_class_t getClass() const; @@ -56,10 +67,6 @@ class H5_DLLCPP DataType : public H5Object { // a named datatype which can be accessed from the location. void commit(const H5Location& loc, const char* name); void commit(const H5Location& loc, const H5std_string& name); - // These two overloaded functions are kept for backward compatibility - // only; they missed the const - removed from 1.8.18 and 1.10.1 - //void commit(H5Location& loc, const char* name); - //void commit(H5Location& loc, const H5std_string& name); // Determines whether this datatype is a named datatype or // a transient datatype. @@ -121,6 +128,9 @@ class H5_DLLCPP DataType : public H5Object { // Default constructor DataType(); + // Determines whether this datatype has a binary object description. + bool hasBinaryDesc() const; + // Gets the datatype id. virtual hid_t getId() const; @@ -131,11 +141,24 @@ class H5_DLLCPP DataType : public H5Object { #ifndef DOXYGEN_SHOULD_SKIP_THIS hid_t id; // HDF5 datatype id + // Returns an id of a type by decoding the binary object + // description of this datatype. + hid_t p_decode() const; + // Sets the datatype id. virtual void p_setId(const hid_t new_id); + + // Opens a datatype and returns the id. + hid_t p_opentype(const H5Location& loc, const char* dtype_name) const; + #endif // DOXYGEN_SHOULD_SKIP_THIS private: + // Buffer for binary object description of this datatype, allocated + // in DataType::encode and used in DataType::decode + unsigned char *encoded_buf; + size_t buf_size; + // Friend function to set DataType id. For library use only. friend void f_DataType_setId(DataType* dtype, hid_t new_id); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 0c26728..4b06ca5 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -106,6 +106,65 @@ EnumType::EnumType(const IntType& data_type) : DataType() } //-------------------------------------------------------------------------- +// Function: EnumType overloaded constructor +///\brief Creates an EnumType instance by opening an HDF5 enum datatype +/// given its name, provided as a C character string. +///\param loc - IN: Location of the type +///\param type_name - IN: Enum datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openEnumType(const char*) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +EnumType::EnumType(const H5Location& loc, const char *type_name) : DataType() +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: EnumType overloaded constructor +///\brief Creates an EnumType instance by opening an HDF5 enum datatype +/// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: Enum datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openEnumType(const H5std_string&) +// to improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +EnumType::EnumType(const H5Location& loc, const H5std_string& type_name) : DataType() +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: EnumType::decode +///\brief Returns an EnumType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* EnumType::decode() const +{ + hid_t encoded_enumtype_id = H5I_INVALID_HID; + try { + encoded_enumtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + EnumType *encoded_enumtype = new EnumType; + encoded_enumtype->p_setId(encoded_enumtype_id); + return(encoded_enumtype); +} + +//-------------------------------------------------------------------------- // Function: EnumType::insert ///\brief Inserts a new member to this enumeration datatype. ///\param name - IN: Name of the new member diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 5cbe262..745c09b 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -34,6 +34,14 @@ class H5_DLLCPP EnumType : public DataType { // Creates a new enum datatype based on an integer datatype EnumType(const IntType& data_type); // H5Tenum_create + // Constructors that open an enum datatype, given a location. + EnumType(const H5Location& loc, const char* name); + EnumType(const H5Location& loc, const H5std_string& name); + + // Returns an EnumType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Returns the number of members in this enumeration datatype. int getNmembers () const; diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 0abf52a..05284f9 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -87,6 +87,65 @@ FloatType::FloatType(const DataSet& dataset) : AtomType() } //-------------------------------------------------------------------------- +// Function: FloatType overloaded constructor +///\brief Creates an FloatType instance by opening an HDF5 float datatype +/// given its name, provided as a C character string. +///\param loc - IN: Location of the type +///\param type_name - IN: Float type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openFloatType(const char*) +// to improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +FloatType::FloatType(const H5Location& loc, const char *type_name) : AtomType() +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: FloatType overloaded constructor +///\brief Creates an FloatType instance by opening an HDF5 float datatype +/// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: Float type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openFloatType(const H5std_string&) +// to improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +FloatType::FloatType(const H5Location& loc, const H5std_string& type_name) : AtomType() +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: FloatType::decode +///\brief Returns an FloatType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* FloatType::decode() const +{ + hid_t encoded_flttype_id = H5I_INVALID_HID; + try { + encoded_flttype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + FloatType *encoded_flttype = new FloatType; + encoded_flttype->p_setId(encoded_flttype_id); + return(encoded_flttype); +} + +//-------------------------------------------------------------------------- // Function: FloatType::getFields ///\brief Retrieves floating point datatype bit field information. ///\param spos - OUT: Retrieved floating-point sign bit diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index d0256e1..d26df5c 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -30,6 +30,14 @@ class H5_DLLCPP FloatType : public AtomType { // Gets the floating-point datatype of the specified dataset. FloatType(const DataSet& dataset); + // Constructors that open an HDF5 float datatype, given a location. + FloatType(const H5Location& loc, const char* name); + FloatType(const H5Location& loc, const H5std_string& name); + + // Returns an FloatType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Retrieves the exponent bias of a floating-point type. size_t getEbias() const; diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 7d48314..6af2dc2 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -86,6 +86,65 @@ IntType::IntType(const DataSet& dataset) : AtomType() } //-------------------------------------------------------------------------- +// Function: IntType overloaded constructor +///\brief Creates a IntType instance by opening an HDF5 integer datatype +/// given its name as a char*. +///\param loc - IN: Location of the type +///\param type_name - IN: Integer type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openIntType(const char*) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +IntType::IntType(const H5Location& loc, const char *type_name) : AtomType() +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: IntType overloaded constructor +///\brief Creates a IntType instance by opening an HDF5 integer datatype +/// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: Integer type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openIntType(const H5std_string&) +// to improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +IntType::IntType(const H5Location& loc, const H5std_string& type_name) : AtomType() +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: IntType::decode +///\brief Returns an IntType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* IntType::decode() const +{ + hid_t encoded_inttype_id = H5I_INVALID_HID; + try { + encoded_inttype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + IntType *encoded_inttype = new IntType; + encoded_inttype->p_setId(encoded_inttype_id); + return(encoded_inttype); +} + +//-------------------------------------------------------------------------- // Function: IntType::getSign ///\brief Retrieves the sign type for an integer type. ///\return Valid sign type diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index 5602b32..3e10111 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -32,6 +32,14 @@ class H5_DLLCPP IntType : public AtomType { // Gets the integer datatype of the specified dataset IntType(const DataSet& dataset); + // Constructors that open an HDF5 integer datatype, given a location. + IntType(const H5Location& loc, const char* name); + IntType(const H5Location& loc, const H5std_string& name); + + // Returns an IntType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Retrieves the sign type for an integer type H5T_sign_t getSign() const; diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index ab09305..4ef5d82 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -338,10 +338,13 @@ void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& new //-------------------------------------------------------------------------- // Function: H5Location::getNumAttrs -///\brief Returns the number of attributes attached to this HDF5 object. +///\brief Deprecated - Returns the number of attributes attached to +/// this HDF5 object. ///\return Number of attributes ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 +// Modification +// - Moved to H5Object in 1.8.20. -BMR //-------------------------------------------------------------------------- int H5Location::getNumAttrs() const { diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index bbeb30f..7a54c2b 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -41,20 +41,6 @@ class UserData4Aiterate { // user data for attribute iteration // Inheritance: IdComponent class H5_DLLCPP H5Location : public IdComponent { public: - // Creates an attribute for the specified object at this location - // PropList is currently not used, so always be default. - virtual Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; - virtual Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; - - // Given its name, opens the attribute that belongs to an object at - // this location. - virtual Attribute openAttribute(const char* name) const; - virtual Attribute openAttribute(const H5std_string& name) const; - - // Given its index, opens the attribute that belongs to an object at - // this location. - virtual Attribute openAttribute(const unsigned int idx) const; - // Checks if a link of a given name exists in this location bool nameExists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; bool nameExists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; @@ -66,7 +52,8 @@ class H5_DLLCPP H5Location : public IdComponent { H5std_string getFileName() const; // Determines the number of attributes at this location. - int getNumAttrs() const; + // - moved to H5Object (1.8.20) + int getNumAttrs() const; // Deprecated #ifndef H5_NO_DEPRECATED_SYMBOLS // Retrieves the type of object that an object reference points to. @@ -78,21 +65,6 @@ class H5_DLLCPP H5Location : public IdComponent { // Note: getRefObjType deprecates getObjType, but getObjType's name is // misleading, so getRefObjType is used in the new function instead. - // Iterate user's function over the attributes at this location. - virtual int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); - - // Checks whether the named attribute exists at this location. - virtual bool attrExists(const char* name) const; - virtual bool attrExists(const H5std_string& name) const; - - // Renames the named attribute to a new name. - virtual void renameAttr(const char* oldname, const char* newname) const; - virtual void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; - - // Removes the named attribute from this location. - virtual void removeAttr(const char* name) const; - virtual void removeAttr(const H5std_string& name) const; - // Returns the object header version of an object unsigned objVersion() const; @@ -140,6 +112,51 @@ class H5_DLLCPP H5Location : public IdComponent { ///\brief Returns an identifier. (pure virtual) virtual hid_t getId() const = 0; +/*************************************************************************** + Notes for H5A wrappers + ====================== + These H5A wrappers are marked "deprecated" in 1.8.19. + They are moved to H5Object to prevent the object id from being + passed in to H5A APIs. +***************************************************************************/ + + // Creates an attribute for the specified object at this location + // PropList is currently not used, so always be default. + // Deprecated + virtual Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + virtual Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const; + + // Given its name, opens the attribute that belongs to an object at + // this location. + // Deprecated + virtual Attribute openAttribute(const char* name) const; + virtual Attribute openAttribute(const H5std_string& name) const; + + // Given its index, opens the attribute that belongs to an object at + // this location. + virtual Attribute openAttribute(const unsigned int idx) const; // Deprecated + + // Iterate user's function over the attributes at this location. + virtual int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, + void* op_data = NULL); // Deprecated + + // Checks whether the named attribute exists at this location. + // Deprecated + virtual bool attrExists(const char* name) const; + virtual bool attrExists(const H5std_string& name) const; + + // Renames the named attribute to a new name. + // Deprecated + virtual void renameAttr(const char* oldname, const char* newname) const; + virtual void renameAttr(const H5std_string& oldname, const H5std_string& newname) const; + + // Removes the named attribute from this location. + // Deprecated + virtual void removeAttr(const char* name) const; + virtual void removeAttr(const H5std_string& name) const; + +/**************************** End of H5A note *******************************/ + protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS // Default constructor, diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index b35206e..8fe8e56 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -29,6 +29,23 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS +// userAttrOpWrpr simply interfaces between the user's function and the +// C library function H5Aiterate2; used to resolve the different prototype +// problem. May be moved to Iterator later. + /* extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, + const H5A_info_t *ainfo, void *op_data) +{ + H5std_string s_attr_name = H5std_string(attr_name); +#ifdef NO_STATIC_CAST + UserData4Aiterate* myData = (UserData4Aiterate *) op_data; +#else + UserData4Aiterate* myData = static_cast (op_data); +#endif + myData->op(*myData->location, s_attr_name, myData->opData); + return 0; +} + */ + //-------------------------------------------------------------------------- // Function: H5Object default constructor (protected) // Programmer Binh-Minh Ribler - 2000 @@ -272,6 +289,25 @@ void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newna // end of Notes for H5A wrappers //-------------------------------------------------------------------------- +// Function: H5Object::getNumAttrs +///\brief Returns the number of attributes attached to this HDF5 object. +///\return Number of attributes +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2000 +// Modification +// - Moved from H5Location in 1.8.20. -BMR Oct, 2017 +//-------------------------------------------------------------------------- +int H5Object::getNumAttrs() const +{ + H5O_info_t oinfo; /* Object info */ + + if(H5Oget_info(getId(), &oinfo) < 0) + throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); + else + return(static_cast(oinfo.num_attrs)); +} + +//-------------------------------------------------------------------------- // Function: getObjName ///\brief Given an id, returns the type of the object. ///\return The name of the object diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 8d9cb45..afeea7d 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -33,6 +33,7 @@ namespace H5 { Apr 2, 2014: Added wrapper getObjName for H5Iget_name -BMR */ // Inheritance: H5Location -> IdComponent + class H5_DLLCPP H5Object : public H5Location { public: // Creates an attribute for the specified object @@ -59,6 +60,9 @@ class H5_DLLCPP H5Object : public H5Location { void removeAttr(const char* name) const; void removeAttr(const H5std_string& name) const; + // Determines the number of attributes belong to this object. + int getNumAttrs() const; + // Gets the name of this HDF5 object, i.e., Group, DataSet, or // DataType. ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; @@ -81,7 +85,7 @@ class H5_DLLCPP H5Object : public H5Location { // removal does not raise any problems in two 1.10 releases. // Creates a copy of an existing object giving the object id - H5Object(const hid_t object_id); + // H5Object(const hid_t object_id); // Copy constructor: makes copy of an H5Object object. // H5Object(const H5Object& original); diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index ef63ccb..00fbe20 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -142,6 +142,65 @@ StrType::StrType(const DataSet& dataset) : AtomType () } //-------------------------------------------------------------------------- +// Function: StrType overloaded constructor +///\brief Creates an StrType instance by opening an HDF5 string datatype +/// given its name, provided as a C character string. +///\param loc - IN: Location of the type +///\param type_name - IN: String type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openStrType(const char*) +// to improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +StrType::StrType(const H5Location& loc, const char *type_name) : AtomType() +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: StrType overloaded constructor +///\brief Creates an StrType instance by opening an HDF5 string datatype +/// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: String type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openStrType(const H5std_string&) +// to improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +StrType::StrType(const H5Location& loc, const H5std_string& type_name) : AtomType() +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: StrType::decode +///\brief Returns an StrType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* StrType::decode() const +{ + hid_t encoded_strtype_id = H5I_INVALID_HID; + try { + encoded_strtype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + StrType *encoded_strtype = new StrType; + encoded_strtype->p_setId(encoded_strtype_id); + return(encoded_strtype); +} + +//-------------------------------------------------------------------------- // Function: StrType::getCset ///\brief Retrieves the character set type of this string datatype. ///\return Character set type, which can be: diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 7ae33ee..24c9ca3 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -36,6 +36,14 @@ class H5_DLLCPP StrType : public AtomType { // Gets the string datatype of the specified dataset StrType(const DataSet& dataset); + // Constructors that open an HDF5 string datatype, given a location. + StrType(const H5Location& loc, const char* name); + StrType(const H5Location& loc, const H5std_string& name); + + // Returns an StrType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + // Retrieves the character set type of this string datatype. H5T_cset_t getCset() const; diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index c3d5e58..8d9e3a1 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -70,6 +70,65 @@ VarLenType::VarLenType(const DataType* base_type) : DataType() } //-------------------------------------------------------------------------- +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType instance by opening an HDF5 variable +/// length datatype given its name, provided as a C char*. +///\param loc - IN: Location of the type +///\param type_name - IN: Variable length type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openVarLenType(const char*) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +VarLenType::VarLenType(const H5Location& loc, const char *type_name) : DataType() +{ + id = p_opentype(loc, type_name); +} + +//-------------------------------------------------------------------------- +// Function: VarLenType overloaded constructor +///\brief Creates an VarLenType instance by opening an HDF5 variable +/// length datatype given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type +///\param type_name - IN: Variable length type name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +// Description +// In 1.8.20, this constructor was introduced and may replace the +// existing function CommonFG::openVarLenType(const H5std_string&) to +// improve usability. +// -BMR, Sept 2017 +//-------------------------------------------------------------------------- +VarLenType::VarLenType(const H5Location& loc, const H5std_string& type_name) : DataType() +{ + id = p_opentype(loc, type_name.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: VarLenType::decode +///\brief Returns an VarLenType object via DataType* by decoding the +/// binary object description of this type. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +DataType* VarLenType::decode() const +{ + hid_t encoded_vltype_id = H5I_INVALID_HID; + try { + encoded_vltype_id = p_decode(); + } + catch (DataTypeIException &err) { + throw; + } + VarLenType *encoded_vltype = new VarLenType; + encoded_vltype->p_setId(encoded_vltype_id); + return(encoded_vltype); +} + +//-------------------------------------------------------------------------- // Function: VarLenType destructor ///\brief Properly terminates access to this datatype. // Programmer Binh-Minh Ribler - May, 2004 diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index 1b93876..a9713ad 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -26,8 +26,19 @@ class H5_DLLCPP VarLenType : public DataType { public: // Constructor that creates a variable-length datatype based // on the specified base type. + VarLenType(const DataType& base_type); + + // Deprecated - will be removed after 1.8.20 VarLenType(const DataType* base_type); + // Constructors that open a variable-length datatype, given a location. + VarLenType(const H5Location& loc, const char* name); + VarLenType(const H5Location& loc, const H5std_string& name); + + // Returns an VarLenType object via DataType* by decoding the + // binary object description of this type. + virtual DataType* decode() const; + ///\brief Returns this class name. virtual H5std_string fromClass () const { return("VarLenType"); } -- cgit v0.12 From d9e13936003eae33f05f38ce62762b460c64839b Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 6 Oct 2017 14:10:20 -0500 Subject: Addition to PR# 697 This test file was missing from the previous commit. --- c++/test/ttypes.cpp | 254 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 235 insertions(+), 19 deletions(-) diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 30504bc..43e85a9 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -81,13 +81,19 @@ typedef enum int_t { INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, INT_OTHER } int_t; +typedef struct { + int a; + float b; + long c; + double d; +} src_typ_t; /*------------------------------------------------------------------------- * Function: test_classes * * Purpose: Test type classes * - * Return: None. + * Return: None * * Programmer: Binh-Minh Ribler (using C version) * January, 2007 @@ -126,9 +132,7 @@ static void test_classes() * * Purpose: Test datatype copy functionality * - * Return: Success: 0 - * - * Failure: number of errors + * Return: None * * Programmer: Binh-Minh Ribler (using C version) * January, 2007 @@ -183,9 +187,7 @@ static void test_copy() * * Purpose: Tests query functions of compound and enumeration types. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: None * * Programmer: Binh-Minh Ribler (use C version) * January, 2007 @@ -200,12 +202,6 @@ const H5std_string EnumT_NAME("Enum_type"); static void test_query() { - typedef struct { - int a; - float b; - long c; - double d; - } src_typ_t; short enum_val; // Output message about test being performed @@ -311,9 +307,7 @@ static void test_query() * * Purpose: Tests transient datatypes. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: None * * Programmer: Binh-Minh Ribler (use C version) * January, 2007 @@ -390,9 +384,7 @@ static void test_transient () * * Purpose: Tests named datatypes. * - * Return: Success: 0 - * - * Failure: number of errors + * Return: None * * Programmer: Binh-Minh Ribler (use C version) * January, 2007 @@ -550,6 +542,229 @@ static void test_named () } // test_named +/*------------------------------------------------------------------------- + * Function: test_encode_decode + * + * Purpose Test datatype encode/decode functionality. + * + * Return None + * + * Programmer Binh-Minh Ribler (using C version) + * October, 2017 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +const H5std_string filename3("encode_decode.h5"); +const int ARRAY1_RANK = 1; +const int ARRAY1_DIM = 10; +static void test_encode_decode() +{ + short enum_val; + + SUBTEST("DataType::encode() and DataType::decode()"); + try { + // Create the file. + H5File file(filename3, H5F_ACC_TRUNC); + + // + // Test with CompType + // + + // Create a compound datatype + CompType cmptyp(sizeof(src_typ_t)); + + cmptyp.insertMember("a", HOFFSET(src_typ_t, a), PredType::NATIVE_INT); + cmptyp.insertMember("b", HOFFSET(src_typ_t, b), PredType::NATIVE_FLOAT); + cmptyp.insertMember("c", HOFFSET(src_typ_t, c), PredType::NATIVE_LONG); + cmptyp.insertMember("d", HOFFSET(src_typ_t, d), PredType::NATIVE_DOUBLE); + + // Encode compound type in its buffer + cmptyp.encode(); + + // Verify that encoding had been done + verify_val(cmptyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode compound type's buffer to a new CompType + CompType* decoded_cmp_ptr(static_cast(cmptyp.decode())); + + // Verify that the datatype was copied exactly via encoding/decoding + verify_val(cmptyp == *decoded_cmp_ptr, true, "DataType::decode", __LINE__, __FILE__); + + // Verify again via querying member number and member index by name. + verify_val(decoded_cmp_ptr->getNmembers(), 4, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_cmp_ptr->getMemberIndex("c"), 2, "DataType::decode", __LINE__, __FILE__); + + // Create a CompType instance from the pointer and verify it + CompType cmptyp_clone(*decoded_cmp_ptr); + verify_val(cmptyp == cmptyp_clone, true, "DataType::decode", __LINE__, __FILE__); + verify_val(cmptyp_clone.getNmembers(), 4, "DataType::decode", __LINE__, __FILE__); + verify_val(cmptyp_clone.getMemberIndex("c"), 2, "DataType::decode", __LINE__, __FILE__); + + delete decoded_cmp_ptr; + + // + // Test with EnumType + // + + // Create a enumerate datatype + EnumType enumtyp(sizeof(short)); + + enumtyp.insert("RED", (enum_val=0,&enum_val)); + enumtyp.insert("GREEN", (enum_val=1,&enum_val)); + enumtyp.insert("BLUE", (enum_val=2,&enum_val)); + enumtyp.insert("ORANGE", (enum_val=3,&enum_val)); + enumtyp.insert("YELLOW", (enum_val=4,&enum_val)); + + // Encode compound type in a buffer + enumtyp.encode(); + + // Verify that encoding had been done + verify_val(enumtyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode enumeration type's buffer to a new EnumType + EnumType* decoded_enum_ptr(static_cast(enumtyp.decode())); + + // Verify that the datatype was copied exactly via encoding/decoding + verify_val(enumtyp == *decoded_enum_ptr, true, "DataType::decode", __LINE__, __FILE__); + + // Verify again via querying member number and member index by name. + verify_val(decoded_enum_ptr->getNmembers(), 5, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_enum_ptr->getMemberIndex("GREEN"), 1, "DataType::decode", __LINE__, __FILE__); + + // Create a EnumType instance from the pointer and verify it + EnumType enumtyp_clone(*decoded_enum_ptr); + verify_val(enumtyp == enumtyp_clone, true, "DataType::decode", __LINE__, __FILE__); + verify_val(enumtyp_clone.getNmembers(), 5, "DataType::decode", __LINE__, __FILE__); + verify_val(enumtyp_clone.getMemberIndex("GREEN"), 1, "DataType::decode", __LINE__, __FILE__); + + delete decoded_enum_ptr; + + // + // Test with variable-length string + // + + // Create a variable-length string type + StrType vlsttyp(PredType::C_S1); + vlsttyp.setSize(H5T_VARIABLE); + + // Encode the variable-length type in its buffer + vlsttyp.encode(); + + // Verify that encoding had been done + verify_val(vlsttyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode the variable-length type's buffer to a new StrType + StrType* decoded_str_ptr(static_cast(vlsttyp.decode())); + + verify_val(vlsttyp == *decoded_str_ptr, true, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_str_ptr->isVariableStr(), true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_str_ptr; + + // Test decoding the type by way of DataType* + + // Decode variable-length string type to a new DataType + DataType* decoded_vlstr_ptr(vlsttyp.decode()); + + // Create a StrType instance from the DataType object and verify it + StrType decoded_vlsttyp(decoded_vlstr_ptr->getId()); + verify_val(vlsttyp == decoded_vlsttyp, true, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_vlsttyp.isVariableStr(), true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_vlstr_ptr; + + // + // Test with ArrayType + // + + hsize_t tdims1[] = {ARRAY1_DIM}; + + // Create an array datatype of the compound datatype + ArrayType arrtyp(cmptyp, ARRAY1_RANK, tdims1); + + // Encode the array type in its buffer + arrtyp.encode(); + + // Verify that encoding had been done + verify_val(arrtyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Create an ArrayType instance from the decoded pointer and verify it + ArrayType* decoded_arr_ptr(static_cast(arrtyp.decode())); + + verify_val(arrtyp == *decoded_arr_ptr, true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_arr_ptr; + + // Test decoding the type by way of DataType* + + // Decode the array type's buffer + DataType *decoded_dt_ptr = arrtyp.decode(); + + // Create a ArrayType instance from the decoded pointer and verify it + ArrayType decoded_arrtyp(decoded_dt_ptr->getId()); + verify_val(arrtyp == decoded_arrtyp, true, "DataType::decode", __LINE__, __FILE__); + verify_val(decoded_arrtyp.getArrayNDims(), ARRAY1_RANK, "DataType::decode", __LINE__, __FILE__); + + delete decoded_dt_ptr; + + // + // Test with IntType + // + + // Create an int datatype + IntType inttyp(PredType::NATIVE_UINT); + + // Encode the array type in its buffer + inttyp.encode(); + + // Verify that encoding had been done + verify_val(inttyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Create an IntType instance from the decoded pointer and verify it + IntType* decoded_int_ptr(static_cast(inttyp.decode())); + H5T_sign_t int_sign = decoded_int_ptr->getSign(); + verify_val(int_sign, H5T_SGN_NONE, "DataType::decode", __LINE__, __FILE__); + verify_val(inttyp == *decoded_int_ptr, true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_int_ptr; + + // + // Test decoding FloatType by way of DataType* + // + + // Create a float datatype + FloatType flttyp(PredType::NATIVE_FLOAT); + + // Encode the float type in its buffer + flttyp.encode(); + + // Verify that encoding had been done + verify_val(flttyp.hasBinaryDesc(), true, "DataType::encode", __LINE__, __FILE__); + + // Decode the array type's buffer + DataType* decoded_flt_ptr(flttyp.decode()); + + // Create a IntType instance from the decoded pointer and verify it + FloatType decoded_flttyp(decoded_flt_ptr->getId()); + verify_val(flttyp == decoded_flttyp, true, "DataType::decode", __LINE__, __FILE__); + + H5std_string norm_string; + H5T_norm_t mant_norm = decoded_flttyp.getNorm(norm_string); + //verify_val(decoded_flttyp.isVariableStr(), true, "DataType::decode", __LINE__, __FILE__); + + delete decoded_flt_ptr; + + PASSED(); + } + catch (Exception& E) + { + issue_fail_msg("test_encode_decode", __LINE__, __FILE__, E.getCDetailMsg()); + } +} + + /**************************************************************** ** ** test_types(): Main datatypes testing routine. @@ -567,6 +782,7 @@ void test_types() test_query(); test_transient(); test_named(); + test_encode_decode(); } // test_types() -- cgit v0.12 From a757999b6aeba88314b9a967ff7167ab38f685ae Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 8 Oct 2017 21:40:52 -0500 Subject: Snapshot version 1.8 release 20 (snap6) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- hl/src/H5LTparse.c | 144 +++++++++++++++++----------------- hl/src/H5LTparse.h | 4 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 +- 8 files changed, 81 insertions(+), 81 deletions(-) diff --git a/README.txt b/README.txt index 3cc088b..d7d4ec0 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap6 currently under development +HDF5 version 1.8.20-snap7 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 77e5fef..3c4c609 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap6, currently under development" +PROJECT_NUMBER = "1.8.20-snap7, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 8999949..00fd386 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap6") +set (CTEST_SOURCE_VERSEXT "-snap7") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index abfbb38..2c758c8 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap6], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap7], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 16a0bcf..2a0f267 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1792 of yacc.c */ +/* Line 1807 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 7481a45..2af0172 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2058 of yacc.c */ +/* Line 2065 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 93fac38..47317a4 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap6 currently under development +HDF5 version 1.8.20-snap7 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 05e5165..67663c7 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap6" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap7" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap6" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap7" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 247f753b833390b59e465312a60295ca9351c395 Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 11 Oct 2017 13:18:34 -0500 Subject: Configure file with snap number change for last snapshot was not checked in by automation script. --- configure | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 1f6b4da..f2619d0 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap6. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap7. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-snap6' -PACKAGE_STRING='HDF5 1.8.20-snap6' +PACKAGE_VERSION='1.8.20-snap7' +PACKAGE_STRING='HDF5 1.8.20-snap7' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,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.8.20-snap6 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-snap7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-snap6:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-snap7:";; esac cat <<\_ACEOF @@ -1745,7 +1745,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-snap6 +HDF5 configure 1.8.20-snap7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2682,7 +2682,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.8.20-snap6, which was +It was created by HDF5 $as_me 1.8.20-snap7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3553,7 +3553,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-snap6' + VERSION='1.8.20-snap7' cat >>confdefs.h <<_ACEOF @@ -29313,7 +29313,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-snap6 +HDF5 config.lt 1.8.20-snap7 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31373,7 +31373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-snap6, which was +This file was extended by HDF5 $as_me 1.8.20-snap7, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31439,7 +31439,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-snap6 +HDF5 config.status 1.8.20-snap7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -- cgit v0.12 From fbc86cfb3d503d7e7091c4cc58bd72aa9a97aac7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 11 Oct 2017 15:11:39 -0500 Subject: HDFFV-10297 merge from develop Also cleaned up some other non-merged changes --- MANIFEST | 13 +- release_docs/RELEASE.txt | 23 + src/H5Pocpl.c | 10 - src/H5Z.c | 20 +- tools/h5copy/CMakeTests.cmake | 20 +- tools/h5diff/CMakeLists.txt | 50 +- tools/h5diff/CMakeTests.cmake | 70 +- tools/h5dump/CMakeTests.cmake | 89 +- tools/h5dump/CMakeTestsPBITS.cmake | 10 + tools/h5dump/CMakeTestsXML.cmake | 26 +- tools/h5dump/h5dumpgentest.c | 4 +- tools/h5import/CMakeTests.cmake | 131 +- tools/h5import/h5import.c | 982 ++++++++++++-- tools/h5import/h5import.h | 8 +- tools/h5import/h5importtest.c | 132 +- tools/h5import/h5importtestutil.sh.in | 146 +- tools/h5import/testfiles/binuin32.conf | 12 - tools/h5import/testfiles/tall_fp32.ddl | 28 + tools/h5import/testfiles/tall_i32.ddl | 32 + tools/h5import/testfiles/tintsattrs_u32.ddl | 28 + tools/h5jam/CMakeTests.cmake | 28 +- tools/h5jam/h5jamgentest.c | 2 - tools/h5jam/h5unjam.c | 6 +- tools/h5jam/tellub.c | 6 - tools/h5jam/testh5jam.sh.in | 2 +- tools/h5ls/CMakeTests.cmake | 15 +- tools/h5ls/h5ls.c | 1 - tools/h5ls/h5ls_plugin.sh.in | 16 +- tools/h5repack/CMakeTests.cmake | 683 ++++++---- tools/h5repack/h5repack.c | 339 ++--- tools/h5repack/h5repack.h | 100 +- tools/h5repack/h5repack_copy.c | 267 ++-- tools/h5repack/h5repack_filters.c | 306 +++-- tools/h5repack/h5repack_main.c | 31 +- tools/h5repack/h5repack_opttable.c | 194 ++- tools/h5repack/h5repack_parse.c | 13 +- tools/h5repack/h5repack_refs.c | 259 ++-- tools/h5repack/h5repack_verify.c | 269 ++-- tools/h5repack/h5repacktst.c | 1419 ++++++++++---------- .../testfiles/deflate_limit.h5repack_layout.h5.ddl | 4 +- .../h5repack_filters.h5-gzip_verbose_filters.tst | 5 +- tools/h5repack/testfiles/h5repack_filters.h5.tst | 13 - ...h5repack_layout.h5-dset2_chunk_20x10-errstk.tst | 38 + .../testfiles/h5repack_layout.h5-plugin_test.ddl | 2 +- .../h5repack_layout.h5-plugin_version_test.ddl | 2 +- .../testfiles/h5repack_layout.h5-plugin_zero.ddl | 135 ++ .../testfiles/h5repack_layout.h5-plugin_zero.tst | 9 - tools/h5repack/testfiles/h5repack_none.h5 | Bin 0 -> 1808 bytes .../plugin_none.h5repack_layout.UD.h5.tst | 5 +- .../testfiles/plugin_test.h5repack_layout.h5.tst | 5 +- .../plugin_version_test.h5repack_layout.h5.tst | 5 +- .../testfiles/plugin_zero.h5repack_layout.h5.tst | 22 + tools/h5stat/CMakeTests.cmake | 144 +- tools/h5stat/h5stat.c | 2 - tools/h5stat/h5stat_gentest.c | 2 +- tools/lib/h5diff_attr.c | 8 +- tools/lib/h5diff_dset.c | 105 +- tools/lib/h5tools_dump.c | 138 +- tools/lib/h5tools_error.h | 16 +- tools/lib/h5tools_filters.c | 207 ++- tools/lib/h5tools_ref.c | 3 +- tools/lib/h5tools_str.c | 10 +- tools/lib/io_timer.c | 10 +- tools/misc/h5mkgrp.c | 2 - tools/misc/h5repart.c | 17 - tools/misc/repart_test.c | 94 +- tools/misc/talign.c | 3 - tools/misc/testh5repart.sh.in | 97 +- tools/perform/CMakeTests.cmake | 129 +- 69 files changed, 4227 insertions(+), 2795 deletions(-) delete mode 100644 tools/h5import/testfiles/binuin32.conf create mode 100644 tools/h5import/testfiles/tall_fp32.ddl create mode 100644 tools/h5import/testfiles/tall_i32.ddl create mode 100644 tools/h5import/testfiles/tintsattrs_u32.ddl delete mode 100644 tools/h5repack/testfiles/h5repack_filters.h5.tst create mode 100644 tools/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst create mode 100644 tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl delete mode 100644 tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst create mode 100644 tools/h5repack/testfiles/h5repack_none.h5 create mode 100644 tools/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst diff --git a/MANIFEST b/MANIFEST index 3f8725e..e40cb73 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1038,7 +1038,6 @@ ./tools/h5dump/testh5dumpxml.sh.in ./tools/h5dump/binread.c - ./tools/h5import/Makefile.am ./tools/h5import/Makefile.in ./tools/h5import/h5import.h @@ -1047,20 +1046,16 @@ ./tools/h5import/h5importtestutil.sh.in # testfiles for h5import -./tools/h5import/testfiles/binfp64.conf ./tools/h5import/testfiles/binfp64.h5 -./tools/h5import/testfiles/binin16.conf ./tools/h5import/testfiles/binin16.h5 -./tools/h5import/testfiles/binin32.conf ./tools/h5import/testfiles/binin32.h5 -./tools/h5import/testfiles/binin8.conf ./tools/h5import/testfiles/binin8.h5 -./tools/h5import/testfiles/binin8w.conf ./tools/h5import/testfiles/binin8w.h5 -./tools/h5import/testfiles/binuin16.conf ./tools/h5import/testfiles/binuin16.h5 -./tools/h5import/testfiles/binuin32.conf ./tools/h5import/testfiles/binuin32.h5 +./tools/h5import/testfiles/tall_fp32.ddl +./tools/h5import/testfiles/tall_i32.ddl +./tools/h5import/testfiles/tintsattrs_u32.ddl ./tools/h5import/testfiles/textpfe.conf ./tools/h5import/testfiles/textpfe.h5 ./tools/h5import/testfiles/textpfe64.txt @@ -2066,6 +2061,7 @@ ./tools/h5repack/testfiles/h5repack_nested_8bit_enum_deflated.h5 ./tools/h5repack/testfiles/h5repack_nested_8bit_enum.h5 ./tools/h5repack/testfiles/h5repack_nbit.h5 +./tools/h5repack/testfiles/h5repack_none.h5 ./tools/h5repack/testfiles/h5repack_objs.h5 ./tools/h5repack/testfiles/h5repack_refs.h5 ./tools/h5repack/testfiles/h5repack_shuffle.h5 @@ -2076,6 +2072,7 @@ ./tools/h5repack/testfiles/deflate_limit.h5repack_layout.h5.ddl ./tools/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst ./tools/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst +./tools/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst ./tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst ./tools/h5repack/testfiles/h5repack-help.txt ./tools/h5repack/testfiles/h5repack_filters.h5.tst diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 47317a4..386e0a3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -130,6 +130,17 @@ Bug Fixes since HDF5-1.8.19 Library ------- + - H5Zfilter_avail in H5Z.c + + The public function checked for plugins, while the private + function did not. + + Modified H5Zfilter_avail and private function, H5Z_filter_avail. + Moved check for plugin from public to private function. Updated + H5P__set_filter due to change in H5Z_filter_avail. Updated tests. + + (ADB - 2017/10/10, HDFFV-10297) + - Fix H5HL_offset_into() (1) Fix H5HL_offset_into() to return error when offset exceeds heap data @@ -154,6 +165,18 @@ Bug Fixes since HDF5-1.8.19 ----- - h5repack + h5repack failed to copy a dataset with existing filter. + + Reworked code for h5repack and h5diff code in tools library. Added + improved error handling, cleanup of resources and checks of calls. + Modified H5Zfilter_avail and private function, H5Z_filter_avail. + Moved check for plugin from public to private function. Updated + H5P__set_filter due to change in H5Z_filter_avail. Updated tests. + + (ADB - 2017/10/10, HDFFV-10297) + + - h5repack + h5repack always set the User Defined filter flag to H5Z_FLAG_MANDATORY. Added another parameter to the 'UD=' option to set the flag by default diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index b2fe4d1..5db1788 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -807,16 +807,6 @@ H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, if((filter_avail = H5Z_filter_avail(filter)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't check filter availability") - /* If filter is not available, try to dynamically load it */ - if(!filter_avail) { - const H5Z_class2_t *filter_info; - - if(NULL == (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter))) - HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin") - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register dynamic filter") - } /* end if */ - /* Get the pipeline property to append to */ if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") diff --git a/src/H5Z.c b/src/H5Z.c index 1223556..0579c62 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -653,15 +653,9 @@ H5Zfilter_avail(H5Z_filter_t id) /* Check args */ if(id<0 || id>H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - - if((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") - else if(ret_value == FALSE) { - const H5Z_class2_t *filter_info; - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) - ret_value = TRUE; - } /* end if */ + if((ret_value = H5Z_filter_avail(id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -684,15 +678,21 @@ htri_t H5Z_filter_avail(H5Z_filter_t id) { size_t i; /* Local index variable */ + const H5Z_class2_t *filter_info; htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == id) - HGOTO_DONE(TRUE) + if(H5Z_table_g[i].id == id) + HGOTO_DONE(TRUE) + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE(TRUE) + } done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_filter_avail() */ diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index 99bccff..b255f3c 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -71,13 +71,13 @@ endif () # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_F-${testname}-DIFF COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -107,13 +107,13 @@ endif () # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -157,13 +157,13 @@ ) set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -198,13 +198,13 @@ ) set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test - if (NOT ${resultcode} STREQUAL "2") + if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () @@ -218,7 +218,7 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -231,6 +231,8 @@ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + ./testfiles/${testname}.out.out + ./testfiles/${testname}.out.out.err ) add_test ( NAME H5COPY-CMP-${testname} diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 41897da..d26c742 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -64,30 +64,32 @@ if (BUILD_TESTING) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) - - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/plugins/$" - ) + if (BUILD_SHARED_LIBS) + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) + TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) + + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) + endif () include (CMakeTests.cmake) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 4570e95..caf1298 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -331,13 +331,24 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DIFF-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -350,6 +361,7 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS H5DIFF-${resultfile}-clear-objects) endif () if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) @@ -361,13 +373,24 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF_ERR-${resultfile} COMMAND $ --enable-error-stack ${ARGN}) set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DIFF_ERR-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}_ERR.out + testfiles/${resultfile}_ERR.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DIFF_ERR-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5DIFF_ERR-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -381,9 +404,7 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS H5DIFF_ERR-${resultfile}-clear-objects) endif () set (last_test "H5DIFF_ERR-${resultfile}") endmacro () @@ -393,13 +414,24 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME PH5DIFF-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + PAR/testfiles/${resultfile}.out + PAR/testfiles/${resultfile}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (PH5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -415,9 +447,7 @@ -D "TEST_SORT_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS PH5DIFF-${resultfile}-clear-objects) set (last_test "PH5DIFF-${resultfile}") endif () endmacro () @@ -426,17 +456,17 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5DIFF_UD-${testname}-clearall-objects + NAME H5DIFF_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/${resultfile}.out testfiles/${resultfile}.out.err ) - if (${resultcode} STREQUAL "2") + if ("${resultcode}" STREQUAL "2") add_test ( NAME H5DIFF_UD-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -451,7 +481,7 @@ add_test ( NAME H5DIFF_UD-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" @@ -463,7 +493,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects) + set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clear-objects) endif () endmacro () @@ -477,11 +507,11 @@ testfiles/${resultfile}_ERR.out testfiles/${resultfile}_ERR.out.err ) - if (${resultcode} STREQUAL "2") + if ("${resultcode}" STREQUAL "2") add_test ( NAME H5DIFF_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}_ERR.out" @@ -497,7 +527,7 @@ add_test ( NAME H5DIFF_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" + -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}_ERR.out" @@ -1554,8 +1584,10 @@ ADD_H5_TEST (h5diff_801 1 -v ${FILE7} ${FILE8A} /g1/array /g1/array) ############################################################################## ### P L U G I N T E S T S ############################################################################## -ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) -ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) +if (BUILD_SHARED_LIBS) + ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5) + ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5) +endif () # ############################################################################## # # END diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index d930edd..ec1e7e3 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -405,8 +405,19 @@ endif () set (last_test "H5DUMP-${testname}") else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/std/h5dump-${testname}.out + testfiles/std/h5dump-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( - NAME H5DUMP-h5dump-${testname} + NAME H5DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" @@ -416,11 +427,12 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS H5DUMP-${testname}-clear-objects) endif () endmacro () macro (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) - if (${testtype} STREQUAL "SKIP") + if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-${skipresultfile}-SKIPPED @@ -437,7 +449,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -447,7 +459,10 @@ add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.bin + -E remove + ${resultfile}.bin + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -470,7 +485,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -480,7 +495,10 @@ add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}-N.bin + -E remove + ${resultfile}-N.bin + ${resultfile}-N.out + ${resultfile}-N.out.err ) set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -503,7 +521,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -513,7 +531,10 @@ add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.txt + -E remove + ${resultfile}.txt + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -543,7 +564,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND $ --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -553,7 +574,11 @@ add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${ddlfile}.txt ${resultfile}.txt + -E remove + ${ddlfile}.txt + ${resultfile}.txt + ${resultfile}.out + ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -611,6 +636,15 @@ macro (ADD_H5_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -623,11 +657,21 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () macro (ADD_H5ERR_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -641,11 +685,21 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -661,6 +715,7 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () @@ -670,7 +725,10 @@ add_test ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.bin ${resultfile}.h5 + -E remove + ${resultfile}.bin + ${resultfile}.h5 + ${conffile}.out ) set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( @@ -698,12 +756,13 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5DUMP_UD-${testname}-clearall-objects + NAME H5DUMP_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - testfiles/std/${resultfile}.out - testfiles/std/${resultfile}.out.err + ${resultfile}.out + ${resultfile}.out.err ) + set_tests_properties (H5DUMP_UD-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP_UD-${testname} COMMAND "${CMAKE_COMMAND}" @@ -717,7 +776,7 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clearall-objects) + set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clear-objects) endif () endmacro () diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index c0a0681..c52d67e 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -131,6 +131,15 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -142,6 +151,7 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects) endif () endmacro () diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 9a3b511..20cd89e 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -161,10 +161,10 @@ ############################################################################## macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) - if (${testtype} STREQUAL "SKIP") + if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5DUMP-XML-${skipresultfile}-SKIPPED + NAME H5DUMP_XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) endif () @@ -175,17 +175,26 @@ macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) - set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - if (NOT ${resultcode} STREQUAL "0") - set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") + add_test (NAME H5DUMP_XML-${resultfile} COMMAND $ --xml ${ARGN}) + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + if (NOT "${resultcode}" STREQUAL "0") + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_xml_test}" STREQUAL "") - set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif () else () + # Remove any output file left over from previous test run add_test ( - NAME H5DUMP-XML-${resultfile} + NAME H5DUMP_XML-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + add_test ( + NAME H5DUMP_XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=--xml;${ARGN}" @@ -195,6 +204,7 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS H5DUMP_XML-${resultfile}-clear-objects) endif () endmacro () diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index f9450cb..f55b3fd 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -10070,7 +10070,6 @@ static void gent_compound_complex2(void) H5Tclose(type); } */ - H5Fclose(file); } @@ -10123,7 +10122,7 @@ static void gent_vlenstr_array(void) if ((type = H5Tarray_create2(array_tid, F83_RANK, arraydim)) >= 0) { if ((dset = H5Dcreate2(file, F83_DATASETNAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) { if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer) < 0) - fprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); + HDfprintf(stderr, "gent_vlenstr_array H5Dwrite failed\n"); H5Dclose(dset); } @@ -10169,7 +10168,6 @@ static void gent_udfilter(void) hid_t dcpl; /* dataset creation property list */ hid_t dsid; /* dataset ID */ hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ hsize_t dims1[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 84d1190..bfe54f9 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -17,13 +17,6 @@ ############################################################################## set (HDF5_REFERENCE_CONF_FILES - binfp64.conf - binin8.conf - binin8w.conf - binin16.conf - binin32.conf - binuin16.conf - binuin32.conf txtfp32.conf txtfp64.conf txtin8.conf @@ -52,6 +45,9 @@ dbinuin16.h5.txt dbinuin32.h5.txt dtxtstr.h5.txt + tall_fp32.ddl + tall_i32.ddl + tintsattrs_u32.ddl ) set (HDF5_REFERENCE_TEST_FILES binfp64.h5 @@ -71,6 +67,10 @@ txtstr.h5 textpfe.h5 ) + set (HDF5_TOOLS_TEST_FILES + tall.h5 + tintsattrs.h5 + ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) @@ -84,6 +84,10 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5import_files") endforeach () + + foreach (h5_file ${HDF5_TOOLS_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5import_files") + endforeach () add_custom_target(h5import_files ALL COMMENT "Copying files needed by h5import tests" DEPENDS ${h5import_files_list}) ############################################################################## @@ -104,6 +108,11 @@ COMMAND ${CMAKE_COMMAND} -E remove ${testfile} + ${testfile}.new + ${testfile}.new.err + ${testfile}.out + ${testfile}.out.err + ${testfile} ) set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) @@ -148,6 +157,12 @@ -E remove d${testfile} d${testfile}.bin + d${testfile}.dmp + d${testfile}.dmp.err + d${testfile}.imp + d${testfile}.imp.err + d${testfile}.dff + d${testfile}.dff.err ) set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) @@ -156,7 +171,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" -D "TEST_EXPECT=0" @@ -207,6 +222,64 @@ endif () endmacro () + macro (ADD_H5_DUMPSUBTEST testname testfile datasetname) + # If using memchecker skip tests + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + d-${testname}.dmp + d-${testname}.dmp.err + d-${testname}.h5 + ${testname}.dmp + ${testname}.dmp.err + ${testname}.imp + ${testname}.imp.err + ${testname}.bin + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testname}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects") + + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testname}.imp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP") + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-CMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-p;d-${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d-${testname}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=testfiles/${testname}.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP") + endif () + endmacro () + macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -386,6 +459,22 @@ dtxtstr.h5.dmp.err dtxtstr.h5.dff dtxtstr.h5.dff.err + tall_fp32.dmp + tall_fp32.dmp.err + tall_fp32.bin + tall_fp32.imp + tall_fp32.imp.err + d-tall_fp32.dmp + d-tall_fp32.dmp.err + d-tall_fp32.h5 + tall_i32.dmp + tall_i32.dmp.err + tall_i32.bin + tall_i32.imp + tall_i32.imp.err + d-tall_i32.dmp + d-tall_i32.dmp.err + d-tall_i32.h5 ) set (last_test "H5IMPORT-clear-objects") endif () @@ -395,12 +484,19 @@ COMMAND ${CMAKE_COMMAND} -E remove binfp64.bin + binfp64.conf binin8.bin + binin8.conf binin8w.bin + binin8w.conf binin16.bin + binin16.conf binin32.bin + binin32.conf binuin16.bin + binuin16.conf binuin32.bin + binuin32.conf ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) @@ -432,7 +528,7 @@ ADD_H5_TEST (ASCII_F64 testfiles/txtfp64.txt testfiles/txtfp64.conf txtfp64.h5) # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " - ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) + ADD_H5_TEST (BINARY_F64 binfp64.bin binfp64.conf binfp64.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) else () @@ -440,7 +536,7 @@ endif () # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " - ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) + ADD_H5_TEST (BINARY_I8 binin8.bin binin8.conf binin8.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) else () @@ -448,19 +544,19 @@ endif () # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " - ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) + ADD_H5_TEST (BINARY_I16 binin16.bin binin16.conf binin16.h5) ADD_H5_DUMPTEST (BINARY_I16 "/int/bin/16-bit" binin16.h5 BINARY) # ----- TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " - ADD_H5_TEST (BINARY_I32 binin32.bin testfiles/binin32.conf binin32.h5) + ADD_H5_TEST (BINARY_I32 binin32.bin binin32.conf binin32.h5) ADD_H5_DUMPTEST (BINARY_I32 "/int/bin/32-bit" binin32.h5 BINARY) # ----- TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " - ADD_H5_TEST (BINARY_UI16 binuin16.bin testfiles/binuin16.conf binuin16.h5) + ADD_H5_TEST (BINARY_UI16 binuin16.bin binuin16.conf binuin16.h5) ADD_H5_DUMPTEST (BINARY_UI16 "/int/buin/16-bit" binuin16.h5 BINARY) # ----- TESTING "BINARY UI32 - rank 3 - Output LE " - ADD_H5_TEST (BINARY_UI32 binuin32.bin testfiles/binuin32.conf binuin32.h5) + ADD_H5_TEST (BINARY_UI32 binuin32.bin binuin32.conf binuin32.h5) ADD_H5_DUMPTEST (BINARY_UI32 "/int/buin/32-bit" binuin32.h5 BINARY) # ----- TESTING "STR" @@ -468,9 +564,14 @@ ADD_H5_DUMPTEST (STR "/mytext/data" txtstr.h5) # ----- TESTING "BINARY I8 CR LF EOF" - ADD_H5_TEST (BINARY_I8_EOF binin8w.bin testfiles/binin8w.conf binin8w.h5) + ADD_H5_TEST (BINARY_I8_EOF binin8w.bin binin8w.conf binin8w.h5) ADD_H5_DUMPTEST (BINARY_I8_EOF "/dataset0" binin8w.h5 BINARY) # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " ADD_H5_TEST (ASCII_F64_R1 testfiles/textpfe64.txt testfiles/textpfe.conf textpfe.h5) + # ----- TESTING "Binary Subset " + ADD_H5_DUMPSUBTEST (tall_fp32 tall.h5 /g2/dset2.2 --start=1,1 --stride=2,3 --count=1,2 --block=1,1) + ADD_H5_DUMPSUBTEST (tall_i32 tall.h5 /g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1) + ADD_H5_DUMPSUBTEST (tintsattrs_u32 tintsattrs.h5 /DU32BITS --start=1,1 --stride=2,3 --count=3,2 --block=1,1) + diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index c71aeef..36a8c21 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -13,10 +13,6 @@ #include "hdf5.h" #include "H5private.h" -#include -#include -#include -#include #include "h5import.h" #include "h5tools.h" #include "h5tools_utils.h" @@ -40,6 +36,7 @@ static int parseDimensions(struct Input *in, char *strm); static int getInputSize(struct Input *in, int ival); static int getInputClass(struct Input *in, char * strm); static int getInputClassType(struct Input *in, char * strm); +static int getInputByteOrder(struct Input *in, FILE *strm); static int InputClassStrToInt(char *temp); static int getRank(struct Input *in, FILE *strm); static int getDimensionSizes(struct Input *in, FILE *strm); @@ -66,6 +63,12 @@ static int allocateUIntegerStorage(struct Input *in); static int validateConfigurationParameters(struct Input *in); static int processStrData(FILE *strm, struct Input *in, hid_t file_id); static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id); +uint16_t swap_uint16(uint16_t val); +int16_t swap_int16(int16_t val); +uint32_t swap_uint32(uint32_t val); +int32_t swap_int32(int32_t val); +int64_t swap_int64(int64_t val); +uint64_t swap_uint64(uint64_t val); int main(int argc, char *argv[]) { @@ -226,7 +229,7 @@ int main(int argc, char *argv[]) if (process(&opt) == -1) goto err; - + for (i = 0; i < opt.fcount; i++) { in = &(opt.infiles[i].in); if (in->sizeOfDimension) @@ -242,7 +245,7 @@ int main(int argc, char *argv[]) } return (EXIT_SUCCESS); -err: +err: (void) HDfprintf(stderr, "%s", err4); for (i = 0; i < opt.fcount; i++) { in = &(opt.infiles[i].in); @@ -450,10 +453,12 @@ static int readIntegerData(FILE *strm, struct Input *in) { H5DT_INT8 *in08; H5DT_INT16 *in16; - H5DT_INT16 temp; + H5DT_INT16 temp16; H5DT_INT32 *in32; + H5DT_INT32 temp32; #ifdef H5_SIZEOF_LONG_LONG H5DT_INT64 *in64; + H5DT_INT64 temp64; char buffer[256]; #endif hsize_t len = 1; @@ -473,11 +478,11 @@ static int readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ in08 = (H5DT_INT8 *) in->data; for (i = 0; i < len; i++, in08++) { - if (fscanf(strm, "%hd", &temp) != 1) { + if (fscanf(strm, "%hd", &temp16) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } - (*in08) = (H5DT_INT8) temp; + (*in08) = (H5DT_INT8) temp16; } break; @@ -488,6 +493,9 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +#ifdef H5DEBUGIMPORT + printf("readIntegerData %d (0x%.8X)\n", *in08, *in08); +#endif } break; @@ -512,10 +520,19 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *) in16, sizeof(H5DT_INT16), 1, strm) != 1) { + if (HDfread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *in16 = swap_int16(temp16); + else +*/ + *in16 = temp16; +#ifdef H5DEBUGIMPORT + printf("readIntegerData %d (0x%.8X)\n", *in16, temp16); +#endif } break; @@ -539,10 +556,19 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *) in32, sizeof(H5DT_INT32), 1, strm) != 1) { + if (HDfread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *in32 = swap_int32(temp32); + else +*/ + *in32 = temp32; +#ifdef H5DEBUGIMPORT + printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); +#endif } break; @@ -568,10 +594,19 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *) in64, sizeof(H5DT_INT64), 1, strm) != 1) { + if (HDfread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *in64 = swap_int64(temp64); + else +*/ + *in64 = temp64; +#ifdef H5DEBUGIMPORT + printf("readIntegerData %d (0x%.8X)\n", *in64, temp64); +#endif } break; @@ -593,10 +628,12 @@ static int readUIntegerData(FILE *strm, struct Input *in) { H5DT_UINT8 *in08; H5DT_UINT16 *in16; - H5DT_UINT16 temp; + H5DT_UINT16 temp16; H5DT_UINT32 *in32; + H5DT_UINT32 temp32; #ifdef H5_SIZEOF_LONG_LONG H5DT_UINT64 *in64; + H5DT_UINT64 temp64; char buffer[256]; #endif hsize_t len = 1; @@ -615,11 +652,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ in08 = (H5DT_UINT8 *) in->data; for (i = 0; i < len; i++, in08++) { - if (fscanf(strm, "%hu", &temp) != 1) { + if (fscanf(strm, "%hu", &temp16) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } - (*in08) = (H5DT_UINT8) temp; + (*in08) = (H5DT_UINT8) temp16; } break; @@ -653,10 +690,19 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *) in16, sizeof(H5DT_UINT16), 1, strm) != 1) { + if (HDfread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *in16 = swap_uint16(temp16); + else +*/ + *in16 = temp16; +#ifdef H5DEBUGIMPORT + printf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16); +#endif } break; @@ -680,10 +726,19 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *) in32, sizeof(H5DT_UINT32), 1, strm) != 1) { + if (HDfread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *in32 = swap_uint32(temp32); + else +*/ + *in32 = temp32; +#ifdef H5DEBUGIMPORT + printf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); +#endif } break; @@ -709,10 +764,19 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *) in64, sizeof(H5DT_UINT64), 1, strm) != 1) { + if (HDfread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *in64 = swap_uint64(temp64); + else +*/ + *in64 = temp64; +#ifdef H5DEBUGIMPORT + printf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64); +#endif } break; @@ -733,12 +797,16 @@ static int readUIntegerData(FILE *strm, struct Input *in) static int readFloatData(FILE *strm, struct Input *in) { H5DT_FLOAT32 *fp32; + uint32_t *bfp32; + uint32_t temp32; H5DT_FLOAT64 *fp64; + uint64_t *bfp64; + uint64_t temp64; hsize_t len = 1; hsize_t i; int j; - const char *err1 = "Unable to get integer value from file.\n"; + const char *err1 = "Unable to get float value from file.\n"; const char *err2 = "Unrecognized input class type.\n"; const char *err3 = "Invalid input size type.\n"; @@ -774,11 +842,21 @@ static int readFloatData(FILE *strm, struct Input *in) break; case 3: /* FP */ - for (i = 0; i < len; i++, fp32++) { - if (HDfread((char *) fp32, sizeof(H5DT_FLOAT32), 1, strm) != 1) { + bfp32 = (uint32_t *) in->data; + for (i = 0; i < len; i++, bfp32++) { + if (HDfread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *bfp32 = swap_uint32(temp32); + else +*/ + *bfp32 = temp32; +#ifdef H5DEBUGIMPORT + printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); +#endif } break; @@ -816,11 +894,21 @@ static int readFloatData(FILE *strm, struct Input *in) break; case 3: /* FP */ - for (i = 0; i < len; i++, fp64++) { - if (HDfread((char *) fp64, sizeof(H5DT_FLOAT64), 1, strm) != 1) { + bfp64 = (uint64_t *) in->data; + for (i = 0; i < len; i++, bfp64++) { + if (HDfread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } +/* + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) + *bfp64 = swap_uint64(temp64); + else +*/ + *bfp64 = temp64; +#ifdef H5DEBUGIMPORT + printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64); +#endif } break; @@ -897,7 +985,7 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) goto out; /* disable error reporting */ - H5E_BEGIN_TRY + H5E_BEGIN_TRY { /* create parent groups */ if (in->path.count > 1) { @@ -1286,7 +1374,7 @@ static int processConfigurationFile(char *infile, struct Input *in) int retval = -1; const char *err1 = "Unable to open the configuration file: %s for reading.\n"; - const char *err2 = "Unknown keyword in configuration file: %s\n"; + const char *err2 = "Unknown keyword: %s in configuration file: %s\n"; const char *err3a = "PATH keyword appears twice in %s.\n"; const char *err3b = "Error in parsing the path information from %s.\n"; const char *err4a = "INPUT-CLASS keyword appears twice in %s.\n"; @@ -1306,6 +1394,9 @@ static int processConfigurationFile(char *infile, struct Input *in) const char *err10b = "Error in retrieving the output architecture from %s.\n"; const char *err11a = "OUTPUT-BYTE-ORDER keyword appears twice in %s.\n"; const char *err11b = "Error in retrieving the output byte order from %s.\n"; + const char *err11c = "INPUT-BYTE-ORDER keyword appears twice in %s.\n"; + const char *err11d = "Error in retrieving the input byte order from %s.\n"; + const char *err11e = "Invalid value for output byte-order.\n"; const char *err12a = "CHUNKED-DIMENSION-SIZES keyword appears twice in %s.\n"; const char *err12b = "CHUNKED-DIMENSION-SIZES cannot appear before DIMENSION-SIZES are provided.\n"; const char *err12c = "Error in retrieving the chunked dimension sizes from %s.\n"; @@ -1321,6 +1412,7 @@ static int processConfigurationFile(char *infile, struct Input *in) const char *err17 = "Configuration parameters are invalid in %s.\n"; const char *err18 = "Unable to get string value.\n"; const char *err19 = "Unable to get integer value.\n"; + const char *err20 = "Unable to get subset values.\n"; /* create vector to map which keywords have been found check vector after each keyword to check for violation @@ -1328,6 +1420,27 @@ static int processConfigurationFile(char *infile, struct Input *in) process the output file according to the options */ + /* Initialize machine endian */ + volatile uint32_t ibyte=0x01234567; + /* 0 for big endian, 1 for little endian. */ + if ((*((uint8_t*)(&ibyte))) == 0x67) { + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err11e); + return (-1); + } + } + else { + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err11e); + return (-1); + } + } + in->inputByteOrder = kindex; +#ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); +#endif + in->inputArchitecture = 0; /* default to NATIVE */ + if ((strm = HDfopen(infile, "r")) == NULL) { (void) HDfprintf(stderr, err1, infile); goto error; @@ -1563,15 +1676,15 @@ static int processConfigurationFile(char *infile, struct Input *in) goto error; } #ifdef H5DEBUGIMPORT - printf("h5dump DATASPACE SIMPLE %d rank\n", in->rank); + printf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank); #endif for (i = 0; i < in->rank; i++) { in->sizeOfDimension[i] = temp_dims[i]; } #ifdef H5DEBUGIMPORT - printf("h5dump DATASPACE SIMPLE dims:", in->rank); + printf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->sizeOfDimension[pndx]); + printf(" %ld", in->sizeOfDimension[pndx]); } printf("\n"); #endif @@ -1644,9 +1757,9 @@ static int processConfigurationFile(char *infile, struct Input *in) } } /* while (get_next_dim) */ #ifdef H5DEBUGIMPORT - printf("h5dump DATASPACE SIMPLE maxdims:", in->rank); + printf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->maxsizeOfDimension[pndx]); + printf(" %ld", in->maxsizeOfDimension[pndx]); } printf("\n"); printf("h5dump DATASPACE SIMPLE get max dim finished\n"); @@ -1731,9 +1844,9 @@ static int processConfigurationFile(char *infile, struct Input *in) } } /* while (get_next_dim) */ #ifdef H5DEBUGIMPORT - printf("h5dump STORAGE_LAYOUT CHUNKED dims:", in->rank); + printf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->sizeOfChunk[pndx]); + printf(" %ld", in->sizeOfChunk[pndx]); } printf("\n"); #endif @@ -1852,6 +1965,151 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("h5dump FILTERS %s found\n", temp); #endif } + else if(!HDstrcmp("SUBSET", key)) { /* reduce dimensions */ + hsize_t temp_dims[MAX_NUM_DIMENSION]; + int get_next_prop = 1; +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET key\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* start bracket */ + (void) HDfprintf(stderr, err20, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* SUBSET keyword */ + (void) HDfprintf(stderr, "%s", err18); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + while (get_next_prop) { + if(!HDstrcmp("COUNT", temp)) { /* COUNT */ + int icount = 0; + if (fscanf(strm, "%s", temp) != 1) { /* start paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if(!HDstrcmp("(", temp)) { /* start paren */ + int get_next_dim = 1; + int i = 0; + + if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */ + (void) HDfprintf(stderr, err16c, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET COUNT [%s] found\n", temp); +#endif + while (get_next_dim) { + char *more = temp; + temp_dims[icount] = HDstrtoull(more, &more, 10); + if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET COUNT %s found\n", temp); +#endif + if(!HDstrcmp(");", temp)) { /* end paren */ + in->rank = ++icount; + in->configOptionVector[RANK] = 1; + get_next_dim = 0; + } + else { /* Dimension */ + icount++; + if (icount > MAX_NUM_DIMENSION) { + (void) HDfprintf(stderr, "Invalid value for rank.\n"); + goto error; + } + } + } /* while (get_next_dim) */ + for (i = 0; i < in->rank; i++) { + in->sizeOfDimension[i] = temp_dims[i]; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET COUNT dims: [%d]", in->rank); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %ld", in->sizeOfDimension[pndx]); + } + printf("\n"); +#endif + in->configOptionVector[DIM] = 1; + } /* if(!HDstrcmp("(", key)) start paren */ + } /* if(!HDstrcmp("COUNT", temp)) COUNT */ + if(!HDstrcmp("BLOCK", temp)) { /* BLOCK */ + int icount = 0; + if (fscanf(strm, "%s", temp) != 1) { /* start paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if(!HDstrcmp("(", temp)) { /* start paren */ + int get_next_dim = 1; + int i = 0; + + if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */ + (void) HDfprintf(stderr, err16c, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET BLOCK [%s] found\n", temp); +#endif + while (get_next_dim) { + char *more = temp; + temp_dims[icount] = HDstrtoull(more, &more, 10); + if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET BLOCK %s found\n", temp); +#endif + if(!HDstrcmp(");", temp)) { /* end paren */ + in->rank = ++icount; + in->configOptionVector[RANK] = 1; + get_next_dim = 0; + } + else { /* Dimension */ + icount++; + if (icount > MAX_NUM_DIMENSION) { + (void) HDfprintf(stderr, "Invalid value for rank.\n"); + goto error; + } + } + } /* while (get_next_dim) */ + for (i = 0; i < in->rank; i++) { + in->sizeOfDimension[i] = in->sizeOfDimension[i] * temp_dims[i]; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET BLOCK dims: [%d]", in->rank); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %ld", in->sizeOfDimension[pndx]); + } + printf("\n"); +#endif + in->configOptionVector[DIM] = 1; + } /* if(!HDstrcmp("(", key)) start paren */ + } /* if(!HDstrcmp("BLOCK", temp)) BLOCK */ + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if(!HDstrcmp("}", temp)) { /* end bracket */ + get_next_prop = 0; + } + } /* while (get_next_prop) */ + } /* else if(!HDstrcmp("SUBSET", key)) */ else if(!HDstrcmp("DATA", key)) { /* FINSHED */ #ifdef H5DEBUGIMPORT printf("h5dump DATA key\n"); @@ -1869,6 +2127,8 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("\n"); printf("h5dump inputClass=%d\n", in->inputClass); printf("h5dump inputSize=%d\n", in->inputSize); + printf("h5dump inputArchitecture=%d\n", in->inputArchitecture); + printf("h5dump inputByteOrder=%d\n", in->inputByteOrder); printf("h5dump rank=%d\n", in->rank); printf("h5dump outputClass=%d\n", in->outputClass); printf("h5dump outputSize=%d\n", in->outputSize); @@ -1877,16 +2137,19 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("h5dump compressionType=%d\n", in->compressionType); printf("h5dump compressionParam=%d\n", in->compressionParam); printf("h5dump externFilename=%s\n", in->externFilename); - printf("h5dump configOptionVector:\n"); - for (pndx = 0; pndx < NUM_KEYS; pndx++) { - printf(" %s=%d\n", keytable[pndx], in->configOptionVector[pndx]); + printf("h5dump sizeOfDimensions:\n"); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %ld\n", in->sizeOfDimension[pndx]); } #endif } else { +#ifdef H5DEBUGIMPORT + printf("original option keyword parsing\n"); +#endif while (scanret == 1) { if ((kindex = mapKeywordToIndex(key)) == -1) { - (void) HDfprintf(stderr, err2, infile); + (void) HDfprintf(stderr, err2, key, infile); goto error; } switch (kindex) { @@ -2121,21 +2384,34 @@ static int processConfigurationFile(char *infile, struct Input *in) in->configOptionVector[EXTEND] = 1; break; + case 14: /* INPUT-BYTE-ORDER */ + if (in->configOptionVector[INPUT_B_ORDER] == 1) { + (void) HDfprintf(stderr, err11c, infile); + goto error; + } + + if (getInputByteOrder(in, strm) == -1) { + (void) HDfprintf(stderr, err11d, infile); + goto error; + } + in->configOptionVector[INPUT_B_ORDER] = 1; + break; + default: break; } scanret = fscanf(strm, "%s", key); } - } - /* - check if keywords obtained are valid - if yes, return 0 else error - */ + /* + check if keywords obtained are valid + if yes, return 0 else error + */ - if (validateConfigurationParameters(in) == -1) { - (void) HDfprintf(stderr, err17, infile); - goto error; + if (validateConfigurationParameters(in) == -1) { + (void) HDfprintf(stderr, err17, infile); + goto error; + } } /* Set success return value */ @@ -2361,7 +2637,7 @@ static int getInputClassType(struct Input *in, char * buffer) int kindex = -1; const char *err1 = "Invalid value for input class.\n"; const char *err2 = "Invalid value for output architecture.\n"; - const char *err3 = "Invalid value for output byte-order.\n"; + const char *err3 = "Invalid value for input byte-order.\n"; if (!HDstrcmp(buffer, "H5T_STD_I8BE")) { in->inputSize = 8; @@ -2378,6 +2654,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2396,6 +2675,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2414,6 +2696,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2432,6 +2717,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2450,6 +2738,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2468,6 +2759,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2486,6 +2780,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2504,6 +2801,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2522,6 +2822,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2540,6 +2843,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2558,6 +2864,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2576,6 +2885,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2594,6 +2906,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2612,6 +2927,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2630,6 +2948,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2648,6 +2969,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2786,6 +3110,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -2804,6 +3131,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -2822,6 +3152,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -2840,6 +3173,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -2913,6 +3249,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -2929,6 +3268,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -2945,6 +3287,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -2961,6 +3306,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -2977,6 +3325,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -2993,6 +3344,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3009,6 +3363,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3025,6 +3382,9 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3062,8 +3422,9 @@ static int getInputClassType(struct Input *in, char * buffer) if (in->configOptionVector[OUTPUT_SIZE] == 0) in->outputSize = in->inputSize; #ifdef H5DEBUGIMPORT - printf("h5dump DATATYPE STRING %d inputSize\n", in->inputSize); - printf("h5dump DATATYPE STRING %d outputSize\n", in->outputSize); + printf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize); + printf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize); + printf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture); #endif in->inputClass = kindex; @@ -3096,6 +3457,27 @@ static int getInputSize(struct Input *in, int ival) return (-1); } +static int getInputByteOrder(struct Input *in, FILE *strm) +{ + char temp[255]; + int kindex; + const char *err1 = "Unable to get 'string' value.\n"; + const char *err2 = "Invalid value for input byte-order.\n"; + + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + + if ((kindex = OutputByteOrderStrToInt(temp)) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + + in->inputByteOrder = kindex; + return (0); +} + static int getRank(struct Input *in, FILE *strm) { int ival; @@ -3361,6 +3743,7 @@ void setDefaultValues(struct Input *in, int count) in->inputSize = 32; in->outputClass = 1; /* FP */ in->outputSize = 32; + in->inputByteOrder = -1; /* use default */ in->rank = 0; in->path.count = 1; @@ -3382,7 +3765,7 @@ hid_t createOutputDataType(struct Input *in) const char *err1 = "Invalid value for output class.\n"; const char *err2 = "Invalid value for output size.\n"; const char *err3 = "Invalid value for output byte order.\n"; - const char *err4 = "Invalid value for output architecture.\n"; + const char *err4 = "Invalid value for output architecture.\n"; const char *err5 = "STD not supported for float.\n"; const char *err6 = "IEEE not supported for INT.\n"; @@ -3504,9 +3887,9 @@ hid_t createOutputDataType(struct Input *in) } break; - default: - (void) HDfprintf(stderr, "%s", err4); - return (-1); + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); } break; @@ -3589,9 +3972,9 @@ hid_t createOutputDataType(struct Input *in) } break; - default: - (void) HDfprintf(stderr, "%s", err4); - return (-1); + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); } break; @@ -3733,85 +4116,433 @@ hid_t createInputDataType(struct Input *in) { hid_t new_type = (-1); const char *err1 = "Invalid value for input class.\n"; - const char *err2 = "Invalid value for output size.\n"; + const char *err2 = "Invalid value for input size.\n"; + const char *err3 = "Invalid value for input byte order.\n"; + const char *err4 = "Invalid value for output architecture.\n"; + const char *err5 = "STD not supported for float.\n"; + const char *err6 = "IEEE not supported for INT.\n"; - switch (in->inputClass) { - case 0: - case 4: - switch (in->inputSize) { - case 8: - new_type = H5Tcopy(H5T_NATIVE_CHAR); - break; + if (in->h5dumpInput) { + switch (in->inputClass) { + case 4: + switch (in->inputArchitecture) { + case 0: /*NATIVE*/ + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_CHAR); + break; - case 16: - new_type = H5Tcopy(H5T_NATIVE_SHORT); - break; + case 16: + new_type = H5Tcopy(H5T_NATIVE_SHORT); + break; - case 32: - new_type = H5Tcopy(H5T_NATIVE_INT); - break; + case 32: + new_type = H5Tcopy(H5T_NATIVE_INT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_LLONG); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + switch (in->inputByteOrder) { + case -1: /* default */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); + break; + + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 1: /*STD*/ + switch (in->inputSize) { + case 8: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I8BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I8LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 16: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I16BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I16LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 32: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I32BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I32LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; - case 64: - new_type = H5Tcopy(H5T_NATIVE_LLONG); + case 64: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I64BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I64LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); + } break; - default: - (void) HDfprintf(stderr, "%s", err2); - return (-1); - } - break; + case 3: + switch (in->inputArchitecture) { + case 0: + switch (in->inputSize) { + case 32: + new_type = H5Tcopy(H5T_NATIVE_FLOAT); + break; - case 1: - case 2: - case 3: - switch (in->inputSize) { - case 32: - new_type = H5Tcopy(H5T_NATIVE_FLOAT); + case 64: + new_type = H5Tcopy(H5T_NATIVE_DOUBLE); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + switch (in->inputByteOrder) { + case -1: /* DEFAULT */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); + break; + + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 1: + (void) HDfprintf(stderr, "%s", err5); + return (-1); + + case 2: + switch (in->inputSize) { + case 32: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_IEEE_F32BE); + break; + + case 1: + new_type = H5Tcopy(H5T_IEEE_F32LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 64: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_IEEE_F64BE); + break; + + case 1: + new_type = H5Tcopy(H5T_IEEE_F64LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); + } break; - case 64: - new_type = H5Tcopy(H5T_NATIVE_DOUBLE); + case 7: + switch (in->inputArchitecture) { + case 0: + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_UCHAR); + break; + + case 16: + new_type = H5Tcopy(H5T_NATIVE_USHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_UINT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_ULLONG); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + switch (in->inputByteOrder) { + case -1: /* Default */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); + break; + + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 1: + switch (in->inputSize) { + case 8: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U8BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U8LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 16: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U16BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U16LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 32: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U32BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U32LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 64: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U64BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U64LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; + + case 2: + (void) HDfprintf(stderr, "%s", err6); + return (-1); + + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); + } break; default: - (void) HDfprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err1); return (-1); } - break; + } + else { + switch (in->inputClass) { + case 0: + case 4: + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_CHAR); + break; - case 5: - (void) HDfprintf(stderr, "%s", err1); - return (-1); - break; + case 16: + new_type = H5Tcopy(H5T_NATIVE_SHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_INT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_LLONG); + break; - case 6: - case 7: - switch (in->inputSize) { - case 8: - new_type = H5Tcopy(H5T_NATIVE_UCHAR); + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } break; - case 16: - new_type = H5Tcopy(H5T_NATIVE_USHORT); + case 1: + case 2: + case 3: + switch (in->inputSize) { + case 32: + new_type = H5Tcopy(H5T_NATIVE_FLOAT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_DOUBLE); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } break; - case 32: - new_type = H5Tcopy(H5T_NATIVE_UINT); + case 5: + (void) HDfprintf(stderr, "%s", err1); + return (-1); break; - case 64: - new_type = H5Tcopy(H5T_NATIVE_ULLONG); + case 6: + case 7: + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_UCHAR); + break; + + case 16: + new_type = H5Tcopy(H5T_NATIVE_USHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_UINT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_ULLONG); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } break; default: - (void) HDfprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err1); return (-1); } - break; - - default: - (void) HDfprintf(stderr, "%s", err1); - return (-1); } return new_type; } @@ -3900,7 +4631,7 @@ static int process(struct Options *opt) intype = createInputDataType(in); outtype = createOutputDataType(in); #ifdef H5DEBUGIMPORT - printf("process intype %d outtype %d\n", intype, outtype); + printf("process intype %ld outtype %ld\n", intype, outtype); #endif /* create property list */ @@ -3971,6 +4702,42 @@ static int process(struct Options *opt) return (0); } +uint16_t swap_uint16( uint16_t val) +{ + return (val << 8) | (val >> 8); +} + +int16_t swap_int16(int16_t val) +{ + return (val << 8) | ((val >> 8) & 0xFF); +} + +uint32_t swap_uint32(uint32_t val) +{ + val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF); + return (val << 16) | (val >> 16); +} + +int32_t swap_int32(int32_t val) +{ + val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF); + return (val << 16) | ((val >> 16) & 0xFFFF); +} + +int64_t swap_int64(int64_t val) +{ + val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL); + val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL); + return (val << 32) | ((val >> 32) & 0xFFFFFFFFULL); +} + +uint64_t swap_uint64(uint64_t val) +{ + val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL); + val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL); + return (val << 32) | (val >> 32); +} + /* * Name: * help @@ -4163,6 +4930,7 @@ void help(char *name) (void) HDfprintf(stdout, "\t PATH\n"); (void) HDfprintf(stdout, "\t INPUT-CLASS\n"); (void) HDfprintf(stdout, "\t INPUT-SIZE\n"); + (void) HDfprintf(stdout, "\t INPUT-BYTE-ORDER\n"); (void) HDfprintf(stdout, "\t RANK\n"); (void) HDfprintf(stdout, "\t DIMENSION-SIZES\n"); (void) HDfprintf(stdout, "\t OUTPUT-CLASS\n"); diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h index c69a542..c55717d 100644 --- a/tools/h5import/h5import.h +++ b/tools/h5import/h5import.h @@ -37,7 +37,7 @@ #define MAX_GROUPS_IN_PATH 20 #define MAX_PATH_NAME_LENGTH 255 -#define NUM_KEYS 14 +#define NUM_KEYS 15 #define MIN_NUM_DIMENSION 1 #define MAX_NUM_DIMENSION 32 #define BASE_10 10 @@ -56,6 +56,7 @@ #define COMPRESS_PARAM 11 #define EXTERNALSTORE 12 #define EXTEND 13 +#define INPUT_B_ORDER 14 /* data types */ #define H5DT_INT8 signed char @@ -82,6 +83,8 @@ struct Input struct path_info path; int inputClass; int inputSize; + int inputArchitecture; + int inputByteOrder; int rank; hsize_t* sizeOfDimension; int outputClass; @@ -126,7 +129,8 @@ char keytable[NUM_KEYS][30] = { "COMPRESSION-TYPE", "COMPRESSION-PARAM", "EXTERNAL-STORAGE", - "MAXIMUM-DIMENSIONS" + "MAXIMUM-DIMENSIONS", + "INPUT-BYTE-ORDER" }; static int state_table[15][8] = diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 135b8e4..489bc01 100644 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -11,7 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include #include "H5private.h" #ifdef H5_HAVE_WIN32_API @@ -25,7 +24,7 @@ * h5importtest * * Description: - * This program creates that can be + * This program creates files that can be * used to test the h5import program. * */ @@ -36,6 +35,7 @@ main(void) int nrow = 3, ncol = 4, npln = 5; int i, j, k; FILE *sp; + char machine_order[3] = {0, 0, 0}; float row4[3], col4[4], pln4[5]; float rowo4 = 11.0F, colo4 = 21.0F, plno4 = 51.0F; @@ -67,6 +67,14 @@ main(void) double rowo8 = 11.0F, colo8 = 21.0F, plno8 = 51.0F; double rowi8 = 1.0F, coli8 = 2.0F, plni8 = 5.0F; + /* Initialize machine endian */ + volatile uint32_t ibyte=0x01234567; + /* 0 for big endian, 1 for little endian. */ + if ((*((uint8_t*)(&ibyte))) == 0x67) + strncpy(machine_order, "LE", 2); + else + strncpy(machine_order, "BE", 2); + /* * initialize the row, column, and plane vectors @@ -217,7 +225,7 @@ main(void) #endif /*------------------------------------------------------------------------- - * TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5 + * TOOLTEST binin32.bin -c binin32.conf -o binin32.h5 *------------------------------------------------------------------------- */ @@ -234,8 +242,21 @@ main(void) } (void) HDfclose(sp); + sp = HDfopen("binin32.conf", "w"); + (void) fprintf(sp, "PATH /int/bin/32-bit\n"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 32\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); + /*------------------------------------------------------------------------- - * TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5 + * TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5 *------------------------------------------------------------------------- */ @@ -252,11 +273,20 @@ main(void) } (void) HDfclose(sp); - - + sp = HDfopen("binuin32.conf", "w"); + (void) fprintf(sp, "PATH /int/buin/32-bit\n"); + (void) fprintf(sp, "INPUT-CLASS UIN\n"); + (void) fprintf(sp, "INPUT-SIZE 32\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); /*------------------------------------------------------------------------- - * TOOLTEST binin16.bin -c $srcdir/testfiles/binin16.conf -o binin16.h5 + * TOOLTEST binin16.bin -c binin16.conf -o binin16.h5 *------------------------------------------------------------------------- */ @@ -273,8 +303,22 @@ main(void) } (void) HDfclose(sp); + sp = HDfopen("binin16.conf", "w"); + (void) fprintf(sp, "PATH /int/bin/16-bit\n"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 16\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); + /*------------------------------------------------------------------------- - * TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5 + * TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5 *------------------------------------------------------------------------- */ sp = HDfopen("binuin16.bin", OPEN_FLAGS); @@ -290,10 +334,22 @@ main(void) } (void) HDfclose(sp); - + sp = HDfopen("binuin16.conf", "w"); + (void) fprintf(sp, "PATH /int/buin/16-bit\n"); + (void) fprintf(sp, "INPUT-CLASS UIN\n"); + (void) fprintf(sp, "INPUT-SIZE 16\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); /*------------------------------------------------------------------------- - * TOOLTEST binin8.bin -c $srcdir/testfiles/binin8.conf -o binin8.h5 + * TOOLTEST binin8.bin -c binin8.conf -o binin8.h5 *------------------------------------------------------------------------- */ @@ -310,13 +366,27 @@ main(void) } (void) HDfclose(sp); -#endif /* UNICOS */ - - + sp = HDfopen("binin8.conf", "w"); + (void) fprintf(sp, "PATH /int/bin/8-bit\n"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 8\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-CLASS IN\n"); + (void) fprintf(sp, "OUTPUT-SIZE 16\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); + (void) fprintf(sp, "COMPRESSION-PARAM 3\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); +#endif /* UNICOS */ /*------------------------------------------------------------------------- - * TOOLTEST binfp64.bin -c $srcdir/testfiles/binfp64.conf -o binfp64.h5 + * TOOLTEST binfp64.bin -c binfp64.conf -o binfp64.h5 *------------------------------------------------------------------------- */ @@ -337,10 +407,23 @@ main(void) } (void) HDfclose(sp); - + sp = HDfopen("binfp64.conf", "w"); + (void) fprintf(sp, "PATH /fp/bin/64-bit\n"); + (void) fprintf(sp, "INPUT-CLASS FP\n"); + (void) fprintf(sp, "INPUT-SIZE 64\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); + (void) fprintf(sp, "COMPRESSION-PARAM 8\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); /*------------------------------------------------------------------------- - * TOOLTEST binin8w.bin -c $srcdir/testfiles/binin8w.conf -o binin8w.h5 + * TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5 *------------------------------------------------------------------------- */ @@ -357,13 +440,20 @@ main(void) } HDfclose(sp); + sp = HDfopen("binin8w.conf", "w"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 8\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 1\n"); + (void) fprintf(sp, "OUTPUT-CLASS IN\n"); + (void) fprintf(sp, "OUTPUT-SIZE 8\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 4\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); } - - - - - return (EXIT_SUCCESS); } diff --git a/tools/h5import/h5importtestutil.sh.in b/tools/h5import/h5importtestutil.sh.in index b724957..2ad7866 100644 --- a/tools/h5import/h5importtestutil.sh.in +++ b/tools/h5import/h5importtestutil.sh.in @@ -22,6 +22,15 @@ TESTNAME=h5import EXIT_SUCCESS=0 EXIT_FAILURE=1 +DUMPER=../h5dump/h5dump # The tool name +DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary + +H5DIFF=../h5diff/h5diff # The h5diff tool name +H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary + +H5IMPORT=./h5import # The h5import tool name +H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary + RM='rm -rf' CP='cp' DIRNAME='dirname' @@ -74,16 +83,11 @@ $SRC_H5IMPORT_TESTFILES/txtuin16.h5 $SRC_H5IMPORT_TESTFILES/txtuin32.h5 $SRC_H5IMPORT_TESTFILES/txtstr.h5 $SRC_H5IMPORT_TESTFILES/textpfe.h5 +$SRC_TOOLS_TESTFILES/tall.h5 +$SRC_TOOLS_TESTFILES/tintsattrs.h5 " LIST_OTHER_TEST_FILES=" -$SRC_H5IMPORT_TESTFILES/binfp64.conf -$SRC_H5IMPORT_TESTFILES/binin8.conf -$SRC_H5IMPORT_TESTFILES/binin8w.conf -$SRC_H5IMPORT_TESTFILES/binin16.conf -$SRC_H5IMPORT_TESTFILES/binin32.conf -$SRC_H5IMPORT_TESTFILES/binuin16.conf -$SRC_H5IMPORT_TESTFILES/binuin32.conf $SRC_H5IMPORT_TESTFILES/txtfp32.conf $SRC_H5IMPORT_TESTFILES/txtfp64.conf $SRC_H5IMPORT_TESTFILES/txtin8.conf @@ -110,6 +114,9 @@ $SRC_H5IMPORT_TESTFILES/dbinin32.h5.txt $SRC_H5IMPORT_TESTFILES/dbinuin16.h5.txt $SRC_H5IMPORT_TESTFILES/dbinuin32.h5.txt $SRC_H5IMPORT_TESTFILES/dtxtstr.h5.txt +$SRC_H5IMPORT_TESTFILES/tall_fp32.ddl +$SRC_H5IMPORT_TESTFILES/tall_i32.ddl +$SRC_H5IMPORT_TESTFILES/tintsattrs_u32.ddl " # @@ -133,10 +140,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -175,11 +182,11 @@ SKIP() { TOOLTEST() { err=0 -$RUNSERIAL ./h5import $* -$RUNSERIAL ../h5dump/h5dump $5 >log2 +$RUNSERIAL $H5IMPORT_BIN $* +$RUNSERIAL $DUMPER_BIN $5 >log2 cd tmp_testfiles -$RUNSERIAL ../../h5dump/h5dump $5 >log1 +$RUNSERIAL $DUMPER_BIN $5 >log1 cd .. cmp -s tmp_testfiles/log1 log2 || err=1 @@ -197,9 +204,9 @@ fi TOOLTEST2() { err=0 -$RUNSERIAL ../h5dump/h5dump -p -d $1 -o d$2.bin -b tmp_testfiles/$2 > d$2.dmp -$RUNSERIAL ./h5import d$2.bin -c d$2.dmp -o d$2 > d$2.imp -$RUNSERIAL ../h5diff/h5diff -v d$2 tmp_testfiles/$2 $1 $1 > log2 +$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b NATIVE tmp_testfiles/$2 > d$2.dmp +$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp +$RUNSERIAL $H5DIFF_BIN -v d$2 tmp_testfiles/$2 $1 $1 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1 cmp -s log1 log2 || err=1 @@ -218,9 +225,9 @@ fi TOOLTEST3() { err=0 -$RUNSERIAL ../h5dump/h5dump -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp -$RUNSERIAL ./h5import d$2.bin -c d$2.dmp -o d$2 > d$2.imp -$RUNSERIAL ../h5diff/h5diff -v d$2 tmp_testfiles/$2 $1 $1 > log2 +$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp +$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp +$RUNSERIAL $H5DIFF_BIN -v d$2 tmp_testfiles/$2 $1 $1 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1 cmp -s log1 log2 || err=1 @@ -239,9 +246,9 @@ fi TOOLTEST4() { err=0 -$RUNSERIAL ../h5dump/h5dump -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp -$RUNSERIAL ./h5import d$2.bin -c d$2.dmp -o d$2 > d$2.imp -$RUNSERIAL ../h5diff/h5diff -r d$2 tmp_testfiles/$2 $1 $1 > log2 +$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -y --width=1 tmp_testfiles/$2 > d$2.dmp +$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp +$RUNSERIAL $H5DIFF_BIN -r d$2 tmp_testfiles/$2 $1 $1 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1 @@ -255,12 +262,32 @@ else fi } -echo "" +# Same as TOOLTEST2 except for subsets +# Use h5dump output as input to h5import for binary numbers +# Use h5dump to verify results +TOOLTEST5() +{ +err=0 +$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d-$1.bin -b NATIVE tmp_testfiles/$2 > d-$1.dmp +$RUNSERIAL $H5IMPORT_BIN d-$1.bin -c d-$1.dmp -o d-$1.h5 > d-$1.imp +$RUNSERIAL $DUMPER_BIN -p d-$1.h5 > log2 +$CP -f $SRC_H5IMPORT_TESTFILES/$1.ddl log1 + +cmp -s log1 log2 || err=1 +rm -f log1 log2 +if [ $err -eq 1 ]; then +nerrors="` expr $nerrors + 1 `"; + echo "*FAILED*" +else + echo " PASSED" +fi +} + +echo "" echo "==============================" echo "H5IMPORT tests started" echo "==============================" -if [ -f h5import -a -f h5importtest ]; then #echo "** Testing h5import ***" rm -f output.h5 log1 tx* b* *.dat @@ -280,30 +307,30 @@ $RUNSERIAL ./h5importtest TESTING "ASCII I32 rank 3 - Output BE " ; TOOLTEST $TESTDIR/txtin32.txt -c $TESTDIR/txtin32.conf -o txtin32.h5 -TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" +TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin16.conf -o txtin16.h5 -TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " +TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " TOOLTEST $TESTDIR/txtin8.txt -c $TESTDIR/txtin8.conf -o txtin8.h5 -TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " +TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " TOOLTEST $TESTDIR/txtuin16.txt -c $TESTDIR/txtuin16.conf -o txtuin16.h5 -TESTING "ASCII UI32 - rank 3 - Output BE" +TESTING "ASCII UI32 - rank 3 - Output BE" TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5 -TESTING "ASCII F32 - rank 3 - Output LE " +TESTING "ASCII F32 - rank 3 - Output LE " TOOLTEST $TESTDIR/txtfp32.txt -c $TESTDIR/txtfp32.conf -o txtfp32.h5 -TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " +TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " TOOLTEST $TESTDIR/txtfp64.txt -c $TESTDIR/txtfp64.conf -o txtfp64.h5 -TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " -TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o binfp64.h5 -TESTING "H5DUMP-BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " +TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " +TOOLTEST binfp64.bin -c binfp64.conf -o binfp64.h5 +TESTING "H5DUMP-BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " if test $USE_FILTER_DEFLATE != "yes"; then SKIP "/fp/bin/64-bit" binfp64.h5 else @@ -311,58 +338,61 @@ else fi -TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " -TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5 -TESTING "H5DUMP-BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " +TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " +TOOLTEST binin8.bin -c binin8.conf -o binin8.h5 +TESTING "H5DUMP-BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " if test $USE_FILTER_DEFLATE != "yes"; then SKIP "/int/bin/8-bit" binin8.h5 else TOOLTEST2 "/int/bin/8-bit" binin8.h5 fi -TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " -TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5 -TESTING "H5DUMP-BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " +TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " +TOOLTEST binin16.bin -c binin16.conf -o binin16.h5 +TESTING "H5DUMP-BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " TOOLTEST2 "/int/bin/16-bit" binin16.h5 -TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " -TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o binin32.h5 -TESTING "H5DUMP-BINARY I32 - rank 3 - Output BE + CHUNKED " +TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " +TOOLTEST binin32.bin -c binin32.conf -o binin32.h5 +TESTING "H5DUMP-BINARY I32 - rank 3 - Output BE + CHUNKED " TOOLTEST2 "/int/bin/32-bit" binin32.h5 -TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " -TOOLTEST binuin16.bin -c $TESTDIR/binuin16.conf -o binuin16.h5 -TESTING "H5DUMP-BINARY UI16 - rank 3 - Output byte BE + CHUNKED " +TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " +TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5 +TESTING "H5DUMP-BINARY UI16 - rank 3 - Output byte BE + CHUNKED " TOOLTEST2 "/int/buin/16-bit" binuin16.h5 -TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " -TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o binuin32.h5 -TESTING "H5DUMP-BINARY UI32 - rank 3 - Output LE + CHUNKED " +TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " +TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5 +TESTING "H5DUMP-BINARY UI32 - rank 3 - Output LE + CHUNKED " TOOLTEST2 "/int/buin/32-bit" binuin32.h5 -TESTING "STR" +TESTING "STR" TOOLTEST $TESTDIR/txtstr.txt -c $TESTDIR/txtstr.conf -o txtstr.h5 -TESTING "H5DUMP-STR" +TESTING "H5DUMP-STR" TOOLTEST4 "/mytext/data" txtstr.h5 -TESTING "BINARY I8 CR LF EOF" -TOOLTEST binin8w.bin -c $TESTDIR/binin8w.conf -o binin8w.h5 -TESTING "H5DUMP-BINARY I8 CR LF EOF" +TESTING "BINARY I8 CR LF EOF" +TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5 +TESTING "H5DUMP-BINARY I8 CR LF EOF" TOOLTEST2 "/dataset0" binin8w.h5 -TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " +TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5 +TESTING "Binary Subset FP" +TOOLTEST5 tall_fp32 tall.h5 "/g2/dset2.2" "--start=1,1 --stride=2,3 --count=1,2 --block=1,1" +TESTING "Binary Subset INT" +TOOLTEST5 tall_i32 tall.h5 "/g1/g1.1/dset1.1.1" "--start=1,1 --stride=2,3 --count=3,2 --block=1,1" +TESTING "Binary Subset UINT" +TOOLTEST5 tintsattrs_u32 tintsattrs.h5 "/DU32BITS" "--start=1,1 --stride=2,3 --count=3,2 --block=1,1" + -rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.dmp *.imp *.h5 +rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.dmp *.conf *.imp *.h5 rm -rf tmp_testfiles -else - echo "** h5import or h5importtest not available ***" - nerrors="` expr $nerrors + 1 `"; -fi # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR diff --git a/tools/h5import/testfiles/binuin32.conf b/tools/h5import/testfiles/binuin32.conf deleted file mode 100644 index a649e97..0000000 --- a/tools/h5import/testfiles/binuin32.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/buin/32-bit -INPUT-CLASS UIN -INPUT-SIZE 32 -RANK 3 -DIMENSION-SIZES 5 3 4 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER LE - - - - - diff --git a/tools/h5import/testfiles/tall_fp32.ddl b/tools/h5import/testfiles/tall_fp32.ddl new file mode 100644 index 0000000..2a0dc1b --- /dev/null +++ b/tools/h5import/testfiles/tall_fp32.ddl @@ -0,0 +1,28 @@ +HDF5 "d-tall_fp32.h5" { +GROUP "/" { + GROUP "g2" { + DATASET "dset2.2" { + DATATYPE H5T_IEEE_F32BE + DATASPACE SIMPLE { ( 1, 2 ) / ( 1, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 8 + OFFSET 2432 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + (0,0): 0.2, 0.8 + } + } + } +} +} diff --git a/tools/h5import/testfiles/tall_i32.ddl b/tools/h5import/testfiles/tall_i32.ddl new file mode 100644 index 0000000..d9280bc --- /dev/null +++ b/tools/h5import/testfiles/tall_i32.ddl @@ -0,0 +1,32 @@ +HDF5 "d-tall_i32.h5" { +GROUP "/" { + GROUP "g1" { + GROUP "g1.1" { + DATASET "dset1.1.1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3464 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + (0,0): 1, 4, + (1,0): 3, 12, + (2,0): 5, 20 + } + } + } + } +} +} diff --git a/tools/h5import/testfiles/tintsattrs_u32.ddl b/tools/h5import/testfiles/tintsattrs_u32.ddl new file mode 100644 index 0000000..37ef8b9 --- /dev/null +++ b/tools/h5import/testfiles/tintsattrs_u32.ddl @@ -0,0 +1,28 @@ +HDF5 "d-tintsattrs_u32.h5" { +GROUP "/" { + DATASET "DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2144 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + (0,0): 4294967292, 4294967264, + (1,0): 4294967280, 4294967168, + (2,0): 4294967232, 4294966784 + } + } +} +} diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 47276eb..646ae06 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -60,6 +60,13 @@ endif () else () add_test ( + NAME H5JAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -70,6 +77,7 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS "H5JAM-${expectfile}-clear-objects") endif () endmacro () @@ -86,6 +94,13 @@ endif () else () add_test ( + NAME H5JAM-UNJAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -96,6 +111,7 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS "H5JAM-UNJAM-${expectfile}-clear-objects") endif () endmacro () @@ -103,6 +119,16 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( + NAME H5JAM-${testname}-CHECKFILE-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${actual}.new + ${actual}.new.err + ${actual}.out + ${actual}.out.err + ) + set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -114,7 +140,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS ${testdepends}) + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index fa8bd4e..12ea6b8 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -20,8 +20,6 @@ * trying it on a new platform, ...), you need to verify the correctness * of the expected output and update the corresponding *.ddl files. */ -#include -#include #include "hdf5.h" #include "H5private.h" diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 4cc0c70..9c83740 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -274,10 +274,8 @@ main(int argc, const char *argv[]) goto done; } - status = H5Pclose(plist); - HDassert(status >= 0); - status = H5Fclose(ifile); - HDassert(status >= 0); + H5Pclose(plist); + H5Fclose(ifile); if (usize == 0) { /* no user block to remove: message? */ diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index fad14b7..8e4b3ac 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -11,12 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include - -#ifdef H5_HAVE_UNISTD_H -#include -#endif - #include "hdf5.h" #include "H5private.h" #include "h5tools.h" diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index d28db72..187054b 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -603,7 +603,7 @@ CLEANUP taz3.h5 JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 --clobber taz4.h5 CHECKFILE $TESTDIR/tall.h5 taz4.h5 CLEANUP taz4.h5 -JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5 CHECKFILE $TESTDIR/tall.h5 taz5.h5 CLEANUP taz5.h5 diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index a839518..6c9f118 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -127,13 +127,21 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (${resultcode} STREQUAL "1") + if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () + # Remove any output file left over from previous test run + add_test ( + NAME H5LS-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${resultfile}.out + testfiles/${resultfile}.out.err + ) add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -145,6 +153,7 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects) endif () endmacro () @@ -152,7 +161,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5LS_UD-${testname}-clearall-objects + NAME H5LS_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/${resultfile}.out @@ -171,7 +180,7 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clearall-objects) + set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clear-objects) endif () endmacro () diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index e81a8eb..583f8bf 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1757,7 +1757,6 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) size_t cd_nelmts; /* filter client number of values */ size_t cd_num; /* filter client data counter */ char f_name[256]; /* filter/file name */ - char dset_name[256]; /* filter/file name */ char s[64]; /* temporary string buffer */ off_t f_offset; /* offset in external file */ hsize_t f_size; /* bytes used in external file */ diff --git a/tools/h5ls/h5ls_plugin.sh.in b/tools/h5ls/h5ls_plugin.sh.in index d7351c1..5fae0c3 100644 --- a/tools/h5ls/h5ls_plugin.sh.in +++ b/tools/h5ls/h5ls_plugin.sh.in @@ -135,12 +135,26 @@ CLEAN_TESTFILES_AND_TESTDIR() fi } +# Print a $* message left justified in a field of 70 characters +# +MESSAGE() { + SPACES=" " + echo "$* $SPACES" | cut -c1-70 | tr -d '\012' +} + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". # TESTING() { SPACES=" " - echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Verifying". +# +VERIFY() { + MESSAGE "Verifying $*" } # Source in the output filter function definitions. diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index e9315ca..20d0463 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -92,28 +92,49 @@ ) set (LIST_OTHER_TEST_FILES - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack-help.txt - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack.info - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/deflate_limit.h5repack_layout.h5.ddl - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5.ddl - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5.tst - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_test.ddl - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_test.h5repack_layout.h5.tst - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none.ddl - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5.tst - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test.ddl - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5.tst - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero.tst - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/crtorder.tordergr.h5.ddl + h5repack-help.txt + h5repack_ext.bin + h5repack.info + ublock.bin ) - foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + set (LIST_TST_TEST_FILES + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5-gzip_verbose_filters + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_test.h5repack_layout.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_version_test.h5repack_layout.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_zero.h5repack_layout.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5 + ) + + set (LIST_DDL_TEST_FILES + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/crtorder.tordergr.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/deflate_limit.h5repack_layout.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_test + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_version_test + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5-plugin_zero + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.UD.h5-plugin_none + ) + + foreach (h5_file ${LIST_HDF5_TEST_FILES}) get_filename_component(fname "${h5_file}" NAME) HDFTEST_COPY_FILE("${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5repack_files") endforeach () + + foreach (h5_file ${LIST_OTHER_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5repack_files") + endforeach () + + foreach (h5_file ${LIST_TST_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + HDFTEST_COPY_FILE("${h5_file}.tst" "${PROJECT_BINARY_DIR}/testfiles/${fname}.tst" "h5repack_files") + endforeach () + + foreach (h5_file ${LIST_DDL_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + HDFTEST_COPY_FILE("${h5_file}.ddl" "${PROJECT_BINARY_DIR}/testfiles/${fname}.ddl" "h5repack_files") + endforeach () add_custom_target(h5repack_files ALL COMMENT "Copying files needed by h5repack tests" DEPENDS ${h5repack_files_list}) ############################################################################## @@ -125,14 +146,24 @@ macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) - set_tests_properties (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME H5REPACK-h5repack-${testname} COMMAND $ ${ARGN}) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS ${last_test}) endif () - set (last_test "H5REPACK-${testname}") + set (last_test "H5REPACK-h5repack-${testname}") else () add_test ( + NAME H5REPACK-h5repack-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/h5repack-${testname}.out + testfiles/h5repack-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -143,6 +174,7 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS H5REPACK-h5repack-${testname}-clear-objects) endif () endmacro () @@ -156,13 +188,20 @@ endif () else () add_test ( - NAME H5REPACK_OLD-${testname} - COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + NAME H5REPACK_OLD-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK_OLD-${testname} + COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS H5REPACK_OLD-${testname}-clear-objects) + add_test ( NAME H5REPACK_OLD-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) @@ -180,13 +219,20 @@ endif () else () add_test ( - NAME H5REPACK-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + NAME H5REPACK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects) + add_test ( NAME H5REPACK-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) @@ -209,8 +255,22 @@ NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif () else () add_test ( + NAME H5REPACK_CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -222,9 +282,54 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS H5REPACK_CMP-${testname}-clear-objects) endif () - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif () + endmacro () + + macro (ADD_H5_MASK_TEST testname testtype resultcode resultfile) + if ("${testtype}" STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_MASK-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" + ) + endif () + else () + # If using memchecker add tests without using scripts + if (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_MASK-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test}) + endif () + else (HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_MASK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5REPACK_MASK-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}-${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_MASK_ERROR=true" + -D "TEST_REFERENCE=${resultfile}-${testname}.tst" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS H5REPACK_MASK-${testname}-clear-objects) endif () endif () endmacro () @@ -238,14 +343,22 @@ ) endif () else () - # If using memchecker add tests without using scripts add_test ( - NAME H5REPACK_DMP-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + NAME H5REPACK_DMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () + add_test ( + NAME H5REPACK_DMP-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS H5REPACK_DMP-${testname}-clear-objects) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_DMP-h5dump-${testname} @@ -263,6 +376,48 @@ endif () endmacro () + macro (ADD_H5_STAT_TEST testname testtype resultcode statarg resultfile) + if ("${testtype}" STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_STAT-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}" + ) + endif () + else () + add_test ( + NAME H5REPACK_STAT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${statarg}.${resultfile} + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( + NAME H5REPACK_STAT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + ) + set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS H5REPACK_STAT-${testname}-clear-objects) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5REPACK_STAT-h5stat-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}-${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${statarg}.${resultfile}.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES DEPENDS "H5REPACK_STAT-${testname}") + endif () + endif () + endmacro () + macro (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) if ("${testtype}" STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -274,13 +429,22 @@ else () if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}.${testfile} + testfiles/${testfile}-${testname}-v.out + testfiles/${testfile}-${testname}-v.out.err ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects) + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) @@ -328,14 +492,23 @@ endmacro () macro (ADD_H5_TEST_META testname testfile) + # Remove any output file left over from previous test run add_test ( - NAME H5REPACK_META-${testname}_N - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + NAME H5REPACK_META-${testname}_N-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/out-${testname}_N.${testname}.h5 + testfiles/out-${testname}_M.${testname}.h5 ) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( + NAME H5REPACK_META-${testname}_N + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + ) + set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS H5REPACK_META-${testname}_N-clear-objects) + add_test ( NAME H5REPACK_META-${testname}_M COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) @@ -350,11 +523,18 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5REPACK_UD-${testname}-clearall-objects + NAME H5REPACK_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + testfiles/${testname}.${resultfile}.out + testfiles/${testname}.${resultfile}.out.err + testfiles/${resultfile}-${testname}.out + testfiles/${resultfile}-${testname}.out.err ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () add_test ( NAME H5REPACK_UD-${testname} COMMAND "${CMAKE_COMMAND}" @@ -369,21 +549,21 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) + set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clear-objects) add_test ( - NAME H5REPACK_UD-h5dump-${testname} + NAME H5REPACK_UD-${testname}-h5dump COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}-${testname}.out" - -D "TEST_EXPECT=${resultcode}" + -D "TEST_EXPECT=0" -D "TEST_REFERENCE=${resultfile}-${testname}.ddl" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") + set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES DEPENDS "H5REPACK_UD-${testname}") endif () endmacro () @@ -418,189 +598,177 @@ set (FILE_REF h5repack_refs.h5) set (FILE_ATTR_REF h5repack_attr_refs.h5) - # Remove any output file left over from previous test run - add_test ( - NAME H5REPACK-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/h5dump-help.out - ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out - ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out.err - ./testfiles/h5repack_layout.h5-chunk_18x13-v.out - ./testfiles/h5repack_layout.h5-chunk_18x13-v.out.err - ./testfiles/h5repack_layout.h5-chunk_20x10-v.out - ./testfiles/h5repack_layout.h5-chunk_20x10-v.out.err - ./testfiles/h5repack_layout.h5-chunk_compa-v.out - ./testfiles/h5repack_layout.h5-chunk_compa-v.out.err - ./testfiles/h5repack_layout.h5-chunk_conti-v.out - ./testfiles/h5repack_layout.h5-chunk_conti-v.out.err - ./testfiles/h5repack_layout.h5-compa-v.out - ./testfiles/h5repack_layout.h5-compa-v.out.err - ./testfiles/h5repack_layout.h5-conti-v.out - ./testfiles/h5repack_layout.h5-conti-v.out.err - ./testfiles/h5repack_layout.h5-deflate_limit.out - ./testfiles/h5repack_layout.h5-deflate_limit.out.err - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out.err - ./testfiles/h5repack_layout.h5-dset2_compa-v.out - ./testfiles/h5repack_layout.h5-dset2_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset2_conti-v.out - ./testfiles/h5repack_layout.h5-dset2_conti-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out - ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out - ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out - ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out - ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out - ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out - ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out.err - ./testfiles/h5repack_layout.h5-layout_long_switches-v.out - ./testfiles/h5repack_layout.h5-layout_long_switches-v.out.err - ./testfiles/h5repack_layout.h5-layout_short_switches-v.out - ./testfiles/h5repack_layout.h5-layout_short_switches-v.out.err - ./testfiles/h5repack_layout.h5-plugin_test.out - ./testfiles/h5repack_layout.h5-plugin_test.out.err - ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out - ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out.err - ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out - ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out.err - ./testfiles/h5repack_layout3.h5-ckdim_biger-v.out - ./testfiles/h5repack_layout3.h5-ckdim_biger-v.out.err - ./testfiles/h5repack_layout3.h5-ckdim_smaller-v.out - ./testfiles/h5repack_layout3.h5-ckdim_smaller-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out - ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2compa-v.out - ./testfiles/h5repack_layout3.h5-chunk2compa-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2conti-v.out - ./testfiles/h5repack_layout3.h5-chunk2conti-v.out.err - ./testfiles/h5repack_layout3.h5-error1-v.out - ./testfiles/h5repack_layout3.h5-error1-v.out.err - ./testfiles/h5repack_layout3.h5-error2-v.out - ./testfiles/h5repack_layout3.h5-error2-v.out.err - ./testfiles/h5repack_layout3.h5-error3-v.out - ./testfiles/h5repack_layout3.h5-error3-v.out.err - ./testfiles/out-family.tfamily%05d.h5 - ./testfiles/out-HDFFV-7840.h5diff_attr1.h5 - ./testfiles/out-attr.h5repack_attr.h5 - ./testfiles/out-native_attr.h5repack_attr.h5 - ./testfiles/out-HDFFV-5932.h5repack_attr_refs.h5 - ./testfiles/out-deflate_copy.h5repack_deflate.h5 - ./testfiles/out-deflate_remove.h5repack_deflate.h5 - ./testfiles/out-early.h5repack_early.h5 - ./testfiles/out-fill.h5repack_fill.h5 - ./testfiles/out-native_fill.h5repack_fill.h5 - ./testfiles/out-gzip_verbose_filters.h5repack_filters.h5 - ./testfiles/out-fletcher_copy.h5repack_fletcher.h5 - ./testfiles/out-fletcher_remove.h5repack_fletcher.h5 - ./testfiles/out-hlink.h5repack_hlink.h5 - ./testfiles/out-chunk_18x13.h5repack_layout.h5 - ./testfiles/out-chunk_20x10.h5repack_layout.h5 - ./testfiles/out-chunk_compa.h5repack_layout.h5 - ./testfiles/out-chunk_conti.h5repack_layout.h5 - ./testfiles/out-compa.h5repack_layout.h5 - ./testfiles/out-conti.h5repack_layout.h5 - ./testfiles/out-deflate_file.h5repack_layout.h5 - ./testfiles/out-deflate_limit.h5repack_layout.h5 - ./testfiles/out-dset2_chunk_20x10.h5repack_layout.h5 - ./testfiles/out-dset2_compa.h5repack_layout.h5 - ./testfiles/out-dset2_conti.h5repack_layout.h5 - ./testfiles/out-dset_compa_chunk.h5repack_layout.h5 - ./testfiles/out-dset_compa_compa.h5repack_layout.h5 - ./testfiles/out-dset_compa_conti.h5repack_layout.h5 - ./testfiles/out-dset_conti_chunk.h5repack_layout.h5 - ./testfiles/out-dset_conti_compa.h5repack_layout.h5 - ./testfiles/out-dset_conti_conti.h5repack_layout.h5 - ./testfiles/out-fletcher_all.h5repack_layout.h5 - ./testfiles/out-fletcher_individual.h5repack_layout.h5 - ./testfiles/out-global_filters.h5repack_layout.h5 - ./testfiles/out-gzip_all.h5repack_layout.h5 - ./testfiles/out-gzip_individual.h5repack_layout.h5 - ./testfiles/out-layout.h5repack_layout.h5 - ./testfiles/out-layout_long_switches.h5repack_layout.h5 - ./testfiles/out-layout_short_switches.h5repack_layout.h5 - ./testfiles/out-old_style_layout_short_switches.h5repack_layout.h5 - ./testfiles/out-plugin_test.h5repack_layout.h5 - ./testfiles/out-shuffle_all.h5repack_layout.h5 - ./testfiles/out-shuffle_individual.h5repack_layout.h5 - ./testfiles/out-upgrade_layout.h5repack_layouto.h5 - ./testfiles/out-contig_small_compa.h5repack_layout2.h5 - ./testfiles/out-contig_small_fixed_compa.h5repack_layout2.h5 - ./testfiles/out-ckdim_biger.h5repack_layout3.h5 - ./testfiles/out-ckdim_smaller.h5repack_layout3.h5 - ./testfiles/out-chunk2chunk.h5repack_layout3.h5 - ./testfiles/out-chunk2compa.h5repack_layout3.h5 - ./testfiles/out-chunk2conti.h5repack_layout3.h5 - ./testfiles/out-error1.h5repack_layout3.h5 - ./testfiles/out-error2.h5repack_layout3.h5 - ./testfiles/out-error3.h5repack_layout3.h5 - ./testfiles/out-error4.h5repack_layout3.h5 - ./testfiles/out-committed_dt.h5repack_named_dtypes.h5 - ./testfiles/out-nbit_add.h5repack_nbit.h5 - ./testfiles/out-nbit_copy.h5repack_nbit.h5 - ./testfiles/out-nbit_remove.h5repack_nbit.h5 - ./testfiles/out-add_alignment.h5repack_objs.h5 - ./testfiles/out-add_userblock.h5repack_objs.h5 - ./testfiles/out-objs.h5repack_objs.h5 - ./testfiles/out-gt_mallocsize.h5repack_objs.h5 - ./testfiles/out-bug1814.h5repack_refs.h5 - ./testfiles/out-shuffle_copy.h5repack_shuffle.h5 - ./testfiles/out-shuffle_remove.h5repack_shuffle.h5 - ./testfiles/out-scale_add.h5repack_soffset.h5 - ./testfiles/out-scale_copy.h5repack_soffset.h5 - ./testfiles/out-scale_remove.h5repack_soffset.h5 - ./testfiles/out-meta_short_M.meta_short.h5 - ./testfiles/out-meta_short_N.meta_short.h5 - ./testfiles/out-meta_long_M.meta_long.h5 - ./testfiles/out-meta_long_N.meta_long.h5 - # from the h5repacktst - h5repack_attr.h5 - h5repack_attr_out.h5 - h5repack_attr_refs.h5 - h5repack_big.h5 - h5repack_deflate.h5 - h5repack_deflate_out.h5 - h5repack_early2.h5 - h5repack_early.h5 - h5repack_early_out.h5 - h5repack_ext.h5 - h5repack_ext_out.h5 - h5repack_fill.h5 - h5repack_fill_out.h5 - h5repack_filters.h5 - h5repack_filters_out.h5 - h5repack_fletcher.h5 - h5repack_fletcher_out.h5 - h5repack_hlink.h5 - h5repack_hlink_out.h5 - h5repack_layout.h5 - h5repack_layout_out.h5 - h5repack_layout2.h5 - h5repack_layout3.h5 - h5repack_named_dtypes.h5 - h5repack_named_dtypes_out.h5 - h5repack_nbit.h5 - h5repack_nbit_out.h5 - h5repack_objs.h5 - h5repack_objs_out.h5 - h5repack_refs.h5 - h5repack_shuffle.h5 - h5repack_shuffle_out.h5 - h5repack_soffset.h5 - h5repack_soffset_out.h5 - h5repack_szip.h5 - h5repack_szip_out.h5 - h5repack_ub.h5 - h5repack_ub_out.h5 - h5repack_ext.bin - ublock.bin - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + if (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + set (LIST_TO_CLEAR + h5dump-help.out + h5repack_layout.h5-chunk_18x13-v.out + h5repack_layout.h5-chunk_18x13-v.out.err + h5repack_layout.h5-chunk_20x10-v.out + h5repack_layout.h5-chunk_20x10-v.out.err + h5repack_layout.h5-chunk_compa-v.out + h5repack_layout.h5-chunk_compa-v.out.err + h5repack_layout.h5-chunk_conti-v.out + h5repack_layout.h5-chunk_conti-v.out.err + h5repack_layout.h5-compa-v.out + h5repack_layout.h5-compa-v.out.err + h5repack_layout.h5-conti-v.out + h5repack_layout.h5-conti-v.out.err + h5repack_layout.h5-deflate_limit.out + h5repack_layout.h5-deflate_limit.out.err + h5repack_layout.h5-dset2_chunk_20x10-v.out + h5repack_layout.h5-dset2_chunk_20x10-v.out.err + h5repack_layout.h5-dset2_chunk_20x10-errstk.out + h5repack_layout.h5-dset2_chunk_20x10-errstk.out.err + h5repack_layout.h5-dset2_compa-v.out + h5repack_layout.h5-dset2_compa-v.out.err + h5repack_layout.h5-dset2_conti-v.out + h5repack_layout.h5-dset2_conti-v.out.err + h5repack_layout.h5-dset_compa_chunk-v.out + h5repack_layout.h5-dset_compa_chunk-v.out.err + h5repack_layout.h5-dset_compa_compa-v.out + h5repack_layout.h5-dset_compa_compa-v.out.err + h5repack_layout.h5-dset_compa_conti-v.out + h5repack_layout.h5-dset_compa_conti-v.out.err + h5repack_layout.h5-dset_conti_chunk-v.out + h5repack_layout.h5-dset_conti_chunk-v.out.err + h5repack_layout.h5-dset_conti_compa-v.out + h5repack_layout.h5-dset_conti_compa-v.out.err + h5repack_layout.h5-dset_conti_conti-v.out + h5repack_layout.h5-dset_conti_conti-v.out.err + h5repack_layout.h5-layout_long_switches-v.out + h5repack_layout.h5-layout_long_switches-v.out.err + h5repack_layout.h5-layout_short_switches-v.out + h5repack_layout.h5-layout_short_switches-v.out.err + h5repack_layout.h5-plugin_test.out + h5repack_layout.h5-plugin_test.out.err + h5repack_layout2.h5-contig_small_compa-v.out + h5repack_layout2.h5-contig_small_compa-v.out.err + h5repack_layout2.h5-contig_small_fixed_compa-v.out + h5repack_layout2.h5-contig_small_fixed_compa-v.out.err + h5repack_layout3.h5-ckdim_biger-v.out + h5repack_layout3.h5-ckdim_biger-v.out.err + h5repack_layout3.h5-ckdim_smaller-v.out + h5repack_layout3.h5-ckdim_smaller-v.out.err + h5repack_layout3.h5-chunk2chunk-v.out + h5repack_layout3.h5-chunk2chunk-v.out.err + h5repack_layout3.h5-chunk2compa-v.out + h5repack_layout3.h5-chunk2compa-v.out.err + h5repack_layout3.h5-chunk2conti-v.out + h5repack_layout3.h5-chunk2conti-v.out.err + h5repack_layout3.h5-error1-v.out + h5repack_layout3.h5-error1-v.out.err + h5repack_layout3.h5-error2-v.out + h5repack_layout3.h5-error2-v.out.err + h5repack_layout3.h5-error3-v.out + h5repack_layout3.h5-error3-v.out.err + out-family.tfamily%05d.h5 + out-HDFFV-7840.h5diff_attr1.h5 + out-attr.h5repack_attr.h5 + out-native_attr.h5repack_attr.h5 + out-HDFFV-5932.h5repack_attr_refs.h5 + out-deflate_copy.h5repack_deflate.h5 + out-deflate_remove.h5repack_deflate.h5 + out-early.h5repack_early.h5 + out-fill.h5repack_fill.h5 + out-native_fill.h5repack_fill.h5 + out-gzip_verbose_filters.h5repack_filters.h5 + out-fletcher_copy.h5repack_fletcher.h5 + out-fletcher_remove.h5repack_fletcher.h5 + out-hlink.h5repack_hlink.h5 + out-chunk_18x13.h5repack_layout.h5 + out-chunk_20x10.h5repack_layout.h5 + out-chunk_compa.h5repack_layout.h5 + out-chunk_conti.h5repack_layout.h5 + out-compa.h5repack_layout.h5 + out-conti.h5repack_layout.h5 + out-deflate_file.h5repack_layout.h5 + out-deflate_limit.h5repack_layout.h5 + out-dset2_chunk_20x10.h5repack_layout.h5 + out-dset2_compa.h5repack_layout.h5 + out-dset2_conti.h5repack_layout.h5 + out-dset_compa_chunk.h5repack_layout.h5 + out-dset_compa_compa.h5repack_layout.h5 + out-dset_compa_conti.h5repack_layout.h5 + out-dset_conti_chunk.h5repack_layout.h5 + out-dset_conti_compa.h5repack_layout.h5 + out-dset_conti_conti.h5repack_layout.h5 + out-fletcher_all.h5repack_layout.h5 + out-fletcher_individual.h5repack_layout.h5 + out-global_filters.h5repack_layout.h5 + out-gzip_all.h5repack_layout.h5 + out-gzip_individual.h5repack_layout.h5 + out-layout.h5repack_layout.h5 + out-layout_long_switches.h5repack_layout.h5 + out-layout_short_switches.h5repack_layout.h5 + out-old_style_layout_short_switches.h5repack_layout.h5 + out-plugin_test.h5repack_layout.h5 + out-shuffle_all.h5repack_layout.h5 + out-shuffle_individual.h5repack_layout.h5 + out-upgrade_layout.h5repack_layouto.h5 + out-contig_small_compa.h5repack_layout2.h5 + out-contig_small_fixed_compa.h5repack_layout2.h5 + out-ckdim_biger.h5repack_layout3.h5 + out-ckdim_smaller.h5repack_layout3.h5 + out-chunk2chunk.h5repack_layout3.h5 + out-chunk2compa.h5repack_layout3.h5 + out-chunk2conti.h5repack_layout3.h5 + out-error1.h5repack_layout3.h5 + out-error2.h5repack_layout3.h5 + out-error3.h5repack_layout3.h5 + out-error4.h5repack_layout3.h5 + out-committed_dt.h5repack_named_dtypes.h5 + out-nbit_add.h5repack_nbit.h5 + out-nbit_copy.h5repack_nbit.h5 + out-nbit_remove.h5repack_nbit.h5 + out-add_alignment.h5repack_objs.h5 + out-add_userblock.h5repack_objs.h5 + out-objs.h5repack_objs.h5 + out-gt_mallocsize.h5repack_objs.h5 + out-bug1814.h5repack_refs.h5 + out-shuffle_copy.h5repack_shuffle.h5 + out-shuffle_remove.h5repack_shuffle.h5 + out-scale_add.h5repack_soffset.h5 + out-scale_copy.h5repack_soffset.h5 + out-scale_remove.h5repack_soffset.h5 + out-meta_short_M.meta_short.h5 + out-meta_short_N.meta_short.h5 + out-meta_long_M.meta_long.h5 + out-meta_long_N.meta_long.h5 + ) + + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} ${LIST_OTHER_TEST_FILES}) + + foreach (h5_file ${LIST_HDF5_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} + ${h5_file}.h5 + ) + endforeach () + + foreach (h5_file ${LIST_TST_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} + ${h5_file}.tst.out + ${h5_file}.tst.out.err + ) + endforeach () + + foreach (h5_file ${LIST_DDL_TEST_FILES}) + get_filename_component(fname "${h5_file}" NAME) + set (LIST_TO_CLEAR ${LIST_TO_CLEAR} + ${h5_file}.ddl.out + ${h5_file}.ddl.out.err + ) + endforeach () + add_test ( + NAME H5REPACK-clearall-objects + COMMAND ${CMAKE_COMMAND} -E remove ${LIST_TO_CLEAR} + ) + set_tests_properties (H5REPACK-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + endif () endif () ADD_HELP_TEST(help 0 -h) @@ -638,17 +806,17 @@ # filters are defined. # detect whether the encoder is present. - set (USE_FILTER_SZIP_ENCODER "no") +# set (USE_FILTER_SZIP_ENCODER 0) if (HDF5_ENABLE_SZIP_ENCODING) set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) endif () if (H5_HAVE_FILTER_DEFLATE) - set (USE_FILTER_DEFLATE "true") + set (USE_FILTER_DEFLATE 1) endif () if (H5_HAVE_FILTER_SZIP) - set (USE_FILTER_SZIP "true") + set (USE_FILTER_SZIP 1) endif () # copy files (these files have no filters) @@ -680,16 +848,20 @@ # szip with individual object set (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all set (arg ${FILE4} -f SZIP=8,NN) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) @@ -712,8 +884,10 @@ # all filters set (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) @@ -732,16 +906,20 @@ # szip copy set (arg ${FILE7}) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove set (arg ${FILE7} --filter=dset_szip:NONE) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) @@ -804,23 +982,29 @@ # remove all filters set (arg ${FILE11} -f NONE) set (TESTTYPE "TEST") - if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions set (arg ${FILE8} -f dset_deflate:SZIP=8,NN) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) set (arg ${FILE7} -f dset_szip:GZIP=1) set (TESTTYPE "TEST") - if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - set (TESTTYPE "SKIP") + if (NOT USE_FILTER_SZIP_ENCODER) + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif () endif () ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) @@ -854,6 +1038,7 @@ ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS -l CONTI) ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT -l dset2:COMPA) ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT -l COMPA) + ADD_H5_MASK_TEST (dset2_chunk_20x10-errstk "TEST" 0 ${FILE4} --layout=dset2:CHUNK=20x10x5 --enable-error-stack) ################################################################ # layout conversions (file has no filters) @@ -1006,11 +1191,7 @@ ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,0,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) # check for no parameters - set (TESTRETVAL 255) - if (WIN32) - set (TESTRETVAL -1) - endif () - ADD_H5_CMP_TEST (plugin_zero "" "TEST" ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0,0) + ADD_H5_UD_TEST (plugin_zero 0 h5repack_layout.h5 -v -f UD=250,0,0) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index c8ff98e..efbd8be 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -39,11 +39,6 @@ static int have_request(pack_opt_t *options); * object name requests * * Return: 0, ok, -1, fail - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 - * *------------------------------------------------------------------------- */ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { @@ -68,17 +63,17 @@ int h5repack(const char* infile, const char* outfile, pack_opt_t *options) { * Purpose: initialize options * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ - -h5repack_init(pack_opt_t *options, int verbose) +int +h5repack_init(pack_opt_t *options, int verbose, hbool_t latest) { int k, n; HDmemset(options, 0, sizeof(pack_opt_t)); options->min_comp = 0; options->verbose = verbose; + options->latest = latest; options->layout_g = H5D_LAYOUT_ERROR; for (n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { @@ -95,7 +90,6 @@ h5repack_init(pack_opt_t *options, int verbose) * Function: h5repack_end * * Purpose: free options table - * *------------------------------------------------------------------------- */ @@ -110,18 +104,17 @@ int h5repack_end(pack_opt_t *options) { * Example: -f dset:GZIP=6 * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ int -h5repack_addfilter(const char* str, pack_opt_t *options) +h5repack_addfilter(const char *str, pack_opt_t *options) { obj_list_t *obj_list = NULL; /* one object list for the -f and -l option entry */ filter_info_t filter; /* filter info for the current -f option entry */ unsigned n_objs; /* number of objects in the current -f or -l option entry */ int is_glb; /* is the filter global */ - /* parse the -f option */ + /* parse the -f (--filter) option */ if (NULL == (obj_list = parse_filter(str, &n_objs, &filter, options, &is_glb))) return -1; @@ -151,11 +144,10 @@ h5repack_addfilter(const char* str, pack_opt_t *options) * Purpose: add a layout option * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ int -h5repack_addlayout(const char* str, pack_opt_t *options) +h5repack_addlayout(const char *str, pack_opt_t *options) { obj_list_t *obj_list = NULL; /*one object list for the -t and -c option entry */ unsigned n_objs; /*number of objects in the current -t or -c option entry */ @@ -219,11 +211,6 @@ h5repack_addlayout(const char* str, pack_opt_t *options) * returned must be closed after it is no longer needed. * named_datatype_free must be called before the program exits * to free the stack. - * - * Programmer: Neil Fortner - * - * Date: April 14, 2009 - * *------------------------------------------------------------------------- */ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, @@ -297,24 +284,18 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, /* Set return value */ ret_value = dt_ret->id_out; - /* Increment the ref count on id_out, because the calling function will try - * to close it */ + /* Increment the ref count on id_out, because the calling function will try to close it */ if(H5Iinc_ref(ret_value) < 0) ret_value = -1; done: - return (ret_value); + return ret_value; } /* end copy_named_datatype */ /*------------------------------------------------------------------------- * Function: named_datatype_free * * Purpose: Frees the stack of named datatypes. - * - * Programmer: Neil Fortner - * - * Date: April 14, 2009 - * *------------------------------------------------------------------------- */ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { @@ -345,11 +326,6 @@ done: * loc_id = H5Topen2( fid, name); * * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 28, 2003 - * *------------------------------------------------------------------------- */ int @@ -476,7 +452,6 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, buf = (void *)HDmalloc((size_t)(nelmts * msize)); if (buf == NULL) { - error_msg("h5repack", "cannot read into memory\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if (H5Aread(attr_id, wtype_id, buf) < 0) @@ -488,7 +463,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, */ if ((attr_out = H5Acreate2(loc_out, name, wtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Acreate2 failed on ,%s>", name); if (H5Awrite(attr_out, wtype_id, buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Awrite failed"); @@ -506,24 +481,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, if (options->verbose) printf(FORMAT_OBJ_ATTR, "attr", name); - - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - - if (H5Tclose(ftype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - if (H5Tclose(wtype_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - if (H5Sclose(space_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); - if (H5Aclose(attr_id) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); } /* u */ - return 0; - done: H5E_BEGIN_TRY { if (buf) { @@ -552,13 +511,10 @@ done: * Purpose: print options, checks for invalid options * * Return: void, return -1 on error - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 *------------------------------------------------------------------------- */ static int check_options(pack_opt_t *options) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ unsigned int i; int k, j, has_cp = 0, has_ck = 0; char slayout[30]; @@ -568,8 +524,8 @@ static int check_options(pack_opt_t *options) { *------------------------------------------------------------------------- */ if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to modify layout are...\n"); if (options->all_layout == 1) { + printf("All objects to modify layout are...\n"); switch (options->layout_g) { case H5D_COMPACT: strcpy(slayout, "compact"); @@ -582,20 +538,22 @@ static int check_options(pack_opt_t *options) { break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: - error_msg("invalid layout\n"); - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid layout"); default: strcpy(slayout, "invalid layout\n"); - return -1; + HGOTO_DONE(FAIL); } - printf(" Apply %s layout to all\n", slayout); + printf(" Apply %s layout to all", slayout); if (H5D_CHUNKED == options->layout_g) { - printf("with dimension ["); + printf("with dimension [ "); for (j = 0; j < options->chunk_g.rank; j++) printf("%d ", (int) options->chunk_g.chunk_lengths[j]); - printf("]\n"); + printf("]"); } + printf("\n"); } + else + printf("No all objects to modify layout\n"); }/* verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -605,25 +563,20 @@ static int check_options(pack_opt_t *options) { if (options->verbose) { printf(" <%s> with chunk size ", name); for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) - printf("%d ", - (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); + printf("%d ", (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); printf("\n"); } has_ck = 1; } else if (options->op_tbl->objs[i].chunk.rank == -2) { if (options->verbose) - printf(" <%s> %s\n", name, "NONE (contigous)"); + printf(" <%s> %s\n", name, "NONE (contiguous)"); has_ck = 1; } } - if (options->all_layout == 1 && has_ck) { - error_msg( - "invalid chunking input: 'all' option\ - is present with other objects\n"); - return -1; - } + if (options->all_layout == 1 && has_ck) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid chunking input: 'all' option is present with other objects"); /*------------------------------------------------------------------------- * objects to filter @@ -631,10 +584,14 @@ static int check_options(pack_opt_t *options) { */ if (options->verbose && have_request(options) /* only print if requested */) { - printf("Objects to apply filter are...\n"); if (options->all_filter == 1) { + printf("All objects to apply filter are...\n"); for (k = 0; k < options->n_filter_g; k++) { H5Z_filter_t filtn = options->filter_g[k].filtn; + if (filtn < 0) { + printf(" Unknown\n"); + continue; + } switch (filtn) { case H5Z_FILTER_NONE: printf(" Uncompress all\n"); @@ -645,8 +602,7 @@ static int check_options(pack_opt_t *options) { break; case H5Z_FILTER_SZIP: case H5Z_FILTER_DEFLATE: - printf(" All with %s, parameter %d\n", get_sfilter(filtn), - options->filter_g[k].cd_values[0]); + printf(" All with %s, parameter %d\n", get_sfilter(filtn), options->filter_g[k].cd_values[0]); break; default: printf(" User Defined %d\n", filtn); @@ -654,6 +610,8 @@ static int check_options(pack_opt_t *options) { } /* k */ }; } + else + printf("No all objects to apply filter\n"); } /* verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -662,48 +620,34 @@ static int check_options(pack_opt_t *options) { for (j = 0; j < pack.nfilters; j++) { if (options->verbose) { - printf(" <%s> with %s filter\n", name, - get_sfilter(pack.filter[j].filtn)); + if(pack.filter[j].filtn >= 0) { + if(pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET) + printf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), pack.filter[j].filtn); + else + printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn)); + } } - has_cp = 1; - } /* j */ } /* i */ - if (options->all_filter == 1 && has_cp) { - error_msg( - "invalid compression input: 'all' option\ - is present with other objects\n"); - return -1; - } + if (options->all_filter == 1 && has_cp) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid compression input: 'all' option is present with other objects"); /*------------------------------------------------------------------------- * check options for the latest format *------------------------------------------------------------------------- */ - if (options->grp_compact < 0) { - error_msg( - "invalid maximum number of links to store as header messages\n"); - return -1; - } - if (options->grp_indexed < 0) { - error_msg( - "invalid minimum number of links to store in the indexed format\n"); - return -1; - } - if (options->grp_indexed > options->grp_compact) { - error_msg( - "minimum indexed size is greater than the maximum compact size\n"); - return -1; - } - for (i = 0; i < 8; i++) { - if (options->msg_size[i] < 0) { - error_msg("invalid shared message size\n"); - return -1; - } - } + if (options->grp_compact < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid maximum number of links to store as header messages"); + if (options->grp_indexed < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid minimum number of links to store in the indexed format"); + if (options->grp_indexed > options->grp_compact) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "minimum indexed size is greater than the maximum compact size"); + for (i = 0; i < 8; i++) + if (options->msg_size[i] < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid shared message size"); /*-------------------------------------------------------------------------------- * verify new user userblock options; file name must be present @@ -711,30 +655,24 @@ static int check_options(pack_opt_t *options) { */ if (options->ublock_filename != NULL && options->ublock_size == 0) { if (options->verbose) { - printf( - "Warning: user block size missing for file %s. Assigning a default size of 1024...\n", - options->ublock_filename); + printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename); options->ublock_size = 1024; } } - if (options->ublock_filename == NULL && options->ublock_size != 0) { - error_msg("file name missing for user block\n", - options->ublock_filename); - return -1; - } + if (options->ublock_filename == NULL && options->ublock_size != 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file name missing for user block", options->ublock_filename); /*-------------------------------------------------------------------------------- * verify alignment options; threshold is zero default but alignment not *--------------------------------------------------------------------------------- */ - if (options->alignment == 0 && options->threshold != 0) { - error_msg("alignment for H5Pset_alignment missing\n"); - return -1; - } + if (options->alignment == 0 && options->threshold != 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "alignment for H5Pset_alignment missing"); - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- @@ -744,36 +682,32 @@ static int check_options(pack_opt_t *options) { * supplied list * * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: September, 23, 2003 - * *------------------------------------------------------------------------- */ static int check_objects(const char* fname, pack_opt_t *options) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t fid; + hid_t did; + hid_t sid; unsigned int i; + unsigned int uf; trav_table_t *travt = NULL; /* nothing to do */ if (options->op_tbl->nelems == 0) - return 0; + HGOTO_DONE(0); /*------------------------------------------------------------------------- - * open the file - *------------------------------------------------------------------------- - */ - if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) - < 0) { - printf("<%s>: %s\n", fname, H5FOPENERROR); - return -1; - } + * open the file + *------------------------------------------------------------------------- + */ + if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR); /*------------------------------------------------------------------------- - * get the list of objects in the file - *------------------------------------------------------------------------- - */ + * get the list of objects in the file + *------------------------------------------------------------------------- + */ /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); @@ -782,16 +716,15 @@ static int check_objects(const char* fname, pack_opt_t *options) { /* get the list of objects in the file */ if (h5trav_gettable(fid, travt) < 0) - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); /*------------------------------------------------------------------------- - * compare with user supplied list - *------------------------------------------------------------------------- - */ + * compare with user supplied list + *------------------------------------------------------------------------- + */ if (options->verbose) - printf("Opening file <%s>. Searching for objects to modify...\n", - fname); + printf("Opening file. Searching %d objects to modify ...\n", travt->nobjs); for (i = 0; i < options->op_tbl->nelems; i++) { char* name = options->op_tbl->objs[i].path; @@ -799,74 +732,70 @@ static int check_objects(const char* fname, pack_opt_t *options) { printf(" <%s>", name); /* the input object names are present in the file and are valid */ - if (h5trav_getindext(name, travt) < 0) { - error_msg("%s Could not find <%s> in file <%s>. Exiting...\n", + if (h5trav_getindext(name, travt) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%s Could not find <%s> in file <%s>. Exiting...\n", (options->verbose ? "\n" : ""), name, fname); - goto out; - } if (options->verbose) printf("...Found\n"); - /* check for extra filter conditions */ - switch (options->op_tbl->objs[i].filter->filtn) { - /* chunk size must be smaller than pixels per block */ - case H5Z_FILTER_SZIP: - { - int j; - hsize_t csize = 1; - unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0]; - hsize_t dims[H5S_MAX_RANK]; - int rank; - hid_t did; - hid_t sid; - - if (options->op_tbl->objs[i].chunk.rank > 0) { - rank = options->op_tbl->objs[i].chunk.rank; - for (j = 0; j < rank; j++) - csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; - } - else { - if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) - goto out; - if ((sid = H5Dget_space(did)) < 0) - goto out; - if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) - goto out; - HDmemset(dims, 0, sizeof dims); - if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) - goto out; - for (j = 0; j < rank; j++) - csize *= dims[j]; - if (H5Sclose(sid) < 0) - goto out; - if (H5Dclose(did) < 0) - goto out; - } - - if (csize < ppb) { - printf( - " \n"); - goto out; + for (uf = 0; uf < options->op_tbl->objs[i].nfilters; uf++) { + if (options->op_tbl->objs[i].filter[uf].filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + /* check for extra filter conditions */ + switch (options->op_tbl->objs[i].filter[uf].filtn) { + /* chunk size must be smaller than pixels per block */ + case H5Z_FILTER_SZIP: + { + int j; + hsize_t csize = 1; + unsigned ppb = options->op_tbl->objs[i].filter[uf].cd_values[0]; + hsize_t dims[H5S_MAX_RANK]; + int rank; + + if (options->op_tbl->objs[i].chunk.rank > 0) { + rank = options->op_tbl->objs[i].chunk.rank; + for (j = 0; j < rank; j++) + csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j]; + } + else { + if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + if ((sid = H5Dget_space(did)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + if ((rank = H5Sget_simple_extent_ndims(sid)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + HDmemset(dims, 0, sizeof dims); + if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + for (j = 0; j < rank; j++) + csize *= dims[j]; + if (H5Sclose(sid) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + if (H5Dclose(did) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); + } + + if (csize < ppb) { + printf(" \n"); + HGOTO_DONE(0); + } } + break; + default: + break; } - break; - default: - break; - } - } /* i */ + } /* for uf */ + } /* for i */ - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - H5Fclose(fid); - trav_table_free(travt); - return 0; - -out: - H5Fclose(fid); - trav_table_free(travt); - return -1; +done: + H5E_BEGIN_TRY { + H5Fclose(fid); + H5Sclose(sid); + H5Dclose(did); + } H5E_END_TRY; + if (travt) + trav_table_free(travt); + return ret_value; } /*------------------------------------------------------------------------- @@ -875,9 +804,6 @@ out: * Purpose: check if a filter or layout was requested * * Return: 1 yes, 0 no - * - * Date: May, 24, 2007 - * *------------------------------------------------------------------------- */ static int have_request(pack_opt_t *options) { @@ -895,12 +821,13 @@ static int have_request(pack_opt_t *options) { * Purpose: return the filter as a string name * * Return: name of filter, exit on error - * *------------------------------------------------------------------------- */ static const char* get_sfilter(H5Z_filter_t filtn) { - if (filtn == H5Z_FILTER_NONE) + if (filtn < 0) + return NULL; + else if (filtn == H5Z_FILTER_NONE) return "NONE"; else if (filtn == H5Z_FILTER_DEFLATE) return "GZIP"; diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index bdde740..5b7bb0b 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -35,7 +35,7 @@ /* a list of names */ typedef struct { - char obj[MAX_NC_NAME]; + char obj[MAX_NC_NAME]; } obj_list_t; /* @@ -53,16 +53,16 @@ typedef struct { #define CD_VALUES 20 typedef struct { - H5Z_filter_t filtn; /* filter identification number */ - unsigned filt_flag; /* filter definition flag */ - unsigned cd_values[CD_VALUES]; /* filter client data values */ - size_t cd_nelmts; /* filter client number of values */ + H5Z_filter_t filtn; /* filter identification number */ + unsigned filt_flag; /* filter definition flag */ + unsigned cd_values[CD_VALUES]; /* filter client data values */ + size_t cd_nelmts; /* filter client number of values */ } filter_info_t; /* chunk lengths along each dimension and rank */ typedef struct { - hsize_t chunk_lengths[MAX_VAR_DIMS]; - int rank; + hsize_t chunk_lengths[MAX_VAR_DIMS]; + int rank; } chunk_info_t; /* we currently define a maximum value for the filters array, @@ -71,19 +71,19 @@ typedef struct { /* information for one object, contains PATH, CHUNK info and FILTER info */ typedef struct { - char path[MAX_NC_NAME]; /* name of object */ - filter_info_t filter[H5_REPACK_MAX_NFILTERS]; /* filter array */ - int nfilters; /* current number of filters */ - H5D_layout_t layout; /* layout information */ - chunk_info_t chunk; /* chunk information */ - hid_t refobj_id; /* object ID, references */ + char path[MAX_NC_NAME]; /* name of object */ + filter_info_t filter[H5_REPACK_MAX_NFILTERS]; /* filter array */ + int nfilters; /* current number of filters */ + H5D_layout_t layout; /* layout information */ + chunk_info_t chunk; /* chunk information */ + hid_t refobj_id; /* object ID, references */ } pack_info_t; /* store a table of all objects */ typedef struct { - unsigned int size; - unsigned int nelems; - pack_info_t *objs; + unsigned int size; + unsigned int nelems; + pack_info_t *objs; } pack_opttbl_t; @@ -94,26 +94,26 @@ typedef struct { /* all the above, ready to go to the hrepack call */ typedef struct { - pack_opttbl_t *op_tbl; /*table with all -c and -f options */ - int all_layout; /*apply the layout to all objects */ - int all_filter; /*apply the filter to all objects */ - filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */ - int n_filter_g; /*number of global filters */ - chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ - H5D_layout_t layout_g; /*global layout information for the ALL case */ - int verbose; /*verbose mode */ - hsize_t min_comp; /*minimum size to compress, in bytes */ - int use_native; /*use a native type in write */ - int latest; /*pack file with the latest file format */ - int grp_compact; /* Set the maximum number of links to store as header messages in the group */ - int grp_indexed; /* Set the minimum number of links to store in the indexed format */ - int msg_size[8]; /* Minimum size of shared messages: dataspace, - datatype, fill value, filter pipleline, attribute */ - const char *ublock_filename; /* user block file name */ - hsize_t ublock_size; /* user block size */ - hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ - hsize_t threshold; /* alignment threshold for H5Pset_alignment */ - hsize_t alignment ; /* alignment for H5Pset_alignment */ + pack_opttbl_t *op_tbl; /*table with all -c and -f options */ + int all_layout; /*apply the layout to all objects */ + int all_filter; /*apply the filter to all objects */ + filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */ + int n_filter_g; /*number of global filters */ + chunk_info_t chunk_g; /*global chunk INFO for the ALL case */ + H5D_layout_t layout_g; /*global layout information for the ALL case */ + int verbose; /*verbose mode */ + hsize_t min_comp; /*minimum size to compress, in bytes */ + int use_native; /*use a native type in write */ + int latest; /*pack file with the latest file format */ + int grp_compact; /* Set the maximum number of links to store as header messages in the group */ + int grp_indexed; /* Set the minimum number of links to store in the indexed format */ + int msg_size[8]; /* Minimum size of shared messages: dataspace, + datatype, fill value, filter pipleline, attribute */ + const char *ublock_filename; /* user block file name */ + hsize_t ublock_size; /* user block size */ + hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ + hsize_t threshold; /* alignment threshold for H5Pset_alignment */ + hsize_t alignment; /* alignment for H5Pset_alignment */ } pack_opt_t; @@ -135,9 +135,9 @@ extern "C" { int h5repack(const char* infile, const char* outfile, pack_opt_t *options); int h5repack_addfilter(const char* str, pack_opt_t *options); int h5repack_addlayout(const char* str, pack_opt_t *options); -int h5repack_init(pack_opt_t *options, int verbose); +int h5repack_init(pack_opt_t *options, int verbose, hbool_t latest); int h5repack_end(pack_opt_t *options); -int h5repack_verify(const char *out_fname, pack_opt_t *options); +int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options); int h5repack_cmp_pl(const char *fname1, const char *fname2); /* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() @@ -203,18 +203,18 @@ int apply_filters(const char* name, /* object name from traverse list */ * options table *------------------------------------------------------------------------- */ -int options_table_init( pack_opttbl_t **tbl ); -int options_table_free( pack_opttbl_t *table ); -int options_add_layout( obj_list_t *obj_list, - unsigned n_objs, - pack_info_t *pack, - pack_opttbl_t *table ); -int options_add_filter ( obj_list_t *obj_list, - unsigned n_objs, - filter_info_t filt, - pack_opttbl_t *table ); -pack_info_t* options_get_object( const char *path, - pack_opttbl_t *table); +int options_table_init(pack_opttbl_t **tbl); +int options_table_free(pack_opttbl_t *table); +int options_add_layout(obj_list_t *obj_list, + unsigned n_objs, + pack_info_t *pack, + pack_opttbl_t *table); +int options_add_filter(obj_list_t *obj_list, + unsigned n_objs, + filter_info_t filt, + pack_opttbl_t *table); +pack_info_t* options_get_object(const char *path, + pack_opttbl_t *table); /*------------------------------------------------------------------------- * parse functions diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 93612e2..86c6e6f 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -101,10 +101,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) * open input file *------------------------------------------------------------------------- */ - if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t) 0)) < 0) { - error_msg("<%s>: %s\n", fnamein, H5FOPENERROR); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t) 0)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fnamein, H5FOPENERROR); /* get user block size and file space strategy/threshold */ { @@ -112,15 +110,11 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) hid_t grp_in = -1; /* group ID */ hid_t gcpl_in = -1; /* group creation property list */ - if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) { - error_msg("failed to retrieve file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); - if (H5Pget_userblock(fcpl_in, &ub_size) < 0) { - error_msg("failed to retrieve userblock size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if (H5Pget_userblock(fcpl_in, &ub_size) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size"); /* open root group */ if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0) @@ -134,26 +128,19 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) if (H5Pget_link_creation_order(gcpl_in, &crt_order_flags) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed"); - if (H5Pclose(fcpl_in) < 0) { - error_msg("failed to close property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if (H5Pclose(fcpl_in) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed to close property list"); } /* Check if we need to create a non-default file creation property list */ if (options->latest || ub_size > 0) { /* Create file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg("fail to create a file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); - if (ub_size > 0) { - if (H5Pset_userblock(fcpl, ub_size) < 0) { - error_msg("failed to set non-default userblock size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } - } + if (ub_size > 0) + if (H5Pset_userblock(fcpl, ub_size) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set non-default userblock size"); if (options->latest) { unsigned i = 0, nindex = 0, mesg_type_flags[5], min_mesg_sizes[5]; @@ -161,10 +148,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) /* Adjust group creation parameters for root group */ /* (So that it is created in "dense storage" form) */ if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact, - (unsigned) options->grp_indexed) < 0) { - error_msg("fail to adjust group creation parameters for root group\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + (unsigned) options->grp_indexed) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_phase_change failed to adjust group creation parameters for root group"); for (i = 0; i < 5; i++) { if (options->msg_size[i] > 0) { @@ -199,30 +184,21 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) } /* end for */ if (nindex > 0) { - if (H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) { - error_msg("fail to set the number of shared object header message indexes\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if (H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_nindexes failed to set the number of shared object header message indexes"); /* msg_size[0]=dataspace, 1=datatype, 2=file value, 3=filter pipleline, 4=attribute */ - for (i = 0; i < (nindex - 1); i++) { - if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) { - error_msg("fail to configure the specified shared object header message index\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } /* end if */ - } /* end for */ + for (i = 0; i < (nindex - 1); i++) + if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_index failed to configure the specified shared object header message index"); } /* if (nindex>0) */ /* Create file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg("Could not create file access property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } /* end if */ - - if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { - error_msg("Could not set property for using latest version of the format\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } /* end if */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); + + if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set property for using latest version of the format"); } /* end if */ } /* end if */ #if defined (H5REPACK_DEBUG_USER_BLOCK) @@ -235,19 +211,14 @@ print_user_block(fnamein, fidin); */ if (options->ublock_size > 0) { /* either use the FCPL already created or create a new one */ - if (fcpl == H5P_DEFAULT) { + if (fcpl == H5P_DEFAULT) /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg("fail to create a file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } - } + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); /* set user block size */ - if (H5Pset_userblock(fcpl, options->ublock_size) < 0) { - error_msg("failed to set userblock size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if (H5Pset_userblock(fcpl, options->ublock_size) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set userblock size"); } /*------------------------------------------------------------------------- @@ -256,18 +227,13 @@ print_user_block(fnamein, fidin); */ if (options->alignment > 0) { /* either use the FAPL already created or create a new one */ - if (fapl == H5P_DEFAULT) { + if (fapl == H5P_DEFAULT) /* create a file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg("Could not create file access property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } - } + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); - if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { - error_msg("failed to set alignment\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alignment failed to set alignment"); } /*------------------------------------------------------------------------- @@ -276,18 +242,13 @@ print_user_block(fnamein, fidin); */ if (options->meta_block_size > 0) { /* either use the FAPL already created or create a new one */ - if (fapl == H5P_DEFAULT) { + if (fapl == H5P_DEFAULT) /* create a file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg("Could not create file access property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } - } + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list"); - if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) { - error_msg("failed to set metadata block size\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_meta_block_size failed to set metadata block size"); } /*------------------------------------------------------------------------- @@ -296,13 +257,10 @@ print_user_block(fnamein, fidin); */ /* either use the FCPL already created or create a new one */ - if (fcpl == H5P_DEFAULT) { + if (fcpl == H5P_DEFAULT) /* create a file creation property list */ - if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { - error_msg("fail to create a file creation property list\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } - } + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list"); if(H5Pset_link_creation_order(fcpl, crt_order_flags ) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_creation_order failed"); @@ -312,23 +270,18 @@ print_user_block(fnamein, fidin); *------------------------------------------------------------------------- */ if (options->verbose) - printf("Making file <%s>...\n", fnameout); + printf("Making new file ...\n"); - if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { - error_msg("<%s>: Could not create file\n", fnameout); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fcreate could not create file <%s>:", fnameout); /*------------------------------------------------------------------------- * write a new user block if requested *------------------------------------------------------------------------- */ - if (options->ublock_size > 0) { - if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0) { - error_msg("Could not copy user block. Exiting...\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } - } + if (options->ublock_size > 0) + if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); /*------------------------------------------------------------------------- * get list of objects @@ -342,26 +295,22 @@ print_user_block(fnamein, fidin); /* get the list of objects in the file */ if (h5trav_gettable(fidin, travt) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); /*------------------------------------------------------------------------- * do the copy *------------------------------------------------------------------------- */ - if (do_copy_objects(fidin, fidout, travt, options) < 0) { - error_msg("<%s>: Could not copy data to: %s\n", fnamein, fnameout); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } /* end if */ + if (do_copy_objects(fidin, fidout, travt, options) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout); /*------------------------------------------------------------------------- * do the copy of referenced objects * and create hard links *------------------------------------------------------------------------- */ - if (do_copy_refobjs(fidin, fidout, travt, options) < 0) { - printf("h5repack: <%s>: Could not copy data to: %s\n", fnamein, fnameout); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } + if (do_copy_refobjs(fidin, fidout, travt, options) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout); /*------------------------------------------------------------------------- * close @@ -386,12 +335,9 @@ print_user_block(fnamein, fidin); *------------------------------------------------------------------------- */ - if (ub_size > 0 && options->ublock_size == 0) { - if (copy_user_block(fnamein, fnameout, ub_size) < 0) { - error_msg("Could not copy user block. Exiting...\n"); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); - } - } + if (ub_size > 0 && options->ublock_size == 0) + if (copy_user_block(fnamein, fnameout, ub_size) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); return 0; @@ -476,7 +422,7 @@ int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], /* get chunk dims */ rank_chunk = H5Pget_chunk(dcpl_id, rank_dset, dims_chunk); if (rank_chunk < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); for (k = rank_dset; k > 0; --k) size_chunk *= dims_chunk[k - 1]; @@ -538,7 +484,7 @@ int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], hslab_nbytes *= dims_hslab[k - 1]; if (hslab_nbytes <= 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "calculate total size for the hyperslab failed"); } } } @@ -562,7 +508,7 @@ int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], hslab_nbytes *= dims_hslab[k - 1]; if (hslab_nbytes <= 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "calculate total size for the hyperslab failed"); } } @@ -702,13 +648,14 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, unsigned crt_order_flags; /* group creation order flag */ unsigned i; unsigned u; + unsigned uf; int is_ref = 0; htri_t is_named; hbool_t limit_maxdims; hsize_t size_dset; /*------------------------------------------------------------------------- - * copy the suppplied object list + * copy the supplied object list *------------------------------------------------------------------------- */ @@ -718,12 +665,13 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, printf("-----------------------------------------\n"); } - for (i = 0; i < travt->nobjs; i++) { - /* init variables per obj */ - buf = NULL; - limit_maxdims = FALSE; + if (travt->objs) { + for (i = 0; i < travt->nobjs; i++) { + /* init variables per obj */ + buf = NULL; + limit_maxdims = FALSE; - switch (travt->objs[i].type) { + switch (travt->objs[i].type) { case H5TRAV_TYPE_UNKNOWN: break; @@ -803,10 +751,15 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, req_filter = 1; /* check if filters were requested for individual objects */ - for (u = 0; u < options->op_tbl->nelems; u++) - if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0) - if (options->op_tbl->objs[u].filter->filtn > 0) - req_filter = 1; + if (options->op_tbl->objs) { + for (u = 0; u < options->op_tbl->nelems; u++) { + if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0) + for (uf = 0; uf < options->op_tbl->objs[uf].nfilters; uf++) { + if (options->op_tbl->objs[u].filter[uf].filtn > 0) + req_filter = 1; + } + } + } /* check if layout change requested individual object */ if (options->layout_g != H5D_LAYOUT_ERROR) { @@ -982,9 +935,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, buf = HDmalloc(need); if (buf != NULL) { - /* read/write: use the macro to check error, e.g. memory allocation error inside the library. */ - CHECK_H5DRW_ERROR(H5Dread, FAIL, dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - CHECK_H5DRW_ERROR(H5Dwrite, FAIL, dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if(H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + if(H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* Check if we have VL data in the dataset's * datatype that must be reclaimed */ @@ -1067,9 +1021,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, hs_select_nelmts = 1; } /* rank */ - /* read/write: use the macro to check error, e.g. memory allocation error inside the library. */ - CHECK_H5DRW_ERROR(H5Dread, FAIL, dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); - CHECK_H5DRW_ERROR(H5Dwrite, FAIL, dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); + if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + if(H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* reclaim any VL memory, if necessary */ if (vl_data) @@ -1263,19 +1218,9 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, default: HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Object type not found"); - } /* switch */ - - /* free */ - if (buf != NULL) { - HDfree(buf); - buf = NULL; - } - } /* i */ - - /* Finalize (link) the stack of named datatypes (if any) */ - named_datatype_free(&named_dt_head, 0); - - return ret_value; + } /* switch */ + } /* end for */ + } /* end if */ done: H5E_BEGIN_TRY @@ -1292,8 +1237,7 @@ done: H5Tclose(wtype_id); H5Tclose(type_in); H5Tclose(type_out); - named_datatype_free(&named_dt_head, 1); - }H5E_END_TRY; + } H5E_END_TRY; /* free */ if (buf != NULL) @@ -1301,6 +1245,14 @@ done: if (hslab_buf != NULL) HDfree(hslab_buf); + /* Finalize (link) the stack of named datatypes (if any) */ + if (0 == ret_value && named_dt_head != NULL) + named_datatype_free(&named_dt_head, 0); + else + H5E_BEGIN_TRY { + named_datatype_free(&named_dt_head, 1); + } H5E_END_TRY; + return ret_value; } @@ -1334,8 +1286,11 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p for (i = 0; i < nfilters; i++) { cd_nelmts = NELMTS(cd_values); - filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts, - cd_values, sizeof(f_objname), f_objname, NULL); + if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts, + cd_values, sizeof(f_objname), f_objname, NULL)) < 0) { + HDstrcat(strfilter, "ERROR "); + continue; + } switch (filtn) { case H5Z_FILTER_NONE: @@ -1431,9 +1386,9 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t size /* Open files */ if ((infid = HDopen(infile, O_RDONLY, 0)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed input file <%s>", infile); if ((outfid = HDopen(outfile, O_WRONLY, 0644)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDopen failed output file <%s>", outfile); /* Copy the userblock from the input file to the output file */ while (size > 0) { @@ -1447,7 +1402,7 @@ static int copy_user_block(const char *infile, const char *outfile, hsize_t size else nread = HDread(infid, rbuf, (size_t)size); if (nread < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDread failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDread failed to read userblock"); /* Write buffer to destination file */ /* (compensating for interrupted writes & checking for errors, etc.) */ @@ -1509,24 +1464,20 @@ void print_user_block(const char *filename, hid_t fid) /* get user block size */ if(( fcpl = H5Fget_create_plist(fid)) < 0) { - error_msg("failed to retrieve file creation property list\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); } if(H5Pget_userblock(fcpl, &ub_size) < 0) { - error_msg("failed to retrieve userblock size\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size"); } if(H5Pclose(fcpl) < 0) { - error_msg("failed to close property list\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed to close property list"); } /* open file */ if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { - error_msg("failed to open file\n"); - HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed"); + HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed to open file <%s>", filename); } size = ub_size; diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 88178f6..523f81a 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -25,23 +25,71 @@ #define MIN(a,b) (((a)<(b)) ? (a) : (b)) /*------------------------------------------------------------------------- + * Function: aux_copy_obj + * + * Purpose: copy the object filters for object copy + * + * Return: 0 success, -1 failure + *------------------------------------------------------------------------- + */ +static int aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */ + const char* name, /* object name from traverse list */ + pack_info_t *objout /*OUT*/) /* info about object to filter */ +{ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int nfilters; /* number of filters in DCPL */ + char f_objname[256]; /* filter objname */ + H5D_layout_t layout; + int rank; /* rank of dataset */ + hsize_t chsize[64]; /* chunk size in elements */ + unsigned int i, j; + + /* get information about input filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed"); + /* copy filter_info_t structure */ + for (i = 0; i < nfilters; i++) { + if ((objout->filter[i].filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &objout->filter[i].filt_flag, &objout->filter[i].cd_nelmts, + objout->filter[i].cd_values, sizeof(f_objname), f_objname, NULL)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed"); + } + + objout->nfilters = nfilters; + HDstrcpy(objout->path, name); + + if ((layout = H5Pget_layout(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + objout->layout = layout; + + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); + objout->chunk.rank = rank; + for (i = 0; i < rank; i++) + objout->chunk.chunk_lengths[i] = chsize[i]; + } + +done: + return ret_value; +} + +/*------------------------------------------------------------------------- * Function: aux_find_obj * * Purpose: find the object name NAME (got from the traverse list) * in the repack options list - * *------------------------------------------------------------------------- */ static int aux_find_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { char *pdest; int result; unsigned int i; for (i = 0; i < options->op_tbl->nelems; i++) { - if (HDstrcmp(options->op_tbl->objs[i].path,name) == 0) { + if (HDstrcmp(options->op_tbl->objs[i].path, name) == 0) { *obj = options->op_tbl->objs[i]; return (int) i; } @@ -66,14 +114,12 @@ static int aux_find_obj(const char* name, /* object name from traverse list */ * in the repack options list; assign the filter information OBJ * * Return: 0 not found, 1 found - * *------------------------------------------------------------------------- */ static int aux_assign_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ - pack_info_t *obj /*OUT*/) /* info about object to filter */ + pack_opt_t *options, /* repack options */ + pack_info_t *obj /*OUT*/) /* info about object to filter */ { - int idx, i; pack_info_t tmp; @@ -83,7 +129,6 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ /* name was on input */ if (idx >= 0) { - /* applying to all objects */ if (options->all_layout) { /* assign the global layout info to the OBJ info */ @@ -92,8 +137,7 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ case H5D_CHUNKED: tmp.chunk.rank = options->chunk_g.rank; for (i = 0; i < tmp.chunk.rank; i++) - tmp.chunk.chunk_lengths[i] = - options->chunk_g.chunk_lengths[i]; + tmp.chunk.chunk_lengths[i] = options->chunk_g.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -110,8 +154,7 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ case H5D_CHUNKED: tmp.chunk.rank = options->op_tbl->objs[idx].chunk.rank; for (i = 0; i < tmp.chunk.rank; i++) - tmp.chunk.chunk_lengths[i] = - options->op_tbl->objs[idx].chunk.chunk_lengths[i]; + tmp.chunk.chunk_lengths[i] = options->op_tbl->objs[idx].chunk.chunk_lengths[i]; break; case H5D_LAYOUT_ERROR: case H5D_COMPACT: @@ -121,7 +164,6 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ default: break; }/*switch*/ - } /* applying to all objects */ @@ -180,95 +222,103 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */ * of H5Z_FILTER_NONE present in the PACK_INFO_T filter array * * Return: 0 success, -1 an error occured - * *------------------------------------------------------------------------- */ int apply_filters(const char* name, /* object name from traverse list */ - int rank, /* rank of dataset */ - hsize_t *dims, /* dimensions of dataset */ - size_t msize, /* size of type */ - hid_t dcpl_id, /* dataset creation property list */ - pack_opt_t *options, /* repack options */ - int *has_filter) /* (OUT) object NAME has a filter */ + int rank, /* rank of dataset */ + hsize_t *dims, /* dimensions of dataset */ + size_t msize, /* size of type */ + hid_t dcpl_id, /* dataset creation property list */ + pack_opt_t *options, /* repack options */ + int *has_filter) /* (OUT) object NAME has a filter */ { - int nfilters; /* number of filters in DCPL */ - hsize_t chsize[64]; /* chunk size in elements */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int nfilters; /* number of filters in DCPL */ + hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; - int i; + int i, j; pack_info_t obj; + pack_info_t filtobj; *has_filter = 0; if (rank == 0) /* scalar dataset, do not apply */ - return 0; + HGOTO_DONE(0); - /*------------------------------------------------------------------------- - * initialize the assigment object - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * initialize the assigment object + *------------------------------------------------------------------------- + */ init_packobject(&obj); + init_packobject(&filtobj); - /*------------------------------------------------------------------------- - * find options - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * find options + *------------------------------------------------------------------------- + */ if (aux_assign_obj(name, options, &obj) == 0) - return 0; + HGOTO_DONE(0); /* get information about input filters */ if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) - return -1; - - /*------------------------------------------------------------------------- - * check if we have filters in the pipeline - * we want to replace them with the input filters - * only remove if we are inserting new ones - *------------------------------------------------------------------------- - */ + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed"); + + + /*------------------------------------------------------------------------- + * check if we have filters in the pipeline + * we want to replace them with the input filters + * only remove if we are inserting new ones + *------------------------------------------------------------------------- + */ if (nfilters && obj.nfilters) { *has_filter = 1; if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) - return -1; - } + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); - /*------------------------------------------------------------------------- - * check if there is an existent chunk - * read it only if there is not a requested layout - *------------------------------------------------------------------------- - */ - if (obj.layout == -1) { - if ((layout = H5Pget_layout(dcpl_id)) < 0) - return -1; - - if (layout == H5D_CHUNKED) { - if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) - return -1; - obj.layout = H5D_CHUNKED; - obj.chunk.rank = rank; - for (i = 0; i < rank; i++) - obj.chunk.chunk_lengths[i] = chsize[i]; + /*------------------------------------------------------------------------- + * check if there is an existent chunk + * read it only if there is not a requested layout + *------------------------------------------------------------------------- + */ + if (obj.layout == -1) { + if ((layout = H5Pget_layout(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + + if (layout == H5D_CHUNKED) { + if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed"); + obj.layout = H5D_CHUNKED; + obj.chunk.rank = rank; + for (i = 0; i < rank; i++) + obj.chunk.chunk_lengths[i] = chsize[i]; + } } } + else if(nfilters) { + *has_filter = 1; + if (aux_copy_obj(dcpl_id, name, &filtobj) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed"); + } /*------------------------------------------------------------------------- - * the type of filter and additional parameter - * type can be one of the filters - * H5Z_FILTER_NONE 0 , uncompress if compressed - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - * H5Z_FILTER_SZIP 4 , szip compression - * H5Z_FILTER_NBIT 5 , nbit compression - * H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression - *------------------------------------------------------------------------- - */ + * the type of filter and additional parameter + * type can be one of the filters + * H5Z_FILTER_NONE 0 , uncompress if compressed + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + * H5Z_FILTER_SZIP 4 , szip compression + * H5Z_FILTER_NBIT 5 , nbit compression + * H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression + *------------------------------------------------------------------------- + */ if (obj.nfilters) { /*------------------------------------------------------------------------- - * filters require CHUNK layout; if we do not have one define a default - *------------------------------------------------------------------------- - */ + * filters require CHUNK layout; if we do not have one define a default + *------------------------------------------------------------------------- + */ if (obj.layout == -1) { /* stripmine info */ hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ @@ -277,9 +327,9 @@ int apply_filters(const char* name, /* object name from traverse list */ obj.chunk.rank = rank; /* - * determine the strip mine size. The strip mine is - * a hyperslab whose size is manageable. - */ + * determine the strip mine size. The strip mine is + * a hyperslab whose size is manageable. + */ sm_nbytes = msize; for (i = rank; i > 0; --i) { @@ -297,6 +347,9 @@ int apply_filters(const char* name, /* object name from traverse list */ } for (i = 0; i < obj.nfilters; i++) { + if (obj.filter[i].filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + switch (obj.filter[i].filtn) { /*------------------------------------------------------------------------- * H5Z_FILTER_NONE 0 , uncompress if compressed @@ -305,10 +358,10 @@ int apply_filters(const char* name, /* object name from traverse list */ case H5Z_FILTER_NONE: break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + *------------------------------------------------------------------------- + */ case H5Z_FILTER_DEFLATE: { unsigned aggression; /* the deflate level */ @@ -316,16 +369,16 @@ int apply_filters(const char* name, /* object name from traverse list */ aggression = obj.filter[i].cd_values[0]; /* set up for deflated data */ if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_deflate(dcpl_id, aggression) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_deflate failed"); } break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP 4 , szip compression - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP 4 , szip compression + *------------------------------------------------------------------------- + */ case H5Z_FILTER_SZIP: { unsigned options_mask; @@ -336,48 +389,47 @@ int apply_filters(const char* name, /* object name from traverse list */ /* set up for szip data */ if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_szip(dcpl_id, options_mask, pixels_per_block) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_szip failed"); } break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + *------------------------------------------------------------------------- + */ case H5Z_FILTER_SHUFFLE: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_shuffle(dcpl_id) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shuffle failed"); break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + *------------------------------------------------------------------------- + */ case H5Z_FILTER_FLETCHER32: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_fletcher32(dcpl_id) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fletcher32 failed"); break; - /*----------- ------------------------------------------------------------- - * H5Z_FILTER_NBIT , NBIT compression - *------------------------------------------------------------------------- - */ + /*----------- ------------------------------------------------------------- + * H5Z_FILTER_NBIT , NBIT compression + *------------------------------------------------------------------------- + */ case H5Z_FILTER_NBIT: if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_nbit(dcpl_id) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_nbit failed"); break; /*----------- ------------------------------------------------------------- * H5Z_FILTER_SCALEOFFSET , scale+offset compression *------------------------------------------------------------------------- */ - case H5Z_FILTER_SCALEOFFSET: { H5Z_SO_scale_type_t scale_type; @@ -387,19 +439,19 @@ int apply_filters(const char* name, /* object name from traverse list */ scale_factor = (int) obj.filter[i].cd_values[1]; if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_scaleoffset(dcpl_id, scale_type, scale_factor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_scaleoffset failed"); } break; default: { + if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); if (H5Pset_filter(dcpl_id, obj.filter[i].filtn, obj.filter[i].filt_flag, obj.filter[i].cd_nelmts, obj.filter[i].cd_values) < 0) - return -1; - if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_filter failed"); } break; } /* switch */ @@ -407,32 +459,42 @@ int apply_filters(const char* name, /* object name from traverse list */ } /*obj.nfilters*/ + if (filtobj.nfilters) { + for (i = 0; i < filtobj.nfilters; i++) { + if (filtobj.filter[i].filtn < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter"); + + if (H5Zfilter_avail(filtobj.filter[i].filtn) <= 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%d filter unavailable", filtobj.filter[i].filtn); + } /* for */ + } /* nfilters */ + /*------------------------------------------------------------------------- - * layout - *------------------------------------------------------------------------- - */ + * layout + *------------------------------------------------------------------------- + */ if (obj.layout >= 0) { /* a layout was defined */ if (H5Pset_layout(dcpl_id, obj.layout) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_layout failed"); if (H5D_CHUNKED == obj.layout) { if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed"); } else if (H5D_COMPACT == obj.layout) { if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alloc_time failed"); } /* remove filters for the H5D_CONTIGUOUS case */ else if (H5D_CONTIGUOUS == obj.layout) { if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed"); } - } - return 0; +done: + return ret_value; } diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 1d09e20..0c5aac6 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -50,8 +50,8 @@ static struct long_options l_opts[] = { { "metadata_block_size", require_arg, 'M' }, { "threshold", require_arg, 't' }, { "alignment", require_arg, 'a' }, - { "infile", require_arg, 'i' }, /* -i for backward compability */ - { "outfile", require_arg, 'o' }, /* -o for backward compability */ + { "infile", require_arg, 'i' }, /* -i for backward compability */ + { "outfile", require_arg, 'o' }, /* -o for backward compability */ { "sort_by", require_arg, 'q' }, { "sort_order", require_arg, 'z' }, { "enable-error-stack", no_arg, 'E' }, @@ -191,10 +191,6 @@ static void usage(const char *prog) { * Purpose: Shutdown MPI & HDF5 and call exit() * * Return: Does not return - * - * Programmer: Quincey Koziol - * Saturday, 31. January 2004 - * *------------------------------------------------------------------------- */ static void leave(int ret) @@ -209,11 +205,6 @@ static void leave(int ret) * Purpose: read comp and chunk options from a file * * Return: void, exit on error - * - * Programmer: pvn@ncsa.uiuc.edu - * - * Date: September, 22, 2003 - * *------------------------------------------------------------------------- */ static @@ -395,7 +386,6 @@ set_sort_order(const char *form) * Function: parse_command_line * * Purpose: parse command line input - * *------------------------------------------------------------------------- */ static @@ -408,13 +398,13 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) { - /* -i for backward compability */ + /* -i for backward compatibility */ case 'i': infile = opt_arg; has_i_o = 1; break; - /* -o for backward compability */ + /* -o for backward compatibility */ case 'o': outfile = opt_arg; has_i_o = 1; @@ -598,13 +588,6 @@ done: * Return: Success: EXIT_SUCCESS(0) * * Failure: EXIT_FAILURE(1) - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - * Comments: - * *------------------------------------------------------------------------- */ int main(int argc, const char **argv) @@ -636,8 +619,10 @@ int main(int argc, const char **argv) } /* initialize options */ - h5repack_init(&options, 0); - + if (h5repack_init(&options, 0, FALSE) < 0) { + h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* Initialize default indexing options */ sort_by = H5_INDEX_CRT_ORDER; diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index e24d479..b816176 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -21,23 +21,23 @@ * Purpose: initialize a pack_info_t structure * * Return: void - * - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ void init_packobject(pack_info_t *obj) { - int j, k; - - HDstrcpy(obj->path, "\0"); - for (j = 0; j < H5_REPACK_MAX_NFILTERS; j++) { - obj->filter[j].filtn = -1; - for (k = 0; k < CD_VALUES; k++) - obj->filter[j].cd_values[k] = 0; - } - obj->chunk.rank = -1; - obj->refobj_id = -1; - obj->layout = H5D_LAYOUT_ERROR; - obj->nfilters = 0; + int j, k; + + HDstrcpy(obj->path, "\0"); + for (j = 0; j < H5_REPACK_MAX_NFILTERS; j++) { + obj->filter[j].filtn = -1; + obj->filter[j].cd_nelmts = CD_VALUES; + for (k = 0; k < CD_VALUES; k++) + obj->filter[j].cd_values[k] = 0; + } + obj->chunk.rank = -1; + obj->refobj_id = -1; + obj->layout = H5D_LAYOUT_ERROR; + obj->nfilters = 0; } /*------------------------------------------------------------------------- @@ -46,20 +46,14 @@ void init_packobject(pack_info_t *obj) { * Purpose: auxiliary function, inserts the filter in object OBJS[ I ] * * Return: void - * *------------------------------------------------------------------------- */ -static void aux_tblinsert_filter(pack_opttbl_t *table, unsigned int I, - filter_info_t filt) { - if (table->objs[I].nfilters < H5_REPACK_MAX_NFILTERS) { - table->objs[I].filter[table->objs[I].nfilters++] = filt; - } - else { - error_msg( - "cannot insert the filter in this object.\ - Maximum capacity exceeded\n"); - } +static void aux_tblinsert_filter(pack_opttbl_t *table, unsigned int I, filter_info_t filt) { + if (table->objs[I].nfilters < H5_REPACK_MAX_NFILTERS) + table->objs[I].filter[table->objs[I].nfilters++] = filt; + else + H5TOOLS_INFO(H5E_tools_min_id_g, "cannot insert the filter in this object. Maximum capacity exceeded"); } /*------------------------------------------------------------------------- @@ -68,30 +62,27 @@ static void aux_tblinsert_filter(pack_opttbl_t *table, unsigned int I, * Purpose: auxiliary function, inserts the layout in object OBJS[ I ] * * Return: void - * *------------------------------------------------------------------------- */ - -static void aux_tblinsert_layout(pack_opttbl_t *table, unsigned int I, - pack_info_t *pack) { - int k; - - table->objs[I].layout = pack->layout; - if (H5D_CHUNKED == pack->layout) { - /* -2 means the NONE option, remove chunking - and set the layout to contiguous */ - if (pack->chunk.rank == -2) { - table->objs[I].layout = H5D_CONTIGUOUS; - table->objs[I].chunk.rank = -2; - } - /* otherwise set the chunking type */ - else { - table->objs[I].chunk.rank = pack->chunk.rank; - for (k = 0; k < pack->chunk.rank; k++) - table->objs[I].chunk.chunk_lengths[k] = - pack->chunk.chunk_lengths[k]; - } - } +static void aux_tblinsert_layout(pack_opttbl_t *table, unsigned int I, pack_info_t *pack) { + int k; + + table->objs[I].layout = pack->layout; + if (H5D_CHUNKED == pack->layout) { + /* -2 means the NONE option, remove chunking + and set the layout to contiguous */ + if (pack->chunk.rank == -2) { + table->objs[I].layout = H5D_CONTIGUOUS; + table->objs[I].chunk.rank = -2; + } + /* otherwise set the chunking type */ + else { + table->objs[I].chunk.rank = pack->chunk.rank; + for (k = 0; k < pack->chunk.rank; k++) + table->objs[I].chunk.chunk_lengths[k] = + pack->chunk.chunk_lengths[k]; + } + } } /*------------------------------------------------------------------------- @@ -100,7 +91,6 @@ static void aux_tblinsert_layout(pack_opttbl_t *table, unsigned int I, * Purpose: auxiliary function, increases the size of the collection by N_OBJS * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ static int @@ -111,7 +101,7 @@ aux_inctable(pack_opttbl_t *table, unsigned n_objs) table->size += n_objs; table->objs = (pack_info_t*) HDrealloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs == NULL) { - error_msg("not enough memory for options table\n"); + H5TOOLS_INFO(H5E_tools_min_id_g, "not enough memory for options table"); return -1; } @@ -128,32 +118,30 @@ aux_inctable(pack_opttbl_t *table, unsigned n_objs) * Purpose: init options table * * Return: 0, ok, -1, fail - * - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ int options_table_init(pack_opttbl_t **tbl) { - unsigned int i; - pack_opttbl_t *table; - - if (NULL == (table = (pack_opttbl_t *) HDmalloc(sizeof(pack_opttbl_t)))) { - error_msg("not enough memory for options table\n"); - return -1; - } - - table->size = 30; - table->nelems = 0; - if (NULL == (table->objs = - (pack_info_t*) HDmalloc(table->size * sizeof(pack_info_t)))) { - error_msg("not enough memory for options table\n"); - HDfree(table); - return -1; - } - - for (i = 0; i < table->size; i++) - init_packobject(&table->objs[i]); - - *tbl = table; - return 0; + unsigned int i; + pack_opttbl_t *table; + + if (NULL == (table = (pack_opttbl_t *) HDmalloc(sizeof(pack_opttbl_t)))) { + H5TOOLS_INFO(H5E_tools_min_id_g, "not enough memory for options table"); + return -1; + } + + table->size = 30; + table->nelems = 0; + if (NULL == (table->objs = (pack_info_t*) HDmalloc(table->size * sizeof(pack_info_t)))) { + H5TOOLS_INFO(H5E_tools_min_id_g, "not enough memory for options table"); + HDfree(table); + return -1; + } + + for (i = 0; i < table->size; i++) + init_packobject(&table->objs[i]); + + *tbl = table; + return 0; } @@ -163,14 +151,13 @@ int options_table_init(pack_opttbl_t **tbl) { * Purpose: free table memory * * Return: 0 - * *------------------------------------------------------------------------- */ int options_table_free(pack_opttbl_t *table) { - HDfree(table->objs); - HDfree(table); - return 0; + HDfree(table->objs); + HDfree(table); + return 0; } /*------------------------------------------------------------------------- @@ -179,12 +166,10 @@ int options_table_free(pack_opttbl_t *table) { * Purpose: add a layout option to the option list * * Return: 0, ok, -1, fail - * - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ int -options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, - pack_opttbl_t *table) +options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, pack_opttbl_t *table) { unsigned i, j, I; unsigned added = 0; @@ -205,7 +190,7 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, if (HDstrcmp(obj_list[j].obj,table->objs[i].path) == 0) { /* already chunk info inserted for this one; exit */ if (table->objs[i].chunk.rank > 0) { - error_msg("chunk information already inserted for <%s>\n", obj_list[j].obj); + H5TOOLS_INFO(H5E_tools_min_id_g, "chunk information already inserted for <%s>\n", obj_list[j].obj); HDexit(EXIT_FAILURE); } /* insert the layout info */ @@ -261,12 +246,10 @@ options_add_layout(obj_list_t *obj_list, unsigned n_objs, pack_info_t *pack, * Purpose: add a compression -f option to the option list * * Return: 0, ok, -1, fail - * *------------------------------------------------------------------------- */ int -options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, - pack_opttbl_t *table) +options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pack_opttbl_t *table) { unsigned int i, j, I; unsigned added = 0; @@ -279,7 +262,7 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, /* search if this object is already in the table; "path" is the key */ if (table->nelems > 0) { - /* go tru the supplied list of names */ + /* go through the supplied list of names */ for (j = 0; j < n_objs; j++) { /* linear table search */ for (i = 0; i < table->nelems; i++) { @@ -337,29 +320,26 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, * Purpose: get object from table; "path" is the key * * Return: pack_info_t* OBJECT or NULL if not found; PATH is the key - * *------------------------------------------------------------------------- */ pack_info_t* options_get_object(const char *path, pack_opttbl_t *table) { - unsigned int i; - char tbl_path[MAX_NC_NAME + 1]; /* +1 for start with "/" case */ - - for (i = 0; i < table->nelems; i++) { - /* make full path (start with "/") to compare correctly */ - if (HDstrncmp(table->objs[i].path, "/", 1)) { - HDstrcpy(tbl_path, "/"); - HDstrcat(tbl_path, table->objs[i].path); - } - else - HDstrcpy(tbl_path, table->objs[i].path); - - /* found it */ - if (HDstrcmp(tbl_path, path) == 0) { - return (&table->objs[i]); - } - } - - return NULL; -} + unsigned int i; + char tbl_path[MAX_NC_NAME + 1]; /* +1 for start with "/" case */ + + for (i = 0; i < table->nelems; i++) { + /* make full path (start with "/") to compare correctly */ + if (HDstrncmp(table->objs[i].path, "/", 1)) { + HDstrcpy(tbl_path, "/"); + HDstrcat(tbl_path, table->objs[i].path); + } + else + HDstrcpy(tbl_path, table->objs[i].path); + /* found it */ + if (HDstrcmp(tbl_path, path) == 0) { + return (&table->objs[i]); + } + } + return NULL; +} diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 4d62723..05af197 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -58,26 +58,30 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, /* check for the end of object list and number of objects */ for (i = 0, n = 0; i < len; i++) { c = str[i]; - if (c == ':') + if (c == ':') { end_obj = (int) i; + break; + } if (c == ',') n++; } + n++; /* Check for missing : */ if (end_obj == -1) { /* apply to all objects */ options->all_filter = 1; *is_glb = 1; + *n_objs = 1; } + else + *n_objs = n; - n++; obj_list = (obj_list_t *) HDmalloc(n * sizeof(obj_list_t)); if (obj_list == NULL) { error_msg("could not allocate object list\n"); return NULL; } - *n_objs = n; /* get object list */ if (end_obj > 0) @@ -89,6 +93,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, sobj[k] = '\0'; else sobj[k + 1] = '\0'; + HDstrcpy(obj_list[n].obj, sobj); HDmemset(sobj, 0, sizeof(sobj)); n++; @@ -142,7 +147,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, if (l == 2) { smask[l] = '\0'; i = len - 1; /* end */ - (*n_objs)--; /* we counted an extra ',' */ if (HDstrcmp(smask,"NN") == 0) filt->cd_values[j++] = H5_SZIP_NN_OPTION_MASK; else if (HDstrcmp(smask,"EC") == 0) @@ -193,7 +197,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, if (l == 2) { smask[l] = '\0'; i = len - 1; /* end */ - (*n_objs)--; /* we counted an extra ',' */ if (HDstrcmp(smask,"IN") == 0) filt->cd_values[j++] = H5Z_SO_INT; else if (HDstrcmp(smask, "DS") == H5Z_SO_FLOAT_DSCALE) diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 4220091..01b3407 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -30,15 +30,10 @@ static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, /*------------------------------------------------------------------------- * Function: do_copy_refobjs * - * Purpose: duplicate all referenced HDF5 objects in the file - * and create hard links - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December, 10, 2003 + * Purpose: duplicate all referenced HDF5 objects in the file + * and create hard links * + * Return: 0, ok, -1 no *------------------------------------------------------------------------- */ @@ -47,41 +42,39 @@ int do_copy_refobjs(hid_t fidin, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t grp_in = (-1); /* read group ID */ - hid_t grp_out = (-1); /* write group ID */ - hid_t dset_in = (-1); /* read dataset ID */ - hid_t dset_out = (-1); /* write dataset ID */ - hid_t type_in = (-1); /* named type ID */ - hid_t dcpl_id = (-1); /* dataset creation property list ID */ - hid_t space_id = (-1); /* space ID */ - hid_t ftype_id = (-1); /* file data type ID */ - hid_t mtype_id = (-1); /* memory data type ID */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t grp_in = -1; /* read group ID */ + hid_t grp_out = -1; /* write group ID */ + hid_t dset_in = -1; /* read dataset ID */ + hid_t dset_out = -1; /* write dataset ID */ + hid_t type_in = -1; /* named type ID */ + hid_t dcpl_id = -1; /* dataset creation property list ID */ + hid_t space_id = -1; /* space ID */ + hid_t ftype_id = -1; /* file data type ID */ + hid_t mtype_id = -1; /* memory data type ID */ size_t msize; /* memory size of memory type */ hsize_t nelmts; /* number of elements in dataset */ int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */ unsigned int i, j; int k; - named_dt_t *named_dt_head=NULL; /* Pointer to the stack of named datatypes - copied */ + named_dt_t *named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */ /*------------------------------------------------------------------------- * browse *------------------------------------------------------------------------- */ for(i = 0; i < travt->nobjs; i++) { - switch(travt->objs[i].type) - { + switch(travt->objs[i].type) { /*------------------------------------------------------------------------- - * H5TRAV_TYPE_GROUP - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_GROUP + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_GROUP: /*------------------------------------------------------------------------- - * copy referenced objects in attributes - *------------------------------------------------------------------------- - */ + * copy referenced objects in attributes + *------------------------------------------------------------------------- + */ if((grp_out = H5Gopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); @@ -97,18 +90,18 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); /*------------------------------------------------------------------------- - * check for hard links - *------------------------------------------------------------------------- - */ + * check for hard links + *------------------------------------------------------------------------- + */ if(travt->objs[i].nlinks) for(j = 0; j < travt->objs[i].nlinks; j++) H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT); break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_DATASET - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_DATASET + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_DATASET: if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); @@ -141,16 +134,16 @@ int do_copy_refobjs(hid_t fidin, */ if(h5tools_canreadf(NULL, dcpl_id) == 1) { /*------------------------------------------------------------------------- - * test for a valid output dataset - *------------------------------------------------------------------------- - */ + * test for a valid output dataset + *------------------------------------------------------------------------- + */ dset_out = FAIL; /*------------------------------------------------------------------------- - * object references are a special case - * we cannot just copy the buffers, but instead we recreate the reference - *------------------------------------------------------------------------- - */ + * object references are a special case + * we cannot just copy the buffers, but instead we recreate the reference + *------------------------------------------------------------------------- + */ if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { hid_t refobj_id; hobj_ref_t *refbuf = NULL; /* buffer for object references */ @@ -159,9 +152,9 @@ int do_copy_refobjs(hid_t fidin, unsigned u; /*------------------------------------------------------------------------- - * read to memory - *------------------------------------------------------------------------- - */ + * read to memory + *------------------------------------------------------------------------- + */ if(nelmts) { buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf==NULL) { @@ -201,9 +194,9 @@ int do_copy_refobjs(hid_t fidin, } /*nelmts*/ /*------------------------------------------------------------------------- - * create/write dataset/close - *------------------------------------------------------------------------- - */ + * create/write dataset/close + *------------------------------------------------------------------------- + */ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); if(nelmts) @@ -223,11 +216,10 @@ int do_copy_refobjs(hid_t fidin, } /*H5T_STD_REF_OBJ*/ /*------------------------------------------------------------------------- - * dataset region references - *------------------------------------------------------------------------- - */ - else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) - { + * dataset region references + *------------------------------------------------------------------------- + */ + else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { hid_t refobj_id; hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */ hdset_reg_ref_t *buf = NULL; /* output buffer */ @@ -235,9 +227,9 @@ int do_copy_refobjs(hid_t fidin, unsigned u; /*------------------------------------------------------------------------- - * read input to memory - *------------------------------------------------------------------------- - */ + * read input to memory + *------------------------------------------------------------------------- + */ if(nelmts) { buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { @@ -248,9 +240,9 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /*------------------------------------------------------------------------- - * create output - *------------------------------------------------------------------------- - */ + * create output + *------------------------------------------------------------------------- + */ refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { printf("cannot allocate memory\n"); @@ -289,9 +281,9 @@ int do_copy_refobjs(hid_t fidin, } /*nelmts*/ /*------------------------------------------------------------------------- - * create/write dataset/close - *------------------------------------------------------------------------- - */ + * create/write dataset/close + *------------------------------------------------------------------------- + */ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed"); if(nelmts) @@ -310,25 +302,25 @@ int do_copy_refobjs(hid_t fidin, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed"); } /* H5T_STD_REF_DSETREG */ /*------------------------------------------------------------------------- - * not references, open previously created object in 1st traversal - *------------------------------------------------------------------------- - */ + * not references, open previously created object in 1st traversal + *------------------------------------------------------------------------- + */ else { if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); } /* end else */ /*------------------------------------------------------------------------- - * copy referenced objects in attributes - *------------------------------------------------------------------------- - */ + * copy referenced objects in attributes + *------------------------------------------------------------------------- + */ if(copy_refs_attr(dset_in, dset_out, options, travt, fidout) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); /*------------------------------------------------------------------------- - * check for hard links - *------------------------------------------------------------------------- - */ + * check for hard links + *------------------------------------------------------------------------- + */ if(travt->objs[i].nlinks) for(j = 0; j < travt->objs[i].nlinks; j++) H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT); @@ -338,9 +330,9 @@ int do_copy_refobjs(hid_t fidin, } /*can_read*/ /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ + * close + *------------------------------------------------------------------------- + */ if(H5Tclose(ftype_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Tclose(mtype_id) < 0) @@ -354,9 +346,9 @@ int do_copy_refobjs(hid_t fidin, break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_NAMED_DATATYPE - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_NAMED_DATATYPE + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_NAMED_DATATYPE: if((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); @@ -365,9 +357,9 @@ int do_copy_refobjs(hid_t fidin, break; /*------------------------------------------------------------------------- - * H5TRAV_TYPE_LINK - *------------------------------------------------------------------------- - */ + * H5TRAV_TYPE_LINK + *------------------------------------------------------------------------- + */ case H5TRAV_TYPE_LINK: /*nothing to do */ break; @@ -410,27 +402,22 @@ done: /*------------------------------------------------------------------------- * Function: copy_refs_attr * - * Purpose: duplicate all referenced HDF5 located in attributes - * relative to LOC_IN, which is obtained either from - * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); - * loc_id = H5Dopen2(fid, name, H5P_DEFAULT); - * loc_id = H5Topen2(fid, name, H5P_DEFAULT); - * - * Return: 0, ok, -1 no + * Purpose: duplicate all referenced HDF5 located in attributes + * relative to LOC_IN, which is obtained either from + * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); + * loc_id = H5Dopen2(fid, name, H5P_DEFAULT); + * loc_id = H5Topen2(fid, name, H5P_DEFAULT); * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Return: 0, ok, -1 no * - * Modifier: xcao@hdfgroup.org, 9/12/2011 - * Update values of references(object and region) for the following types: + * Modified: + * Update values of references(object and region) for the following types: * 1) References, * 2) ARRAY of reference, * 3) VLEN of references. * 4) COMPOUND of references. - * This function does not handle references in other complicated structures, - * such as references in nested compound datatypes. - * - * Date: October, 28, 2003 - * + * This function does not handle references in other complicated structures, + * such as references in nested compound datatypes. *------------------------------------------------------------------------- */ @@ -438,30 +425,32 @@ static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, - hid_t fidout /* for saving references */ - ) + hid_t fidout) /* for saving references */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t attr_id = -1; /* attr ID */ - hid_t attr_out = -1; /* attr ID */ - hid_t space_id = -1; /* space ID */ - hid_t ftype_id = -1; /* file data type ID */ - hid_t mtype_id = -1; /* memory data type ID */ - size_t msize; /* memory size of type */ - hsize_t nelmts; /* number of elements in dataset */ - hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ - char name[255]; - H5O_info_t oinfo; /* Object info */ - unsigned u, i, j; - int rank; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t attr_id = -1; /* attr ID */ + hid_t attr_out = -1; /* attr ID */ + hid_t space_id = -1; /* space ID */ + hid_t ftype_id = -1; /* file data type ID */ + hid_t mtype_id = -1; /* memory data type ID */ + size_t msize; /* memory size of type */ + hsize_t nelmts; /* number of elements in dataset */ + hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ + char name[255]; + H5O_info_t oinfo; /* Object info */ + unsigned u, i, j; + int rank; H5T_class_t type_class = -1; - hbool_t is_ref=0, is_ref_vlen=0, is_ref_array=0, is_ref_comp=0; - void *refbuf = NULL; - void *buf = NULL; - const char* refname = NULL; - unsigned *ref_comp_index = NULL; - size_t *ref_comp_size = NULL; - int ref_comp_field_n = 0; + hbool_t is_ref = 0, + is_ref_vlen = 0, + is_ref_array = 0, + is_ref_comp = 0; + void *refbuf = NULL; + void *buf = NULL; + const char *refname = NULL; + unsigned *ref_comp_index = NULL; + size_t *ref_comp_size = NULL; + int ref_comp_field_n = 0; if(H5Oget_info(loc_in, &oinfo) < 0) @@ -492,7 +481,7 @@ static int copy_refs_attr(hid_t loc_in, hid_t base_type; base_type = H5Tget_super(ftype_id); - is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE); + is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); H5Tclose(base_type); } @@ -500,7 +489,7 @@ static int copy_refs_attr(hid_t loc_in, hid_t base_type; base_type = H5Tget_super(ftype_id); - is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE); + is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); H5Tclose(base_type); } @@ -515,9 +504,9 @@ static int copy_refs_attr(hid_t loc_in, ref_comp_field_n = 0; for (i=0; i<(unsigned)nmembers; i++) { - hid_t mtid = H5Tget_member_type( ftype_id, i ); + hid_t mtid = H5Tget_member_type(ftype_id, i); - if ((H5Tget_class(mtid)==H5T_REFERENCE)) { + if ((H5Tget_class(mtid) == H5T_REFERENCE)) { ref_comp_index[ref_comp_field_n] = i; ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid); ref_comp_field_n++; @@ -627,9 +616,9 @@ static int copy_refs_attr(hid_t loc_in, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed"); /*------------------------------------------------------------------------- - * create output - *------------------------------------------------------------------------- - */ + * create output + *------------------------------------------------------------------------- + */ refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { printf( "cannot allocate memory\n" ); @@ -669,7 +658,8 @@ static int copy_refs_attr(hid_t loc_in, HDmemcpy(&(ptr[j]), &ref_out, msize); } } /* for (i=0; inobjs; u++) { @@ -830,18 +817,16 @@ out: /*------------------------------------------------------------------------- * Function: Update_Ref_value * - * Purpose: Update a reference value - * - * Programmer: xcao@hdfgroup.org 9/12/2011 - * + * Purpose: Update a reference value *------------------------------------------------------------------------- */ static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, hid_t fid_out, void *ref_out, trav_table_t *travt) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - const char* ref_obj_name; - hid_t space_id=-1, ref_obj_id=-1; + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + const char *ref_obj_name; + hid_t space_id = -1; + hid_t ref_obj_id = -1; ref_obj_id = H5Rdereference(obj_id, ref_type, ref_in); if (ref_obj_id < 0) diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 003875d..cad92ab 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -33,34 +33,29 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil * 1 match * 0 do not match * -1 error - * - * Programmer: Pedro Vicente, pvn@hdfgroup.org - * - * Date: December 19, 2003 - * *------------------------------------------------------------------------- */ int -h5repack_verify(const char *out_fname, pack_opt_t *options) +h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fidin = -1; /* file ID for input file*/ hid_t fidout = -1; /* file ID for output file*/ hid_t did = -1; /* dataset ID */ hid_t pid = -1; /* dataset creation property list ID */ hid_t sid = -1; /* space ID */ hid_t tid = -1; /* type ID */ + int ok = 1; /* step results */ unsigned int i; trav_table_t *travt = NULL; - int ok = 1; /* open the output file */ if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed on <%s>", out_fname); - for(i = 0; i < options->op_tbl->nelems; i++) - { - char* name = options->op_tbl->objs[i].path; + for(i = 0; i < options->op_tbl->nelems; i++) { + char *name = options->op_tbl->objs[i].path; pack_info_t *obj = &options->op_tbl->objs[i]; /*------------------------------------------------------------------------- @@ -68,7 +63,7 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) *------------------------------------------------------------------------- */ if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on <%s>", name); if((sid = H5Dget_space(did)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); if((pid = H5Dget_create_plist(did)) < 0) @@ -83,7 +78,6 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) if(verify_filters(pid, tid, obj->nfilters, obj->filter) <= 0) ok = 0; - /*------------------------------------------------------------------------- * layout check *------------------------------------------------------------------------- @@ -103,18 +97,14 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); if (H5Tclose(tid) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); - } - /*------------------------------------------------------------------------- * check for the "all" objects option *------------------------------------------------------------------------- */ - if(options->all_filter == 1 || options->all_layout == 1) - { - + if(options->all_filter == 1 || options->all_layout == 1) { /* Initialize indexing options */ h5trav_set_index(sort_by, sort_order); /* init table */ @@ -124,19 +114,16 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) if(h5trav_gettable(fidout, travt) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); - for(i = 0; i < travt->nobjs; i++) - { + for(i = 0; i < travt->nobjs; i++) { char *name = travt->objs[i].name; - if(travt->objs[i].type == H5TRAV_TYPE_DATASET) - { - + if(travt->objs[i].type == H5TRAV_TYPE_DATASET) { /*------------------------------------------------------------------------- * open *------------------------------------------------------------------------- */ if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on <%s>", name); if((sid = H5Dget_space(did)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); if((pid = H5Dget_create_plist(did)) < 0) @@ -148,8 +135,7 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) * filter check *------------------------------------------------------------------------- */ - if(options->all_filter == 1) - { + if(options->all_filter == 1) { if(verify_filters(pid, tid, options->n_filter_g, options->filter_g) <= 0) ok = 0; } @@ -158,8 +144,7 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) * layout check *------------------------------------------------------------------------- */ - if(options->all_layout == 1) - { + if(options->all_layout == 1) { pack_info_t pack; init_packobject(&pack); @@ -169,7 +154,6 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) ok = 0; } - /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- @@ -183,28 +167,22 @@ h5repack_verify(const char *out_fname, pack_opt_t *options) if (H5Tclose(tid) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); } /* if */ - } /* i */ /* free table */ trav_table_free(travt); + travt = NULL; } - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - - if (H5Fclose(fidout) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed"); - - return ok; + ret_value = ok; done: H5E_BEGIN_TRY { H5Pclose(pid); H5Sclose(sid); H5Dclose(did); + H5Tclose(tid); + H5Fclose(fidin); H5Fclose(fidout); if (travt) trav_table_free(travt); @@ -213,28 +191,22 @@ done: return ret_value; } /* h5repack_verify() */ - - /*------------------------------------------------------------------------- * Function: verify_layout * - * Purpose: verify which layout is present in the property list DCPL_ID - * - * H5D_COMPACT = 0 - * H5D_CONTIGUOUS = 1 - * H5D_CHUNKED = 2 - * - * Return: 1 has, 0 does not, -1 error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 30, 2003 + * Purpose: verify which layout is present in the property list DCPL_ID + * H5D_COMPACT = 0 + * H5D_CONTIGUOUS = 1 + * H5D_CHUNKED = 2 * + * Return: + * 1 has, + * 0 does not, + * -1 error *------------------------------------------------------------------------- */ -int verify_layout(hid_t pid, - pack_info_t *obj) +int verify_layout(hid_t pid, pack_info_t *obj) { hsize_t chsize[64]; /* chunk size in elements */ H5D_layout_t layout; /* layout */ @@ -247,7 +219,7 @@ int verify_layout(hid_t pid, return -1; /* a non chunked layout was requested on a filtered object */ - if (nfilters && obj->layout!=H5D_CHUNKED) + if (nfilters && obj->layout != H5D_CHUNKED) return 0; /* get layout */ @@ -257,13 +229,12 @@ int verify_layout(hid_t pid, if (obj->layout != layout) return 0; - if (layout==H5D_CHUNKED) - { - if ((rank = H5Pget_chunk(pid,NELMTS(chsize),chsize/*out*/)) < 0) + if (layout==H5D_CHUNKED) { + if ((rank = H5Pget_chunk(pid, NELMTS(chsize), chsize/*out*/)) < 0) return -1; if (obj->chunk.rank != rank) return 0; - for ( i=0; ichunk.chunk_lengths[i]) return 0; } @@ -274,58 +245,40 @@ int verify_layout(hid_t pid, /*------------------------------------------------------------------------- * Function: h5repack_cmp_pl * - * Purpose: compare 2 files for identical property lists of all objects - * - * Return: 1=identical, 0=not identical, -1=error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 31, 2003 + * Purpose: compare 2 files for identical property lists of all objects * + * Return: + * 1 = identical, + * 0 = not identical, + * -1 = error *------------------------------------------------------------------------- */ -int h5repack_cmp_pl(const char *fname1, - const char *fname2) +int h5repack_cmp_pl(const char *fname1, const char *fname2) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fid1=-1; /* file ID */ - hid_t fid2=-1; /* file ID */ - hid_t dset1=-1; /* dataset ID */ - hid_t dset2=-1; /* dataset ID */ - hid_t gid=-1; /* group ID */ - hid_t dcpl1=-1; /* dataset creation property list ID */ - hid_t dcpl2=-1; /* dataset creation property list ID */ - hid_t gcplid=-1; /* group creation property list */ - unsigned crt_order_flag1; /* group creation order flag */ - unsigned crt_order_flag2; /* group creation order flag */ - trav_table_t *trav=NULL; - int ret=1; + int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + hid_t fid1 =-1; /* file ID */ + hid_t fid2 =-1; /* file ID */ + hid_t dset1 =-1; /* dataset ID */ + hid_t dset2 =-1; /* dataset ID */ + hid_t gid =-1; /* group ID */ + hid_t dcpl1 =-1; /* dataset creation property list ID */ + hid_t dcpl2 =-1; /* dataset creation property list ID */ + hid_t gcplid =-1; /* group creation property list */ + unsigned crt_order_flag1; /* group creation order flag */ + unsigned crt_order_flag2; /* group creation order flag */ + trav_table_t *trav = NULL; unsigned int i; /*------------------------------------------------------------------------- * open the files *------------------------------------------------------------------------- */ - - /* disable error reporting */ - H5E_BEGIN_TRY - { - - /* Open the files */ - if ((fid1 = H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) - { - error_msg("<%s>: %s\n", fname1, H5FOPENERROR ); - return -1; - } - if ((fid2 = H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) - { - error_msg("<%s>: %s\n", fname2, H5FOPENERROR ); - H5Fclose(fid1); - return -1; - } - /* enable error reporting */ - } H5E_END_TRY; + /* Open the files */ + if ((fid1 = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR); + if ((fid2 = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR); /*------------------------------------------------------------------------- * get file table list of objects @@ -342,14 +295,10 @@ int h5repack_cmp_pl(const char *fname1, * traverse the suppplied object list *------------------------------------------------------------------------- */ - for(i = 0; i < trav->nobjs; i++) - { - - if(trav->objs[i].type == H5TRAV_TYPE_GROUP) - { - + for(i = 0; i < trav->nobjs; i++) { + if(trav->objs[i].type == H5TRAV_TYPE_GROUP) { if ((gid = H5Gopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed on first <%s>", trav->objs[i].name); if ((gcplid = H5Gget_create_plist(gid)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed"); if (H5Pget_link_creation_order(gcplid, &crt_order_flag1) < 0) @@ -360,7 +309,7 @@ int h5repack_cmp_pl(const char *fname1, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); if ((gid = H5Gopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed on second <%s>", trav->objs[i].name); if ((gcplid = H5Gget_create_plist(gid)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gget_create_plist failed"); if (H5Pget_link_creation_order(gcplid, &crt_order_flag2) < 0) @@ -370,21 +319,14 @@ int h5repack_cmp_pl(const char *fname1, if (H5Gclose(gid) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed"); - if (crt_order_flag1 != crt_order_flag2) { - error_msg("property lists for <%s> are different\n",trav->objs[i].name); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed"); - } - + if (crt_order_flag1 != crt_order_flag2) + HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name); } - - - - else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) - { + else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) { if((dset1 = H5Dopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on first <%s>", trav->objs[i].name); if((dset2 = H5Dopen2(fid2, trav->objs[i].name, H5P_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed on second <%s>", trav->objs[i].name); if((dcpl1 = H5Dget_create_plist(dset1)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((dcpl2 = H5Dget_create_plist(dset2)) < 0) @@ -394,13 +336,11 @@ int h5repack_cmp_pl(const char *fname1, * compare the property lists *------------------------------------------------------------------------- */ - if((ret = H5Pequal(dcpl1, dcpl2)) < 0) + if((ret_value = H5Pequal(dcpl1, dcpl2)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pequal failed"); - if(ret == 0) { - error_msg("property lists for <%s> are different\n",trav->objs[i].name); - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed"); - } + if(ret_value == 0) + HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name); /*------------------------------------------------------------------------- * close @@ -415,29 +355,8 @@ int h5repack_cmp_pl(const char *fname1, if(H5Dclose(dset2) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); } /*if*/ - } /*i*/ - - /*------------------------------------------------------------------------- - * free - *------------------------------------------------------------------------- - */ - - trav_table_free(trav); + } /*for*/ - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - - H5Fclose(fid1); - H5Fclose(fid2); - - return ret; - -/*------------------------------------------------------------------------- -* error -*------------------------------------------------------------------------- -*/ done: H5E_BEGIN_TRY { @@ -449,7 +368,8 @@ done: H5Fclose(fid2); H5Pclose(gcplid); H5Gclose(gid); - trav_table_free(trav); + if(trav) + trav_table_free(trav); } H5E_END_TRY; return ret_value; @@ -459,19 +379,14 @@ done: /*------------------------------------------------------------------------- * Function: verify_filters * - * Purpose: verify if all requested filters in the array FILTER obtained - * from user input are present in the property list PID obtained from - * the output file + * Purpose: verify if all requested filters in the array FILTER obtained + * from user input are present in the property list PID obtained from + * the output file * * Return: - * 1 match - * 0 do not match - * -1 error - * - * Programmer: Pedro Vicente, pvn@hdfgroup.org - * - * Date: December 21, 2007 - * + * 1 match + * 0 do not match + * -1 error *------------------------------------------------------------------------- */ @@ -495,11 +410,11 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) /* if we do not have filters and the requested filter is NONE, return 1 */ if(!nfilters_dcpl && nfilters == 1 && - filter[0].filtn == H5Z_FILTER_NONE ) + filter[0].filtn == H5Z_FILTER_NONE) return 1; /* else the numbers of filters must match */ - if (nfilters_dcpl != nfilters ) + if (nfilters_dcpl != nfilters) return 0; /*------------------------------------------------------------------------- @@ -507,26 +422,25 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) *------------------------------------------------------------------------- */ - for( i = 0; i < nfilters_dcpl; i++) - { + for (i = 0; i < nfilters_dcpl; i++) { cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter2(pid, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); /* filter ID */ + if (filtn < 0) + return -1; if (filtn != filter[i].filtn) return 0; /* compare client data values. some filters do return local values */ - switch (filtn) - { - + switch (filtn) { case H5Z_FILTER_NONE: break; case H5Z_FILTER_SHUFFLE: /* 1 private client value is returned by DCPL */ - if ( cd_nelmts != H5Z_SHUFFLE_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SHUFFLE_USER_NPARMS ) + if (cd_nelmts != H5Z_SHUFFLE_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SHUFFLE_USER_NPARMS) return 0; /* get dataset's type size */ @@ -534,31 +448,31 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) return -1; /* the private client value holds the dataset's type size */ - if ( size != cd_values[0] ) + if (size != cd_values[0]) return 0; break; case H5Z_FILTER_SZIP: /* 4 private client values are returned by DCPL */ - if ( cd_nelmts != H5Z_SZIP_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SZIP_USER_NPARMS ) + if (cd_nelmts != H5Z_SZIP_TOTAL_NPARMS && filter[i].cd_nelmts != H5Z_SZIP_USER_NPARMS) return 0; /* "User" parameter for pixels-per-block (index 1) */ - if ( cd_values[H5Z_SZIP_PARM_PPB] != filter[i].cd_values[H5Z_SZIP_PARM_PPB] ) + if (cd_values[H5Z_SZIP_PARM_PPB] != filter[i].cd_values[H5Z_SZIP_PARM_PPB]) return 0; break; case H5Z_FILTER_NBIT: /* only client data values number of values checked */ - if ( H5Z_NBIT_USER_NPARMS != filter[i].cd_nelmts) + if (H5Z_NBIT_USER_NPARMS != filter[i].cd_nelmts) return 0; break; case H5Z_FILTER_SCALEOFFSET: /* only client data values checked */ - for( j = 0; j < H5Z_SCALEOFFSET_USER_NPARMS; j++) + for (j = 0; j < H5Z_SCALEOFFSET_USER_NPARMS; j++) if (cd_values[j] != filter[i].cd_values[j]) return 0; break; @@ -567,20 +481,20 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) case H5Z_FILTER_FLETCHER32: case H5Z_FILTER_DEFLATE: - if ( cd_nelmts != filter[i].cd_nelmts) + if (cd_nelmts != filter[i].cd_nelmts) return 0; - for( j = 0; j < cd_nelmts; j++) + for (j = 0; j < cd_nelmts; j++) if (cd_values[j] != filter[i].cd_values[j]) return 0; break; default: - if ( cd_nelmts != filter[i].cd_nelmts) + if (cd_nelmts != filter[i].cd_nelmts) return 0; - for( j = 0; j < cd_nelmts; j++) + for (j = 0; j < cd_nelmts; j++) if (cd_values[j] != filter[i].cd_values[j]) return 0; break; @@ -590,4 +504,3 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) return 1; } - diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 30b879c..7e4fad4 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Copyright by The HDF Group. * -* Copyright by the Board of Trustees of the University of Illinois. * -* All rights reserved. * -* * -* This file is part of HDF5. The full HDF5 copyright notice, including * -* terms governing use, modification, and redistribution, is contained in * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" #include "h5test.h" @@ -112,9 +112,9 @@ const char *H5REPACK_FILENAMES[] = { #define REG_REF_DS1 "Dset_REGREF" /*------------------------------------------------------------------------- -* prototypes -*------------------------------------------------------------------------- -*/ + * prototypes + *------------------------------------------------------------------------- + */ static int make_all_objects(hid_t loc_id); static int make_attributes(hid_t loc_id); static int make_hlinks(hid_t loc_id); @@ -150,27 +150,23 @@ static int make_complex_attr_references(hid_t loc_id); /*------------------------------------------------------------------------- -* Function: main -* -* Purpose: Executes h5repack tests -* -* Return: Success: zero -* Failure: 1 -* -* Programmer: Pedro Vicente -* January, 6, 2004 -* -*------------------------------------------------------------------------- -*/ + * Function: main + * + * Purpose: Executes h5repack tests + * + * Return: Success: zero + * Failure: 1 + *------------------------------------------------------------------------- + */ int main (void) { pack_opt_t pack_options; diff_opt_t diff_options; - h5_stat_t file_stat; + h5_stat_t file_stat; h5_stat_size_t fsize1, fsize2; /* file sizes */ #if defined (H5_HAVE_FILTER_SZIP) - int szip_can_encode = 0; + int szip_can_encode = 0; #endif h5tools_setprogname(PROGRAMNAME); @@ -187,7 +183,7 @@ int main (void) puts("Testing h5repack:"); /* make the test files */ - TESTING(" generating datasets"); + TESTING(" generating files for testing"); if (make_testfiles() < 0) GOERROR; PASSED(); @@ -207,128 +203,129 @@ int main (void) */ TESTING(" copy of datasets (fill values)"); - if (h5repack_init (&pack_options, 0) < 0) + + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME0,FNAME0OUT,&pack_options) < 0) + if (h5repack(FNAME0, FNAME0OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME0,FNAME0OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME0, FNAME0OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME0OUT,&pack_options)<=0) + if (h5repack_verify(FNAME0, FNAME0OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME0,FNAME0OUT)<=0) + if (h5repack_cmp_pl(FNAME0, FNAME0OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with all kinds of dataset datatypes - *------------------------------------------------------------------------- - */ + * file with all kinds of dataset datatypes + *------------------------------------------------------------------------- + */ TESTING(" copy of datasets (all datatypes)"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME1,FNAME1OUT,&pack_options) < 0) + if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME1,FNAME1OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME1OUT,&pack_options)<=0) + if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME1,FNAME1OUT)<=0) + if (h5repack_cmp_pl(FNAME1, FNAME1OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with attributes - *------------------------------------------------------------------------- - */ + * file with attributes + *------------------------------------------------------------------------- + */ TESTING(" copy of datasets (attributes)"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME2,FNAME2OUT,&pack_options) < 0) + if (h5repack(FNAME2, FNAME2OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME2,FNAME2OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME2, FNAME2OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME2OUT,&pack_options)<=0) + if (h5repack_verify(FNAME2, FNAME2OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME2,FNAME2OUT)<=0) + if (h5repack_cmp_pl(FNAME2, FNAME2OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with hardlinks - *------------------------------------------------------------------------- - */ + * file with hardlinks + *------------------------------------------------------------------------- + */ TESTING(" copy of datasets (hardlinks)"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME3,FNAME3OUT,&pack_options) < 0) + if (h5repack(FNAME3, FNAME3OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME3,FNAME3OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME3, FNAME3OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME3OUT,&pack_options)<=0) + if (h5repack_verify(FNAME3, FNAME3OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME3,FNAME3OUT)<=0) + if (h5repack_cmp_pl(FNAME3, FNAME3OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * alloc early test - *------------------------------------------------------------------------- - */ + * alloc early test + *------------------------------------------------------------------------- + */ TESTING(" copy of allocation early file"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME5,FNAME5OUT,&pack_options) < 0) + if (h5repack(FNAME5, FNAME5OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME5,FNAME5OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME5, FNAME5OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME5OUT,&pack_options)<=0) + if (h5repack_verify(FNAME5, FNAME5OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * the remaining files differ in the dcpl's - *------------------------------------------------------------------------- - */ + * the remaining files differ in the dcpl's + *------------------------------------------------------------------------- + */ /*------------------------------------------------------------------------- - * deflate - *------------------------------------------------------------------------- - */ + * deflate + *------------------------------------------------------------------------- + */ TESTING(" adding deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) + if (h5repack_addfilter("dset1:GZIP=9", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT, &pack_options) <= 0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); #else @@ -336,27 +333,27 @@ int main (void) #endif /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding deflate filter to all"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("GZIP=1", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -365,40 +362,40 @@ int main (void) #endif /*------------------------------------------------------------------------- - * SZIP - *------------------------------------------------------------------------- - */ + * SZIP + *------------------------------------------------------------------------- + */ TESTING(" adding szip filter"); #if defined (H5_HAVE_FILTER_SZIP) - if (h5tools_can_encode(H5Z_FILTER_SZIP) >0) { + if (h5tools_can_encode(H5Z_FILTER_SZIP) > 0) szip_can_encode = 1; - } /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ if (szip_can_encode) { - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init (&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options) < 0) + if (h5repack_addfilter("dset2:SZIP=8,EC", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset2:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset2:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -407,28 +404,29 @@ int main (void) /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding szip filter to all"); #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("SZIP=8,NN",&pack_options) < 0) + if (h5repack_addfilter("SZIP=8,NN", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -439,47 +437,47 @@ int main (void) TESTING(" addding shuffle filter"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) + if (h5repack_addfilter("dset1:SHUF", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" addding shuffle filter to all"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("SHUF",&pack_options) < 0) + if (h5repack_addfilter("SHUF", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -488,48 +486,45 @@ int main (void) TESTING(" adding checksum filter"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ - - if (h5repack_init (&pack_options, 0) < 0) + * test an individual object option + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) + if (h5repack_addfilter("dset1:FLET", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ - - + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding checksum filter to all"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("FLET",&pack_options) < 0) + if (h5repack_addfilter("FLET", &pack_options) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -538,38 +533,38 @@ int main (void) TESTING(" filter queue fletcher, shuffle, deflate, szip"); /*------------------------------------------------------------------------- - * add some filters - *------------------------------------------------------------------------- - */ + * add some filters + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK 20x10", &pack_options) < 0) GOERROR; - if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) + if (h5repack_addfilter("dset1:FLET", &pack_options) < 0) GOERROR; - if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) + if (h5repack_addfilter("dset1:SHUF", &pack_options) < 0) GOERROR; #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options) < 0) + if (h5repack_addfilter("dset1:SZIP=8,NN", &pack_options) < 0) GOERROR; } #endif #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_addfilter("dset1:GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("dset1:GZIP=1", &pack_options) < 0) GOERROR; #endif - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -578,41 +573,41 @@ int main (void) TESTING(" adding layout chunked"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("dset1:CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT, &pack_options) <= 0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options ) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ TESTING(" adding layout chunked to all"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) + if (h5repack_addlayout("CHUNK=20x10", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -620,20 +615,20 @@ int main (void) TESTING(" adding layout contiguous"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * test an individual object option + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset1:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -641,37 +636,37 @@ int main (void) TESTING(" adding layout contiguous to all"); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * test all objects option + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("CONTI",&pack_options) < 0) + if (h5repack_addlayout("CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; /*------------------------------------------------------------------------- - * do the same test for a file with filters (chunked) - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * do the same test for a file with filters (chunked) + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("CONTI",&pack_options) < 0) + if (h5repack_addlayout("CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) + if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -679,42 +674,42 @@ int main (void) TESTING(" adding layout compact"); /*------------------------------------------------------------------------- - * test an individual object option - *------------------------------------------------------------------------- - */ + * test an individual object option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset1:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset1:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" adding layout compact to all"); /*------------------------------------------------------------------------- - * test all objects option - *------------------------------------------------------------------------- - */ + * test all objects option + *------------------------------------------------------------------------- + */ - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("COMPA",&pack_options) < 0) + if (h5repack_addlayout("COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -723,210 +718,209 @@ int main (void) TESTING(" layout compact to contiguous conversion"); /*------------------------------------------------------------------------- - * layout compact to contiguous conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout compact to contiguous conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_compact:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset_compact:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout compact to chunk conversion"); /*------------------------------------------------------------------------- - * layout compact to chunk conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout compact to chunk conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_compact:CHUNK=2x5",&pack_options) < 0) + if (h5repack_addlayout("dset_compact:CHUNK=2x5", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout compact to compact conversion"); /*------------------------------------------------------------------------- - * layout compact to compact conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout compact to compact conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_compact:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset_compact:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options)<= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout contiguous to compact conversion"); /*------------------------------------------------------------------------- - * layout contiguous to compact conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout contiguous to compact conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_contiguous:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset_contiguous:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout contiguous to chunk conversion"); /*------------------------------------------------------------------------- - * layout contiguous to chunk conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout contiguous to chunk conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_contiguous:CHUNK=3x6",&pack_options) < 0) + if (h5repack_addlayout("dset_contiguous:CHUNK=3x6", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout contiguous to contiguous conversion"); /*------------------------------------------------------------------------- - * layout contiguous to contiguous conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout contiguous to contiguous conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_contiguous:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset_contiguous:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout chunked to compact conversion"); /*------------------------------------------------------------------------- - * layout chunked to compact conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout chunked to compact conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_chunk:COMPA",&pack_options) < 0) + if (h5repack_addlayout("dset_chunk:COMPA", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout chunked to contiguous conversion"); /*------------------------------------------------------------------------- - * layout chunked to contiguous conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout chunked to contiguous conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_chunk:CONTI",&pack_options) < 0) + if (h5repack_addlayout("dset_chunk:CONTI", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); TESTING(" layout chunked to chunk conversion"); /*------------------------------------------------------------------------- - * layout chunked to chunked conversion - *------------------------------------------------------------------------- - */ - if (h5repack_init (&pack_options, 0) < 0) + * layout chunked to chunked conversion + *------------------------------------------------------------------------- + */ + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addlayout("dset_chunk:CHUNK=18x13",&pack_options) < 0) + if (h5repack_addlayout("dset_chunk:CHUNK=18x13", &pack_options) < 0) GOERROR; - if (h5repack(FNAME4,FNAME4OUT,&pack_options) < 0) + if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * the following tests assume the input files have filters - * FNAME7 - * FNAME8 - * FNAME9 - * FNAME10 - * FNAME11 - *------------------------------------------------------------------------- - */ - - + * the following tests assume the input files have filters + * FNAME7 + * FNAME8 + * FNAME9 + * FNAME10 + * FNAME11 + *------------------------------------------------------------------------- + */ TESTING(" copy of szip filter"); #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0) + if (h5repack(FNAME7, FNAME7OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME7,FNAME7OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME7, FNAME7OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME7OUT,&pack_options)<=0) + if (h5repack_verify(FNAME7, FNAME7OUT, &pack_options) <= 0) GOERROR; - if (h5repack_cmp_pl(FNAME7,FNAME7OUT)<=0) + if (h5repack_cmp_pl(FNAME7, FNAME7OUT) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -937,21 +931,22 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_szip:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_szip:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0) + if (h5repack(FNAME7, FNAME7OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME7,FNAME7OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME7, FNAME7OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME7OUT,&pack_options)<=0) + if (h5repack_verify(FNAME7, FNAME7OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -962,15 +957,15 @@ int main (void) TESTING(" copy of deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) + if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -982,17 +977,17 @@ int main (void) TESTING(" removing deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_deflate:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_deflate:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) + if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1004,15 +999,15 @@ int main (void) TESTING(" copy of shuffle filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0) + if (h5repack(FNAME9, FNAME9OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME9,FNAME9OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME9, FNAME9OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME9OUT,&pack_options)<=0) + if (h5repack_verify(FNAME9, FNAME9OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1020,17 +1015,17 @@ int main (void) TESTING(" removing shuffle filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_shuffle:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_shuffle:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0) + if (h5repack(FNAME9, FNAME9OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME9,FNAME9OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME9, FNAME9OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME9OUT,&pack_options)<=0) + if (h5repack_verify(FNAME9, FNAME9OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1038,15 +1033,15 @@ int main (void) TESTING(" copy of fletcher filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0) + if (h5repack(FNAME10, FNAME10OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME10,FNAME10OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME10, FNAME10OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME10OUT,&pack_options)<=0) + if (h5repack_verify(FNAME10, FNAME10OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1054,17 +1049,17 @@ int main (void) TESTING(" removing fletcher filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_fletcher32:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_fletcher32:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0) + if (h5repack(FNAME10, FNAME10OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME10,FNAME10OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME10, FNAME10OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME10OUT,&pack_options)<=0) + if (h5repack_verify(FNAME10, FNAME10OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1072,15 +1067,15 @@ int main (void) TESTING(" copy of nbit filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) + if (h5repack(FNAME12, FNAME12OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME12, FNAME12OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1088,17 +1083,17 @@ int main (void) TESTING(" removing nbit filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_nbit:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_nbit:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) + if (h5repack(FNAME12, FNAME12OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME12, FNAME12OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1106,17 +1101,17 @@ int main (void) TESTING(" adding nbit filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_int31:NBIT",&pack_options) < 0) + if (h5repack_addfilter("dset_int31:NBIT", &pack_options) < 0) GOERROR; - if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) + if (h5repack(FNAME12, FNAME12OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME12, FNAME12OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT, &pack_options)<= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1124,15 +1119,15 @@ int main (void) TESTING(" copy of scaleoffset filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) + if (h5repack(FNAME13, FNAME13OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME13, FNAME13OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1140,17 +1135,17 @@ int main (void) TESTING(" removing scaleoffset filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_scaleoffset:NONE",&pack_options) < 0) + if (h5repack_addfilter("dset_scaleoffset:NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) + if (h5repack(FNAME13, FNAME13OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME13, FNAME13OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1158,53 +1153,52 @@ int main (void) TESTING(" adding scaleoffset filter"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_none:SOFF=31,IN",&pack_options) < 0) + if (h5repack_addfilter("dset_none:SOFF=31,IN", &pack_options) < 0) GOERROR; - if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) + if (h5repack(FNAME13, FNAME13OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME13, FNAME13OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * file with all filters - * dset_all - * dset_deflate - * dset_szip - * dset_shuffle - * dset_fletcher32 - *------------------------------------------------------------------------- - */ - - + * file with all filters + * dset_all + * dset_deflate + * dset_szip + * dset_shuffle + * dset_fletcher32 + *------------------------------------------------------------------------- + */ TESTING(" filter conversion from deflate to szip"); #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options) < 0) + if (h5repack_addfilter("dset_deflate:SZIP=8,NN", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -1216,21 +1210,22 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("dset_szip:GZIP=1", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); - } else { + } + else { SKIPPED(); } #else @@ -1239,25 +1234,25 @@ int main (void) /*------------------------------------------------------------------------- - * test the NONE global option - *------------------------------------------------------------------------- - */ + * test the NONE global option + *------------------------------------------------------------------------- + */ TESTING(" removing all filters"); #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("NONE",&pack_options) < 0) + if (h5repack_addfilter("NONE", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1266,51 +1261,52 @@ int main (void) #endif /*------------------------------------------------------------------------- - * test a big file - *------------------------------------------------------------------------- - */ + * test a big file + *------------------------------------------------------------------------- + */ TESTING(" big file"); - if (h5repack_init (&pack_options, 0) < 0) + + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME14,FNAME14OUT,&pack_options) < 0) + if (h5repack(FNAME14, FNAME14OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME14,FNAME14OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME14, FNAME14OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME14OUT,&pack_options)<=0) + if (h5repack_verify(FNAME14, FNAME14OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test external dataset - *------------------------------------------------------------------------- - */ + * test external dataset + *------------------------------------------------------------------------- + */ TESTING(" external datasets"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack(FNAME15,FNAME15OUT,&pack_options) < 0) + if (h5repack(FNAME15, FNAME15OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME15,FNAME15OUT,NULL,NULL,&diff_options) > 0) + if (h5diff(FNAME15, FNAME15OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME15OUT,&pack_options)<=0) + if (h5repack_verify(FNAME15, FNAME15OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test file with userblock - *------------------------------------------------------------------------- - */ + * test file with userblock + *------------------------------------------------------------------------- + */ TESTING(" file with userblock"); - if(h5repack_init(&pack_options, 0) < 0) + if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; if(h5repack(FNAME16, FNAME16OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME16, FNAME16OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME16OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME16, FNAME16OUT, &pack_options) <= 0) GOERROR; if(verify_userblock(FNAME16OUT) < 0) GOERROR; @@ -1319,53 +1315,53 @@ int main (void) PASSED(); /*------------------------------------------------------------------------- - * test --latest options - *------------------------------------------------------------------------- - */ + * test --latest options + *------------------------------------------------------------------------- + */ TESTING(" latest file format options"); - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - pack_options.latest=1; - pack_options.grp_compact=10; - pack_options.grp_indexed=5; + pack_options.latest = 1; + pack_options.grp_compact = 10; + pack_options.grp_indexed = 5; pack_options.msg_size[0] = 10; pack_options.msg_size[1] = 20; pack_options.msg_size[2] = 30; pack_options.msg_size[3] = 40; pack_options.msg_size[4] = 50; - if (h5repack(FNAME1,FNAME1OUT,&pack_options) < 0) + if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME1,FNAME1OUT,NULL,NULL,&diff_options) > 0) + if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME1OUT,&pack_options)<=0) + if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options)<=0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); /*------------------------------------------------------------------------- - * test several global filters - *------------------------------------------------------------------------- - */ + * test several global filters + *------------------------------------------------------------------------- + */ TESTING(" several global filters"); #if defined (H5_HAVE_FILTER_DEFLATE) - if (h5repack_init (&pack_options, 0) < 0) + if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; - if (h5repack_addfilter("GZIP=1",&pack_options) < 0) + if (h5repack_addfilter("GZIP=1", &pack_options) < 0) GOERROR; - if (h5repack_addfilter("SHUF",&pack_options) < 0) + if (h5repack_addfilter("SHUF", &pack_options) < 0) GOERROR; - if (h5repack(FNAME11,FNAME11OUT,&pack_options) < 0) + if (h5repack(FNAME11, FNAME11OUT, &pack_options) < 0) GOERROR; - if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) + if (h5diff(FNAME11, FNAME11OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT, &pack_options) <= 0) GOERROR; - if (h5repack_end (&pack_options) < 0) + if (h5repack_end(&pack_options) < 0) GOERROR; PASSED(); @@ -1375,14 +1371,14 @@ int main (void) /*------------------------------------------------------------------------- - * test file with userblock - *------------------------------------------------------------------------- - */ + * test file with userblock + *------------------------------------------------------------------------- + */ TESTING(" file with added userblock"); #ifdef H5_HAVE_FILTER_DEFLATE - if(h5repack_init(&pack_options, 0) < 0) + if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; /* add the options for a user block size and user block filename */ @@ -1393,7 +1389,7 @@ int main (void) GOERROR; if(h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME8OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; if(verify_userblock(FNAME8OUT) < 0) GOERROR; @@ -1408,14 +1404,14 @@ int main (void) /*------------------------------------------------------------------------- - * test file with aligment - *------------------------------------------------------------------------- - */ + * test file with aligment + *------------------------------------------------------------------------- + */ TESTING(" file with aligment"); #ifdef H5_HAVE_FILTER_DEFLATE - if(h5repack_init(&pack_options, 0) < 0) + if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; /* add the options for aligment */ @@ -1426,27 +1422,27 @@ int main (void) GOERROR; if(h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME8OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; /* verify aligment */ { hsize_t threshold; hsize_t alignment; - hid_t fapl; - hid_t fid; + hid_t fapl; + hid_t fid; - if (( fid = H5Fopen(FNAME8OUT, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) + if ((fid = H5Fopen(FNAME8OUT, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) GOERROR; if ((fapl = H5Fget_access_plist(fid)) < 0) GOERROR; - if ( H5Pget_alignment(fapl, &threshold, &alignment ) < 0) + if (H5Pget_alignment(fapl, &threshold, &alignment) < 0) GOERROR; - if ( threshold != 1 ) + if (threshold != 1) GOERROR; - if ( alignment != 1 ) + if (alignment != 1) GOERROR; - if ( H5Pclose(fapl) < 0) + if (H5Pclose(fapl) < 0) GOERROR; if (H5Fclose(fid) < 0) GOERROR; @@ -1464,19 +1460,19 @@ int main (void) #endif /*------------------------------------------------------------------------- - * test file with userblock - *------------------------------------------------------------------------- - */ + * test file with userblock + *------------------------------------------------------------------------- + */ TESTING(" file with committed datatypes"); - if(h5repack_init(&pack_options, 0) < 0) + if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; if(h5repack(FNAME17, FNAME17OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME17, FNAME17OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME17OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME17, FNAME17OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; @@ -1485,16 +1481,18 @@ int main (void) PASSED(); /*------------------------------------------------------------------------- - * test --metadata_block_size option - * Also verify that output file using the metadata_block_size option is - * larger than the output file one not using it. - *------------------------------------------------------------------------- - */ + * test --metadata_block_size option + * Also verify that output file using the metadata_block_size option is + * larger than the output file one not using it. + * FNAME4 is used because it is the same as the test file used for the + * shell script version of this test (h5repack.sh). + *------------------------------------------------------------------------- + */ TESTING(" metadata block size option"); /* First run without metadata option. No need to verify the correctness */ /* since this has been verified by earlier tests. Just record the file */ /* size of the output file. */ - if(h5repack_init(&pack_options, 0) < 0) + if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; if(h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; @@ -1505,14 +1503,14 @@ int main (void) GOERROR; /* run it again with metadata option */ - if(h5repack_init(&pack_options, 0) < 0) + if(h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; pack_options.meta_block_size = 8192; if(h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME4OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; /* record the file size of the output file */ if(HDstat(FNAME4OUT, &file_stat) < 0) @@ -1527,9 +1525,9 @@ int main (void) /*------------------------------------------------------------------------- - * clean temporary test files - *------------------------------------------------------------------------- - */ + * clean temporary test files + *------------------------------------------------------------------------- + */ { hid_t fapl; @@ -1554,21 +1552,21 @@ error: /*------------------------------------------------------------------------- * Function: make_testfiles * -* Purpose: make a test file with all types of HDF5 objects, -* datatypes and filters +* Purpose: make a test file with all types of HDF5 objects, +* datatypes and filters * *------------------------------------------------------------------------- */ static int make_testfiles(void) { - hid_t fid; + hid_t fid = -1; /*------------------------------------------------------------------------- - * create a file for general copy test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME0,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for general copy test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME0, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_fill(fid) < 0) goto out; @@ -1576,10 +1574,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create another file for general copy test (all datatypes) - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create another file for general copy test (all datatypes) + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_all_objects(fid) < 0) goto out; @@ -1587,10 +1585,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for attributes copy test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for attributes copy test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_attributes(fid) < 0) goto out; @@ -1598,10 +1596,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for hard links test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for hard links test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_hlinks(fid) < 0) goto out; @@ -1609,10 +1607,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for layouts test - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file for layouts test + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_layout(fid) < 0) goto out; @@ -1620,9 +1618,9 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for layout conversion test - *------------------------------------------------------------------------- - */ + * create a file for layout conversion test + *------------------------------------------------------------------------- + */ if((fid = H5Fcreate(FNAME18, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; @@ -1633,9 +1631,9 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * for test layout conversions form chunk with unlimited max dims - *------------------------------------------------------------------------- - */ + * for test layout conversions form chunk with unlimited max dims + *------------------------------------------------------------------------- + */ if((fid = H5Fcreate("h5repack_layout3.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; @@ -1646,18 +1644,18 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file for the H5D_ALLOC_TIME_EARLY test - *------------------------------------------------------------------------- - */ + * create a file for the H5D_ALLOC_TIME_EARLY test + *------------------------------------------------------------------------- + */ if (make_early() < 0) goto out; /*------------------------------------------------------------------------- - * create a file with the SZIP filter - *------------------------------------------------------------------------- - */ + * create a file with the SZIP filter + *------------------------------------------------------------------------- + */ #ifdef H5_HAVE_FILTER_SZIP - if((fid = H5Fcreate(FNAME7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + if((fid = H5Fcreate(FNAME7, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_szip(fid) < 0) goto out; @@ -1667,10 +1665,10 @@ int make_testfiles(void) /*------------------------------------------------------------------------- - * create a file with the deflate filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME8,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the deflate filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_deflate(fid) < 0) goto out; @@ -1678,10 +1676,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the shuffle filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME9,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the shuffle filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME9, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_shuffle(fid) < 0) goto out; @@ -1689,10 +1687,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the fletcher32 filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME10,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the fletcher32 filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME10, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_fletcher32(fid) < 0) goto out; @@ -1700,10 +1698,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with all the filters - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME11,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with all the filters + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME11, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_all_filters(fid) < 0) goto out; @@ -1711,10 +1709,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the nbit filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME12,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the nbit filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_nbit(fid) < 0) goto out; @@ -1722,10 +1720,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with the scaleoffset filter - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME13,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with the scaleoffset filter + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME13, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_scaleoffset(fid) < 0) goto out; @@ -1733,10 +1731,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a big dataset - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME14,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a big dataset + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME14, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_big(fid) < 0) goto out; @@ -1744,10 +1742,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with external dataset - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME15,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with external dataset + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME15, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_external(fid) < 0) goto out; @@ -1755,24 +1753,24 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with userblock - *------------------------------------------------------------------------- - */ + * create a file with userblock + *------------------------------------------------------------------------- + */ if(make_userblock() < 0) goto out; /*------------------------------------------------------------------------- - * create a userblock file - *------------------------------------------------------------------------- - */ + * create a userblock file + *------------------------------------------------------------------------- + */ if(make_userblock_file() < 0) goto out; /*------------------------------------------------------------------------- - * create a file with named datatypes - *------------------------------------------------------------------------- - */ - if((fid = H5Fcreate(FNAME17,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with named datatypes + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME17, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_named_dtype(fid) < 0) goto out; @@ -1780,11 +1778,12 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create obj and region reference type datasets (bug1814) - * add attribute with int type (bug1726) - * add attribute with obj and region reference type (bug1726) - *-------------------------------------------------------------------------*/ - if((fid = H5Fcreate(FNAME_REF,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create obj and region reference type datasets (bug1814) + * add attribute with int type (bug1726) + * add attribute with obj and region reference type (bug1726) + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate(FNAME_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; /* create reference type datasets */ if (make_references(fid) < 0) @@ -1793,10 +1792,10 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- - * create a file with obj and region references in attribute of compound and - * vlen datatype - *-------------------------------------------------------------------------*/ - if((fid = H5Fcreate(FNAME_ATTR_REF,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0) + * create a file with obj and region references in attribute of compound and + * vlen datatype + *-------------------------------------------------------------------------*/ + if((fid = H5Fcreate(FNAME_ATTR_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (make_complex_attr_references(fid) < 0) goto out; @@ -1815,20 +1814,20 @@ out: /*------------------------------------------------------------------------- * Function: make_all_objects * -* Purpose: make a test file with all types of HDF5 objects +* Purpose: make a test file with all types of HDF5 objects * *------------------------------------------------------------------------- */ static int make_all_objects(hid_t loc_id) { - hid_t did=-1; - hid_t gid=-1; - hid_t tid=-1; - hid_t rid=-1; - hid_t sid=-1; - hid_t gcplid=-1; - hsize_t dims[1]={2}; + hid_t did = -1; + hid_t gid = -1; + hid_t tid = -1; + hid_t rid = -1; + hid_t sid = -1; + hid_t gcplid = -1; + hsize_t dims[1] = {2}; /* compound datatype */ typedef struct s_t { @@ -1903,7 +1902,7 @@ int make_all_objects(hid_t loc_id) if ((rid = H5Gopen2(loc_id, "/", H5P_DEFAULT)) < 0) goto out; - if (write_dset_in(rid,"dset_referenced",loc_id,0) < 0) + if (write_dset_in(rid, "dset_referenced", loc_id, 0) < 0) goto out; if (H5Gclose(rid) < 0) goto out; @@ -1937,18 +1936,18 @@ out: /*------------------------------------------------------------------------- * Function: make_attributes * -* Purpose: make a test file with all types of attributes +* Purpose: make a test file with all types of attributes * *------------------------------------------------------------------------- */ static int make_attributes(hid_t loc_id) { - hid_t did=-1; - hid_t gid=-1; - hid_t rid=-1; - hid_t sid=-1; - hsize_t dims[1]={2}; + hid_t did = -1; + hid_t gid = -1; + hid_t rid = -1; + hid_t sid = -1; + hsize_t dims[1] = {2}; /*------------------------------------------------------------------------- * H5G_DATASET @@ -1973,11 +1972,11 @@ int make_attributes(hid_t loc_id) *------------------------------------------------------------------------- */ - if ( write_attr_in(did,"dset",loc_id,0) < 0) + if ( write_attr_in(did, "dset", loc_id, 0) < 0) goto out; - if (write_attr_in(gid,"dset",loc_id,0) < 0) + if (write_attr_in(gid, "dset", loc_id, 0) < 0) goto out; - if (write_attr_in(rid,"dset",loc_id,0) < 0) + if (write_attr_in(rid, "dset", loc_id, 0) < 0) goto out; /* close */ @@ -2007,18 +2006,18 @@ out: /*------------------------------------------------------------------------- * Function: make_hlinks * -* Purpose: make a test file with hard links +* Purpose: make a test file with hard links * *------------------------------------------------------------------------- */ static int make_hlinks(hid_t loc_id) { - hid_t g1id=-1; - hid_t g2id=-1; - hid_t g3id=-1; - hsize_t dims[2]={3,2}; - int buf[3][2]= {{1,1},{1,2},{2,2}}; + hid_t g1id =- 1; + hid_t g2id = -1; + hid_t g3id = -1; + hsize_t dims[2] = {3,2}; + int buf[3][2] = {{1,1}, {1,2}, {2,2}}; /*------------------------------------------------------------------------- * create a dataset and some hard links to it @@ -2077,7 +2076,7 @@ out: /*------------------------------------------------------------------------- * Function: make_szip * -* Purpose: make a dataset with the SZIP filter +* Purpose: make a dataset with the SZIP filter * *------------------------------------------------------------------------- */ @@ -2085,21 +2084,19 @@ out: static int make_szip(hid_t loc_id) { - hid_t dcpl; /* dataset creation property list */ - hid_t sid; /* dataspace ID */ - unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK; - unsigned szip_pixels_per_block=8; - hsize_t dims[RANK]={DIM1,DIM2}; - hsize_t chunk_dims[RANK]={CDIM1,CDIM2}; + hid_t dcpl = -1; /* dataset creation property list */ + hid_t sid = -1; /* dataspace ID */ + unsigned szip_options_mask = H5_SZIP_ALLOW_K13_OPTION_MASK | H5_SZIP_NN_OPTION_MASK; + unsigned szip_pixels_per_block = 8; + hsize_t dims[RANK] = {DIM1, DIM2}; + hsize_t chunk_dims[RANK] = {CDIM1, CDIM2}; int buf[DIM1][DIM2]; int i, j, n; int szip_can_encode = 0; - for (i=n=0; i with GZIP filter ...Found +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/h5repack/testfiles/h5repack_filters.h5.tst b/tools/h5repack/testfiles/h5repack_filters.h5.tst deleted file mode 100644 index 36e65b9..0000000 --- a/tools/h5repack/testfiles/h5repack_filters.h5.tst +++ /dev/null @@ -1,13 +0,0 @@ -Objects to modify layout are... -Objects to apply filter are... - with GZIP filter - ...Found ------------------------------------------ - Type Filter (Compression) Name ------------------------------------------ - group / - dset /dset_all - dset GZIP (0.995:1) /dset_deflate - dset /dset_fletcher32 - dset /dset_nbit - dset /dset_shuffle diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst b/tools/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst new file mode 100644 index 0000000..95cc4c6 --- /dev/null +++ b/tools/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst @@ -0,0 +1,38 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dcreate2(): unable to create dataset + major: Dataset + minor: Unable to initialize object + #001: (file name) line (number) in H5D__create_named(): unable to create and link to dataset + major: Dataset + minor: Unable to initialize object + #002: (file name) line (number) in H5L_link_object(): unable to create new link to object + major: Links + minor: Unable to initialize object + #003: (file name) line (number) in H5L_create_real(): can't insert link + major: Symbol table + minor: Unable to insert object + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #005: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #006: (file name) line (number) in H5L_link_cb(): unable to create object + major: Object header + minor: Unable to initialize object + #007: (file name) line (number) in H5O_obj_create(): unable to open object + major: Object header + minor: Can't open object + #008: (file name) line (number) in H5O__dset_create(): unable to create dataset + major: Dataset + minor: Unable to initialize object + #009: (file name) line (number) in H5D__create(): unable to construct layout information + major: Dataset + minor: Unable to initialize object + #010: (file name) line (number) in H5D__chunk_construct(): dimensionality of chunks doesn't match the dataspace + major: Dataset + minor: Bad value +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in do_copy_objects(): H5Dcreate2 failed + major: Failure in tools library + minor: error in function diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl index 87b133d..9e80c72 100644 --- a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, H5S_UNLIMITED ) } STORAGE_LAYOUT { - CHUNKED ( 20, 10 ) + CHUNKED ( 40, 20 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl index 4bdd7f8..255ba9d 100644 --- a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl @@ -92,7 +92,7 @@ GROUP "/" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 40, 20 ) / ( 40, H5S_UNLIMITED ) } STORAGE_LAYOUT { - CHUNKED ( 20, 10 ) + CHUNKED ( 40, 20 ) SIZE 3200 (1.000:1 COMPRESSION) } FILTERS { diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl new file mode 100644 index 0000000..9302485 --- /dev/null +++ b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl @@ -0,0 +1,135 @@ +HDF5 "out-plugin_zero.h5repack_layout.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 2144 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 5344 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset3" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 8544 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset4" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 13792 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } + DATASET "dset_chunk" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, H5S_UNLIMITED ) } + STORAGE_LAYOUT { + CHUNKED ( 20, 10 ) + SIZE 3200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_INCR + } + } + DATASET "dset_compact" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + COMPACT + SIZE 3200 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_EARLY + } + } + DATASET "dset_contiguous" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 3200 + OFFSET 26280 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + } +} +} diff --git a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst b/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst deleted file mode 100644 index 0993d5b..0000000 --- a/tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst +++ /dev/null @@ -1,9 +0,0 @@ -Objects to modify layout are... -Objects to apply filter are... - User Defined 250 -Making file ... ------------------------------------------ - Type Filter (Compression) Name ------------------------------------------ - group / -h5repack error: : Could not copy data to: out-plugin_zero.h5repack_layout.h5 diff --git a/tools/h5repack/testfiles/h5repack_none.h5 b/tools/h5repack/testfiles/h5repack_none.h5 new file mode 100644 index 0000000..2e4d789 Binary files /dev/null and b/tools/h5repack/testfiles/h5repack_none.h5 differ diff --git a/tools/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst b/tools/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst index 4fb6906..30aa8ad 100644 --- a/tools/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst +++ b/tools/h5repack/testfiles/plugin_none.h5repack_layout.UD.h5.tst @@ -1,6 +1,7 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +All objects to apply filter are... Uncompress all +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst b/tools/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst index 7f9bd6e..62ea1cc 100644 --- a/tools/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst +++ b/tools/h5repack/testfiles/plugin_test.h5repack_layout.h5.tst @@ -1,6 +1,7 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +All objects to apply filter are... User Defined 257 +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst b/tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst index 1a496c6..f5c4736 100644 --- a/tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst +++ b/tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst @@ -1,6 +1,7 @@ -Objects to modify layout are... -Objects to apply filter are... +No all objects to modify layout +All objects to apply filter are... User Defined 260 +Making new file ... ----------------------------------------- Type Filter (Compression) Name ----------------------------------------- diff --git a/tools/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst b/tools/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst new file mode 100644 index 0000000..54c873c --- /dev/null +++ b/tools/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst @@ -0,0 +1,22 @@ +No all objects to modify layout +All objects to apply filter are... + User Defined 250 +Making new file ... +----------------------------------------- + Type Filter (Compression) Name +----------------------------------------- + group / + warning: could not create dataset . Applying original settings + dset /dset1 + warning: could not create dataset . Applying original settings + dset /dset2 + warning: could not create dataset . Applying original settings + dset /dset3 + warning: could not create dataset . Applying original settings + dset /dset4 + warning: could not create dataset . Applying original settings + dset /dset_chunk + warning: could not create dataset . Applying original settings + dset /dset_compact + warning: could not create dataset . Applying original settings + dset /dset_contiguous diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 40885a1..885cfd1 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -20,37 +20,37 @@ # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- set (HDF5_REFERENCE_FILES - h5stat_help1.ddl - h5stat_help2.ddl - h5stat_notexist.ddl - h5stat_nofile.ddl - h5stat_filters.ddl - h5stat_filters-file.ddl - h5stat_filters-F.ddl - h5stat_filters-d.ddl - h5stat_filters-g.ddl - h5stat_filters-dT.ddl - h5stat_filters-UD.ddl - h5stat_filters-UT.ddl - h5stat_tsohm.ddl - h5stat_newgrat.ddl - h5stat_newgrat-UG.ddl - h5stat_newgrat-UA.ddl - h5stat_err1_links.ddl - h5stat_links1.ddl - h5stat_links2.ddl - h5stat_links3.ddl - h5stat_links4.ddl - h5stat_links5.ddl - h5stat_err1_dims.ddl - h5stat_dims1.ddl - h5stat_dims2.ddl - h5stat_err1_numattrs.ddl - h5stat_err2_numattrs.ddl - h5stat_numattrs1.ddl - h5stat_numattrs2.ddl - h5stat_numattrs3.ddl - h5stat_numattrs4.ddl + h5stat_help1 + h5stat_help2 + h5stat_notexist + h5stat_nofile + h5stat_filters + h5stat_filters-file + h5stat_filters-F + h5stat_filters-d + h5stat_filters-g + h5stat_filters-dT + h5stat_filters-UD + h5stat_filters-UT + h5stat_tsohm + h5stat_newgrat + h5stat_newgrat-UG + h5stat_newgrat-UA + h5stat_err1_links + h5stat_links1 + h5stat_links2 + h5stat_links3 + h5stat_links4 + h5stat_links5 + h5stat_err1_dims + h5stat_dims1 + h5stat_dims2 + h5stat_err1_numattrs + h5stat_err2_numattrs + h5stat_numattrs1 + h5stat_numattrs2 + h5stat_numattrs3 + h5stat_numattrs4 ) set (HDF5_REFERENCE_TEST_FILES h5stat_filters.h5 @@ -60,7 +60,7 @@ ) foreach (ddl_file ${HDF5_REFERENCE_FILES}) - HDFTEST_COPY_FILE("${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/${ddl_file}" "h5stat_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}.ddl" "${PROJECT_BINARY_DIR}/${ddl_file}.ddl" "h5stat_files") endforeach () foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) @@ -78,7 +78,7 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) - if (NOT ${resultcode} STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () if (NOT "${last_test}" STREQUAL "") @@ -86,6 +86,16 @@ endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( + NAME H5STAT-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) + endif () + add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -96,6 +106,7 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects) endif () endmacro () @@ -107,72 +118,13 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run + foreach (ddl_file ${HDF5_REFERENCE_FILES}) + set (CLEAR_LIST ${CLEAR_LIST} ${ddl_file}.out ${ddl_file}.out.err) + endforeach () add_test ( NAME H5STAT-clearall-objects COMMAND ${CMAKE_COMMAND} - -E remove - h5stat_help1.out - h5stat_help1.out.err - h5stat_help2.out - h5stat_help2.out.err - h5stat_notexist.out - h5stat_notexist.out.err - h5stat_nofile.out - h5stat_nofile.out.err - h5stat_filters.out - h5stat_filters.out.err - h5stat_filters-file.out - h5stat_filters-file.out.err - h5stat_filters-F.out - h5stat_filters-F.out.err - h5stat_filters-d.out - h5stat_filters-d.out.err - h5stat_filters-g.out - h5stat_filters-g.out.err - h5stat_filters-dT.out - h5stat_filters-dT.out.err - h5stat_filters-UD.out - h5stat_filters-UD.out.err - h5stat_filters-UT.out - h5stat_filters-UT.out.err - h5stat_tsohm.out - h5stat_tsohm.out.err - h5stat_newgrat.out - h5stat_newgrat.out.err - h5stat_newgrat-UG.out - h5stat_newgrat-UG.out.err - h5stat_newgrat-UA.out - h5stat_newgrat-UA.out.err - h5stat_err1_links.out - h5stat_err1_links.out.err - h5stat_links1.out - h5stat_links1.out.err - h5stat_links2.out - h5stat_links2.out.err - h5stat_links3.out - h5stat_links3.out.err - h5stat_links4.out - h5stat_links4.out.err - h5stat_links5.out - h5stat_links5.out.err - h5stat_err1_dims.out - h5stat_err1_dims.out.err - h5stat_dims1.out - h5stat_dims1.out.err - h5stat_dims2.out - h5stat_dims2.out.err - h5stat_err1_numattrs.out - h5stat_err1_numattrs.out.err - h5stat_err2_numattrs.out - h5stat_err2_numattrs.out.err - h5stat_numattrs1.out - h5stat_numattrs1.out.err - h5stat_numattrs2.out - h5stat_numattrs2.out.err - h5stat_numattrs3.out - h5stat_numattrs3.out.err - h5stat_numattrs4.out - h5stat_numattrs4.out.err + -E remove ${CLEAR_LIST} ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index aa43645..1357952 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -11,8 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include #include "H5private.h" /* Generic Functions */ #include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index 42e352e..6031808 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -64,7 +64,7 @@ gen_newgrat_file(const char *fname) if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) goto error; - /* Create dataset */ + /* Create file */ if((fid = H5Fcreate(NEWGRAT_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 3018f18..aa33727 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -322,8 +322,8 @@ hsize_t diff_attr(hid_t loc1_id, hid_t space2_id=-1; /* space ID */ hid_t ftype1_id=-1; /* file data type ID */ hid_t ftype2_id=-1; /* file data type ID */ - int vstrtype1=0; /* ftype1 is a variable string */ - int vstrtype2=0; /* ftype2 is a variable string */ + int vstrtype1=0; /* ftype1 is a variable string */ + int vstrtype2=0; /* ftype2 is a variable string */ hid_t mtype1_id=-1; /* memory data type ID */ hid_t mtype2_id=-1; /* memory data type ID */ size_t msize1; /* memory size of memory type */ @@ -461,8 +461,8 @@ hsize_t diff_attr(hid_t loc1_id, for(j = 0; j < rank1; j++) nelmts1 *= dims1[j]; - buf1 = (void *)HDmalloc((size_t)(nelmts1 * msize1)); - buf2 = (void *)HDmalloc((size_t)(nelmts1 * msize2)); + buf1 = (void *)HDcalloc((size_t)(nelmts1), msize1); + buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2); if(buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); goto error; diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index cf8b537..7125f5f 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -170,6 +170,7 @@ hsize_t diff_datasetid( hid_t did1, const char *obj2_name, diff_opt_t *options) { + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ hid_t sid1=-1; hid_t sid2=-1; hid_t f_tid1=-1; @@ -211,30 +212,31 @@ hsize_t diff_datasetid( hid_t did1, int i; unsigned int vl_data = 0; /*contains VL datatypes */ + options->err_stat = 1; h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ if((sid1 = H5Dget_space(did1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get the dataspace handle */ if((sid2 = H5Dget_space(did2)) < 0 ) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); h5diffdebug3("rank: %ld - %ld\n", rank1, rank2); /*------------------------------------------------------------------------- @@ -244,25 +246,25 @@ hsize_t diff_datasetid( hid_t did1, /* Get the data type */ if((f_tid1 = H5Dget_type(did1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); /* Get the data type */ if((f_tid2 = H5Dget_type(did2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); /*------------------------------------------------------------------------- * get the storage layout type *------------------------------------------------------------------------- */ if((dcpl1 = H5Dget_create_plist(did1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((stl1 = H5Pget_layout(dcpl1)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); if((stl2 = H5Pget_layout(dcpl2)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); /*------------------------------------------------------------------------- * check for empty datasets @@ -297,10 +299,10 @@ hsize_t diff_datasetid( hid_t did1, */ h5difftrace("check for memory type and sizes\n"); if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); m_size1 = H5Tget_size(m_tid1); m_size2 = H5Tget_size(m_tid2); @@ -362,14 +364,14 @@ hsize_t diff_datasetid( hid_t did1, if (FAIL == match_up_memsize (f_tid1, f_tid2, &m_tid1, &m_tid2, &m_size1, &m_size2)) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed"); h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2); dadims = dims1; dam_size = m_size1; dam_tid = m_tid1; danelmts = nelmts1; need = (size_t)(nelmts1 * m_size1); /* bytes needed */ - } + } else { h5diffdebug3("Array dims: %d - %d\n", dims1[0], dims2[0]); /* Compare the smallest array, but create the largest buffer */ @@ -407,10 +409,10 @@ hsize_t diff_datasetid( hid_t did1, if(buf1 != NULL && buf2 != NULL) { h5difftrace("buf1 != NULL && buf2 != NULL\n"); if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); h5difftrace("H5Dread did2\n"); if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* array diff */ nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, @@ -421,6 +423,14 @@ hsize_t diff_datasetid( hid_t did1, H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ + if(buf1 != NULL) { + HDfree(buf1); + buf1 = NULL; + } + if(buf2 != NULL) { + HDfree(buf2); + buf2 = NULL; + } } /* end if */ else { /* possibly not enough memory, read/compare by hyperslabs */ size_t p_type_nbytes = dam_size; /*size of memory type */ @@ -462,9 +472,9 @@ hsize_t diff_datasetid( hid_t did1, * E.g., sm_space. */ if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); @@ -481,19 +491,19 @@ hsize_t diff_datasetid( hid_t did1, hs_nelmts *= hs_size[i]; } /* end for */ if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); } /* end if */ else hs_nelmts = 1; if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ @@ -515,6 +525,14 @@ hsize_t diff_datasetid( hid_t did1, carry = 0; } /* i */ } /* elmtno */ + if(sm_buf1 != NULL) { + HDfree(sm_buf1); + sm_buf1 = NULL; + } + if(sm_buf2 != NULL) { + HDfree(sm_buf2); + sm_buf2 = NULL; + } H5Sclose(sm_space); } /* hyperslab read */ @@ -525,40 +543,11 @@ hsize_t diff_datasetid( hid_t did1, * close *------------------------------------------------------------------------- */ - h5difftrace("compare attributes?\n"); - - /* free */ - if(buf1 != NULL) { - HDfree(buf1); - buf1 = NULL; - } /* end if */ - if(buf2 != NULL) { - HDfree(buf2); - buf2 = NULL; - } /* end if */ - if(sm_buf1 != NULL) { - HDfree(sm_buf1); - sm_buf1 = NULL; - } /* end if */ - if(sm_buf2 != NULL) { - HDfree(sm_buf2); - sm_buf2 = NULL; - } /* end if */ + h5difftrace("reclaim any VL memory\n"); - H5E_BEGIN_TRY { - H5Sclose(sid1); - H5Sclose(sid2); - H5Tclose(f_tid1); - H5Tclose(f_tid2); - H5Tclose(m_tid1); - H5Tclose(m_tid2); - } H5E_END_TRY; - h5difftrace("diff_datasetid finish\n"); - - return nfound; +done: -error: - options->err_stat=1; + options->err_stat = ret_value; /* free */ if(buf1 != NULL) { @@ -600,7 +589,7 @@ error: H5Tclose(m_tid2); /* enable error reporting */ } H5E_END_TRY; - h5difftrace("diff_datasetid errored\n"); + h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound); return nfound; } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index f8f1810..c9b0807 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -12,16 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Thursday, July 23, 1998 - * * Purpose: A library for displaying the values of a dataset in a human * readable format. */ -#include -#include - #include "h5tools.h" #include "h5tools_dump.h" #include "h5tools_ref.h" @@ -29,72 +23,72 @@ #include "H5private.h" h5tool_format_t h5tools_dataformat = { -0, /*raw */ - -"", /*fmt_raw */ -"%d", /*fmt_int */ -"%u", /*fmt_uint */ -"%hhd", /*fmt_schar */ -"%u", /*fmt_uchar */ -"%d", /*fmt_short */ -"%u", /*fmt_ushort */ -"%ld", /*fmt_long */ -"%lu", /*fmt_ulong */ -NULL, /*fmt_llong */ -NULL, /*fmt_ullong */ -"%g", /*fmt_double */ -"%g", /*fmt_float */ - -0, /*ascii */ -0, /*str_locale */ -0, /*str_repeat */ - -"[ ", /*arr_pre */ -",", /*arr_sep */ -" ]", /*arr_suf */ -1, /*arr_linebreak */ - -"", /*cmpd_name */ -",\n", /*cmpd_sep */ -"{", /*cmpd_pre */ -"}", /*cmpd_suf */ -"\n", /*cmpd_end */ - -", ", /*vlen_sep */ -"(", /*vlen_pre */ -")", /*vlen_suf */ -"", /*vlen_end */ - -"%s", /*elmt_fmt */ -",", /*elmt_suf1 */ -" ", /*elmt_suf2 */ - -"", /*idx_n_fmt */ -"", /*idx_sep */ -"", /*idx_fmt */ - -80, /*line_ncols *//*standard default columns */ -0, /*line_per_line */ -"", /*line_pre */ -"%s", /*line_1st */ -"%s", /*line_cont */ -"", /*line_suf */ -"", /*line_sep */ -1, /*line_multi_new */ -" ", /*line_indent */ - -1, /*skip_first */ - -1, /*obj_hidefileno */ -" "H5_PRINTF_HADDR_FMT, /*obj_format */ - -1, /*dset_hidefileno */ -"DATASET %s ", /*dset_format */ -"%s", /*dset_blockformat_pre */ -"%s", /*dset_ptformat_pre */ -"%s", /*dset_ptformat */ -1, /*array indices */ -1 /*escape non printable characters */ + 0, /*raw */ + + "", /*fmt_raw */ + "%d", /*fmt_int */ + "%u", /*fmt_uint */ + "%hhd", /*fmt_schar */ + "%u", /*fmt_uchar */ + "%d", /*fmt_short */ + "%u", /*fmt_ushort */ + "%ld", /*fmt_long */ + "%lu", /*fmt_ulong */ + NULL, /*fmt_llong */ + NULL, /*fmt_ullong */ + "%g", /*fmt_double */ + "%g", /*fmt_float */ + + 0, /*ascii */ + 0, /*str_locale */ + 0, /*str_repeat */ + + "[ ", /*arr_pre */ + ",", /*arr_sep */ + " ]", /*arr_suf */ + 1, /*arr_linebreak */ + + "", /*cmpd_name */ + ",\n", /*cmpd_sep */ + "{", /*cmpd_pre */ + "}", /*cmpd_suf */ + "\n", /*cmpd_end */ + + ", ", /*vlen_sep */ + "(", /*vlen_pre */ + ")", /*vlen_suf */ + "", /*vlen_end */ + + "%s", /*elmt_fmt */ + ",", /*elmt_suf1 */ + " ", /*elmt_suf2 */ + + "", /*idx_n_fmt */ + "", /*idx_sep */ + "", /*idx_fmt */ + + 80, /*line_ncols *//*standard default columns */ + 0, /*line_per_line */ + "", /*line_pre */ + "%s", /*line_1st */ + "%s", /*line_cont */ + "", /*line_suf */ + "", /*line_sep */ + 1, /*line_multi_new */ + " ", /*line_indent */ + + 1, /*skip_first */ + + 1, /*obj_hidefileno */ + " "H5_PRINTF_HADDR_FMT, /*obj_format */ + + 1, /*dset_hidefileno */ + "DATASET %s ", /*dset_format */ + "%s", /*dset_blockformat_pre */ + "%s", /*dset_ptformat_pre */ + "%s", /*dset_ptformat */ + 1, /*array indices */ + 1 /*escape non printable characters */ }; const h5tools_dump_header_t h5tools_standardformat = { diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index a556b0a..2cdaf74 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -65,16 +65,16 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * H5TOOLS_INFO macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ -#define H5TOOLS_INFO(min_id, str) { \ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, str); \ +#define H5TOOLS_INFO(min_id, ...) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, __VA_ARGS__); \ } /* * HERROR macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ -#define HERROR(maj_id, min_id, str) { \ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str); \ +#define HERROR(maj_id, min_id, ...) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, __VA_ARGS__); \ ret_value = FAIL; \ } @@ -103,8 +103,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * The return value is assigned to a variable `ret_value' and control branches * to the `catch_except' label, if we're not already past it. */ -#define H5E_THROW(fail_value, min_id, str) { \ - H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, str); \ +#define H5E_THROW(fail_value, min_id, ...) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, min_id, __VA_ARGS__); \ H5_LEAVE(fail_value) \ } @@ -114,8 +114,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * error string. The return value is assigned to a variable `ret_value' and * control branches to the `done' label. */ -#define HGOTO_ERROR(fail_value, min_id, str) { \ - HERROR(H5E_tools_g, min_id, str); \ +#define HGOTO_ERROR(fail_value, min_id, ...) { \ + HERROR(H5E_tools_g, min_id, __VA_ARGS__); \ HGOTO_DONE(fail_value) \ } diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 65be089..9b5df25 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,9 +20,9 @@ */ static void print_warning(const char *dname, const char *fname) { - fprintf(stderr, - "warning: dataset <%s> cannot be read, %s filter is not available\n", - dname, fname); + fprintf(stderr, + "warning: dataset <%s> cannot be read, %s filter is not available\n", + dname, fname); } /*------------------------------------------------------------------------- @@ -34,100 +34,97 @@ static void print_warning(const char *dname, const char *fname) * 2) the internal filters might be turned off * * Return: 1, can read, 0, cannot, -1 error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 1, 2004 - * *------------------------------------------------------------------------- */ int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */ hid_t dcpl_id) /* dataset creation property list */ { + int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int nfilters; /* number of filters */ + H5Z_filter_t filtn; /* filter identification number */ + int i; /* index */ + int udfilter_avail; /* index */ + + /* get information about filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed"); + + /* if we do not have filters, we can read the dataset safely */ + if (!nfilters) + HGOTO_DONE(1); + + /* check availability of filters */ + for (i = 0; i < nfilters; i++) { + if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed"); + + switch (filtn) { + /*------------------------------------------------------------------------- + * user defined filter + *------------------------------------------------------------------------- + */ + default: + if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) { + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zfilter_avail failed"); + } + else if (!udfilter_avail) { + if (name) + print_warning(name, "user defined"); + ret_value = 0; + } + break; - int nfilters; /* number of filters */ - H5Z_filter_t filtn; /* filter identification number */ - int i; /* index */ - int udfilter_avail; /* index */ - - /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) - return -1; - - /* if we do not have filters, we can read the dataset safely */ - if (!nfilters) - return 1; - - /* check availability of filters */ - for (i = 0; i < nfilters; i++) { - if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) - return -1; - - switch (filtn) { - /*------------------------------------------------------------------------- - * user defined filter - *------------------------------------------------------------------------- - */ - default: - if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) - return -1; - else if (udfilter_avail == 0) { - if (name) - print_warning(name, "user defined"); - return 0; - } - break; - - /*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_DEFLATE: + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - if (name) - print_warning(name,"deflate"); - return 0; + if (name) + print_warning(name,"deflate"); + ret_value = 0; #endif - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP 4 , szip compression - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SZIP: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP 4 , szip compression + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - if (name) - print_warning(name,"SZIP"); - return 0; + if (name) + print_warning(name,"SZIP"); + ret_value = 0; #endif - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SHUFFLE: - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_FLETCHER32: - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_NBIT - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_NBIT: - break; - /*------------------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SCALEOFFSET: - break; - }/*switch*/ - }/*for*/ - - return 1; + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SHUFFLE: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_FLETCHER32: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_NBIT + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_NBIT: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SCALEOFFSET: + break; + }/*switch*/ + }/*for*/ + +done: + return ret_value; } /*------------------------------------------------------------------------- @@ -138,30 +135,26 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr * except SZIP, which may be configured decoder-only. * * Return: 1, can write, 0, cannot, -1 error - * - * Programmer: - * - * Date: October 5, 2004 - * *------------------------------------------------------------------------- */ -int h5tools_can_encode(H5Z_filter_t filtn) { - switch (filtn) { - /* user defined filter */ - default: +int +h5tools_can_encode(H5Z_filter_t filtn) { + switch (filtn) { + /* user defined filter */ + default: return 0; - case H5Z_FILTER_DEFLATE: + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE return 0; #endif break; - case H5Z_FILTER_SZIP: + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP return 0; #else - { + { unsigned int filter_config_flags; if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) @@ -170,36 +163,36 @@ int h5tools_can_encode(H5Z_filter_t filtn) { & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { /* filter present but neither encode nor decode is supported (???) */ return -1; - } + } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { /* decoder only: read but not write */ return 0; - } + } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { /* encoder only: write but not read (???) */ return -1; - } + } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { return 1; } - } + } #endif break; - case H5Z_FILTER_SHUFFLE: + case H5Z_FILTER_SHUFFLE: break; - case H5Z_FILTER_FLETCHER32: + case H5Z_FILTER_FLETCHER32: break; - case H5Z_FILTER_NBIT: + case H5Z_FILTER_NBIT: break; - case H5Z_FILTER_SCALEOFFSET: + case H5Z_FILTER_SCALEOFFSET: break; }/*switch*/ diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 6153f0c..d6e5f01 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -166,7 +166,8 @@ haddr_t ref_path_table_lookup(const char *thepath) { H5O_info_t oi; - if((HDstrlen(thepath) == 0) || (thepath == NULL)) + + if((thepath == NULL) || (HDstrlen(thepath) == 0)) return HADDR_UNDEF; /* Allow lookups on the root group, even though it doesn't have any link info */ if(HDstrcmp(thepath, "/")) { diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 1719929..c4df03a 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -12,20 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Bill Wendling - * Monday, 19. February 2001 - * * Purpose: These are string functions for us to use and abuse. */ -#include -#include -#include -#include - #include "H5private.h" #include "h5tools.h" /* for h5tool_format_t structure */ #include "h5tools_ref.h" -#include "h5tools_str.h" /*function prototypes */ +#include "h5tools_str.h" /* function prototypes */ /* * If REPEAT_VERBOSE is defined then character strings will be printed so diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 6a5df98..c894598 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -22,9 +22,6 @@ * This is a module of useful timing functions for performance testing. */ -#include -#include - #include "H5private.h" #include "hdf5.h" @@ -53,9 +50,9 @@ io_time_t *timer_g; /* timer: global for stub functions */ static double sub_time(struct timeval* a, struct timeval* b) { return (((double)a->tv_sec + - ((double)a->tv_usec) / MICROSECOND) - + ((double)a->tv_usec) / (double)MICROSECOND) - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); + ((double)b->tv_usec) / (double)MICROSECOND)); } @@ -195,8 +192,9 @@ set_time(io_time_t *pt, timer_type t, int start_stop) } break; + default: - HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type); + HDfprintf(stderr, "Unknown time clock type (%d)\n", pt->type); return NULL; } /* end switch */ diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index 597b6b3..43d6bfe 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -15,8 +15,6 @@ #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" -#include -#include /* Name of tool */ #define PROGRAMNAME "h5mkgrp" diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index 911e0c6..dee0c1f 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -25,23 +25,6 @@ /* See H5private.h for how to include system headers */ #include "hdf5.h" #include "H5private.h" -#ifdef H5_STDC_HEADERS -# include -# include -# include -# include -# include -# include -#endif - -#ifdef H5_HAVE_UNISTD_H -# include -# include -#endif - -#ifdef H5_HAVE_SYS_STAT_H -# include -#endif #ifndef FALSE # define FALSE 0 diff --git a/tools/misc/repart_test.c b/tools/misc/repart_test.c index 372f46a..493f4ce 100644 --- a/tools/misc/repart_test.c +++ b/tools/misc/repart_test.c @@ -12,14 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * June 1, 2005 - * * Purpose: This program tests family files after being repartitioned * by h5repart. It simply tries to reopen the files with * correct family driver and member size. */ #include "hdf5.h" +#include "H5private.h" #define KB 1024 #define FAMILY_H5REPART_SIZE1 20000 @@ -42,52 +40,54 @@ herr_t test_sec2_h5repart_opens(void); * * Purpose: Tries to reopen family files. * - * Return: Success: exit(0) - * - * Failure: exit(1) + * Return: SUCCEED/FAIL * - * Programmer: Raymond Lu - * June 1, 2005 - * - * Modifications: *------------------------------------------------------------------------- */ herr_t test_family_h5repart_opens(void) { - hid_t file=(-1), fapl=(-1); + hid_t fid = -1; + hid_t fapl_id = -1; /* open 1st file(single member file) with correct family size(20000 byte) */ - if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) + if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; - if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_H5REPART_SIZE1, H5P_DEFAULT)<0) + if (H5Pset_fapl_family(fapl_id, (hsize_t)FAMILY_H5REPART_SIZE1, H5P_DEFAULT) < 0) goto error; - if((file=H5Fopen(FILENAME[0], H5F_ACC_RDWR, fapl))<0) + if ((fid = H5Fopen(FILENAME[0], H5F_ACC_RDWR, fapl_id))<0) goto error; - if(H5Fclose(file)<0) + if (H5Fclose(fid) < 0) goto error; /* open 2nd file(multiple member files) with correct family size(5KB) */ - if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_H5REPART_SIZE2, H5P_DEFAULT)<0) + if (H5Pset_fapl_family(fapl_id, (hsize_t)FAMILY_H5REPART_SIZE2, H5P_DEFAULT) < 0) + goto error; + + if ((fid = H5Fopen(FILENAME[1], H5F_ACC_RDWR, fapl_id)) < 0) goto error; - if((file=H5Fopen(FILENAME[1], H5F_ACC_RDWR, fapl))<0) + if (H5Pclose(fapl_id) < 0) goto error; - if(H5Fclose(file)<0) + if (H5Fclose(fid) < 0) goto error; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Pclose(fapl_id); + H5Fclose(fid); } H5E_END_TRY; - return -1; -} + + return FAIL; + +} /* end test_family_h5repart_opens() */ + /*------------------------------------------------------------------------- @@ -95,36 +95,32 @@ error: * * Purpose: Tries to reopen a sec2 file. * - * Return: Success: exit(0) + * Return: SUCCEED/FAIL * - * Failure: exit(1) - * - * Programmer: Raymond Lu - * June 21, 2005 - * - * Modifications: *------------------------------------------------------------------------- */ herr_t test_sec2_h5repart_opens(void) { - hid_t file=(-1); + hid_t fid = -1; /* open the sec2 file */ - if((file=H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT))<0) + if ((fid = H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT)) < 0) goto error; - if(H5Fclose(file)<0) + if (H5Fclose(fid) < 0) goto error; - return 0; + return SUCCEED; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(fid); } H5E_END_TRY; - return -1; -} + + return FAIL; + +} /* end test_sec2_h5repart_opens() */ /*------------------------------------------------------------------------- @@ -132,32 +128,26 @@ error: * * Purpose: Tests h5repart-ed family files * - * Return: Success: exit(0) - * - * Failure: exit(1) - * - * Programmer: Raymond Lu - * June 1, 2005 - * - * Modifications: + * Return: EXIT_SUCCESS/EXIT_FAILURE * *------------------------------------------------------------------------- */ int main(void) { - int nerrors=0; + int nerrors = 0; - nerrors += test_family_h5repart_opens()<0 ?1:0; - nerrors += test_sec2_h5repart_opens()<0 ?1:0; + nerrors += test_family_h5repart_opens() < 0 ? 1 : 0; + nerrors += test_sec2_h5repart_opens() < 0 ? 1 : 0; - if (nerrors) goto error; + if (nerrors) + goto error; - return 0; + HDexit(EXIT_SUCCESS); error: nerrors = MAX(1, nerrors); - printf("***** %d FAMILY FILE TEST%s FAILED! *****\n", + HDprintf("***** %d FAMILY FILE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/tools/misc/talign.c b/tools/misc/talign.c index 83bb92a..751dad1 100644 --- a/tools/misc/talign.c +++ b/tools/misc/talign.c @@ -15,9 +15,6 @@ * Small program to illustrate the "misalignment" of members within a compound * datatype, in a datatype fixed by H5Tget_native_type(). */ -#include -#include -/*#include *//* Required for unlink() */ #include "hdf5.h" #include "H5private.h" diff --git a/tools/misc/testh5repart.sh.in b/tools/misc/testh5repart.sh.in index e33a905..8e6fb8f 100644 --- a/tools/misc/testh5repart.sh.in +++ b/tools/misc/testh5repart.sh.in @@ -19,18 +19,95 @@ TESTNAME=h5repart EXIT_SUCCESS=0 EXIT_FAILURE=1 -REPART=h5repart # The tool name +REPART=./h5repart # The tool name REPART_BIN=`pwd`/$REPART # The path of the tool binary REPARTED_FAM=repart_test # The test name REPARTED_FAM_BIN=`pwd`/$REPARTED_FAM # The path of the test binary +RM='rm -rf' +CMP='cmp -s' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + nerrors=0 verbose=yes -test -d ../testfiles || mkdir ../testfiles +# source dirs +SRC_TOOLS="$srcdir/.." + +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" -actual_dir=`pwd`/../testfiles +TESTDIR=./testrepart +test -d $TESTDIR || mkdir -p $TESTDIR + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES=" +$SRC_TOOLS_TESTFILES/family_file00000.h5 +$SRC_TOOLS_TESTFILES/family_file00001.h5 +$SRC_TOOLS_TESTFILES/family_file00002.h5 +$SRC_TOOLS_TESTFILES/family_file00003.h5 +$SRC_TOOLS_TESTFILES/family_file00004.h5 +$SRC_TOOLS_TESTFILES/family_file00005.h5 +$SRC_TOOLS_TESTFILES/family_file00006.h5 +$SRC_TOOLS_TESTFILES/family_file00007.h5 +$SRC_TOOLS_TESTFILES/family_file00008.h5 +$SRC_TOOLS_TESTFILES/family_file00009.h5 +$SRC_TOOLS_TESTFILES/family_file00010.h5 +$SRC_TOOLS_TESTFILES/family_file00011.h5 +$SRC_TOOLS_TESTFILES/family_file00012.h5 +$SRC_TOOLS_TESTFILES/family_file00013.h5 +$SRC_TOOLS_TESTFILES/family_file00014.h5 +$SRC_TOOLS_TESTFILES/family_file00015.h5 +$SRC_TOOLS_TESTFILES/family_file00016.h5 +$SRC_TOOLS_TESTFILES/family_file00017.h5 +" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $TESTDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} + +CLEAN_TESTFILES_AND_TESTDIR() +{ + # skip rm if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=$SRC_TOOLS_TESTFILES + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $RM $TESTDIR + fi +} # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -48,7 +125,7 @@ TOOLTEST() { TESTING $REPART $@ ( # echo - cd $srcdir/../testfiles + cd $TESTDIR $RUNSERIAL $REPART_BIN $@ ) @@ -64,7 +141,7 @@ OUTPUTTEST() { # Run test program. TESTING $REPARTED_FAM $@ ( - cd $actual_dir + cd $TESTDIR $RUNSERIAL $REPARTED_FAM_BIN $@ ) @@ -87,19 +164,23 @@ SKIP() { ### T H E T E S T S ### ############################################################################## ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR # repartition family member size to 20,000 bytes. -TOOLTEST -m 20000 family_file%05d.h5 $actual_dir/fst_family%05d.h5 +TOOLTEST -m 20000 family_file%05d.h5 fst_family%05d.h5 # repartition family member size to 5 KB. -TOOLTEST -m 5k family_file%05d.h5 $actual_dir/scd_family%05d.h5 +TOOLTEST -m 5k family_file%05d.h5 scd_family%05d.h5 # convert family file to sec2 file of 20,000 bytes -TOOLTEST -m 20000 -family_to_sec2 family_file%05d.h5 $actual_dir/family_to_sec2.h5 +TOOLTEST -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5 # test the output files repartitioned above. OUTPUTTEST echo # Clean up output file +CLEAN_TESTFILES_AND_TESTDIR + if test -z "$HDF5_NOCLEANUP"; then cd $actual_dir rm -f fst_family*.h5 scd_family*.h5 family_to_sec2.h5 diff --git a/tools/perform/CMakeTests.cmake b/tools/perform/CMakeTests.cmake index 5468b0d..2bd8d46 100644 --- a/tools/perform/CMakeTests.cmake +++ b/tools/perform/CMakeTests.cmake @@ -25,7 +25,7 @@ add_custom_target(zip_perf_files ALL COMMENT "Copying files needed by zip_perf t # Remove any output file left over from previous test run add_test ( - NAME PERFORM_h5perform-clear-objects + NAME PERFORM_h5perform-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove chunk.h5 @@ -36,26 +36,139 @@ add_test ( x-rowmaj-rd.dat x-rowmaj-wr.dat x-gnuplot + h5perf_serial.txt + h5perf_serial.txt.err + chunk.txt + chunk.txt.err + iopipe.txt + iopipe.txt.err + overhead.txt + overhead.txt.err + perf_meta.txt + perf_meta.txt.err + zip_perf-h.txt + zip_perf-h.txt.err + zip_perf.txt + zip_perf.txt.err ) -add_test (NAME PERFORM_h5perf_serial COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_h5perf_serial COMMAND $) +else () + add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=h5perf_serial.txt" + #-D "TEST_REFERENCE=h5perf_serial.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT 1800) +set_tests_properties (PERFORM_h5perf_serial PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (HDF5_BUILD_PERFORM_STANDALONE) add_test (NAME PERFORM_h5perf_serial_alone COMMAND $) endif () -add_test (NAME PERFORM_chunk COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_chunk COMMAND $) +else () + add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=chunk.txt" + #-D "TEST_REFERENCE=chunk.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +set_tests_properties (PERFORM_chunk PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") + +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_iopipe COMMAND $) +else () + add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=iopipe.txt" + #-D "TEST_REFERENCE=iopipe.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +set_tests_properties (PERFORM_iopipe PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") -add_test (NAME PERFORM_iopipe COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_overhead COMMAND $) +else () + add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=overhead.txt" + #-D "TEST_REFERENCE=overhead.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +set_tests_properties (PERFORM_overhead PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") -add_test (NAME PERFORM_overhead COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_perf_meta COMMAND $) +else () + add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=perf_meta.txt" + #-D "TEST_REFERENCE=perf_meta.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +set_tests_properties (PERFORM_perf_meta PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") -add_test (NAME PERFORM_perf_meta COMMAND $) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") +else () + add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=zip_perf-h.txt" + #-D "TEST_REFERENCE=zip_perf-h.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () +set_tests_properties (PERFORM_zip_perf_help PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") -add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") -add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +if (HDF5_ENABLE_USING_MEMCHECKER) + add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +else () + add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -D "TEST_OUTPUT=zip_perf.txt" + #-D "TEST_REFERENCE=zip_perf.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) +endif () set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS PERFORM_zip_perf_help) +set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -- cgit v0.12 From 03fb151cad8b28734450c2fdb3005ce596ab31c5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 11 Oct 2017 15:14:44 -0500 Subject: Added older tool change that was in last merge --- release_docs/RELEASE.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 386e0a3..b17f364 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -213,6 +213,18 @@ Bug Fixes since HDF5-1.8.19 (ADB - 2017/07/25, HDFFV-10246) + - h5import + + h5import crashed trying to import data from a subset of a dataset. + + Improved h5import by adding the SUBSET keyword. h5import understands + to use the Count times the Block as the size of the dimensions. + Added INPUT_B_ORDER keyword to old-style configuration files. + The import from h5dump function expects the binary files to use native + types (FILE '-b' option) in the binary file. + + (ADB - 2017/06/15, HDFFV-10219) + Fortran API ----------- -- cgit v0.12 From baf67cd13f107e0728a57c1cb3005e9252c530a6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 11 Oct 2017 15:41:30 -0500 Subject: Update list of tools test files --- MANIFEST | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index e40cb73..2b60040 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1046,11 +1046,17 @@ ./tools/h5import/h5importtestutil.sh.in # testfiles for h5import +./tools/h5import/testfiles/binfp64.conf ./tools/h5import/testfiles/binfp64.h5 +./tools/h5import/testfiles/binin16.conf ./tools/h5import/testfiles/binin16.h5 +./tools/h5import/testfiles/binin32.conf ./tools/h5import/testfiles/binin32.h5 +./tools/h5import/testfiles/binin8.conf ./tools/h5import/testfiles/binin8.h5 +./tools/h5import/testfiles/binin8w.conf ./tools/h5import/testfiles/binin8w.h5 +./tools/h5import/testfiles/binuin16.conf ./tools/h5import/testfiles/binuin16.h5 ./tools/h5import/testfiles/binuin32.h5 ./tools/h5import/testfiles/tall_fp32.ddl @@ -2075,13 +2081,13 @@ ./tools/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst ./tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst ./tools/h5repack/testfiles/h5repack-help.txt -./tools/h5repack/testfiles/h5repack_filters.h5.tst +./tools/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst ./tools/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst ./tools/h5repack/testfiles/h5repack_layout.h5.ddl ./tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl ./tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl ./tools/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl -./tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.tst +./tools/h5repack/testfiles/h5repack_layout.h5-plugin_zero.ddl # jam utility and tests ./tools/h5jam/h5jam.c -- cgit v0.12 From c7a1245a19ef45cee0f2dbcc16fa10cca630bb62 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 12 Oct 2017 09:04:44 -0500 Subject: Fix VS2012,2008 declaration statements --- tools/h5dump/h5dumpgentest.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index f55b3fd..a2f4036 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -9811,9 +9811,16 @@ static void gent_compound_complex2(void) compound buf[F82_DIM32]; /* compound */ - hid_t file, grp=-1, type=-1, space=-1, dset=-1; - hid_t dset_array_a, dset_array_b, dset_array_c; - hid_t cmpd_tid1, cmpd_tid2, cmpd_tid3; + hid_t file = -1, + type = -1, + space = -1, + dset = -1; + hid_t dset_array_a, + dset_array_b, + dset_array_c; + hid_t cmpd_tid1 = -1, + cmpd_tid2 = -1, + cmpd_tid3 = -1; size_t i; size_t j, k; unsigned dset_array_ndims; @@ -9825,6 +9832,10 @@ static void gent_compound_complex2(void) if ((space = H5Screate_simple(F82_RANK, &nelmts, NULL)) >= 0) { /* CompoundComplex1D */ if ((type = H5Tcreate(H5T_COMPOUND, sizeof(compound))) >= 0) { + hid_t str_type, array; + hsize_t dims[1]; + hid_t nest1, nest2; + /* Insert top-level array members */ dset_array_ndims = 1; dset_array_a_dims[0] = 4; dset_array_a = H5Tarray_create2(H5T_STD_U32LE, dset_array_ndims, dset_array_a_dims); @@ -9842,8 +9853,6 @@ static void gent_compound_complex2(void) H5Tclose(dset_array_c); /* Insert first nested compound */ - hid_t str_type, array; - hsize_t dims[1]; cmpd_tid1 = H5Tcreate(H5T_COMPOUND, sizeof(nested_compound)); H5Tinsert(cmpd_tid1, "nested_double", HOFFSET(nested_compound, nested_a), H5T_IEEE_F64LE); @@ -9865,7 +9874,6 @@ static void gent_compound_complex2(void) H5Tinsert(type, "nested_compound", HOFFSET(compound, d), cmpd_tid1); /* Insert second nested compound */ - hid_t nest1, nest2; cmpd_tid2 = H5Tcreate(H5T_COMPOUND, sizeof(multiple_nested_compound)); H5Tinsert(cmpd_tid2, "nested_float", HOFFSET(multiple_nested_compound, a), H5T_IEEE_F32LE); @@ -9955,10 +9963,10 @@ static void gent_compound_complex2(void) /* Set up first nested compound */ buf[i].d.nested_a = (double) i; - strcpy(buf[i].d.nested_string, "This is a test string."); + HDstrcpy(buf[i].d.nested_string, "This is a test string."); for (j = 0; j < 4; j++) - strcpy(buf[i].d.nested_string_array[j], "String test"); + HDstrcpy(buf[i].d.nested_string_array[j], "String test"); /* Set up multiple nested compound */ buf[i].e.a = (float) i; @@ -9970,9 +9978,9 @@ static void gent_compound_complex2(void) buf[i].e.b.multiple_nested_d[j] = (long)(j - i*10); } - strcpy(buf[i].e.c.further_nested_string, "1234567890"); + HDstrcpy(buf[i].e.c.further_nested_string, "1234567890"); for (j = 0; j < 4; j++) - strcpy(buf[i].e.c.further_nested_string_array[j], "STRING ARRAY"); + HDstrcpy(buf[i].e.c.further_nested_string_array[j], "STRING ARRAY"); for (j = 0; j < 10; j++) { buf[i].e.c.deep_nest.deep_nested_short[j] = (short)(j + i*10); @@ -9984,7 +9992,7 @@ static void gent_compound_complex2(void) } if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - fprintf(stderr, "gent_tcompound_complex2 H5Dwrite failed\n"); + HDfprintf(stderr, "gent_tcompound_complex2 H5Dwrite failed\n"); H5Dclose(dset); } -- cgit v0.12 From 24c6653cbd0fce60fe77007f9776814178f44908 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 15 Oct 2017 20:35:29 -0500 Subject: Snapshot version 1.8 release 20 (snap7) --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index d7d4ec0..fc5bda1 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap7 currently under development +HDF5 version 1.8.20-snap8 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 3c4c609..8b950eb 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap7, currently under development" +PROJECT_NUMBER = "1.8.20-snap8, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 00fd386..5b7b5f5 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap7") +set (CTEST_SOURCE_VERSEXT "-snap8") ############################################################################## # handle input parameters to script. diff --git a/configure.ac b/configure.ac index 2c758c8..aac3681 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap7], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-snap8], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 47317a4..786905b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap7 currently under development +HDF5 version 1.8.20-snap8 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 67663c7..c6193a3 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap7" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "snap8" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap7" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap8" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 78ab45cb72cba95d2be5f12d9c44290696013741 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 17 Oct 2017 23:56:16 -0500 Subject: Adding new C++ wrappers Description: - Added overloaded wrappers for H5Oget_info and H5Oget_info_by_name // Retrieves information about an object void getObjectInfo(H5O_info_t *oinfo) const; void getObjectInfo(const char *name, H5O_info_t *oinfo, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; void getObjectInfo(const H5std_string& name, H5O_info_t *oinfo, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; - Many miscellaneous cleanup for consistent appearance Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5Location.cpp | 125 +++++++++++++++++++++++++++--------- c++/src/H5Location.h | 9 +++ c++/test/dsets.cpp | 30 ++------- c++/test/h5cpputil.cpp | 19 ++---- c++/test/tarray.cpp | 33 +++++----- c++/test/tattr.cpp | 19 +++--- c++/test/tcompound.cpp | 144 ++++++++++++++++++------------------------ c++/test/tdspl.cpp | 11 ++-- c++/test/testhdf5.cpp | 10 +-- c++/test/tfile.cpp | 160 +++++++++++++++++++++++------------------------ c++/test/tfilter.cpp | 4 -- c++/test/th5s.cpp | 3 - c++/test/tlinks.cpp | 79 +++++++++++------------ c++/test/tobject.cpp | 29 ++------- c++/test/trefer.cpp | 2 +- c++/test/ttypes.cpp | 29 ++------- c++/test/tvlstr.cpp | 72 ++++++++++++--------- release_docs/RELEASE.txt | 27 +++++++- 18 files changed, 403 insertions(+), 402 deletions(-) diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 4ef5d82..afeaca7 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -95,7 +95,8 @@ May, 2017 (1.8.19) //-------------------------------------------------------------------------- // Function: H5Location::createAttribute -///\brief Deprecated - Creates an attribute for a group, dataset, or named datatype. +///\brief Deprecated - replaced by H5Object::createAttribute +// brief Creates an attribute for a group, dataset, or named datatype. ///\param name - IN: Name of the attribute ///\param data_type - IN: Datatype for the attribute ///\param data_space - IN: Dataspace for the attribute - only simple @@ -134,7 +135,8 @@ Attribute H5Location::createAttribute(const char* name, const DataType& data_typ //-------------------------------------------------------------------------- // Function: H5Location::createAttribute -///\brief Deprecated - This is an overloaded member function, provided for convenience. +///\brief Deprecated - replaced by H5Object::createAttribute +// brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 @@ -146,7 +148,8 @@ Attribute H5Location::createAttribute(const H5std_string& name, const DataType& //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Deprecated - Opens an attribute given its name. +///\brief Deprecated - replaced by H5Object::openAttribute +// brief Opens an attribute given its name. ///\param name - IN: Name of the attribute ///\return Attribute instance ///\exception H5::AttributeIException @@ -169,9 +172,11 @@ Attribute H5Location::openAttribute(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Deprecated - This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. +///\brief Deprecated - replaced by H5Object::openAttribute +// brief This is an overloaded member function, provided for convenience. +// It differs from the above function in that it takes +// a reference to an \c H5std_string for \a name. +///\param name - IN: Name of the attribute // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Location::openAttribute(const H5std_string& name) const @@ -181,7 +186,8 @@ Attribute H5Location::openAttribute(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::openAttribute -///\brief Deprecated - Opens an attribute given its index. +///\brief Deprecated - replaced by H5Object::openAttribute +// brief Opens an attribute given its index. ///\param idx - IN: Index of the attribute, a 0-based, non-negative integer ///\return Attribute instance ///\exception H5::AttributeIException @@ -205,7 +211,7 @@ Attribute H5Location::openAttribute(const unsigned int idx) const //-------------------------------------------------------------------------- // Function: H5Location::iterateAttrs -///\brief Deprecated - Iterates a user's function over all the attributes of an H5 +///\brief Iterates a user's function over all the attributes of an H5 /// object, which may be a group, dataset or named datatype. ///\param user_op - IN: User's function to operate on each attribute ///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices @@ -250,7 +256,8 @@ int H5Location::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_d //-------------------------------------------------------------------------- // Function: H5Location::attrExists -///\brief Deprecated - Checks whether the named attribute exists at this location. +///\brief Deprecated - replaced by H5Object::attrExists() +// brief Checks whether the named attribute exists at this location. ///\param name - IN: Name of the attribute to be queried ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2013 @@ -271,10 +278,12 @@ bool H5Location::attrExists(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::attrExists -///\brief Deprecated - This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. -// Programmer Binh-Minh Ribler - 2000 +///\brief Deprecated - replaced by H5Object::attrExists() +// brief This is an overloaded member function, provided for convenience. +// It differs from the above function in that it takes +// a reference to an \c H5std_string for \a name. +///\param name - IN: Name of the attribute to be queried +// Programmer Binh-Minh Ribler - 2013 //-------------------------------------------------------------------------- bool H5Location::attrExists(const H5std_string& name) const { @@ -283,7 +292,8 @@ bool H5Location::attrExists(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::removeAttr -///\brief Deprecated - Removes the named attribute from this object. +///\brief Deprecated - replaced by H5Object::removeAttr() +// brief Removes the named attribute from this object. ///\param name - IN: Name of the attribute to be removed ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 @@ -297,9 +307,11 @@ void H5Location::removeAttr(const char* name) const //-------------------------------------------------------------------------- // Function: H5Location::removeAttr -///\brief Deprecated - This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for \a name. +///\brief Deprecated - replaced by H5Object::removeAttr() +// brief This is an overloaded member function, provided for convenience. +// It differs from the above function in that it takes +// a reference to an \c H5std_string for \a name. +///\param name - IN: Name of the attribute to be removed // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::removeAttr(const H5std_string& name) const @@ -309,7 +321,8 @@ void H5Location::removeAttr(const H5std_string& name) const //-------------------------------------------------------------------------- // Function: H5Location::renameAttr -///\brief Deprecated - Renames the named attribute from this object. +///\brief Deprecated - replaced by H5Object::renameAttr() +// brief Renames the named attribute from this object. ///\param oldname - IN: Name of the attribute to be renamed ///\param newname - IN: New name ame of the attribute ///\exception H5::AttributeIException @@ -324,10 +337,13 @@ void H5Location::renameAttr(const char* oldname, const char* newname) const //-------------------------------------------------------------------------- // Function: H5Location::renameAttr -///\brief Deprecated - This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes -/// a reference to an \c H5std_string for the names. -/// +///\brief Deprecated - replaced by H5Object::renameAttr() +// brief This is an overloaded member function, provided for convenience. +// It differs from the above function in that it takes +// a reference to an \c H5std_string for the names. +// +///\param oldname - IN: Name of the attribute to be renamed +///\param newname - IN: New name ame of the attribute ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- @@ -338,8 +354,8 @@ void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& new //-------------------------------------------------------------------------- // Function: H5Location::getNumAttrs -///\brief Deprecated - Returns the number of attributes attached to -/// this HDF5 object. +///\brief Deprecated - replaced by H5Object::getNumAttrs() +// brief Returns the number of attributes attached to this HDF5 object. ///\return Number of attributes ///\exception H5::AttributeIException // Programmer Binh-Minh Ribler - 2000 @@ -348,18 +364,18 @@ void H5Location::renameAttr(const H5std_string& oldname, const H5std_string& new //-------------------------------------------------------------------------- int H5Location::getNumAttrs() const { - H5O_info_t oinfo; /* Object info */ + H5O_info_t objinfo; /* Object info */ - if(H5Oget_info(getId(), &oinfo) < 0) + if(H5Oget_info(getId(), &objinfo) < 0) throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed"); else - return(static_cast(oinfo.num_attrs)); + return(static_cast(objinfo.num_attrs)); } //-------------------------------------------------------------------------- // Function: H5Location::nameExists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name +///\brief Checks if a link of a given name exists in a location. +///\param name - IN: Searched name - \c char* ///\param lapl - IN: Link access property list ///\exception H5::LocationException // Programmer Binh-Minh Ribler - Nov, 2016 @@ -380,8 +396,8 @@ bool H5Location::nameExists(const char* name, const LinkAccPropList& lapl) const //-------------------------------------------------------------------------- // Function: H5Location::nameExists -///\brief Checks if a link of a given name exists in a location -///\param name - IN: Searched name +///\brief Checks if a link of a given name exists in a location. +///\param name - IN: Searched name - \c H5std_string ///\param lapl - IN: Link access property list ///\exception H5::LocationException // Programmer Binh-Minh Ribler - Dec, 2016 @@ -434,6 +450,53 @@ H5std_string H5Location::getFileName() const } //-------------------------------------------------------------------------- +// Function: H5Location::getObjectInfo +///\brief Retrieve information about an object, specified by location. +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Aug, 2017 +//-------------------------------------------------------------------------- +void H5Location::getObjectInfo(H5O_info_t *objinfo) const +{ + herr_t ret_value = H5Oget_info(getId(), objinfo); + if (ret_value < 0) + { + throw LocationException(inMemFunc("getObjectInfo"), "H5Oget_info failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::getObjectInfo +///\brief Retrieve information about an object, specified by name. +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Aug, 2017 +//-------------------------------------------------------------------------- +void H5Location::getObjectInfo(const char *name, H5O_info_t *objinfo, + const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Oget_info_by_name(getId(), name, objinfo, lapl.getId()); + if (ret_value < 0) + { + throw LocationException(inMemFunc("getObjectInfo"), "H5Oget_info_by_name failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: H5Location::getObjectInfo +///\brief Retrieve information about an object, specified by name. +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Aug, 2017 +//-------------------------------------------------------------------------- +void H5Location::getObjectInfo(const H5std_string& name, H5O_info_t *objinfo, + const LinkAccPropList& lapl) const +{ + herr_t ret_value = H5Oget_info_by_name(getId(), name.c_str(), objinfo, lapl.getId()); + if (ret_value < 0) + { + throw LocationException(inMemFunc("getObjectInfo"), "H5Oget_info_by_name failed"); + } +} + +//-------------------------------------------------------------------------- // Function: H5Location::objVersion ///\brief Returns the header version of this HDF5 object. ///\return Object version, which can have the following values: diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 7a54c2b..12c3e8a 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -51,6 +51,15 @@ class H5_DLLCPP H5Location : public IdComponent { // Gets the name of the file, specified by this location. H5std_string getFileName() const; + // Retrieves information about an object at this location + // specified by location + void getObjectInfo(H5O_info_t *oinfo) const; + // specified by the object's name + void getObjectInfo(const char *name, H5O_info_t *oinfo, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + void getObjectInfo(const H5std_string& name, H5O_info_t *oinfo, + const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + // Determines the number of attributes at this location. // - moved to H5Object (1.8.20) int getNumAttrs() const; // Deprecated diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index f534e33..8d2618b 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -28,16 +28,12 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file - - using namespace H5; +using namespace H5; #include "h5cpputil.h" // C++ utilility header file @@ -70,8 +66,6 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, * Programmer: Binh-Minh Ribler (using C version) * Friday, January 5, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -202,8 +196,6 @@ test_create( H5File& file) * Programmer: Binh-Minh Ribler (using C version) * Friday, January 5, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -288,8 +280,6 @@ test_simple_io( H5File& file) * Programmer: Binh-Minh Ribler * Thursday, March 22, 2012 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -358,8 +348,6 @@ test_datasize(FileAccPropList &fapl) * Programmer: Binh-Minh Ribler (using C version) * Friday, January 5, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -452,8 +440,6 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ * Programmer: Robb Matzke * Tuesday, April 21, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t @@ -481,8 +467,6 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, * Programmer: Binh-Minh Ribler (using C version) * Friday, January 5, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -884,8 +868,6 @@ static herr_t test_nbit_compression(H5File& file) * Programmer: Binh-Minh Ribler (using C version) * Saturday, February 17, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -966,8 +948,6 @@ test_multiopen (H5File& file) * Programmer: Binh-Minh Ribler (using C version) * February 17, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1223,8 +1203,6 @@ void test_dset() * * Programmer: (use C version) * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index ec35821..9f81895 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -24,17 +24,14 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; -#include "h5test.h" -#include "H5Cpp.h" +#include +#include "H5Cpp.h" // C++ API header file using namespace H5; +#include "h5test.h" #include "h5cpputil.h" @@ -52,8 +49,6 @@ using namespace H5; * Programmer: Binh-Minh Ribler (using C code segment for reporting tests) * Friday, February 6, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ int test_report( int nerrors, const H5std_string& testname ) @@ -140,8 +135,6 @@ void issue_fail_msg(const char* where, int line, const char* file_name, * Programmer: Binh-Minh Ribler (using C code segment for checking values) * Friday, February 6, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ int check_values (hsize_t i, hsize_t j, int apoint, int acheck) @@ -170,8 +163,6 @@ int check_values (hsize_t i, hsize_t j, int apoint, int acheck) * Programmer: Binh-Minh Ribler * May 2, 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ void verify_val(const char* x, const char* value, const char* where, int line, const char* file_name) diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index c07ba42..218e4e5 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -22,19 +22,17 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; #include "h5cpputil.h" // C++ utilility header file const H5std_string FILENAME("tarray.h5"); +const H5std_string ARRAYTYPE_NAME("/Array type 1"); const int SPACE1_RANK = 1; const hsize_t SPACE1_DIM1 = 4; const int ARRAY1_RANK = 1; @@ -60,8 +58,6 @@ typedef enum int_t { * Programmer: Binh-Minh Ribler (using C version) * January, 2016 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_compound_array() @@ -131,9 +127,22 @@ static void test_array_compound_array() // Write dataset to disk dataset.write(wdata, arrtype); + // Test opening ArrayType with opening constructor (Dec 2016) + + // Commit the arrtype to give it a name + arrtype.commit(file1, ARRAYTYPE_NAME); + + // Close it, then re-open with the opening constructor + arrtype.close(); + ArrayType named_type(file1, ARRAYTYPE_NAME); + + // Get and verify the type's name + H5std_string type_name = named_type.getObjName(); + verify_val(type_name, ARRAYTYPE_NAME, "DataType::getObjName tests constructor", __LINE__, __FILE__); + named_type.close(); + // Close all dataset.close(); - arrtype.close(); space.close(); file1.close(); @@ -282,8 +291,6 @@ static void test_array_compound_array() * Description: * Used user's sample code in HDFFV-9562 * - * Modifications: - * *------------------------------------------------------------------------- */ /* @@ -353,8 +360,6 @@ static void test_array_assignment() * Programmer: Binh-Minh Ribler * April, 2016 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_info() @@ -499,8 +504,6 @@ void test_array() * Programmer: Binh-Minh Ribler (using C version) * January, 2016 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index e3526c6..d97d478 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -23,13 +23,10 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; @@ -1290,6 +1287,14 @@ static void test_attr_dtype_shared() // Commit datatype to file dtype.commit(fid1, TYPE1_NAME); + // Retrieve and verify information about the type + H5O_info_t oinfo; + fid1.getObjectInfo(TYPE1_NAME, &oinfo); + if (oinfo.type != H5O_TYPE_NAMED_DATATYPE) + TestErrPrintf("Line %d: object type wrong!\n", __LINE__); + verify_val(oinfo.num_attrs, 0, "DataType::getObjinfo reference count", __LINE__, __FILE__); + verify_val((int)oinfo.rc, 1, "DataType::getObjinfo reference count", __LINE__, __FILE__); + #ifndef H5_NO_DEPRECATED_SYMBOLS // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); @@ -1879,8 +1884,6 @@ void test_attr() * Programmer: Albert Cheng * July 2, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 09134ed..ce2d061 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -22,24 +22,21 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; #include "h5cpputil.h" // C++ utilility header file /* Number of elements in each test */ -#define NTESTELEM 100000 +#define NTESTELEM 100000 typedef struct complex_t { - double re; - double im; + double re; + double im; } complex_t; @@ -53,8 +50,6 @@ typedef struct complex_t { * Programmer: Binh-Minh Ribler (using C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_1() @@ -90,8 +85,6 @@ static void test_compound_1() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_2() @@ -103,11 +96,11 @@ static void test_compound_2() int e, d, c[4], b, a; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - const int nelmts = NTESTELEM; - const hsize_t four = 4; - int i; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + const int nelmts = NTESTELEM; + const hsize_t four = 4; + int i; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType *array_dt = NULL; @@ -115,9 +108,9 @@ static void test_compound_2() SUBTEST("Compound Element Reordering"); try { // Sizes should be the same, but be careful just in case - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); for (i=0; ia = i*8+0; @@ -183,9 +176,9 @@ static void test_compound_2() } } // Release resources - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); s_ptr = NULL; d_ptr = NULL; st.close(); @@ -215,8 +208,6 @@ static void test_compound_2() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_3() @@ -228,11 +219,11 @@ static void test_compound_3() int a, c[4], e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; - const hsize_t four = 4; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; + const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -240,9 +231,9 @@ static void test_compound_3() SUBTEST("Compound Datatype Subset Conversions"); try { /* Initialize */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); for (i=0; ia = i*8+0; @@ -305,9 +296,9 @@ static void test_compound_3() } // for /* Release resources */ - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); s_ptr = NULL; d_ptr = NULL; st.close(); @@ -337,8 +328,6 @@ static void test_compound_3() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_4() @@ -355,11 +344,11 @@ static void test_compound_4() int e; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; - const hsize_t four = 4; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; + const hsize_t four = 4; unsigned char *buf = NULL, *orig = NULL, *bkg = NULL; ArrayType* array_dt = NULL; @@ -367,9 +356,9 @@ static void test_compound_4() SUBTEST("Compound Element Shrinking & Reordering"); try { /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); for (i=0; ia = i*8+0; @@ -378,7 +367,7 @@ static void test_compound_4() s_ptr->c[1] = i*8+3; s_ptr->c[2] = i*8+4; s_ptr->c[3] = i*8+5; - s_ptr->d = (i*8+6) & 0x7fff; + s_ptr->d = (i*8+6) & 0x7fff; s_ptr->e = i*8+7; } memcpy(buf, orig, nelmts*sizeof(src_typ_t)); @@ -437,9 +426,9 @@ static void test_compound_4() } // for /* Release resources */ - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); s_ptr = NULL; d_ptr = NULL; st.close(); @@ -470,8 +459,6 @@ static void test_compound_4() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_5() @@ -488,12 +475,12 @@ static void test_compound_5() int coll_ids[4]; } dst_typ_t; - hsize_t dims[1] = {4}; - src_typ_t src[2] = {{"one", 102, {104, 105, 106, 107}}, - {"two", 202, {204, 205, 206, 207}}}; - dst_typ_t *dst; - void *buf = calloc(2, sizeof(dst_typ_t)); - void *bkg = calloc(2, sizeof(dst_typ_t)); + hsize_t dims[1] = {4}; + src_typ_t src[2] = {{"one", 102, {104, 105, 106, 107}}, + {"two", 202, {204, 205, 206, 207}}}; + dst_typ_t *dst; + void *buf = HDcalloc(2, sizeof(dst_typ_t)); + void *bkg = HDcalloc(2, sizeof(dst_typ_t)); ArrayType* array_dt = NULL; // Output message about test being performed @@ -545,8 +532,8 @@ static void test_compound_5() { H5_FAILED(); } /* Free memory buffers */ - free(buf); - free(bkg); + HDfree(buf); + HDfree(bkg); dst = NULL; PASSED(); } // end of try block @@ -573,8 +560,6 @@ static void test_compound_5() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_6() @@ -589,23 +574,23 @@ static void test_compound_6() long d; } dst_typ_t; - src_typ_t *s_ptr; - dst_typ_t *d_ptr; - int i; - const int nelmts = NTESTELEM; + src_typ_t *s_ptr; + dst_typ_t *d_ptr; + int i; + const int nelmts = NTESTELEM; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; // Output message about test being performed SUBTEST("Compound Element Growing"); try { /* Sizes should be the same, but be careful just in case */ - buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); - bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t)); - orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t)); + buf = (unsigned char*)HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t))); + bkg = (unsigned char*)HDmalloc(nelmts * sizeof(dst_typ_t)); + orig = (unsigned char*)HDmalloc(nelmts * sizeof(src_typ_t)); for (i=0; ib = (i*8+1) & 0x7fff; - s_ptr->d = (i*8+6) & 0x7fff; + s_ptr->b = (i*8+1) & 0x7fff; + s_ptr->d = (i*8+6) & 0x7fff; } memcpy(buf, orig, nelmts*sizeof(src_typ_t)); @@ -638,9 +623,9 @@ static void test_compound_6() } // for /* Release resources */ - free(buf); - free(bkg); - free(orig); + HDfree(buf); + HDfree(bkg); + HDfree(orig); s_ptr = NULL; d_ptr = NULL; st.close(); @@ -665,8 +650,6 @@ static void test_compound_6() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_7() @@ -731,8 +714,6 @@ static void test_compound_7() * Programmer: Binh-Minh Ribler (use partial C version test_ooo_order) * March, 2014 * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string COMPFILE("tcompound_types.h5"); @@ -821,15 +802,12 @@ static void test_compound_set_size() * Programmer: Binh-Minh Ribler * January 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" void test_compound() { // Output message about test being performed - //MESSAGE("Testing Compound Data Type operations\n"); MESSAGE(5, ("Testing Compound Data Type operations\n")); test_compound_1(); // various things about compound data types @@ -850,8 +828,6 @@ void test_compound() * * Return: none * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index d54d541..0a60a86 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -14,7 +14,7 @@ /***************************************************************************** FILE tdspl.cpp - HDF5 C++ testing the dataset memory and transfer property - list functionality + list functionality ***************************************************************************/ @@ -23,13 +23,10 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 6a5b70d..b998f76 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -44,14 +44,10 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; -#include "h5test.h" // C test header file +#include #include "H5Cpp.h" // C++ API header file using namespace H5; diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 8c626aa..059c548 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -35,30 +35,30 @@ using namespace H5; #include "h5cpputil.h" // C++ utilility header file -const hsize_t F1_USERBLOCK_SIZE = (hsize_t)0; -const size_t F1_OFFSET_SIZE = sizeof(haddr_t); -const size_t F1_LENGTH_SIZE = sizeof(hsize_t); -const unsigned F1_SYM_LEAF_K = 4; -const unsigned F1_SYM_INTERN_K = 16; -const H5std_string FILE1("tfile1.h5"); - -const hsize_t F2_USERBLOCK_SIZE = (hsize_t)512; -const size_t F2_OFFSET_SIZE = 8; -const size_t F2_LENGTH_SIZE = 8; -const unsigned F2_SYM_LEAF_K = 8; -const unsigned F2_SYM_INTERN_K = 32; -const unsigned F2_ISTORE = 64; +const hsize_t F1_USERBLOCK_SIZE = (hsize_t)0; +const size_t F1_OFFSET_SIZE = sizeof(haddr_t); +const size_t F1_LENGTH_SIZE = sizeof(hsize_t); +const unsigned F1_SYM_LEAF_K = 4; +const unsigned F1_SYM_INTERN_K = 16; +const H5std_string FILE1("tfile1.h5"); + +const hsize_t F2_USERBLOCK_SIZE = (hsize_t)512; +const size_t F2_OFFSET_SIZE = 8; +const size_t F2_LENGTH_SIZE = 8; +const unsigned F2_SYM_LEAF_K = 8; +const unsigned F2_SYM_INTERN_K = 32; +const unsigned F2_ISTORE = 64; const H5std_string FILE2("tfile2.h5"); -const hsize_t F3_USERBLOCK_SIZE = (hsize_t)0; -const size_t F3_OFFSET_SIZE = F2_OFFSET_SIZE; -const size_t F3_LENGTH_SIZE = F2_LENGTH_SIZE; -const unsigned F3_SYM_LEAF_K = F2_SYM_LEAF_K; -const unsigned F3_SYM_INTERN_K = F2_SYM_INTERN_K; +const hsize_t F3_USERBLOCK_SIZE = (hsize_t)0; +const size_t F3_OFFSET_SIZE = F2_OFFSET_SIZE; +const size_t F3_LENGTH_SIZE = F2_LENGTH_SIZE; +const unsigned F3_SYM_LEAF_K = F2_SYM_LEAF_K; +const unsigned F3_SYM_INTERN_K = F2_SYM_INTERN_K; const H5std_string FILE3("tfile3.h5"); -const int KB = 1024; -const H5std_string FILE4("tfile4.h5"); +const int KB = 1024; +const H5std_string FILE4("tfile4.h5"); /*------------------------------------------------------------------------- @@ -73,11 +73,11 @@ const H5std_string FILE4("tfile4.h5"); * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ static void test_file_create() // Create file FILE1 file1 = new H5File (FILE1, H5F_ACC_EXCL); - // try to create the same file with H5F_ACC_TRUNC. This should fail + // Try to create the same file with H5F_ACC_TRUNC. This should fail // because file1 is the same file and is currently open. try { H5File file2 (FILE1, H5F_ACC_TRUNC); // should throw E @@ -156,12 +156,12 @@ static void test_file_create() hsize_t ublock = tmpl1.getUserblock(); verify_val((long)ublock, (long)F1_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters + size_t parm1, parm2; // file-creation parameters tmpl1.getSizes( parm1, parm2); verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - unsigned iparm1,iparm2; // file-creation parameters + unsigned iparm1,iparm2; // file-creation parameters tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F1_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F1_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); @@ -214,12 +214,12 @@ static void test_file_create() hsize_t ublock = tmpl1->getUserblock(); verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters + size_t parm1, parm2; // file-creation parameters tmpl1->getSizes( parm1, parm2); verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - unsigned iparm1,iparm2; // file-creation parameters + unsigned iparm1,iparm2; // file-creation parameters tmpl1->getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); @@ -280,11 +280,11 @@ static void test_file_create() * * Modifications: * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specificly handled - * with a special routine. + * cases. Since there are no operator<< for 'long long' + * or int64 in VS C++ ostream, I casted the hsize_t values + * passed to verify_val to 'long' as well. If problems + * arises later, this will have to be specificly handled + * with a special routine. * *------------------------------------------------------------------------- */ @@ -305,13 +305,13 @@ static void test_file_open() hsize_t ublock = tmpl1.getUserblock(); verify_val((long)ublock, (long)F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__); - size_t parm1, parm2; // file-creation parameters - tmpl1.getSizes( parm1, parm2); + size_t parm1, parm2; // file-creation parameters + tmpl1.getSizes(parm1, parm2); verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); - unsigned iparm1,iparm2; // file-creation parameters - tmpl1.getSymk( iparm1, iparm2); + unsigned iparm1,iparm2; // file-creation parameters + tmpl1.getSymk(iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); verify_val(iparm2, F2_SYM_LEAF_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); @@ -361,8 +361,6 @@ static void test_file_open() * Programmer: Raymond Lu * June, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_file_size() @@ -370,7 +368,7 @@ static void test_file_size() // Output message about test being performed SUBTEST("File Size"); - hid_t fapl_id; + hid_t fapl_id; fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template try { @@ -408,8 +406,10 @@ static void test_file_size() issue_fail_msg("test_file_size()", __LINE__, __FILE__, E.getCDetailMsg()); } - // use C test utility routine to close property list. - H5Pclose(fapl_id); + // This fapl_id was returned from h5_fileaccess. + herr_t ret = H5Pclose(fapl_id); + if (ret < 0) + issue_fail_msg("test_file_size()", __LINE__, __FILE__, "H5Pclose failed"); } // test_file_size() @@ -424,18 +424,16 @@ static void test_file_size() * Programmer: Binh-Minh Ribler * July, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ -const int RANK = 2; -const int NX = 4; -const int NY = 5; -const H5std_string GROUPNAME ("group"); -const H5std_string DSETNAME ("dataset"); -const H5std_string DATTRNAME ("dataset attribute"); -const H5std_string FATTRNAME ("file attribute"); -const H5std_string DTYPENAME ("compound"); +const int RANK = 2; +const int NX = 4; +const int NY = 5; +const H5std_string GROUPNAME ("group"); +const H5std_string DSETNAME ("dataset"); +const H5std_string DATTRNAME ("dataset attribute"); +const H5std_string FATTRNAME ("file attribute"); +const H5std_string DTYPENAME ("compound"); // Compound datatype typedef struct s1_t { @@ -502,15 +500,14 @@ static void test_file_name() { issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); } - } // test_file_name() -const int RANK1 = 1; -const int ATTR1_DIM1 = 3; -const H5std_string FILE5("tfattrs.h5"); -const H5std_string FATTR1_NAME ("file attribute 1"); -const H5std_string FATTR2_NAME ("file attribute 2"); +const int RANK1 = 1; +const int ATTR1_DIM1 = 3; +const H5std_string FILE5("tfattrs.h5"); +const H5std_string FATTR1_NAME ("file attribute 1"); +const H5std_string FATTR2_NAME ("file attribute 2"); int fattr_data[ATTR1_DIM1]={512,-234,98123}; // Test data for file attribute int dattr_data[ATTR1_DIM1]={256,-123,1000}; // Test data for dataset attribute @@ -627,11 +624,12 @@ static void test_file_attribute() issue_fail_msg("test_file_attribute()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_file_attribute() + -const H5std_string FILE6("tfile5.h5"); -const H5std_string ROOTGROUP("/"); -const H5std_string GROUP1("/G1"); -const H5std_string SUBGROUP3("/G1/G3"); +const H5std_string FILE6("tfile5.h5"); +const H5std_string ROOTGROUP("/"); +const H5std_string GROUP1("/G1"); +const H5std_string SUBGROUP3("/G1/G3"); /*------------------------------------------------------------------------- * Function: test_libver_bounds_real @@ -744,13 +742,13 @@ static void test_libver_bounds() /*------------------------------------------------------------------------- - * Function: test_commonfg + * Function: test_commonfg * - * Purpose Verify that H5File works as a root group. + * Purpose: Verify that H5File works as a root group. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * March, 2015 * *------------------------------------------------------------------------- @@ -811,13 +809,13 @@ const H5std_string FILE7("tfile7.h5"); /*------------------------------------------------------------------------- * Function: test_file_info * - * Purpose Verify that various properties in a file creation property + * Purpose: Verify that various properties in a file creation property * lists are stored correctly in the file and can be retrieved * when the file is re-opened. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler + * Programmer: Binh-Minh Ribler * February, 2017 * *------------------------------------------------------------------------- @@ -862,7 +860,7 @@ static void test_file_info() fcpl.close(); // Get the file's version information. - file7.getFileInfo(finfo); // there's no C test for H5Fget_info + file7.getFileInfo(finfo); // there's no C test for H5Fget_info // Close the file. file7.close(); @@ -874,7 +872,7 @@ static void test_file_info() FileCreatPropList fcpl2 = file7.getCreatePlist(); // Get the file's version information. - file7.getFileInfo(finfo); // there's no C test for H5Fget_info + file7.getFileInfo(finfo); // there's no C test for H5Fget_info // Retrieve the property values & check them. hsize_t userblock = fcpl2.getUserblock(); @@ -905,15 +903,13 @@ static void test_file_info() /*------------------------------------------------------------------------- * Function: test_file * - * Purpose Main file testing routine + * Purpose: Main file testing routine * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * January 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -936,13 +932,11 @@ void test_file() /*------------------------------------------------------------------------- * Function: cleanup_file * - * Purpose Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return none + * Return: none * - * Programmer (use C version) - * - * Modifications: + * Programmer: (use C version) * *------------------------------------------------------------------------- */ diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 275bdb6..2e3c07c 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -80,8 +80,6 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ * Programmer: Robb Matzke * Tuesday, April 21, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t @@ -287,8 +285,6 @@ void test_filters() * Programmer: Quincey Koziol * September 10, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index e511619..18cd460 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -556,7 +556,6 @@ static void test_h5s_compound_scalar_read() * Programmer: Binh-Minh Ribler (using C version) * Mar 2001 * - * Modifications: *------------------------------------------------------------------------- */ extern "C" @@ -584,8 +583,6 @@ void test_h5s() * Programmer: Albert Cheng * July 2, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 1328a19..b38ed39 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -22,13 +22,10 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; @@ -44,9 +41,9 @@ using namespace H5; //#define H5G_TESTING //#include "h5test.h" -//#include "H5Gpkg.h" /* Groups */ -//#include "H5Iprivate.h" /* IDs */ -//#include "H5Lprivate.h" /* Links */ +//#include "H5Gpkg.h" // Groups +//#include "H5Iprivate.h" // IDs +//#include "H5Lprivate.h" // Links /* File for external link test. Created with gen_udlinks.c */ #define LINKED_FILE "be_extlink2.h5" @@ -117,22 +114,22 @@ const char *FILENAME[] = { #define MAX_NAME_LEN ((64*1024)+1024) /* Link type IDs */ -#define UD_HARD_TYPE 201 -#define UD_CB_TYPE H5L_TYPE_MAX -#define UD_PLIST_TYPE 128 -#define UD_CBFAIL_TYPE UD_PLIST_TYPE -#define UD_ERROR_TYPE 189 -#define UD_BAD_TYPE1 H5L_TYPE_HARD -#define UD_BAD_TYPE2 (H5L_TYPE_UD_MIN - 5) -#define UD_BAD_VERS (H5L_LINK_CLASS_T_VERS + 1) - -#define DEST_PROP_NAME "destination_group" -#define REREG_TARGET_NAME "rereg_target" - -#define UD_CB_LINK_NAME "ud_callback_link" +#define UD_HARD_TYPE 201 +#define UD_CB_TYPE H5L_TYPE_MAX +#define UD_PLIST_TYPE 128 +#define UD_CBFAIL_TYPE UD_PLIST_TYPE +#define UD_ERROR_TYPE 189 +#define UD_BAD_TYPE1 H5L_TYPE_HARD +#define UD_BAD_TYPE2 (H5L_TYPE_UD_MIN - 5) +#define UD_BAD_VERS (H5L_LINK_CLASS_T_VERS + 1) + +#define DEST_PROP_NAME "destination_group" +#define REREG_TARGET_NAME "rereg_target" + +#define UD_CB_LINK_NAME "ud_callback_link" #define NEW_UD_CB_LINK_NAME "ud_callback_link2" -#define UD_CB_TARGET "ud_target" -#define UD_CB_TARGET_LEN 10 +#define UD_CB_TARGET "ud_target" +#define UD_CB_TARGET_LEN 10 #define LE_FILENAME "le_extlink1.h5" #define BE_FILENAME "be_extlink1.h5" @@ -145,9 +142,9 @@ const char *FILENAME[] = { /* Creation order macros */ #define CORDER_GROUP_NAME "corder_group" #define CORDER_SOFT_GROUP_NAME "corder_soft_group" -#define CORDER_NLINKS 18 -#define CORDER_ITER_STOP 3 -#define CORDER_EST_ENTRY_LEN 9 +#define CORDER_NLINKS 18 +#define CORDER_ITER_STOP 3 +#define CORDER_EST_ENTRY_LEN 9 /* Timestamp macros */ #define TIMESTAMP_GROUP_1 "timestamp1" @@ -328,21 +325,19 @@ static const char *FILENAME[] = { * * Purpose: Test building a file with assorted links. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * * Programmer: Binh-Minh Ribler * October 16, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) { - hsize_t size[1] = {1}; - char filename[NAME_BUF_SIZE]; + hsize_t size[1] = {1}; + char filename[NAME_BUF_SIZE]; // Use the file access template id to create a file access prop. list. FileAccPropList fapl(fapl_id); @@ -443,17 +438,15 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) /*------------------------------------------------------------------------- * Function: test_num_links * - * Purpose Test setting and getting limit of number of links + * Purpose: Test setting and getting limit of number of links * - * Return Success: 0 + * Return: Success: 0 * * Failure: -1 * - * Programmer Binh-Minh Ribler + * Programmer: Binh-Minh Ribler * Mar, 2017 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_num_links(hid_t fapl_id, hbool_t new_format) @@ -477,7 +470,7 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) size_t nlinks = 5; lapl.setNumLinks(nlinks); - // Read it back and verify + // Read it back and verify size_t read_nlinks = lapl.getNumLinks(); verify_val(read_nlinks, nlinks, "LinkAccPropList::setNumLinks", __LINE__, __FILE__); @@ -504,9 +497,9 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) extern "C" void test_links() { - hid_t fapl_id, fapl2_id; /* File access property lists */ - hbool_t new_format; /* Whether to use the new format or not */ - const char *envval; + hid_t fapl_id, fapl2_id; // File access property lists + hbool_t new_format; // Whether to use the new format or not + const char *envval; envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) @@ -687,8 +680,6 @@ void test_links() * Programmer: Binh-Minh Ribler * October 16, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index 59716dd..c053604 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -22,13 +22,10 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; @@ -61,8 +58,6 @@ const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset in * Programmer: Binh-Minh Ribler * Friday, March 4, 2014 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objname() @@ -159,8 +154,6 @@ static void test_get_objname() * Programmer: Binh-Minh Ribler * March 4, 2014 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objname_ontypes() @@ -244,8 +237,6 @@ static void test_get_objname_ontypes() * Programmer: Binh-Minh Ribler * Friday, March 4, 2014 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objtype() @@ -301,15 +292,13 @@ static void test_get_objtype() /*------------------------------------------------------------------------- * Function: test_open_object_header * - * Purpose Test H5Location::openObjId function. + * Purpose: Test H5Location::openObjId function. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (use C version) + * Programmer: Binh-Minh Ribler (use C version) * May 15, 2017 * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string GROUPNAME("group"); @@ -428,8 +417,6 @@ static void test_open_object_header() * Programmer: Binh-Minh Ribler * May 15, 2017 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_is_valid() @@ -483,8 +470,6 @@ static void test_is_valid() * Programmer: Binh-Minh Ribler * Friday, Mar 4, 2014 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -510,8 +495,6 @@ void test_object() * * Programmer: (use C version) * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index f088240..9f43054 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -23,8 +23,8 @@ #else #include #endif -#include +#include #include "H5Cpp.h" // C++ API header file using namespace H5; diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 43e85a9..a706197 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -22,13 +22,10 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; @@ -98,8 +95,6 @@ typedef struct { * Programmer: Binh-Minh Ribler (using C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_classes() @@ -137,8 +132,6 @@ static void test_classes() * Programmer: Binh-Minh Ribler (using C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_copy() @@ -192,8 +185,6 @@ static void test_copy() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -312,8 +303,6 @@ static void test_query() * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ const char* filename1 = "dtypes1.h5"; @@ -389,8 +378,6 @@ static void test_transient () * Programmer: Binh-Minh Ribler (use C version) * January, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string filename2("dtypes2.h5"); @@ -545,15 +532,13 @@ static void test_named () /*------------------------------------------------------------------------- * Function: test_encode_decode * - * Purpose Test datatype encode/decode functionality. + * Purpose: Test datatype encode/decode functionality. * - * Return None + * Return: None * - * Programmer Binh-Minh Ribler (using C version) + * Programmer: Binh-Minh Ribler (using C version) * October, 2017 * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string filename3("encode_decode.h5"); @@ -797,8 +782,6 @@ void test_types() * Programmer: Quincey Koziol * September 10, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index f49dbc0..d5f2afe 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -24,13 +24,10 @@ #else #include #endif -#include - -#ifndef H5_NO_STD - using std::cerr; - using std::endl; -#endif // H5_NO_STD +using std::cerr; +using std::endl; +#include #include "H5Cpp.h" // C++ API header file using namespace H5; @@ -56,9 +53,9 @@ const hsize_t SPACE1_DIM1 = 4; #if 0 // not used now static void *test_vlstr_alloc_custom(size_t size, void *info) { - void *ret_value=NULL; // Pointer to return + void *ret_value=NULL; // Pointer to return size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -92,7 +89,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -349,7 +346,7 @@ static void test_vlstrings_special() dataset.read(rdata, vlst); // Check data read in. - hsize_t ii; // counting variable + hsize_t ii; // counting variable for (ii=0; iiopenStrType(VLSTR_TYPE); + vlst = file1->openStrType(VLSTR_TYPE); // deprecated - // Close datatype and file. + // Close again and reopen with constructor. vlst.close(); + StrType vlst1(*file1, VLSTR_TYPE); + + // Close datatype and file. + vlst1.close(); file1->close(); delete file1; // Open file. file1 = new H5File(FILENAME, H5F_ACC_RDWR); - // Open the variable-length string datatype just created + { // deprecated + // Open the variable-length string datatype just created. vlst = file1->openStrType(VLSTR_TYPE); - // Verify character set and padding + // Verify character set and padding. cset = vlst.getCset(); verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); pad = vlst.getStrpad(); verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); - // Close datatype and file + // Close type to test new function. vlst.close(); + } // deprecated + + // Open the variable-length string datatype just created. + StrType vlst2(*file1, VLSTR_TYPE); + + // Verify character set and padding. + cset = vlst2.getCset(); + verify_val(cset, H5T_CSET_ASCII, "StrType::getCset", __LINE__, __FILE__); + pad = vlst2.getStrpad(); + verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__); + + // Close datatype and file. + vlst2.close(); file1->close(); PASSED(); @@ -818,7 +836,7 @@ static void test_vlstring_array_attribute() /* Helper routine for test_vl_rewrite() */ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space, - char *name, char *data) + char *name, char *data) { DataSet dset; try { @@ -836,7 +854,7 @@ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space, /* Helper routine for test_vl_rewrite() */ static void read_scalar_dset(H5File& file, DataType& type, DataSpace& space, - char *name, char *data) + char *name, char *data) { char *data_read; DataSet dset; @@ -891,7 +909,7 @@ static void test_vl_rewrite() // Create in file 1. int i; - char name[256]; // Buffer for names & data + char name[256]; // Buffer for names & data for (i=0; i Date: Wed, 18 Oct 2017 00:12:21 -0500 Subject: Update about C++ documentation --- release_docs/RELEASE.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1fa16a7..a440af9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -123,6 +123,12 @@ New Features (BMR - 2017/10/17, HDFFV-10175) + - A document is added to the HDF5 C++ API Reference Manual to show the + mapping from a C API to C++ wrappers. It can be found from the main + page of the C++ API Reference Manual. + + (BMR - 2017/10/17, HDFFV-10151) + High-Level APIs --------------- @@ -223,7 +229,16 @@ Bug Fixes since HDF5-1.8.19 C++ API ------- - - None + - Marked the following functions deprecated because they were moved to + class H5Object: + H5Location::createAttribute() + H5Location::openAttribute() + H5Location::attrExists() + H5Location::removeAttr() + H5Location::renameAttr() + H5Location::getNumAttrs() + + (BMR - 2017/10/17) High-Level APIs: -- cgit v0.12 From dd16741bc978ff2355c97fcfe081defd28149d59 Mon Sep 17 00:00:00 2001 From: hdftest Date: Wed, 18 Oct 2017 16:01:57 -0500 Subject: Snapshot version 1.8 release 20 (snap7) --- configure | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/configure b/configure index f2619d0..f581c44 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap7. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap8. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-snap7' -PACKAGE_STRING='HDF5 1.8.20-snap7' +PACKAGE_VERSION='1.8.20-snap8' +PACKAGE_STRING='HDF5 1.8.20-snap8' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,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.8.20-snap7 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-snap8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-snap7:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-snap8:";; esac cat <<\_ACEOF @@ -1745,7 +1745,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-snap7 +HDF5 configure 1.8.20-snap8 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2682,7 +2682,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.8.20-snap7, which was +It was created by HDF5 $as_me 1.8.20-snap8, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3553,7 +3553,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-snap7' + VERSION='1.8.20-snap8' cat >>confdefs.h <<_ACEOF @@ -29313,7 +29313,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-snap7 +HDF5 config.lt 1.8.20-snap8 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31373,7 +31373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-snap7, which was +This file was extended by HDF5 $as_me 1.8.20-snap8, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31439,7 +31439,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-snap7 +HDF5 config.status 1.8.20-snap8 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -- cgit v0.12 From 6d7133bf01b40a013813377cd2eba29de787f1ce Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 19 Oct 2017 15:15:44 -0500 Subject: HDFFV-10297 merge from develop --- MANIFEST | 31 +- tools/h5copy/CMakeTests.cmake | 158 +- tools/h5copy/dynlib_copy.c | 89 + tools/h5copy/h5copygentest.c | 3 +- .../testfiles/h5copy_plugin_fail_ERR.out.h5.txt | 3 + .../h5copy/testfiles/h5copy_plugin_test.out.h5.txt | 3 + tools/h5copy/testfiles/tudfilter.h5 | Bin 0 -> 4816 bytes tools/h5copy/testfiles/tudfilter.h5.txt | 2 + tools/h5copy/testfiles/tudfilter.h5_ERR.txt | 2 + tools/h5copy/testfiles/tudfilter2.h5 | Bin 0 -> 4816 bytes tools/h5diff/h5diff_common.c | 83 +- tools/h5diff/h5diff_common.h | 4 +- tools/h5diff/h5diff_main.c | 12 +- tools/h5diff/h5diff_plugin.sh.in | 19 +- tools/h5diff/ph5diff_main.c | 18 +- tools/h5diff/testfiles/h5diff_454_ERR.err | 2 +- tools/h5diff/testfiles/h5diff_454_ERR.txt | 2 +- tools/h5diff/testfiles/h5diff_455_ERR.err | 2 +- tools/h5diff/testfiles/h5diff_455_ERR.txt | 2 +- tools/h5diff/testfiles/h5diff_457_ERR.err | 2 +- tools/h5diff/testfiles/h5diff_457_ERR.txt | 2 +- tools/h5diff/testfiles/h5diff_458_ERR.err | 2 +- tools/h5diff/testfiles/h5diff_458_ERR.txt | 2 +- tools/h5diff/testfiles/h5diff_459_ERR.err | 2 +- tools/h5diff/testfiles/h5diff_459_ERR.txt | 2 +- tools/h5diff/testfiles/h5diff_60.txt | 4 +- tools/h5diff/testfiles/h5diff_61.txt | 48 +- tools/h5diff/testfiles/h5diff_62.txt | 62 +- tools/h5diff/testfiles/h5diff_63.txt | 8 +- tools/h5diff/testfiles/h5diff_70.txt | 756 ++++---- tools/h5diff/testfiles/h5diff_700.txt | 756 ++++---- tools/h5diff/testfiles/h5diff_701.txt | 756 ++++---- tools/h5diff/testfiles/h5diff_702.txt | 756 ++++---- tools/h5diff/testfiles/h5diff_703.txt | 756 ++++---- tools/h5diff/testfiles/h5diff_80.txt | 252 +-- tools/h5diff/testfiles/h5diff_udfail.txt | 2 +- tools/h5import/testfiles/binfp64.conf | 13 - tools/h5import/testfiles/binin16.conf | 12 - tools/h5import/testfiles/binin32.conf | 12 - tools/h5import/testfiles/binin8.conf | 16 - tools/h5import/testfiles/binin8w.conf | 9 - tools/h5import/testfiles/binuin16.conf | 12 - tools/h5repack/CMakeTests.cmake | 4 +- tools/h5repack/h5repack.c | 50 +- tools/h5repack/h5repack_copy.c | 209 +-- tools/h5repack/h5repack_refs.c | 29 +- tools/h5repack/h5repacktst.c | 6 +- tools/h5repack/testh5repack_detect_szip.c | 1 - tools/lib/h5diff.c | 1095 +++++------- tools/lib/h5diff.h | 22 +- tools/lib/h5diff_array.c | 1820 ++++++++++---------- tools/lib/h5diff_attr.c | 265 +-- tools/lib/h5diff_dset.c | 576 +++---- tools/lib/h5diff_util.c | 90 +- tools/lib/h5tools_dump.c | 180 +- tools/lib/h5tools_filters.c | 65 +- tools/lib/h5tools_type.c | 124 +- tools/lib/h5tools_utils.c | 227 +-- tools/lib/h5trav.c | 533 +++--- tools/lib/ph5diff.h | 2 +- 60 files changed, 4824 insertions(+), 5151 deletions(-) create mode 100644 tools/h5copy/dynlib_copy.c create mode 100644 tools/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt create mode 100644 tools/h5copy/testfiles/h5copy_plugin_test.out.h5.txt create mode 100644 tools/h5copy/testfiles/tudfilter.h5 create mode 100644 tools/h5copy/testfiles/tudfilter.h5.txt create mode 100644 tools/h5copy/testfiles/tudfilter.h5_ERR.txt create mode 100644 tools/h5copy/testfiles/tudfilter2.h5 delete mode 100644 tools/h5import/testfiles/binfp64.conf delete mode 100644 tools/h5import/testfiles/binin16.conf delete mode 100644 tools/h5import/testfiles/binin32.conf delete mode 100644 tools/h5import/testfiles/binin8.conf delete mode 100644 tools/h5import/testfiles/binin8w.conf delete mode 100644 tools/h5import/testfiles/binuin16.conf diff --git a/MANIFEST b/MANIFEST index 2b60040..8a1aa31 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1022,7 +1022,6 @@ ./tools/h5dump/Makefile.am ./tools/h5dump/Makefile.in -./tools/h5dump/dynlib_dump.c ./tools/h5dump/h5dump.c ./tools/h5dump/h5dump.h ./tools/h5dump/h5dump_defines.h @@ -1031,6 +1030,7 @@ ./tools/h5dump/h5dump_ddl.h ./tools/h5dump/h5dump_xml.c ./tools/h5dump/h5dump_xml.h +./tools/h5dump/dynlib_dump.c ./tools/h5dump/h5dumpgentest.c ./tools/h5dump/h5dump_plugin.sh.in ./tools/h5dump/testh5dump.sh.in @@ -1046,17 +1046,11 @@ ./tools/h5import/h5importtestutil.sh.in # testfiles for h5import -./tools/h5import/testfiles/binfp64.conf ./tools/h5import/testfiles/binfp64.h5 -./tools/h5import/testfiles/binin16.conf ./tools/h5import/testfiles/binin16.h5 -./tools/h5import/testfiles/binin32.conf ./tools/h5import/testfiles/binin32.h5 -./tools/h5import/testfiles/binin8.conf ./tools/h5import/testfiles/binin8.h5 -./tools/h5import/testfiles/binin8w.conf ./tools/h5import/testfiles/binin8w.h5 -./tools/h5import/testfiles/binuin16.conf ./tools/h5import/testfiles/binuin16.h5 ./tools/h5import/testfiles/binuin32.h5 ./tools/h5import/testfiles/tall_fp32.ddl @@ -1101,11 +1095,11 @@ # h5diff sources ./tools/h5diff/Makefile.am ./tools/h5diff/Makefile.in -./tools/h5diff/dynlib_diff.c ./tools/h5diff/h5diff_common.c ./tools/h5diff/h5diff_common.h ./tools/h5diff/h5diff_main.c ./tools/h5diff/ph5diff_main.c +./tools/h5diff/dynlib_diff.c ./tools/h5diff/h5diffgentest.c ./tools/h5diff/h5diff_plugin.sh.in ./tools/h5diff/testh5diff.sh.in @@ -1114,10 +1108,6 @@ # h5repack sources ./tools/h5repack/Makefile.am ./tools/h5repack/Makefile.in -./tools/h5repack/dynlib_rpk.c -./tools/h5repack/dynlib_vrpk.c -./tools/h5repack/h5repack.sh.in -./tools/h5repack/h5repack_plugin.sh.in ./tools/h5repack/h5repack.c ./tools/h5repack/h5repack.h ./tools/h5repack/h5repack_copy.c @@ -1127,6 +1117,10 @@ ./tools/h5repack/h5repack_opttable.c ./tools/h5repack/h5repack_parse.c ./tools/h5repack/h5repack_verify.c +./tools/h5repack/dynlib_rpk.c +./tools/h5repack/dynlib_vrpk.c +./tools/h5repack/h5repack.sh.in +./tools/h5repack/h5repack_plugin.sh.in ./tools/h5repack/h5repacktst.c ./tools/h5repack/testh5repack_detect_szip.c @@ -1139,11 +1133,12 @@ ./tools/h5ls/testh5ls.sh.in # h5copy sources -./tools/h5copy/testh5copy.sh.in +./tools/h5copy/Makefile.am ./tools/h5copy/Makefile.in ./tools/h5copy/h5copy.c ./tools/h5copy/h5copygentest.c -./tools/h5copy/Makefile.am +./tools/h5copy/testh5copy.sh.in +./tools/h5copy/dynlib_copy.c ./tools/lib/Makefile.am @@ -2081,8 +2076,8 @@ ./tools/h5repack/testfiles/plugin_zero.h5repack_layout.h5.tst ./tools/h5repack/testfiles/plugin_version_test.h5repack_layout.h5.tst ./tools/h5repack/testfiles/h5repack-help.txt -./tools/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst ./tools/h5repack/testfiles/h5repack_filters.h5-gzip_verbose_filters.tst +./tools/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst ./tools/h5repack/testfiles/h5repack_layout.h5.ddl ./tools/h5repack/testfiles/h5repack_layout.UD.h5-plugin_none.ddl ./tools/h5repack/testfiles/h5repack_layout.h5-plugin_test.ddl @@ -2120,6 +2115,12 @@ ./tools/h5copy/testfiles/h5copy_extlinks_trg.h5 ./tools/h5copy/testfiles/h5copy_extlinks_src.out.ls ./tools/h5copy/testfiles/h5copy_misc1.out +./tools/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt +./tools/h5copy/testfiles/h5copy_plugin_test.out.h5.txt +./tools/h5copy/testfiles/tudfilter.h5 +./tools/h5copy/testfiles/tudfilter2.h5 +./tools/h5copy/testfiles/tudfilter.h5.txt +./tools/h5copy/testfiles/tudfilter.h5_ERR.txt # test files for h5mkgrp ./tools/testfiles/h5mkgrp_nested_p.ls diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index b255f3c..ad6d07e 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -24,10 +24,16 @@ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/tudfilter2.h5 ) set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5.txt + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5_ERR.txt + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_fail_ERR.out.h5.txt + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_test.out.h5.txt ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -74,9 +80,9 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_F-${testname}-DIFF - COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) + set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -110,9 +116,9 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF - COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -160,9 +166,9 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY-${testname}-DIFF - COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -201,9 +207,9 @@ if (NOT "${resultcode}" STREQUAL "2") add_test ( NAME H5COPY_SAME-${testname}-DIFF - COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND $ -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) + set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () @@ -250,6 +256,134 @@ endif () endmacro () + macro (ADD_H5_UD_TEST testname resultcode infile sparam srcname dparam dstname cmpfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5COPY_UD-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}.out.h5 + testfiles/${infile}.out + testfiles/${infile}.out.err + testfiles/${testname}.out.h5.out + testfiles/${testname}.out.h5.out.err + ) + if ("${resultcode}" STREQUAL "2") + add_test ( + NAME H5COPY_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${infile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5COPY_UD-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${infile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5COPY_UD-${testname} PROPERTIES DEPENDS H5COPY_UD-${testname}-clear-objects) + add_test ( + NAME H5COPY_UD-${testname}-DIFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testname}.out.h5.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${testname}.out.h5.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname}) + endif () + endmacro () + + macro (ADD_H5_UD_ERR_TEST testname resultcode infile sparam srcname dparam dstname cmpfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + add_test ( + NAME H5COPY_UD_ERR-${testname}-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + testfiles/${testname}_ERR.out.h5 + testfiles/${infile}_ERR.out + testfiles/${infile}_ERR.out.err + testfiles/${testname}_ERR.out.h5.out + testfiles/${testname}_ERR.out.h5.out.err + ) + if ("${resultcode}" STREQUAL "2") + add_test ( + NAME H5COPY_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}_ERR.out" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=./testfiles/${infile}_ERR.txt" + -D "TEST_MASK_ERROR=true" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + else () + add_test ( + NAME H5COPY_UD_ERR-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${infile}_ERR.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${infile}_ERR.txt" + -D "TEST_MASK_ERROR=true" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + endif () + set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-clearall-objects) + add_test ( + NAME H5COPY_UD_ERR-${testname}-DIFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}_ERR.out.h5;${srcname};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testname}_ERR.out.h5.out" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=./testfiles/${testname}_ERR.out.h5.txt" + -D "TEST_APPEND=EXIT CODE:" + -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}) + endif () + endmacro () + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -434,3 +568,11 @@ else () ADD_H5_TEST_SAME (samefile2 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) endif () + +############################################################################## +### P L U G I N T E S T S +############################################################################## +if (BUILD_SHARED_LIBS) + ADD_H5_UD_TEST (h5copy_plugin_test 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 ) + ADD_H5_UD_ERR_TEST (h5copy_plugin_fail 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) +endif () diff --git a/tools/h5copy/dynlib_copy.c b/tools/h5copy/dynlib_copy.c new file mode 100644 index 0000000..571452e --- /dev/null +++ b/tools/h5copy/dynlib_copy.c @@ -0,0 +1,89 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include "H5PLextern.h" + +#define H5Z_FILTER_DYNLIBUD 300 +#define MULTIPLIER 3 + +static size_t H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIBUD, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlibud", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlibud, /* The actual filter function */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIBUD;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlibud + * + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. plugin.c test will load + * and use this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + char *int_ptr = (char *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts > 0) + return(0); + + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Subtract the original value with MULTIPLIER */ + while(buf_left > 0) { + char temp = *int_ptr; + *int_ptr = temp - MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Add the original value with MULTIPLIER */ + while(buf_left > 0) { + char temp = *int_ptr; + *int_ptr = temp + MULTIPLIER; + int_ptr++; + buf_left -= sizeof(*int_ptr); + } /* end while */ + } /* end else */ + + return nbytes; +} /* end H5Z_filter_dynlibud() */ + diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index 587ad45..0af4dc1 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -14,7 +14,6 @@ /* * Generate the binary hdf5 file for the h5copy tests */ -#include #include "hdf5.h" #include "H5private.h" @@ -335,7 +334,7 @@ static void gent_att_compound_vlstr(hid_t loc_id) { typedef struct { /* Compound structure for the attribute */ int i; - char *v; + const char *v; } s1; hsize_t dim[1] = {1}; /* Dimension size */ hid_t sid = -1; /* Dataspace ID */ diff --git a/tools/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt b/tools/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt new file mode 100644 index 0000000..66e9eb2 --- /dev/null +++ b/tools/h5copy/testfiles/h5copy_plugin_fail_ERR.out.h5.txt @@ -0,0 +1,3 @@ +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5copy/testfiles/h5copy_plugin_test.out.h5.txt b/tools/h5copy/testfiles/h5copy_plugin_test.out.h5.txt new file mode 100644 index 0000000..66e9eb2 --- /dev/null +++ b/tools/h5copy/testfiles/h5copy_plugin_test.out.h5.txt @@ -0,0 +1,3 @@ +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5copy/testfiles/tudfilter.h5 b/tools/h5copy/testfiles/tudfilter.h5 new file mode 100644 index 0000000..081b000 Binary files /dev/null and b/tools/h5copy/testfiles/tudfilter.h5 differ diff --git a/tools/h5copy/testfiles/tudfilter.h5.txt b/tools/h5copy/testfiles/tudfilter.h5.txt new file mode 100644 index 0000000..eabe407 --- /dev/null +++ b/tools/h5copy/testfiles/tudfilter.h5.txt @@ -0,0 +1,2 @@ +Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_test.out.h5> and object +EXIT CODE: 0 diff --git a/tools/h5copy/testfiles/tudfilter.h5_ERR.txt b/tools/h5copy/testfiles/tudfilter.h5_ERR.txt new file mode 100644 index 0000000..3c5b3ca --- /dev/null +++ b/tools/h5copy/testfiles/tudfilter.h5_ERR.txt @@ -0,0 +1,2 @@ +Copying file <./testfiles/tudfilter.h5> and object to file <./testfiles/h5copy_plugin_fail_ERR.out.h5> and object +EXIT CODE: 0 diff --git a/tools/h5copy/testfiles/tudfilter2.h5 b/tools/h5copy/testfiles/tudfilter2.h5 new file mode 100644 index 0000000..081b000 Binary files /dev/null and b/tools/h5copy/testfiles/tudfilter2.h5 differ diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 84c6be2..67977e9 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -52,7 +52,7 @@ static struct long_options l_opts[] = { * *------------------------------------------------------------------------- */ -static void check_options(diff_opt_t* options) +static void check_options(diff_opt_t* opts) { /*-------------------------------------------------------------- * check for mutually exclusive options @@ -61,7 +61,7 @@ static void check_options(diff_opt_t* options) /* check between -d , -p, --use-system-epsilon. * These options are mutually exclusive. */ - if ((options->d + options->p + options->use_system_epsilon) > 1) { + if ((opts->d + opts->p + opts->use_system_epsilon) > 1) { printf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); printf("use no more than one.\n"); printf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME); @@ -84,27 +84,27 @@ void parse_command_line(int argc, const char** fname2, const char** objname1, const char** objname2, - diff_opt_t* options) + diff_opt_t* opts) { int i; int opt; struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node; /* process the command-line */ - memset(options, 0, sizeof (diff_opt_t)); + memset(opts, 0, sizeof (diff_opt_t)); /* assume equal contents initially */ - options->contents = 1; + opts->contents = 1; /* NaNs are handled by default */ - options->do_nans = 1; + opts->do_nans = 1; /* not Listing objects that are not comparable */ - options->m_list_not_cmp = 0; + opts->m_list_not_cmp = 0; /* initially no not-comparable. */ /**this is bad in mixing option with results**/ - options->not_cmp=0; + opts->not_cmp=0; /* init for exclude-path option */ exclude_head = NULL; @@ -125,7 +125,7 @@ void parse_command_line(int argc, h5diff_exit(EXIT_SUCCESS); case 'v': - options->m_verbose = 1; + opts->m_verbose = 1; /* This for loop is for handling style like * -v, -v1, --verbose, --verbose=1. */ @@ -135,11 +135,11 @@ void parse_command_line(int argc, */ if (!strcmp (argv[i], "-v")) { /* no arg */ opt_ind--; - options->m_verbose_level = 0; + opts->m_verbose_level = 0; break; } else if (!strncmp (argv[i], "-v", (size_t)2)) { - options->m_verbose_level = atoi(&argv[i][2]); + opts->m_verbose_level = atoi(&argv[i][2]); break; } @@ -147,11 +147,11 @@ void parse_command_line(int argc, * long opt */ if (!strcmp (argv[i], "--verbose")) { /* no arg */ - options->m_verbose_level = 0; + opts->m_verbose_level = 0; break; } else if ( !strncmp (argv[i], "--verbose", (size_t)9) && argv[i][9]=='=') { - options->m_verbose_level = atoi(&argv[i][10]); + opts->m_verbose_level = atoi(&argv[i][10]); break; } } @@ -159,19 +159,19 @@ void parse_command_line(int argc, case 'q': /* use quiet mode; supress the message "0 differences found" */ - options->m_quiet = 1; + opts->m_quiet = 1; break; case 'r': - options->m_report = 1; + opts->m_report = 1; break; case 'l': - options->follow_links = TRUE; + opts->follow_links = TRUE; break; case 'x': - options->no_dangle_links = 1; + opts->no_dangle_links = 1; break; case 'S': @@ -179,7 +179,7 @@ void parse_command_line(int argc, break; case 'E': - options->exclude_path = 1; + opts->exclude_path = 1; /* create linked list of excluding objects */ if( (exclude_node = (struct exclude_path_list*) HDmalloc(sizeof(struct exclude_path_list))) == NULL) { @@ -206,65 +206,64 @@ void parse_command_line(int argc, break; case 'd': - options->d=1; + opts->d=1; if (check_d_input(opt_arg) == - 1) { printf("<-d %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->delta = atof(opt_arg); + opts->delta = atof(opt_arg); /* -d 0 is the same as default */ - if (H5_DBL_ABS_EQUAL(options->delta, (double)0.0F)) - options->d=0; + if (H5_DBL_ABS_EQUAL(opts->delta, (double)0.0F)) + opts->d=0; break; case 'p': - options->p=1; + opts->p=1; if (check_p_input(opt_arg) == -1) { printf("<-p %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->percent = atof(opt_arg); + opts->percent = atof(opt_arg); /* -p 0 is the same as default */ - if (options->percent == 0) - options->p = 0; - + if (H5_DBL_ABS_EQUAL(opts->percent, (double)0.0F)) + opts->p = 0; break; case 'n': - options->n=1; + opts->n=1; if ( check_n_input(opt_arg) == -1) { printf("<-n %s> is not a valid option\n", opt_arg); usage(); h5diff_exit(EXIT_FAILURE); } - options->count = HDstrtoull(opt_arg, NULL, 0); + opts->count = HDstrtoull(opt_arg, NULL, 0); break; case 'N': - options->do_nans = 0; + opts->do_nans = 0; break; case 'c': - options->m_list_not_cmp = 1; + opts->m_list_not_cmp = 1; break; case 'e': - options->use_system_epsilon = 1; + opts->use_system_epsilon = 1; break; } } /* check options */ - check_options(options); + check_options(opts); /* if exclude-path option is used, keep the exclude path list */ - if (options->exclude_path) - options->exclude = exclude_head; + if (opts->exclude_path) + opts->exclude = exclude_head; /* check for file names to be processed */ if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { @@ -301,23 +300,23 @@ void parse_command_line(int argc, *------------------------------------------------------------------------- */ - void print_info(diff_opt_t* options) + void print_info(diff_opt_t* opts) { - if (options->m_quiet || options->err_stat) + if (opts->m_quiet || opts->err_stat) return; - if (options->cmn_objs == 0) { + if (opts->cmn_objs == 0) { printf("No common objects found. Files are not comparable.\n"); - if (!options->m_verbose) + if (!opts->m_verbose) printf("Use -v for a list of objects.\n"); } - if (options->not_cmp == 1) { - if (options->m_list_not_cmp == 0) { + if (opts->not_cmp == 1) { + if (opts->m_list_not_cmp == 0) { printf("--------------------------------\n"); printf("Some objects are not comparable\n"); printf("--------------------------------\n"); - if (options->m_verbose) + if (opts->m_verbose) printf("Use -c for a list of objects without details of differences.\n"); else printf("Use -c for a list of objects.\n"); diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h index e5dfe3f..dc0676c 100644 --- a/tools/h5diff/h5diff_common.h +++ b/tools/h5diff/h5diff_common.h @@ -23,9 +23,9 @@ extern "C" { #endif void usage(void); -void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options); +void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* opts); void h5diff_exit(int status); -void print_info(diff_opt_t* options); +void print_info(diff_opt_t* opts); #ifdef __cplusplus } diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 8dab3b4..ad488a4 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -78,7 +78,7 @@ int main(int argc, const char *argv[]) const char *objname1 = NULL; const char *objname2 = NULL; hsize_t nfound=0; - diff_opt_t options; + diff_opt_t opts; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -98,7 +98,7 @@ int main(int argc, const char *argv[]) * process the command-line *------------------------------------------------------------------------- */ - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); if (enable_error_stack) { H5Eset_auto2(H5E_DEFAULT, func, edata); @@ -110,9 +110,9 @@ int main(int argc, const char *argv[]) *------------------------------------------------------------------------- */ - nfound = h5diff(fname1, fname2, objname1, objname2, &options); + nfound = h5diff(fname1, fname2, objname1, objname2, &opts); - print_info(&options); + print_info(&opts); /*------------------------------------------------------------------------- * exit code @@ -123,11 +123,11 @@ int main(int argc, const char *argv[]) ret = (nfound == 0 ? 0 : 1); /* if graph difference return 1 for differences */ - if (options.contents == 0) + if (opts.contents == 0) ret = 1; /* and return 2 for error */ - if (options.err_stat) + if (opts.err_stat) ret = 2; h5diff_exit(ret); diff --git a/tools/h5diff/h5diff_plugin.sh.in b/tools/h5diff/h5diff_plugin.sh.in index 141e948..aca7c6b 100644 --- a/tools/h5diff/h5diff_plugin.sh.in +++ b/tools/h5diff/h5diff_plugin.sh.in @@ -161,12 +161,27 @@ if [ -n "$RUNSERIAL_NOEXITCODE" ]; then h5haveexitcode=no fi + +# Print a $* message left justified in a field of 70 characters +# +MESSAGE() { + SPACES=" " + echo "$* $SPACES" | cut -c1-70 | tr -d '\012' +} + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". # TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Verifying". +# +VERIFY() { + MESSAGE "Verifying $*" } # Source in the output filter function definitions. diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 89efc39..83240cb 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -50,7 +50,7 @@ int main(int argc, const char *argv[]) const char *fname2 = NULL; const char *objname1 = NULL; const char *objname2 = NULL; - diff_opt_t options; + diff_opt_t opts; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -72,11 +72,11 @@ int main(int argc, const char *argv[]) g_Parallel = 0; - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &opts); - print_info(&options); + print_info(&opts); } /* Parallel h5diff */ else { @@ -84,13 +84,13 @@ int main(int argc, const char *argv[]) /* Have the manager process the command-line */ if(nID == 0) { - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts); - h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &opts); MPI_Barrier(MPI_COMM_WORLD); - print_info(&options); + print_info(&opts); print_manager_output(); } /* All other tasks become workers and wait for assignments. */ @@ -178,8 +178,8 @@ ph5diff_worker(int nID) MPI_Recv(&args, sizeof(args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status); /* Do the diff */ - diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.options), &(args.argdata)); - diffs.not_cmp = args.options.not_cmp; + diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.opts), &(args.argdata)); + diffs.not_cmp = args.opts.not_cmp; /* If print buffer has something in it, request print token.*/ if(outBuffOffset>0) diff --git a/tools/h5diff/testfiles/h5diff_454_ERR.err b/tools/h5diff/testfiles/h5diff_454_ERR.err index 8fa1718..82802a1 100644 --- a/tools/h5diff/testfiles/h5diff_454_ERR.err +++ b/tools/h5diff/testfiles/h5diff_454_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_454_ERR.txt b/tools/h5diff/testfiles/h5diff_454_ERR.txt index de25a69..4501071 100644 --- a/tools/h5diff/testfiles/h5diff_454_ERR.txt +++ b/tools/h5diff/testfiles/h5diff_454_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_455_ERR.err b/tools/h5diff/testfiles/h5diff_455_ERR.err index 8fa1718..82802a1 100644 --- a/tools/h5diff/testfiles/h5diff_455_ERR.err +++ b/tools/h5diff/testfiles/h5diff_455_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_455_ERR.txt b/tools/h5diff/testfiles/h5diff_455_ERR.txt index de25a69..4501071 100644 --- a/tools/h5diff/testfiles/h5diff_455_ERR.txt +++ b/tools/h5diff/testfiles/h5diff_455_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_457_ERR.err b/tools/h5diff/testfiles/h5diff_457_ERR.err index 8fa1718..82802a1 100644 --- a/tools/h5diff/testfiles/h5diff_457_ERR.err +++ b/tools/h5diff/testfiles/h5diff_457_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_457_ERR.txt b/tools/h5diff/testfiles/h5diff_457_ERR.txt index 6594c9a..9d73750 100644 --- a/tools/h5diff/testfiles/h5diff_457_ERR.txt +++ b/tools/h5diff/testfiles/h5diff_457_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_458_ERR.err b/tools/h5diff/testfiles/h5diff_458_ERR.err index 8fa1718..82802a1 100644 --- a/tools/h5diff/testfiles/h5diff_458_ERR.err +++ b/tools/h5diff/testfiles/h5diff_458_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_458_ERR.txt b/tools/h5diff/testfiles/h5diff_458_ERR.txt index 9a09c17..b084914 100644 --- a/tools/h5diff/testfiles/h5diff_458_ERR.txt +++ b/tools/h5diff/testfiles/h5diff_458_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_459_ERR.err b/tools/h5diff/testfiles/h5diff_459_ERR.err index 8fa1718..82802a1 100644 --- a/tools/h5diff/testfiles/h5diff_459_ERR.err +++ b/tools/h5diff/testfiles/h5diff_459_ERR.err @@ -1,4 +1,4 @@ H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function diff --git a/tools/h5diff/testfiles/h5diff_459_ERR.txt b/tools/h5diff/testfiles/h5diff_459_ERR.txt index 6594c9a..9d73750 100644 --- a/tools/h5diff/testfiles/h5diff_459_ERR.txt +++ b/tools/h5diff/testfiles/h5diff_459_ERR.txt @@ -1,6 +1,6 @@ Warning: is a dangling link. H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5diff(): Error: treat dangling link as error + #000: (file name) line (number) in h5diff(): treat dangling link as error major: Failure in tools library minor: error in function EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_60.txt b/tools/h5diff/testfiles/h5diff_60.txt index 938f279..dde17f6 100644 --- a/tools/h5diff/testfiles/h5diff_60.txt +++ b/tools/h5diff/testfiles/h5diff_60.txt @@ -2,8 +2,8 @@ dataset: and size: [3x4] [3x4] position string1 string1 difference ------------------------------------------------------------ -[ 1 0 ] 5 \000 -[ 1 1 ] 6 \000 +[ 1 0 ] \000 5 +[ 1 1 ] \000 6 [ 1 2 ] \000 7 [ 1 3 ] \000 8 4 differences found diff --git a/tools/h5diff/testfiles/h5diff_61.txt b/tools/h5diff/testfiles/h5diff_61.txt index 1f238b1..5553d63 100644 --- a/tools/h5diff/testfiles/h5diff_61.txt +++ b/tools/h5diff/testfiles/h5diff_61.txt @@ -2,29 +2,29 @@ dataset: and size: [20] [20] position string2 string2 difference ------------------------------------------------------------ -[ 8 ] 9 e -[ 8 ] f -[ 8 ] 9 -[ 9 ] 0 e -[ 9 ] f -[ 9 ] 0 -[ 10 ] 1 e -[ 10 ] f -[ 10 ] 1 -[ 11 ] 2 e -[ 11 ] f -[ 11 ] 2 -[ 12 ] e 3 -[ 12 ] f -[ 12 ] 3 -[ 13 ] e 4 -[ 13 ] f -[ 13 ] 4 -[ 14 ] e 5 -[ 14 ] f -[ 14 ] 5 -[ 15 ] e 6 -[ 15 ] f -[ 15 ] 6 +[ 8 ] e 9 +[ 8 ] f +[ 8 ] 9 +[ 9 ] e 0 +[ 9 ] f +[ 9 ] 0 +[ 10 ] e 1 +[ 10 ] f +[ 10 ] 1 +[ 11 ] e 2 +[ 11 ] f +[ 11 ] 2 +[ 12 ] 3 e +[ 12 ] f +[ 12 ] 3 +[ 13 ] 4 e +[ 13 ] f +[ 13 ] 4 +[ 14 ] 5 e +[ 14 ] f +[ 14 ] 5 +[ 15 ] 6 e +[ 15 ] f +[ 15 ] 6 24 differences found EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_62.txt b/tools/h5diff/testfiles/h5diff_62.txt index 0cc0947..934f61e 100644 --- a/tools/h5diff/testfiles/h5diff_62.txt +++ b/tools/h5diff/testfiles/h5diff_62.txt @@ -2,36 +2,36 @@ dataset: and size: [27] [27] position string3 string3 difference ------------------------------------------------------------ -[ 12 ] d c -[ 12 ] 2 d -[ 12 ] \000 2 -[ 13 ] 3 d -[ 13 ] \000 3 -[ 14 ] b a -[ 14 ] c b -[ 14 ] d c -[ 14 ] 4 d -[ 14 ] \000 4 -[ 15 ] c b -[ 15 ] d c -[ 15 ] 5 d -[ 15 ] \000 5 -[ 16 ] c d -[ 16 ] d 6 -[ 16 ] 6 \000 -[ 17 ] d 7 -[ 17 ] 7 \000 -[ 18 ] a b -[ 18 ] b c -[ 18 ] c d -[ 18 ] d 8 -[ 18 ] 8 \000 -[ 19 ] b c -[ 19 ] c d -[ 19 ] d 9 -[ 19 ] 9 \000 -[ 24 ] c d -[ 25 ] c d -[ 26 ] c d +[ 12 ] c d +[ 12 ] d 2 +[ 12 ] 2 \000 +[ 13 ] d 3 +[ 13 ] 3 \000 +[ 14 ] a b +[ 14 ] b c +[ 14 ] c d +[ 14 ] d 4 +[ 14 ] 4 \000 +[ 15 ] b c +[ 15 ] c d +[ 15 ] d 5 +[ 15 ] 5 \000 +[ 16 ] d c +[ 16 ] 6 d +[ 16 ] \000 6 +[ 17 ] 7 d +[ 17 ] \000 7 +[ 18 ] b a +[ 18 ] c b +[ 18 ] d c +[ 18 ] 8 d +[ 18 ] \000 8 +[ 19 ] c b +[ 19 ] d c +[ 19 ] 9 d +[ 19 ] \000 9 +[ 24 ] d c +[ 25 ] d c +[ 26 ] d c 31 differences found EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_63.txt b/tools/h5diff/testfiles/h5diff_63.txt index 043da16..6b46c18 100644 --- a/tools/h5diff/testfiles/h5diff_63.txt +++ b/tools/h5diff/testfiles/h5diff_63.txt @@ -2,9 +2,9 @@ dataset: and size: [3] [3] position string4 string4 difference ------------------------------------------------------------ -[ 1 ] 8 -[ 1 ] 9 -[ 2 ] 8 -[ 2 ] 9 +[ 1 ] 8 +[ 1 ] 9 +[ 2 ] 8 +[ 2 ] 9 4 differences found EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_70.txt b/tools/h5diff/testfiles/h5diff_70.txt index 0a6b0c0..efa34ea 100644 --- a/tools/h5diff/testfiles/h5diff_70.txt +++ b/tools/h5diff/testfiles/h5diff_70.txt @@ -11,79 +11,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -514,79 +514,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -683,79 +683,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1192,79 +1192,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1360,79 +1360,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1863,79 +1863,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_700.txt b/tools/h5diff/testfiles/h5diff_700.txt index 1cf71dd..851a407 100644 --- a/tools/h5diff/testfiles/h5diff_700.txt +++ b/tools/h5diff/testfiles/h5diff_700.txt @@ -13,79 +13,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -516,79 +516,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -687,79 +687,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1196,79 +1196,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1366,79 +1366,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1869,79 +1869,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_701.txt b/tools/h5diff/testfiles/h5diff_701.txt index 405ab2f..33f1a0f 100644 --- a/tools/h5diff/testfiles/h5diff_701.txt +++ b/tools/h5diff/testfiles/h5diff_701.txt @@ -45,79 +45,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -548,79 +548,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -754,79 +754,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1263,79 +1263,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1465,79 +1465,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1968,79 +1968,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_702.txt b/tools/h5diff/testfiles/h5diff_702.txt index 1cf71dd..851a407 100644 --- a/tools/h5diff/testfiles/h5diff_702.txt +++ b/tools/h5diff/testfiles/h5diff_702.txt @@ -13,79 +13,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -516,79 +516,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -687,79 +687,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1196,79 +1196,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1366,79 +1366,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1869,79 +1869,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_703.txt b/tools/h5diff/testfiles/h5diff_703.txt index 405ab2f..33f1a0f 100644 --- a/tools/h5diff/testfiles/h5diff_703.txt +++ b/tools/h5diff/testfiles/h5diff_703.txt @@ -45,79 +45,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -548,79 +548,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -754,79 +754,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1263,79 +1263,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1465,79 +1465,79 @@ attribute: > and > size: [2] [2] position VLstring of VLstring of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position VLstring2D of VLstring2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position VLstring3D of VLstring3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] @@ -1968,79 +1968,79 @@ attribute: > and > size: [2] [2] position string of string of difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found attribute: > and > size: [3x2] [3x2] position string2D of string2D of difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found attribute: > and > size: [4x3x2] [4x3x2] position string3D of string3D of difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found attribute: > and > size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_80.txt b/tools/h5diff/testfiles/h5diff_80.txt index 836e073..b223eed 100644 --- a/tools/h5diff/testfiles/h5diff_80.txt +++ b/tools/h5diff/testfiles/h5diff_80.txt @@ -59,79 +59,79 @@ dataset: and size: [2] [2] position VLstring VLstring difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found dataset: and size: [3x2] [3x2] position VLstring2D VLstring2D difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found dataset: and size: [4x3x2] [4x3x2] position VLstring3D VLstring3D difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found dataset: and size: [2] [2] @@ -702,79 +702,79 @@ dataset: and size: [2] [2] position string string difference ------------------------------------------------------------ -[ 0 ] a z -[ 0 ] b z -[ 1 ] d z -[ 1 ] e z +[ 0 ] z a +[ 0 ] z b +[ 1 ] z d +[ 1 ] z e 4 differences found dataset: and size: [3x2] [3x2] position string2D string2D difference ------------------------------------------------------------ -[ 0 0 ] a z -[ 0 0 ] b z -[ 0 1 ] c z -[ 0 1 ] d z -[ 1 0 ] e z -[ 1 0 ] f z -[ 1 1 ] g z -[ 1 1 ] h z -[ 2 0 ] i z -[ 2 0 ] j z -[ 2 1 ] k z -[ 2 1 ] l z +[ 0 0 ] z a +[ 0 0 ] z b +[ 0 1 ] z c +[ 0 1 ] z d +[ 1 0 ] z e +[ 1 0 ] z f +[ 1 1 ] z g +[ 1 1 ] z h +[ 2 0 ] z i +[ 2 0 ] z j +[ 2 1 ] z k +[ 2 1 ] z l 12 differences found dataset: and size: [4x3x2] [4x3x2] position string3D string3D difference ------------------------------------------------------------ -[ 0 0 0 ] a z -[ 0 0 0 ] b z -[ 0 0 1 ] c z -[ 0 0 1 ] d z -[ 0 1 0 ] e z -[ 0 1 0 ] f z -[ 0 1 1 ] g z -[ 0 1 1 ] h z -[ 0 2 0 ] i z -[ 0 2 0 ] j z -[ 0 2 1 ] k z -[ 0 2 1 ] l z -[ 1 0 0 ] m z -[ 1 0 0 ] n z -[ 1 0 1 ] p z -[ 1 0 1 ] q z -[ 1 1 0 ] r z -[ 1 1 0 ] s z -[ 1 1 1 ] t z -[ 1 1 1 ] u z -[ 1 2 0 ] v z -[ 1 2 0 ] w z -[ 1 2 1 ] x z -[ 2 0 0 ] A z -[ 2 0 0 ] B z -[ 2 0 1 ] C z -[ 2 0 1 ] D z -[ 2 1 0 ] E z -[ 2 1 0 ] F z -[ 2 1 1 ] G z -[ 2 1 1 ] H z -[ 2 2 0 ] I z -[ 2 2 0 ] J z -[ 2 2 1 ] K z -[ 2 2 1 ] L z -[ 3 0 0 ] M z -[ 3 0 0 ] N z -[ 3 0 1 ] P z -[ 3 0 1 ] Q z -[ 3 1 0 ] R z -[ 3 1 0 ] S z -[ 3 1 1 ] T z -[ 3 1 1 ] U z -[ 3 2 0 ] V z -[ 3 2 0 ] W z -[ 3 2 1 ] X z -[ 3 2 1 ] Z z +[ 0 0 0 ] z a +[ 0 0 0 ] z b +[ 0 0 1 ] z c +[ 0 0 1 ] z d +[ 0 1 0 ] z e +[ 0 1 0 ] z f +[ 0 1 1 ] z g +[ 0 1 1 ] z h +[ 0 2 0 ] z i +[ 0 2 0 ] z j +[ 0 2 1 ] z k +[ 0 2 1 ] z l +[ 1 0 0 ] z m +[ 1 0 0 ] z n +[ 1 0 1 ] z p +[ 1 0 1 ] z q +[ 1 1 0 ] z r +[ 1 1 0 ] z s +[ 1 1 1 ] z t +[ 1 1 1 ] z u +[ 1 2 0 ] z v +[ 1 2 0 ] z w +[ 1 2 1 ] z x +[ 2 0 0 ] z A +[ 2 0 0 ] z B +[ 2 0 1 ] z C +[ 2 0 1 ] z D +[ 2 1 0 ] z E +[ 2 1 0 ] z F +[ 2 1 1 ] z G +[ 2 1 1 ] z H +[ 2 2 0 ] z I +[ 2 2 0 ] z J +[ 2 2 1 ] z K +[ 2 2 1 ] z L +[ 3 0 0 ] z M +[ 3 0 0 ] z N +[ 3 0 1 ] z P +[ 3 0 1 ] z Q +[ 3 1 0 ] z R +[ 3 1 0 ] z S +[ 3 1 1 ] z T +[ 3 1 1 ] z U +[ 3 2 0 ] z V +[ 3 2 0 ] z W +[ 3 2 1 ] z X +[ 3 2 1 ] z Z 47 differences found dataset: and size: [2] [2] diff --git a/tools/h5diff/testfiles/h5diff_udfail.txt b/tools/h5diff/testfiles/h5diff_udfail.txt index c154c6b..d51de38 100644 --- a/tools/h5diff/testfiles/h5diff_udfail.txt +++ b/tools/h5diff/testfiles/h5diff_udfail.txt @@ -8,5 +8,5 @@ group : and 0 differences found dataset: and 0 differences found -warning: dataset cannot be read, user defined filter is not available +Warning: dataset cannot be read, user defined filter is not available EXIT CODE: 2 diff --git a/tools/h5import/testfiles/binfp64.conf b/tools/h5import/testfiles/binfp64.conf deleted file mode 100644 index 6b4c361..0000000 --- a/tools/h5import/testfiles/binfp64.conf +++ /dev/null @@ -1,13 +0,0 @@ -PATH /fp/bin/64-bit -INPUT-CLASS FP -INPUT-SIZE 64 -RANK 3 -DIMENSION-SIZES 5 3 4 -OUTPUT-ARCHITECTURE IEEE -OUTPUT-BYTE-ORDER LE -CHUNKED-DIMENSION-SIZES 2 2 2 -COMPRESSION-PARAM 8 -MAXIMUM-DIMENSIONS -1 6 7 - - - diff --git a/tools/h5import/testfiles/binin16.conf b/tools/h5import/testfiles/binin16.conf deleted file mode 100644 index 06869cb..0000000 --- a/tools/h5import/testfiles/binin16.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/bin/16-bit -INPUT-CLASS IN -INPUT-SIZE 16 -RANK 3 -DIMENSION-SIZES 2 3 4 -CHUNKED-DIMENSION-SIZES 2 2 2 -MAXIMUM-DIMENSIONS -1 -1 8 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER LE - - - diff --git a/tools/h5import/testfiles/binin32.conf b/tools/h5import/testfiles/binin32.conf deleted file mode 100644 index 11996ef..0000000 --- a/tools/h5import/testfiles/binin32.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/bin/32-bit -INPUT-CLASS IN -INPUT-SIZE 32 -RANK 3 -DIMENSION-SIZES 5 3 4 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER BE -CHUNKED-DIMENSION-SIZES 1 2 1 - - - - diff --git a/tools/h5import/testfiles/binin8.conf b/tools/h5import/testfiles/binin8.conf deleted file mode 100644 index 1edd80a..0000000 --- a/tools/h5import/testfiles/binin8.conf +++ /dev/null @@ -1,16 +0,0 @@ -PATH /int/bin/8-bit -INPUT-CLASS IN -INPUT-SIZE 8 -OUTPUT-CLASS IN -OUTPUT-SIZE 16 -RANK 3 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER LE -DIMENSION-SIZES 5 3 4 -CHUNKED-DIMENSION-SIZES 2 2 2 -MAXIMUM-DIMENSIONS -1 -1 -1 -COMPRESSION-PARAM 3 - - - - diff --git a/tools/h5import/testfiles/binin8w.conf b/tools/h5import/testfiles/binin8w.conf deleted file mode 100644 index fccb4ac..0000000 --- a/tools/h5import/testfiles/binin8w.conf +++ /dev/null @@ -1,9 +0,0 @@ - -INPUT-CLASS IN -INPUT-SIZE 8 -RANK 1 -DIMENSION-SIZES 4 -OUTPUT-BYTE-ORDER LE -OUTPUT-CLASS IN -OUTPUT-SIZE 8 -OUTPUT-ARCHITECTURE STD diff --git a/tools/h5import/testfiles/binuin16.conf b/tools/h5import/testfiles/binuin16.conf deleted file mode 100644 index a4603df..0000000 --- a/tools/h5import/testfiles/binuin16.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/buin/16-bit -INPUT-CLASS UIN -INPUT-SIZE 16 -RANK 3 -DIMENSION-SIZES 2 3 4 -CHUNKED-DIMENSION-SIZES 2 2 2 -MAXIMUM-DIMENSIONS -1 -1 8 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER BE - - - diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 20d0463..b6ec914 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -229,12 +229,12 @@ endif () add_test ( NAME H5REPACK-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND $ --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects) add_test ( NAME H5REPACK-${testname}_DFF - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND $ --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) endif () diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index efbd8be..61bf097 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -221,13 +221,12 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, hid_t ret_value = -1; /* The identifier of the named dtype in the out file */ if (H5Oget_info(type_in, &oinfo) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info failed"); if (*named_dt_head_p) { /* Stack already exists, search for the datatype */ while (dt && dt->addr_in != oinfo.addr) dt = dt->next; - dt_ret = dt; } else { @@ -238,7 +237,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed"); dt->next = *named_dt_head_p; *named_dt_head_p = dt; @@ -259,7 +258,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, if (!dt_ret) { /* Push the new datatype onto the stack */ if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed"); dt_ret->next = *named_dt_head_p; *named_dt_head_p = dt_ret; @@ -276,9 +275,9 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, else dt_ret->id_out = H5Tcopy(type_in); if (dt_ret->id_out < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type-H5Tcopy failed"); if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommit_anon failed"); } /* end if */ /* Set return value */ @@ -286,7 +285,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, /* Increment the ref count on id_out, because the calling function will try to close it */ if(H5Iinc_ref(ret_value) < 0) - ret_value = -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Iinc_ref failed"); done: return ret_value; @@ -305,7 +304,7 @@ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { while (dt) { /* Pop the datatype off the stack and free it */ if (H5Tclose(dt->id_out) < 0 && !ignore_err) - goto done; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); dt = dt->next; HDfree(*named_dt_head_p); *named_dt_head_p = dt; @@ -332,7 +331,7 @@ int copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; hid_t attr_id = -1; /* attr ID */ hid_t attr_out = -1; /* attr ID */ hid_t space_id = -1; /* space ID */ @@ -426,7 +425,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, base_type = H5Tget_super(ftype_id); is_ref = (is_ref || (H5Tget_class(base_type) == H5T_REFERENCE)); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } if (type_class == H5T_COMPOUND) { @@ -435,7 +435,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, for (j = 0; j < nmembers; j++) { hid_t mtid = H5Tget_member_type(wtype_id, (unsigned)j); H5T_class_t mtclass = H5Tget_class(mtid); - H5Tclose(mtid); + if (H5Tclose(mtid) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed"); if (mtclass == H5T_REFERENCE) { is_ref = 1; @@ -481,7 +482,24 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, if (options->verbose) printf(FORMAT_OBJ_ATTR, "attr", name); - } /* u */ + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + if (H5Sclose(space_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); + space_id = -1; + if (H5Tclose(wtype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + wtype_id = -1; + if (H5Tclose(ftype_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + ftype_id = -1; + if (H5Aclose(attr_id) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed"); + attr_id = -1; + } /* for u */ done: H5E_BEGIN_TRY { @@ -495,11 +513,11 @@ done: HDfree(buf); } /* end if */ - H5Tclose(ftype_id); - H5Tclose(wtype_id); + H5Aclose(attr_out); H5Sclose(space_id); + H5Tclose(wtype_id); + H5Tclose(ftype_id); H5Aclose(attr_id); - H5Aclose(attr_out); } H5E_END_TRY; return ret_value; @@ -789,9 +807,9 @@ static int check_objects(const char* fname, pack_opt_t *options) { done: H5E_BEGIN_TRY { - H5Fclose(fid); H5Sclose(sid); H5Dclose(did); + H5Fclose(fid); } H5E_END_TRY; if (travt) trav_table_free(travt); diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 86c6e6f..fada1a8 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -78,23 +78,21 @@ static herr_t walk_error_callback(H5_ATTR_UNUSED unsigned n, const H5E_error2_t * * Return: 0, ok, * -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 23, 2003 - * *------------------------------------------------------------------------- */ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) { - int ret_value = 0; /* no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fidin; + int ret_value = 0; + hid_t fidin = -1; hid_t fidout = -1; - trav_table_t *travt = NULL; - hsize_t ub_size = 0; /* size of user block */ + hid_t fcpl_in = -1; /* file creation property list ID for input file */ + hid_t grp_in = -1; /* group ID */ + hid_t gcpl_in = -1; /* group creation property list */ hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */ hid_t fapl = H5P_DEFAULT; /* file access property list ID */ + trav_table_t *travt = NULL; + hsize_t ub_size = 0; /* size of user block */ unsigned crt_order_flags; /* group creation order flag */ /*------------------------------------------------------------------------- @@ -106,10 +104,6 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options) /* get user block size and file space strategy/threshold */ { - hid_t fcpl_in; /* file creation property list ID for input file */ - hid_t grp_in = -1; /* group ID */ - hid_t gcpl_in = -1; /* group creation property list */ - if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); @@ -293,42 +287,26 @@ print_user_block(fnamein, fidin); /* init table */ trav_table_init(&travt); - /* get the list of objects in the file */ - if (h5trav_gettable(fidin, travt) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); - - /*------------------------------------------------------------------------- - * do the copy - *------------------------------------------------------------------------- - */ - if (do_copy_objects(fidin, fidout, travt, options) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout); - - /*------------------------------------------------------------------------- - * do the copy of referenced objects - * and create hard links - *------------------------------------------------------------------------- - */ - if (do_copy_refobjs(fidin, fidout, travt, options) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout); - - /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - - if (fapl > 0) - H5Pclose(fapl); - - if (fcpl > 0) - H5Pclose(fcpl); - - H5Fclose(fidin); - H5Fclose(fidout); - - /* free table */ - trav_table_free(travt); - travt = NULL; + if (travt) { + /* get the list of objects in the file */ + if (h5trav_gettable(fidin, travt) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed"); + + /*------------------------------------------------------------------------- + * do the copy + *------------------------------------------------------------------------- + */ + if (do_copy_objects(fidin, fidout, travt, options) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout); + + /*------------------------------------------------------------------------- + * do the copy of referenced objects + * and create hard links + *------------------------------------------------------------------------- + */ + if (do_copy_refobjs(fidin, fidout, travt, options) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout); + } /*------------------------------------------------------------------------- * write only the input file user block if there is no user block file input @@ -339,17 +317,15 @@ print_user_block(fnamein, fidin); if (copy_user_block(fnamein, fnameout, ub_size) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting..."); - return 0; - - /*------------------------------------------------------------------------- - * out - *------------------------------------------------------------------------- - */ - done: H5E_BEGIN_TRY { + H5Pclose(fcpl_in); + H5Pclose(gcpl_in); H5Pclose(fapl); H5Pclose(fcpl); + H5Gclose(grp_in); + H5Fclose(fidin); + H5Fclose(fidout); H5Fclose(fidin); H5Fclose(fidout); } H5E_END_TRY; @@ -366,7 +342,7 @@ done: * The size of hyperslab is limitted by H5TOOLS_BUFSIZE. * Return the hyperslab dimentions and size in byte. * - * Return: 0 - SUCCEED, -1 FAILED + * Return: 0 - SUCCEED, -1 FAILED * * Parameters: * dcpl_id : [IN] dataset creation property. @@ -376,8 +352,6 @@ done: * dims_hslab[] : [OUT] calculated hyperslab dimentions * * hslab_nbytes_p : [OUT] total byte of the hyperslab * - * Programmer: Jonathan Kim - * Date: Feburary, 2012 * Update: * The hyperslab calucation would be depend on if the dataset is chunked * or not. @@ -391,25 +365,23 @@ done: * the boundary would be dataset's dims. * * The calulation starts from the last dimention (h5dump dims output). - * - * Note: - * Added for JIRA HDFFV-7862. *-----------------------------------------*/ -int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], +int +Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; int k; H5D_layout_t dset_layout; int rank_chunk; hsize_t dims_chunk[H5S_MAX_RANK]; hsize_t size_chunk = 1; - hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ - hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimentions */ - hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */ - hsize_t hslab_nbytes; /* size of hyperslab in byte */ + hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */ + hsize_t hslab_nbytes; /* size of hyperslab in byte */ /* init to set as size of a data element */ hslab_nbytes = size_datum; @@ -522,24 +494,9 @@ done: /*------------------------------------------------------------------------- * Function: do_copy_objects * - * Purpose: duplicate all HDF5 objects in the file - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October, 23, 2003 - * - * Modifications: - * - * July 2004: Introduced the extra EC or NN option for SZIP - * - * December 2004: Added a check for H5Dcreate; if the dataset cannot be created - * with the requested filter, use the input one - * - * October 2006: Read/write using the file type by default. + * Purpose: duplicate all HDF5 objects in the file * - * October 2006: Read by hyperslabs for big datasets. + * Return: 0, ok, -1 no * * A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done * i.e., if the memory needed to read a dataset is greater than this limit, @@ -580,31 +537,6 @@ done: * in (2) is that, when using the strip mine size, it assures that the "remaining" part * of the dataset that does not fill an entire strip mine is processed. * - * November 2006: Use H5Ocopy in the copy of objects. The logic for using - * H5Ocopy or not is if a change of filters or layout is requested by the user - * then use read/write else use H5Ocopy. - * - * May, 1, 2008: Add a printing of the compression ratio of old size / new size - * - * Feburary 2012: improve Read/Write by hyperslabs for big datasets. - * Programmer: Jonathan Kim - * - * A threshold of H5TOOLS_MALLOCSIZE is the limit upon which I/O hyperslab is done - * i.e., if the memory needed to read a dataset is greater than this limit, - * then hyperslab I/O is done instead of one operation I/O - * For each dataset, the memory needed is calculated according to - * - * memory needed = number of elements * size of each element - * - * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations - * are done - * - * H5Dread( input_dataset ) - * H5Dwrite( output_dataset ) - * - * with all elements in the datasets selected. If the memory needed is greater than - * H5TOOLS_MALLOCSIZE, then the following operations are done instead: - * * 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()). * 2. Calculate the hyperslab selections as the selection is moving forward. * Selection would be same as the hyperslab except for the remaining edge portion @@ -616,7 +548,7 @@ done: int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *options) /* repack options */ { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; hid_t grp_in = -1; /* group ID */ hid_t grp_out = -1; /* group ID */ hid_t dset_in = -1; /* read dataset ID */ @@ -1193,6 +1125,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); if (H5Tclose(type_out) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed"); + type_out = -1; /* named datatypes stack, named_dt_head, manages allocation */ break; @@ -1223,6 +1156,18 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, } /* end if */ done: + + /* Finalize (link) the stack of named datatypes (if any) first + * because of reference counting */ + if (0 == ret_value && named_dt_head != NULL) { + if (named_datatype_free(&named_dt_head, 0) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "named_datatype_free failed"); + } + else + H5E_BEGIN_TRY { + named_datatype_free(&named_dt_head, 1); + } H5E_END_TRY; + H5E_BEGIN_TRY { H5Gclose(grp_in); @@ -1245,14 +1190,6 @@ done: if (hslab_buf != NULL) HDfree(hslab_buf); - /* Finalize (link) the stack of named datatypes (if any) */ - if (0 == ret_value && named_dt_head != NULL) - named_datatype_free(&named_dt_head, 0); - else - H5E_BEGIN_TRY { - named_datatype_free(&named_dt_head, 1); - } H5E_END_TRY; - return ret_value; } @@ -1260,10 +1197,10 @@ done: * Function: print_dataset_info * * Purpose: print name, filters, percentage compression of a dataset - * *------------------------------------------------------------------------- */ -static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) +static void +print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) { char strfilter[255]; #if defined (PRINT_DEBUG ) @@ -1275,7 +1212,7 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p unsigned cd_values[20]; /* filter client data values */ size_t cd_nelmts; /* filter client number of values */ char f_objname[256]; /* filter objname */ - int i; + int i; HDstrcpy(strfilter, "\0"); @@ -1367,19 +1304,15 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p /*------------------------------------------------------------------------- * Function: copy_user_block * - * Purpose: copy user block from one file to another - * - * Return: 0, ok, -1 no - * - * Programmer: Peter Cao - * - * Date: October, 25, 2007 + * Purpose: copy user block from one file to another * + * Return: 0, ok, -1 no *------------------------------------------------------------------------- */ -static int copy_user_block(const char *infile, const char *outfile, hsize_t size) +static int +copy_user_block(const char *infile, const char *outfile, hsize_t size) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; int infid = -1, outfid = -1; /* File descriptors */ /* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */ @@ -1441,21 +1374,17 @@ done: /*------------------------------------------------------------------------- * Function: print_user_block * - * Purpose: print user block - * - * Return: 0, ok, -1 no - * - * Programmer: Pedro Vicente - * - * Date: August, 20, 2008 + * Purpose: print user block * + * Return: 0, ok, -1 no *------------------------------------------------------------------------- */ #if defined (H5REPACK_DEBUG_USER_BLOCK) static -void print_user_block(const char *filename, hid_t fid) +void +print_user_block(const char *filename, hid_t fid) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 0; int fh; /* file handle */ hsize_t ub_size; /* user block size */ hsize_t size; /* size read */ diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 01b3407..5133966 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -189,7 +189,8 @@ int do_copy_refobjs(hid_t fidin, refname); } } /*refname*/ - H5Oclose(refobj_id); + if (H5Oclose(refobj_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refob failed"); } /* u */ } /*nelmts*/ @@ -276,7 +277,8 @@ int do_copy_refobjs(hid_t fidin, refname); } } /*refname*/ - H5Oclose(refobj_id); + if (H5Oclose(refobj_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Oclose refobj_id failed"); } /* u */ } /*nelmts*/ @@ -392,7 +394,7 @@ done: H5Tclose(ftype_id); H5Tclose(mtype_id); H5Tclose(type_in); - named_datatype_free(&named_dt_head, 0); + named_datatype_free(&named_dt_head, 1); } H5E_END_TRY; return ret_value; @@ -483,7 +485,8 @@ static int copy_refs_attr(hid_t loc_in, base_type = H5Tget_super(ftype_id); is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } else if(type_class == H5T_ARRAY ) { hid_t base_type; @@ -491,7 +494,8 @@ static int copy_refs_attr(hid_t loc_in, base_type = H5Tget_super(ftype_id); is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } else if(type_class == H5T_COMPOUND) { int nmembers = H5Tget_nmembers(ftype_id) ; @@ -511,7 +515,8 @@ static int copy_refs_attr(hid_t loc_in, ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid); ref_comp_field_n++; } - H5Tclose(mtid); + if (H5Tclose(mtid) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtid failed"); } /* if compound don't contain reference type member, free the above @@ -533,9 +538,12 @@ static int copy_refs_attr(hid_t loc_in, is_ref_comp = (ref_comp_field_n > 0); if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) { - H5Tclose(mtype_id); - H5Tclose(ftype_id); - H5Aclose(attr_id); + if (H5Tclose(mtype_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose mtype_id failed"); + if (H5Tclose(ftype_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose ftype_id failed"); + if (H5Aclose(attr_id) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Aclose attr_id failed"); continue; } @@ -568,7 +576,8 @@ static int copy_refs_attr(hid_t loc_in, base_type = H5Tget_super(ftype_id); msize = H5Tget_size(base_type); - H5Tclose(base_type); + if (H5Tclose(base_type) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); array_rank = (unsigned)H5Tget_array_ndims(mtype_id); H5Tget_array_dims2(mtype_id, array_dims); diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 7e4fad4..72f76c3 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -2652,9 +2652,9 @@ int make_all_filters(hid_t loc_id) /* close */ if(H5Tclose(dtid) < 0) - return -1; + goto out; if(H5Dclose(dsid) < 0) - return -1; + goto out; if(H5Sclose(sid) < 0) goto out; @@ -2666,6 +2666,8 @@ int make_all_filters(hid_t loc_id) out: H5E_BEGIN_TRY { + H5Tclose(dtid); + H5Dclose(dsid); H5Pclose(dcpl); H5Sclose(sid); } H5E_END_TRY; diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c index e08d5ab..6e7a24e 100644 --- a/tools/h5repack/testh5repack_detect_szip.c +++ b/tools/h5repack/testh5repack_detect_szip.c @@ -11,7 +11,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include #include "h5repack.h" #include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index d5d0dee..0b10249 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -21,25 +21,25 @@ /*------------------------------------------------------------------------- * Function: print_objname * - * Purpose: check if object name is to be printed, only when: - * 1) verbose mode - * 2) when diff was found (normal mode) + * Purpose: check if object name is to be printed, only when: + * 1) verbose mode + * 2) when diff was found (normal mode) *------------------------------------------------------------------------- */ -int -print_objname (diff_opt_t * options, hsize_t nfound) + int +print_objname (diff_opt_t * opts, hsize_t nfound) { - return ((options->m_verbose || nfound) && !options->m_quiet) ? 1 : 0; + return ((opts->m_verbose || nfound) && !opts->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- * Function: do_print_objname * - * Purpose: print object name - * + * Purpose: print object name *------------------------------------------------------------------------- */ -void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts) +void +do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts) { /* if verbose level is higher than 0, put space line before * displaying any object or symbolic links. This improves @@ -53,8 +53,7 @@ void do_print_objname (const char *OBJ, const char *path1, const char *path2, di /*------------------------------------------------------------------------- * Function: do_print_attrname * - * Purpose: print attribute name - * + * Purpose: print attribute name *------------------------------------------------------------------------- */ void @@ -66,17 +65,16 @@ do_print_attrname (const char *attr, const char *path1, const char *path2) /*------------------------------------------------------------------------- * Function: print_warn * - * Purpose: check print warning condition. + * Purpose: check print warning condition. * Return: - * 1 if verbose mode - * 0 if not verbos mode - * Programmer: Jonathan Kim - * Date: Feb 4, 2010 + * 1 if verbose mode + * 0 if not verbos mode *------------------------------------------------------------------------- */ -static int print_warn(diff_opt_t *options) +static int +print_warn(diff_opt_t *opts) { - return ((options->m_verbose))?1:0; + return ((opts->m_verbose)) ? 1: 0; } @@ -84,20 +82,16 @@ static int print_warn(diff_opt_t *options) /*------------------------------------------------------------------------- * Function: phdiff_dismiss_workers * - * Purpose: tell all workers to end. - * - * Return: none - * - * Programmer: Albert Cheng - * - * Date: Feb 6, 2005 + * Purpose: tell all workers to end. * + * Return: none *------------------------------------------------------------------------- */ -void phdiff_dismiss_workers(void) +void +phdiff_dismiss_workers(void) { int i; - for(i=1; im_quiet && (options->m_verbose || options->m_report)) - { + if(opts->m_quiet && (opts->m_verbose || opts->m_report)) { parallel_print("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); - options->err_stat=1; - ret = 0; - goto out; + opts->err_stat = 1; + HGOTO_DONE(0); } /* ------------------------------------------------------- * only allow --no-dangling-links along with --follow-symlinks */ - if(options->no_dangle_links && !options->follow_links) - { + if(opts->no_dangle_links && !opts->follow_links) { parallel_print("Error: --no-dangling-links must be used along with --follow-symlinks option.\n"); - options->err_stat=1; - ret = 0; - goto out; + opts->err_stat = 1; + HGOTO_DONE(0); } -out: +done: - return ret; + return ret_value; } /*------------------------------------------------------------------------- * Function: is_exclude_path * - * Purpose: check if 'paths' are part of exclude path list + * Purpose: check if 'paths' are part of exclude path list * * Return: - * 1 - excluded path - * 0 - not excluded path - * - * Programmer: Jonathan Kim - * Date: Aug 23, 2010 + * 1 - excluded path + * 0 - not excluded path *------------------------------------------------------------------------*/ -static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options) +static int +is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *opts) { struct exclude_path_list * exclude_path_ptr; - int ret_cmp; - int ret = 0; + int ret_cmp; + int ret_value = 0; /* check if exclude path option is given */ - if (!options->exclude_path) - goto out; + if (!opts->exclude_path) + HGOTO_DONE(0); /* assign to local exclude list pointer */ - exclude_path_ptr = options->exclude; + exclude_path_ptr = opts->exclude; /* search objects in exclude list */ - while (NULL != exclude_path_ptr) - { + while (NULL != exclude_path_ptr) { /* if exclude path is is group, exclude its members as well */ - if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) - { + if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, HDstrlen(exclude_path_ptr->obj_path)); - if (ret_cmp == 0) /* found matching members */ - { + if (ret_cmp == 0) { /* found matching members */ size_t len_grp; /* check if given path belong to an excluding group, if so @@ -223,22 +198,19 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options * not under “/grp1xxx/†group. */ len_grp = HDstrlen(exclude_path_ptr->obj_path); - if (path[len_grp] == '/') - { + if (path[len_grp] == '/') { /* belong to excluded group! */ - ret = 1; + ret_value = 1; break; /* while */ } } } /* exclude target is not group, just exclude the object */ - else - { + else { ret_cmp = HDstrcmp(exclude_path_ptr->obj_path, path); - if (ret_cmp == 0) /* found matching object */ - { + if (ret_cmp == 0) { /* found matching object */ /* excluded non-group object */ - ret = 1; + ret_value = 1; /* remember the type of this maching object. * if it's group, it can be used for excluding its member * objects in this while() loop */ @@ -249,26 +221,23 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options exclude_path_ptr = exclude_path_ptr->next; } -out: - return ret; +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: free_exclude_path_list * - * Purpose: free exclud object list from diff options - * - * Programmer: Jonathan Kim - * Date: Aug 23, 2010 + * Purpose: free exclude object list from diff options *------------------------------------------------------------------------*/ -static void free_exclude_path_list(diff_opt_t *options) +static void +free_exclude_path_list(diff_opt_t *opts) { - struct exclude_path_list * curr = options->exclude; - struct exclude_path_list * next; + struct exclude_path_list *curr = opts->exclude; + struct exclude_path_list *next; - while (NULL != curr) - { + while (NULL != curr) { next = curr->next; HDfree(curr); curr = next; @@ -278,44 +247,43 @@ static void free_exclude_path_list(diff_opt_t *options) /*------------------------------------------------------------------------- * Function: build_match_list * - * Purpose: get list of matching path_name from info1 and info2 + * Purpose: get list of matching path_name from info1 and info2 * * Note: - * Find common objects; the algorithm used for this search is the - * cosequential match algorithm and is described in - * Folk, Michael; Zoellick, Bill. (1992). File Structures. Addison-Wesley. - * Moved out from diff_match() to make code more flexible. + * Find common objects; the algorithm used for this search is the + * cosequential match algorithm and is described in + * Folk, Michael; Zoellick, Bill. (1992). File Structures. Addison-Wesley. + * Moved out from diff_match() to make code more flexible. * * Parameter: - * table_out [OUT] : return the list - * - * Programmer: Jonathan Kim - * - * Date: Aug 18, 2010 + * table_out [OUT] : return the list *------------------------------------------------------------------------*/ -static void build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, trav_table_t ** table_out, diff_opt_t *options) +static void +build_match_list (const char *objname1, trav_info_t *info1, const char *objname2, trav_info_t *info2, + trav_table_t ** table_out, diff_opt_t *opts) { - size_t curr1 = 0; - size_t curr2 = 0; + size_t curr1 = 0; + size_t curr2 = 0; unsigned infile[2]; - char * path1_lp; - char * path2_lp; + char *path1_lp = NULL; + char *path2_lp = NULL; h5trav_type_t type1_l; h5trav_type_t type2_l; - size_t path1_offset = 0; - size_t path2_offset = 0; - int cmp; - trav_table_t *table; - size_t idx; + size_t path1_offset = 0; + size_t path2_offset = 0; + int cmp; + trav_table_t *table = NULL; + size_t idx; h5difftrace("build_match_list start\n"); /* init */ - trav_table_init( &table ); - + trav_table_init(&table); + if (table == NULL) + H5TOOLS_INFO(H5E_tools_min_id_g, "Cannot create tarverse table"); /* * This is necessary for the case that given objects are group and * have different names (ex: obj1 is /grp1 and obj2 is /grp5). - * All the objects belong to given groups are the cadidates. + * All the objects belong to given groups are the candidates. * So prepare to compare paths without the group names. */ @@ -329,8 +297,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /*-------------------------------------------------- * build the list */ - while(curr1 < info1->nused && curr2 < info2->nused) - { + while(curr1 < info1->nused && curr2 < info2->nused) { path1_lp = (info1->paths[curr1].path) + path1_offset; path2_lp = (info2->paths[curr2].path) + path2_offset; type1_l = info1->paths[curr1].type; @@ -338,19 +305,15 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /* criteria is string compare */ cmp = HDstrcmp(path1_lp, path2_lp); - - if(cmp == 0) - { - if(!is_exclude_path(path1_lp, type1_l, options)) - { + if(cmp == 0) { + if(!is_exclude_path(path1_lp, type1_l, opts)) { infile[0] = 1; infile[1] = 1; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); /* if the two point to the same target object, * mark that in table */ if (info1->paths[curr1].fileno == info2->paths[curr2].fileno && - info1->paths[curr1].objno == info2->paths[curr2].objno ) - { + info1->paths[curr1].objno == info2->paths[curr2].objno) { idx = table->nobjs - 1; table->objs[idx].is_same_trgobj = 1; } @@ -358,20 +321,16 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch curr1++; curr2++; } /* end if */ - else if(cmp < 0) - { - if(!is_exclude_path(path1_lp, type1_l, options)) - { + else if(cmp < 0) { + if(!is_exclude_path(path1_lp, type1_l, opts)) { infile[0] = 1; infile[1] = 0; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); } curr1++; } /* end else-if */ - else - { - if (!is_exclude_path(path2_lp, type2_l, options)) - { + else { + if (!is_exclude_path(path2_lp, type2_l, opts)) { infile[0] = 0; infile[1] = 1; trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); @@ -383,13 +342,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /* list1 did not end */ infile[0] = 1; infile[1] = 0; - while(curr1 < info1->nused) - { + while(curr1 < info1->nused) { path1_lp = (info1->paths[curr1].path) + path1_offset; type1_l = info1->paths[curr1].type; - if(!is_exclude_path(path1_lp, type1_l, options)) - { + if(!is_exclude_path(path1_lp, type1_l, opts)) { trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); } curr1++; @@ -398,19 +355,17 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /* list2 did not end */ infile[0] = 0; infile[1] = 1; - while(curr2 < info2->nused) - { + while(curr2 < info2->nused) { path2_lp = (info2->paths[curr2].path) + path2_offset; type2_l = info2->paths[curr2].type; - if (!is_exclude_path(path2_lp, type2_l, options)) - { + if (!is_exclude_path(path2_lp, type2_l, opts)) { trav_table_addflags(infile, path2_lp, info2->paths[curr2].type, table); } curr2++; } /* end while */ - free_exclude_path_list (options); + free_exclude_path_list (opts); *table_out = table; h5difftrace("build_match_list finish\n"); @@ -420,15 +375,11 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch /*------------------------------------------------------------------------- * Function: trav_grp_objs * - * Purpose: - * Call back function from h5trav_visit(). - * - * Programmer: Jonathan Kim - * - * Date: Aug 16, 2010 + * Purpose: Call back function from h5trav_visit(). *------------------------------------------------------------------------*/ -static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, - const char *already_visited, void *udata) +static herr_t +trav_grp_objs(const char *path, const H5O_info_t *oinfo, + const char *already_visited, void *udata) { trav_info_visit_obj(path, oinfo, already_visited, udata); @@ -438,18 +389,13 @@ static herr_t trav_grp_objs(const char *path, const H5O_info_t *oinfo, /*------------------------------------------------------------------------- * Function: trav_grp_symlinks * - * Purpose: - * Call back function from h5trav_visit(). - * Track and extra checkings while visiting all symbolic-links. - * - * Programmer: Jonathan Kim - * - * Date: Aug 16, 2010 + * Purpose: Call back function from h5trav_visit(). + * Track and extra checkings while visiting all symbolic-links. *------------------------------------------------------------------------*/ -static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, - void *udata) +static herr_t +trav_grp_symlinks(const char *path, const H5L_info_t *linfo, void *udata) { - int ret_value = 0; + herr_t ret_value = 0; trav_info_t *tinfo = (trav_info_t *)udata; diff_opt_t *opts = (diff_opt_t *)tinfo->opts; h5tool_link_info_t lnk_info; @@ -461,66 +407,68 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, if (!opts->follow_links) { trav_info_visit_lnk(path, linfo, tinfo); - goto done; + HGOTO_DONE(0); } switch(linfo->type) { case H5L_TYPE_SOFT: - if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) - goto done; - /* no dangling link option given and detect dangling link */ + if((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) { + HGOTO_DONE(FAIL); + } else if (ret_value == 0) { - tinfo->symlink_visited.dangle_link = TRUE; + /* no dangling link option given and detect dangling link */ + tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) opts->err_stat = 1; /* make dangling link is error */ - goto done; + HGOTO_DONE(0); } /* check if already visit the target object */ if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path)) - goto done; + HGOTO_DONE(0); /* add this link as visited link */ if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, NULL, lnk_info.trg_path) < 0) - goto done; + HGOTO_DONE(0); if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents"); } break; case H5L_TYPE_EXTERNAL: - if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) - goto done; - /* no dangling link option given and detect dangling link */ + if ((ret_value = H5tools_get_symlink_info(tinfo->fid, path, &lnk_info, opts->follow_links)) < 0) { + HGOTO_DONE(FAIL); + } else if (ret_value == 0) { + /* no dangling link option given and detect dangling link */ tinfo->symlink_visited.dangle_link = TRUE; trav_info_visit_lnk(path, linfo, tinfo); if (opts->no_dangle_links) opts->err_stat = 1; /* make dangling link is error */ - goto done; + HGOTO_DONE(0); } if(H5Lunpack_elink_val(lnk_info.trg_path, linfo->u.val_size, NULL, &ext_fname, &ext_path) < 0) - goto done; + HGOTO_DONE(0); /* check if already visit the target object */ if(symlink_is_visited( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path)) - goto done; + HGOTO_DONE(0); /* add this link as visited link */ if(symlink_visit_add( &(tinfo->symlink_visited), linfo->type, ext_fname, ext_path) < 0) - goto done; + HGOTO_DONE(0); if(h5trav_visit(tinfo->fid, path, TRUE, TRUE, trav_grp_objs,trav_grp_symlinks, tinfo) < 0) { parallel_print("Error: Could not get file contents\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents\n"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Could not get file contents\n"); } break; @@ -530,52 +478,48 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, default: parallel_print("Error: Invalid link type\n"); opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Invalid link type"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Error: Invalid link type"); break; } /* end of switch */ done: if (lnk_info.trg_path) HDfree(lnk_info.trg_path); - return 0; + return ret_value; } /*------------------------------------------------------------------------- * Function: h5diff * - * Purpose: public function, can be called in an application program. - * return differences between 2 HDF5 files - * - * Return: Number of differences found. - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 22, 2003 + * Purpose: public function, can be called in an application program. + * return differences between 2 HDF5 files * + * Return: Number of differences found. *------------------------------------------------------------------------- */ -hsize_t h5diff(const char *fname1, +hsize_t +h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, diff_opt_t *opts) { - int ret_value = 0; - hid_t file1_id = (-1); - hid_t file2_id = (-1); - char filenames[2][MAX_FILENAME]; - hsize_t nfound = 0; - int l_ret1 = -1; - int l_ret2 = -1; - char * obj1fullname = NULL; - char * obj2fullname = NULL; - int both_objs_grp = 0; + int ret_value = 0; + hid_t file1_id = -1; + hid_t file2_id = -1; + char filenames[2][MAX_FILENAME]; + hsize_t nfound = 0; + int l_ret1 = -1; + int l_ret2 = -1; + char *obj1fullname = NULL; + char *obj2fullname = NULL; + int both_objs_grp = 0; /* init to group type */ h5trav_type_t obj1type = H5TRAV_TYPE_GROUP; h5trav_type_t obj2type = H5TRAV_TYPE_GROUP; /* for single object */ - H5O_info_t oinfo1, oinfo2; /* object info */ + H5O_info_t oinfo1, oinfo2; /* object info */ trav_info_t *info1_obj = NULL; trav_info_t *info2_obj = NULL; /* for group object */ @@ -585,8 +529,8 @@ hsize_t h5diff(const char *fname1, trav_info_t *info1_lp = NULL; trav_info_t *info2_lp = NULL; /* link info from specified object */ - H5L_info_t src_linfo1; - H5L_info_t src_linfo2; + H5L_info_t src_linfo1; + H5L_info_t src_linfo2; /* link info from member object */ h5tool_link_info_t trg_linfo1; h5tool_link_info_t trg_linfo2; @@ -604,34 +548,27 @@ hsize_t h5diff(const char *fname1, * check invalid combination of options *-----------------------------------------------------------------------*/ if(!is_valid_options(opts)) - goto done; + HGOTO_DONE(0); opts->cmn_objs = 1; /* eliminate warning */ + opts->err_stat = 0; /* initialize error status */ /*------------------------------------------------------------------------- * open the files first; if they are not valid, no point in continuing *------------------------------------------------------------------------- */ - - /* disable error reporting */ - H5E_BEGIN_TRY - { - /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { - parallel_print("h5diff: <%s>: unable to open file\n", fname1); - opts->err_stat = 1; - goto done; - } /* end if */ + /* open file 1 */ + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { + parallel_print("h5diff: <%s>: unable to open file\n", fname1); + HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname1); + } /* end if */ - /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { - parallel_print("h5diff: <%s>: unable to open file\n", fname2); - opts->err_stat = 1; - goto done; - } /* end if */ - /* enable error reporting */ - } H5E_END_TRY; + /* open file 2 */ + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { + parallel_print("h5diff: <%s>: unable to open file\n", fname2); + HGOTO_ERROR(1, H5E_tools_min_id_g, "<%s>: unable to open file\n", fname2); + } /* end if */ /*------------------------------------------------------------------------- * Initialize the info structs @@ -648,10 +585,12 @@ hsize_t h5diff(const char *fname1, #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj1fullname, "/%s", objname1) < 0) - goto done; + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2); + if ((obj1fullname = (char*)HDmalloc(HDstrlen(objname1) + 2)) == NULL) + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); + HDstrcpy(obj1fullname, "/"); HDstrcat(obj1fullname, objname1); #endif /* H5_HAVE_ASPRINTF */ @@ -664,10 +603,11 @@ hsize_t h5diff(const char *fname1, #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ if(HDasprintf(&obj2fullname, "/%s", objname2) < 0) - goto done; + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2); + if ((obj2fullname = (char*)HDmalloc(HDstrlen(objname2) + 2)) == NULL) + HGOTO_ERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); HDstrcpy(obj2fullname, "/"); HDstrcat(obj2fullname, objname2); #endif /* H5_HAVE_ASPRINTF */ @@ -686,14 +626,12 @@ hsize_t h5diff(const char *fname1, /* check if link itself exist */ if(H5Lexists(file1_id, obj1fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ if(H5Lget_info(file1_id, obj1fullname, &src_linfo1, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj1fullname); - H5TOOLS_INFO(H5E_tools_min_id_g, "Unable to get link info\n"); - goto done; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed"); } info1_lp = info1_obj; @@ -709,8 +647,7 @@ hsize_t h5diff(const char *fname1, if(H5Oget_info_by_name(file1_id, obj1fullname, &oinfo1, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj1type = (h5trav_type_t)oinfo1.type; trav_info_add(info1_obj, obj1fullname, obj1type); @@ -739,13 +676,12 @@ hsize_t h5diff(const char *fname1, /* check if link itself exist */ if(H5Lexists(file2_id, obj2fullname, H5P_DEFAULT) <= 0) { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Object could not be found"); } /* get info from link */ if(H5Lget_info(file2_id, obj2fullname, &src_linfo2, H5P_DEFAULT) < 0) { parallel_print("Unable to get link info from <%s>\n", obj2fullname); - goto done; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Lget_info failed"); } info2_lp = info2_obj; @@ -761,8 +697,7 @@ hsize_t h5diff(const char *fname1, if(H5Oget_info_by_name(file2_id, obj2fullname, &oinfo2, H5P_DEFAULT) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Error: Could not get file contents"); } obj2type = (h5trav_type_t)oinfo2.type; trav_info_add(info2_obj, obj2fullname, obj2type); @@ -790,7 +725,7 @@ hsize_t h5diff(const char *fname1, obj2type = H5TRAV_TYPE_GROUP; } - + h5diffdebug2("get any symbolic links info - errstat:%d\n", opts->err_stat); /* get any symbolic links info */ l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, opts->follow_links); l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, opts->follow_links); @@ -814,8 +749,7 @@ hsize_t h5diff(const char *fname1, /* treat dangling link as error */ if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error"); } else { if(opts->m_verbose) @@ -823,14 +757,13 @@ hsize_t h5diff(const char *fname1, if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto done; + HGOTO_DONE(0); } } } else if(l_ret1 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found"); } else if(l_ret1 != 2) { /* symbolic link */ obj1type = (h5trav_type_t)trg_linfo1.trg_type; @@ -857,23 +790,21 @@ hsize_t h5diff(const char *fname1, /* treat dangling link as error */ if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: treat dangling link as error"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "treat dangling link as error"); } else { if(opts->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); - if (l_ret1 != 0 || l_ret2 != 0) { + if (l_ret1 != 0 || l_ret2 != 0) { nfound++; print_found(nfound); - goto done; + HGOTO_DONE(0); } } } else if(l_ret2 < 0) { /* fail */ parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Object could not be found"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Object could not be found"); } else if(l_ret2 != 2) { /* symbolic link */ obj2type = (h5trav_type_t)trg_linfo2.trg_type; @@ -899,9 +830,9 @@ hsize_t h5diff(const char *fname1, if(!(opts->m_verbose || opts->m_report)) { h5difftrace("h5diff NOT (opts->m_verbose || opts->m_report)\n"); /* if no danglink links */ - if ( l_ret1 > 0 && l_ret2 > 0 ) - if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname)!=0) - goto done; + if (l_ret1 > 0 && l_ret2 > 0) + if (h5tools_is_obj_same(file1_id, obj1fullname, file2_id, obj2fullname) != 0) + HGOTO_DONE(0); } both_objs_grp = (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP); @@ -917,8 +848,7 @@ hsize_t h5diff(const char *fname1, if(h5trav_visit(file1_id, obj1fullname, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, info1_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents"); } info1_lp = info1_grp; @@ -932,11 +862,11 @@ hsize_t h5diff(const char *fname1, if(h5trav_visit(file2_id, obj2fullname, TRUE, TRUE, trav_grp_objs, trav_grp_symlinks, info2_grp) < 0) { parallel_print("Error: Could not get file contents\n"); - opts->err_stat = 1; - HGOTO_ERROR(opts->err_stat, H5E_tools_min_id_g, "Error: Could not get file contents"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Could not get file contents"); } /* end if */ info2_lp = info2_grp; } + h5diffdebug2("groups traversed - errstat:%d\n", opts->err_stat); #ifdef H5_HAVE_PARALLEL if(g_Parallel) { @@ -957,14 +887,12 @@ hsize_t h5diff(const char *fname1, #endif /* process the objects */ - build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp, - &match_list, opts); + build_match_list (obj1fullname, info1_lp, obj2fullname, info2_lp, &match_list, opts); if (both_objs_grp) { /*------------------------------------------------------ * print the list */ - if(opts->m_verbose) - { + if(opts->m_verbose) { unsigned u; parallel_print("\n"); @@ -988,6 +916,8 @@ hsize_t h5diff(const char *fname1, match_list, opts); done: + opts->err_stat = opts->err_stat | ret_value; + #ifdef H5_HAVE_PARALLEL if(g_Parallel) /* All done at this point, let tasks know that they won't be needed */ @@ -1022,6 +952,7 @@ done: H5Fclose(file1_id); H5Fclose(file2_id); } H5E_END_TRY; + h5difftrace("h5diff finish\n"); return nfound; @@ -1032,43 +963,34 @@ done: /*------------------------------------------------------------------------- * Function: diff_match * - * Purpose: - * Compare common objects in given groups according to table structure. - * The table structure has flags which can be used to find common objects - * and will be compared. - * Common object means same name (absolute path) objects in both location. - * - * Return: Number of differences found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Purpose: Compare common objects in given groups according to table structure. + * The table structure has flags which can be used to find common objects + * and will be compared. + * Common object means same name (absolute path) objects in both location. * - * Date: May 9, 2003 + * Return: Number of differences found * - * Modifications: Jan 2005 Leon Arber, larber@uiuc.edu - * Added support for parallel diffing - * - * Pedro Vicente, pvn@hdfgroup.org, Nov 4, 2008 - * Compare the graph and make h5diff return 1 for difference if - * 1) the number of objects in file1 is not the same as in file2 - * 2) the graph does not match, i.e same names (absolute path) - * 3) objects with the same name are not of the same type + * Modifications: Compare the graph and make h5diff return 1 for difference if + * 1) the number of objects in file1 is not the same as in file2 + * 2) the graph does not match, i.e same names (absolute path) + * 3) objects with the same name are not of the same type *------------------------------------------------------------------------- */ -hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, +hsize_t +diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, const char *grp2, trav_info_t *info2, - trav_table_t *table, diff_opt_t *options) + trav_table_t *table, diff_opt_t *opts) { hsize_t nfound = 0; unsigned i; - - const char * grp1_path = ""; - const char * grp2_path = ""; - char * obj1_fullpath = NULL; - char * obj2_fullpath = NULL; - diff_args_t argdata; - size_t idx1 = 0; - size_t idx2 = 0; - + int ret_value = opts->err_stat; + const char *grp1_path = ""; + const char *grp2_path = ""; + char *obj1_fullpath = NULL; + char *obj2_fullpath = NULL; + diff_args_t argdata; + size_t idx1 = 0; + size_t idx2 = 0; h5difftrace("diff_match start\n"); /* @@ -1081,85 +1003,89 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, grp2_path = grp2; /*------------------------------------------------------------------------- - * regarding the return value of h5diff (0, no difference in files, 1 difference ) - * 1) the number of objects in file1 must be the same as in file2 - * 2) the graph must match, i.e same names (absolute path) - * 3) objects with the same name must be of the same type - *------------------------------------------------------------------------- - */ + * regarding the return value of h5diff (0, no difference in files, 1 difference ) + * 1) the number of objects in file1 must be the same as in file2 + * 2) the graph must match, i.e same names (absolute path) + * 3) objects with the same name must be of the same type + *------------------------------------------------------------------------- + */ /* not valid compare used when --exclude-path option is used */ - if (!options->exclude_path) - { + if (!opts->exclude_path) { /* number of different objects */ - if ( info1->nused != info2->nused ) - { - options->contents = 0; + if (info1->nused != info2->nused) { + opts->contents = 0; } } /* objects in one file and not the other */ - for( i = 0; i < table->nobjs; i++) - { - if( table->objs[i].flags[0] != table->objs[i].flags[1] ) - { - options->contents = 0; + for(i = 0; i < table->nobjs; i++) { + if(table->objs[i].flags[0] != table->objs[i].flags[1]) { + opts->contents = 0; break; } } - /*------------------------------------------------------------------------- - * do the diff for common objects - *------------------------------------------------------------------------- - */ + * do the diff for common objects + *------------------------------------------------------------------------- + */ #ifdef H5_HAVE_PARALLEL { - char *workerTasks = (char*)HDmalloc((g_nTasks - 1) * sizeof(char)); - int n; - int busyTasks = 0; - struct diffs_found nFoundbyWorker; - struct diff_mpi_args args; - int havePrintToken = 1; - MPI_Status Status; - - /*set all tasks as free */ - HDmemset(workerTasks, 1, (g_nTasks - 1)); + char *workerTasks = (char*)HDmalloc((g_nTasks - 1) * sizeof(char)); + int n; + int busyTasks = 0; + struct diffs_found nFoundbyWorker; + struct diff_mpi_args args; + int havePrintToken = 1; + MPI_Status Status; + + /*set all tasks as free */ + HDmemset(workerTasks, 1, (g_nTasks - 1)); #endif - for(i = 0; i < table->nobjs; i++) - { - if( table->objs[i].flags[0] && table->objs[i].flags[1]) - { + for(i = 0; i < table->nobjs; i++) { + h5diffdebug3("diff for common objects[%d] - errstat:%d\n", i, opts->err_stat); + if(table->objs[i].flags[0] && table->objs[i].flags[1]) { /* make full path for obj1 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) - goto out; + if(HDasprintf(&obj1_fullpath, "%s%s", grp1_path, table->objs[i].name) < 0) { + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); + } #else /* H5_HAVE_ASPRINTF */ - obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1); - HDstrcpy(obj1_fullpath, grp1_path); - HDstrcat(obj1_fullpath, table->objs[i].name); + if((obj1_fullpath = (char*)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); + } + else { + HDstrcpy(obj1_fullpath, grp1_path); + HDstrcat(obj1_fullpath, table->objs[i].name); + } #endif /* H5_HAVE_ASPRINTF */ + h5diffdebug2("diff_match path1 - %s\n", obj1_fullpath); /* make full path for obj2 */ #ifdef H5_HAVE_ASPRINTF /* Use the asprintf() routine, since it does what we're trying to do below */ - if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) - goto out; + if(HDasprintf(&obj2_fullpath, "%s%s", grp2_path, table->objs[i].name) < 0) { + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); + } #else /* H5_HAVE_ASPRINTF */ - obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1); - HDstrcpy(obj2_fullpath, grp2_path); - HDstrcat(obj2_fullpath, table->objs[i].name); + if((obj2_fullpath = (char*)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { + HERROR(1, H5E_tools_min_id_g, "name buffer allocation failed"); + } + else { + HDstrcpy(obj2_fullpath, grp2_path); + HDstrcat(obj2_fullpath, table->objs[i].name); + } #endif /* H5_HAVE_ASPRINTF */ + h5diffdebug2("diff_match path2 - %s\n", obj2_fullpath); /* get index to figure out type of the object in file1 */ - while(info1->paths[idx1].path && - (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) + while(info1->paths[idx1].path && (HDstrcmp(obj1_fullpath, info1->paths[idx1].path) != 0)) idx1++; /* get index to figure out type of the object in file2 */ - while(info2->paths[idx2].path && - (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) + while(info2->paths[idx2].path && (HDstrcmp(obj2_fullpath, info2->paths[idx2].path) != 0)) idx2++; /* Set argdata to pass other args into diff() */ @@ -1167,16 +1093,14 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, argdata.type[1] = info2->paths[idx2].type; argdata.is_same_trgobj = table->objs[i].is_same_trgobj; - options->cmn_objs = 1; - if(!g_Parallel) - { + opts->cmn_objs = 1; + if(!g_Parallel) { nfound += diff(file1_id, obj1_fullpath, file2_id, obj2_fullpath, - options, &argdata); + opts, &argdata); } /* end if */ #ifdef H5_HAVE_PARALLEL - else - { + else { int workerFound = 0; h5difftrace("Beginning of big else block\n"); @@ -1190,8 +1114,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /*Set up args to pass to worker task. */ if(HDstrlen(obj1_fullpath) > 255 || - HDstrlen(obj2_fullpath) > 255) - { + HDstrlen(obj2_fullpath) > 255) { printf("The parallel diff only supports object names up to 255 characters\n"); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ @@ -1199,32 +1122,29 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* set args struct to pass */ HDstrcpy(args.name1, obj1_fullpath); HDstrcpy(args.name2, obj2_fullpath); - args.options = *options; + args.opts = *opts; args.argdata.type[0] = info1->paths[idx1].type; args.argdata.type[1] = info2->paths[idx2].type; args.argdata.is_same_trgobj = table->objs[i].is_same_trgobj; /* if there are any outstanding print requests, let's handle one. */ - if(busyTasks > 0) - { + if(busyTasks > 0) { int incomingMessage; /* check if any tasks freed up, and didn't need to print. */ MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &incomingMessage, &Status); /* first block*/ - if(incomingMessage) - { + if(incomingMessage) { workerTasks[Status.MPI_SOURCE - 1] = 1; MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; } /* end if */ /* check to see if the print token was returned. */ - if(!havePrintToken) - { + if(!havePrintToken) { /* If we don't have the token, someone is probably sending us output */ print_incoming_data(); @@ -1236,19 +1156,17 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, workerTasks[Status.MPI_SOURCE - 1] = 1; MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; havePrintToken = 1; } /* end if */ } /* end if */ /* check to see if anyone needs the print token. */ - if(havePrintToken) - { + if(havePrintToken) { /* check incoming queue for print token requests */ MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &incomingMessage, &Status); - if(incomingMessage) - { + if(incomingMessage) { MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status); MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); havePrintToken = 0; @@ -1259,10 +1177,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, /* check array of tasks to see which ones are free. * Manager task never does work, so freeTasks[0] is really * worker task 0. */ - for(n = 1; (n < g_nTasks) && !workerFound; n++) - { - if(workerTasks[n-1]) - { + for(n = 1; (n < g_nTasks) && !workerFound; n++) { + if(workerTasks[n-1]) { /* send file id's and names to first free worker */ MPI_Send(&args, sizeof(args), MPI_BYTE, n, MPI_TAG_ARGS, MPI_COMM_WORLD); @@ -1275,55 +1191,47 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end if */ } /* end for */ - if(!workerFound) - { + if(!workerFound) { /* if they were all busy, we've got to wait for one free up * before we can move on. If we don't have the token, some * task is currently printing so we'll wait for that task to * return it. */ - if(!havePrintToken) - { - while(!havePrintToken) - { + if(!havePrintToken) { + while(!havePrintToken) { int incomingMessage; print_incoming_data(); MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status); - if(incomingMessage) - { + if(incomingMessage) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); havePrintToken = 1; nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; /* send this task the work unit. */ MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end if */ } /* end while */ } /* end if */ /* if we do have the token, check for task to free up, or wait for a task to request it */ - else - { + else { /* But first print all the data in our incoming queue */ print_incoming_data(); MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status); - if(Status.MPI_TAG == MPI_TAG_DONE) - { + if(Status.MPI_TAG == MPI_TAG_DONE) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end if */ - else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) - { + else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) { int incomingMessage; MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status); MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); - do - { + do { MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status); print_incoming_data(); @@ -1331,11 +1239,10 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; MPI_Send(&args, sizeof(args), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_ARGS, MPI_COMM_WORLD); } /* end else-if */ - else - { + else { printf("ERROR: Invalid tag (%d) received \n", Status.MPI_TAG); MPI_Abort(MPI_COMM_WORLD, 0); MPI_Finalize(); @@ -1350,27 +1257,22 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, HDfree(obj2_fullpath); } /* end if */ } /* end for */ - h5difftrace("done with for loop\n"); + h5diffdebug2("done with for loop - errstat:%d\n", opts->err_stat); #ifdef H5_HAVE_PARALLEL - if(g_Parallel) - { + if(g_Parallel) { /* make sure all tasks are done */ - while(busyTasks > 0) - { + while(busyTasks > 0) { MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &Status); - if(Status.MPI_TAG == MPI_TAG_DONE) - { + if(Status.MPI_TAG == MPI_TAG_DONE) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_DONE, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; } /* end if */ - else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) - { + else if(Status.MPI_TAG == MPI_TAG_TOK_REQUEST) { MPI_Recv(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_REQUEST, MPI_COMM_WORLD, &Status); - if(havePrintToken) - { + if(havePrintToken) { int incomingMessage; MPI_Send(NULL, 0, MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); @@ -1383,17 +1285,15 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; } /* end if */ /* someone else must have it...wait for them to return it, then give it to the task that just asked for it. */ - else - { + else { int source = Status.MPI_SOURCE; int incomingMessage; - do - { + do { MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &incomingMessage, &Status); print_incoming_data(); @@ -1402,21 +1302,19 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, MPI_ANY_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; MPI_Send(NULL, 0, MPI_BYTE, source, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD); } /* end else */ } /* end else-if */ - else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN) - { + else if(Status.MPI_TAG == MPI_TAG_TOK_RETURN) { MPI_Recv(&nFoundbyWorker, sizeof(nFoundbyWorker), MPI_BYTE, Status.MPI_SOURCE, MPI_TAG_TOK_RETURN, MPI_COMM_WORLD, &Status); nfound += nFoundbyWorker.nfound; - options->not_cmp = options->not_cmp | nFoundbyWorker.not_cmp; + opts->not_cmp = opts->not_cmp | nFoundbyWorker.not_cmp; busyTasks--; havePrintToken = 1; } /* end else-if */ - else if(Status.MPI_TAG == MPI_TAG_PRINT_DATA) - { + else if(Status.MPI_TAG == MPI_TAG_PRINT_DATA) { char data[PRINT_DATA_MAX_SIZE + 1]; HDmemset(data, 0, PRINT_DATA_MAX_SIZE + 1); @@ -1424,8 +1322,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, printf("%s", data); } /* end else-if */ - else - { + else { printf("ph5diff-manager: ERROR!! Invalid tag (%d) received \n", Status.MPI_TAG); MPI_Abort(MPI_COMM_WORLD, 0); } /* end else */ @@ -1444,10 +1341,12 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, #endif /* H5_HAVE_PARALLEL */ out: - /* free table */ + opts->err_stat = opts->err_stat | ret_value; + +/* free table */ if (table) trav_table_free(table); - h5difftrace("diff_match finish\n"); + h5diffdebug2("diff_match finish:%d\n", nfound); return nfound; } @@ -1456,47 +1355,36 @@ out: /*------------------------------------------------------------------------- * Function: diff * - * Purpose: switch between types and choose the diff function - * TYPE is either - * H5G_GROUP Object is a group - * H5G_DATASET Object is a dataset - * H5G_TYPE Object is a named data type - * H5G_LINK Object is a symbolic link - * - * Return: Number of differences found + * Purpose: switch between types and choose the diff function + * TYPE is either + * H5G_GROUP Object is a group + * H5G_DATASET Object is a dataset + * H5G_TYPE Object is a named data type + * H5G_LINK Object is a symbolic link * - * Programmer: Jonathan Kim - * - Move follow symlinks code toward top. (March 2812) - * - Add following symlinks feature (Feb 11,2010) - * - Change to use diff_args_t to pass the rest of args. - * Passing through it instead of individual args provides smoother - * extensibility through its members along with MPI code update for ph5diff - * as it doesn't require interface change. - * (May 6,2011) - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * Date: May 9, 2003 + * Return: Number of differences found *------------------------------------------------------------------------- */ - -hsize_t diff(hid_t file1_id, +hsize_t +diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, - diff_opt_t * options, + diff_opt_t * opts, diff_args_t *argdata) { - hid_t dset1_id = (-1); - hid_t dset2_id = (-1); - hid_t type1_id = (-1); - hid_t type2_id = (-1); - hid_t grp1_id = (-1); - hid_t grp2_id = (-1); - int ret; - hbool_t is_dangle_link1 = FALSE; - hbool_t is_dangle_link2 = FALSE; - hbool_t is_hard_link = FALSE; - hsize_t nfound = 0; + int ret_value = opts->err_stat; + int status = -1; + hid_t dset1_id = -1; + hid_t dset2_id = -1; + hid_t type1_id = -1; + hid_t type2_id = -1; + hid_t grp1_id = -1; + hid_t grp2_id = -1; + hbool_t is_dangle_link1 = FALSE; + hbool_t is_dangle_link2 = FALSE; + hbool_t is_hard_link = FALSE; + hsize_t nfound = 0; h5trav_type_t object_type; /* to get link info */ @@ -1506,11 +1394,11 @@ hsize_t diff(hid_t file1_id, h5difftrace("diff start\n"); /*init link info struct */ - HDmemset(&linkinfo1,0,sizeof(h5tool_link_info_t)); - HDmemset(&linkinfo2,0,sizeof(h5tool_link_info_t)); + HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t)); + HDmemset(&linkinfo2, 0, sizeof(h5tool_link_info_t)); /* pass how to handle printing warnings to linkinfo option */ - if(print_warn(options)) + if(print_warn(opts)) linkinfo1.opt.msg_mode = linkinfo2.opt.msg_mode = 1; /* for symbolic links, take care follow symlink and no dangling link @@ -1518,78 +1406,69 @@ hsize_t diff(hid_t file1_id, if (argdata->type[0] == H5TRAV_TYPE_LINK || argdata->type[0] == H5TRAV_TYPE_UDLINK || argdata->type[1] == H5TRAV_TYPE_LINK || - argdata->type[1] == H5TRAV_TYPE_UDLINK ) - { + argdata->type[1] == H5TRAV_TYPE_UDLINK) { /* * check dangling links for path1 and path2 */ /* target object1 - get type and name */ - ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, options->follow_links); + if ((status = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, opts->follow_links)) < 0) + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); + /* dangling link */ - if (ret == 0) - { - if (options->no_dangle_links) - { + if (status == 0) { + if (opts->no_dangle_links) { /* dangling link is error */ - if(options->m_verbose) + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path1); - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "dangling link is error"); } else is_dangle_link1 = TRUE; } - else if (ret < 0) - goto out; /* target object2 - get type and name */ - ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, options->follow_links ); + if ((status = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, opts->follow_links)) < 0) + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5tools_get_symlink_info failed"); /* dangling link */ - if (ret == 0) - { - if (options->no_dangle_links) - { + if (status == 0) { + if (opts->no_dangle_links) { /* dangling link is error */ - if(options->m_verbose) + if(opts->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", path2); - goto out; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "dangling link is error"); } else is_dangle_link2 = TRUE; } - else if (ret < 0) - goto out; /* found dangling link */ - if (is_dangle_link1 || is_dangle_link2) - goto out2; + if (is_dangle_link1 || is_dangle_link2) { + HGOTO_DONE(0); + } /* follow symbolic link option */ - if (options->follow_links) - { + if (opts->follow_links) { if (linkinfo1.linfo.type == H5L_TYPE_SOFT || linkinfo1.linfo.type == H5L_TYPE_EXTERNAL) argdata->type[0] = (h5trav_type_t)linkinfo1.trg_type; - if (linkinfo2.linfo.type == H5L_TYPE_SOFT || - linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) + if (linkinfo2.linfo.type == H5L_TYPE_SOFT || linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) argdata->type[1] = (h5trav_type_t)linkinfo2.trg_type; } } /* if objects are not the same type */ - if (argdata->type[0] != argdata->type[1]) - { - if (options->m_verbose||options->m_list_not_cmp) - { + if (argdata->type[0] != argdata->type[1]) { + if (opts->m_verbose||opts->m_list_not_cmp) { parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", path1, get_type(argdata->type[0]), path2, get_type(argdata->type[1])); } - options->not_cmp=1; + opts->not_cmp = 1; /* TODO: will need to update non-comparable is different - * options->contents = 0; + * opts->contents = 0; */ - goto out2; + HGOTO_DONE(0); } else /* now both object types are same */ object_type = argdata->type[0]; @@ -1602,88 +1481,79 @@ hsize_t diff(hid_t file1_id, * * Perform this to match the outputs as bypassing. */ - if (argdata->is_same_trgobj) - { + if (argdata->is_same_trgobj) { h5difftrace("argdata->is_same_trgobj\n"); is_hard_link = (object_type == H5TRAV_TYPE_DATASET || object_type == H5TRAV_TYPE_NAMED_DATATYPE || object_type == H5TRAV_TYPE_GROUP); - if (options->follow_links || is_hard_link) - { + if (opts->follow_links || is_hard_link) { /* print information is only verbose option is used */ - if(options->m_verbose || options->m_report) - { - switch(object_type) - { + if(opts->m_verbose || opts->m_report) { + switch(object_type) { case H5TRAV_TYPE_DATASET: - do_print_objname("dataset", path1, path2, options); + do_print_objname("dataset", path1, path2, opts); break; case H5TRAV_TYPE_NAMED_DATATYPE: - do_print_objname("datatype", path1, path2, options); + do_print_objname("datatype", path1, path2, opts); break; case H5TRAV_TYPE_GROUP: - do_print_objname("group", path1, path2, options); + do_print_objname("group", path1, path2, opts); break; case H5TRAV_TYPE_LINK: - do_print_objname("link", path1, path2, options); + do_print_objname("link", path1, path2, opts); break; case H5TRAV_TYPE_UDLINK: if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) - do_print_objname("external link", path1, path2, options); + do_print_objname("external link", path1, path2, opts); else - do_print_objname ("user defined link", path1, path2, options); + do_print_objname ("user defined link", path1, path2, opts); break; case H5TRAV_TYPE_UNKNOWN: default: parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(object_type) ); - options->not_cmp = 1; + opts->not_cmp = 1; break; } /* switch(type)*/ print_found(nfound); - } /* if(options->m_verbose || options->m_report) */ + } /* if(opts->m_verbose || opts->m_report) */ /* exact same, so comparison is done */ - goto out2; + HGOTO_DONE(0); } } - switch(object_type) - { + switch(object_type) { /*---------------------------------------------------------------------- * H5TRAV_TYPE_DATASET *---------------------------------------------------------------------- */ case H5TRAV_TYPE_DATASET: if((dset1_id = H5Dopen2(file1_id, path1, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed"); if((dset2_id = H5Dopen2(file2_id, path2, H5P_DEFAULT)) < 0) - goto out; - /* verbose (-v) and report (-r) mode */ - if(options->m_verbose || options->m_report) - { - do_print_objname("dataset", path1, path2, options); - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 failed"); + /* verbose (-v) and report (-r) mode */ + if(opts->m_verbose || opts->m_report) { + do_print_objname("dataset", path1, path2, opts); + nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if(options->m_quiet) - { - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + else if(opts->m_quiet) { + nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); } - /* the rest (-c, none, ...) */ - else - { - nfound = diff_dataset(file1_id, file2_id, path1, path2, options); + /* the rest (-c, none, ...) */ + else { + nfound = diff_dataset(file1_id, file2_id, path1, path2, opts); /* print info if difference found */ - if (nfound) - { - do_print_objname("dataset", path1, path2, options); + if (nfound) { + do_print_objname("dataset", path1, path2, opts); print_found(nfound); } } - + h5diffdebug2("diff after dataset:%d\n", nfound); /*--------------------------------------------------------- * compare attributes @@ -1692,13 +1562,13 @@ hsize_t diff(hid_t file1_id, *--------------------------------------------------------- */ if(path1) - nfound += diff_attr(dset1_id, dset2_id, path1, path2, options); + nfound += diff_attr(dset1_id, dset2_id, path1, path2, opts); if(H5Dclose(dset1_id) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed"); if(H5Dclose(dset2_id) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dclose failed"); break; /*---------------------------------------------------------------------- @@ -1707,21 +1577,21 @@ hsize_t diff(hid_t file1_id, */ case H5TRAV_TYPE_NAMED_DATATYPE: if((type1_id = H5Topen2(file1_id, path1, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed"); if((type2_id = H5Topen2(file2_id, path2, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Topen2 failed"); - if((ret = H5Tequal(type1_id, type2_id)) < 0) - goto out; + if((status = H5Tequal(type1_id, type2_id)) < 0) + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tequal failed"); /* if H5Tequal is > 0 then the datatypes refer to the same datatype */ - nfound = (ret > 0) ? 0 : 1; + nfound = (status > 0) ? 0 : 1; - if(print_objname(options,nfound)) - do_print_objname("datatype", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("datatype", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(options->m_verbose) + if(opts->m_verbose) print_found(nfound); /*----------------------------------------------------------------- @@ -1731,12 +1601,12 @@ hsize_t diff(hid_t file1_id, *----------------------------------------------------------------- */ if(path1) - nfound += diff_attr(type1_id, type2_id, path1, path2, options); + nfound += diff_attr(type1_id, type2_id, path1, path2, opts); if(H5Tclose(type1_id) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed"); if(H5Tclose(type2_id) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose failed"); break; /*---------------------------------------------------------------------- @@ -1744,17 +1614,17 @@ hsize_t diff(hid_t file1_id, *---------------------------------------------------------------------- */ case H5TRAV_TYPE_GROUP: - if(print_objname(options, nfound)) - do_print_objname("group", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("group", path1, path2, opts); /* always print the number of differences found in verbose mode */ - if(options->m_verbose) + if(opts->m_verbose) print_found(nfound); if((grp1_id = H5Gopen2(file1_id, path1, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); if((grp2_id = H5Gopen2(file2_id, path2, H5P_DEFAULT)) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); /*----------------------------------------------------------------- * compare attributes @@ -1763,12 +1633,12 @@ hsize_t diff(hid_t file1_id, *----------------------------------------------------------------- */ if(path1) - nfound += diff_attr(grp1_id, grp2_id, path1, path2, options); + nfound += diff_attr(grp1_id, grp2_id, path1, path2, opts); if(H5Gclose(grp1_id) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); if(H5Gclose(grp2_id) < 0) - goto out; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Gclose failed"); break; @@ -1778,19 +1648,19 @@ hsize_t diff(hid_t file1_id, */ case H5TRAV_TYPE_LINK: { - ret = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); + status = HDstrcmp(linkinfo1.trg_path, linkinfo2.trg_path); - /* if the target link name is not same then the links are "different" */ - nfound = (ret != 0) ? 1 : 0; + /* if the target link name is not same then the links are "different" */ + nfound = (status != 0) ? 1 : 0; - if(print_objname(options, nfound)) - do_print_objname("link", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("link", path1, path2, opts); - /* always print the number of differences found in verbose mode */ - if(options->m_verbose) - print_found(nfound); + /* always print the number of differences found in verbose mode */ + if(opts->m_verbose) + print_found(nfound); - } + } break; /*---------------------------------------------------------------------- @@ -1799,101 +1669,85 @@ hsize_t diff(hid_t file1_id, */ case H5TRAV_TYPE_UDLINK: { - /* Only external links will have a query function registered */ - if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) - { - /* If the buffers are the same size, compare them */ - if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) - { - ret = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); - } - else - ret = 1; + /* Only external links will have a query function registered */ + if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) { + /* If the buffers are the same size, compare them */ + if(linkinfo1.linfo.u.val_size == linkinfo2.linfo.u.val_size) { + status = HDmemcmp(linkinfo1.trg_path, linkinfo2.trg_path, linkinfo1.linfo.u.val_size); + } + else + status = 1; - /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links - * are "different" extlinkinfo#.path is combination string of - * file_name and obj_name - */ - nfound = (ret != 0) ? 1 : 0; + /* if "linkinfo1.trg_path" != "linkinfo2.trg_path" then the links + * are "different" extlinkinfo#.path is combination string of + * file_name and obj_name + */ + nfound = (status != 0) ? 1 : 0; - if(print_objname(options, nfound)) - do_print_objname("external link", path1, path2, options); + if(print_objname(opts, nfound)) + do_print_objname("external link", path1, path2, opts); - } /* end if */ - else - { - /* If one or both of these links isn't an external link, we can only - * compare information from H5Lget_info since we don't have a query - * function registered for them. - * - * If the link classes or the buffer length are not the - * same, the links are "different" - */ - if((linkinfo1.linfo.type != linkinfo2.linfo.type) || - (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size)) - nfound = 1; - else - nfound = 0; - - if (print_objname (options, nfound)) - do_print_objname ("user defined link", path1, path2, options); - } /* end else */ + } /* end if */ + else { + /* If one or both of these links isn't an external link, we can only + * compare information from H5Lget_info since we don't have a query + * function registered for them. + * + * If the link classes or the buffer length are not the + * same, the links are "different" + */ + if((linkinfo1.linfo.type != linkinfo2.linfo.type) || + (linkinfo1.linfo.u.val_size != linkinfo2.linfo.u.val_size)) + nfound = 1; + else + nfound = 0; - /* always print the number of differences found in verbose mode */ - if(options->m_verbose) - print_found(nfound); + if (print_objname (opts, nfound)) + do_print_objname ("user defined link", path1, path2, opts); + } /* end else */ + + /* always print the number of differences found in verbose mode */ + if(opts->m_verbose) + print_found(nfound); } break; case H5TRAV_TYPE_UNKNOWN: default: - if(options->m_verbose) + if(opts->m_verbose) parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(object_type) ); - options->not_cmp = 1; + opts->not_cmp = 1; break; } - /* free link info buffer */ - if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); - if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); - - return nfound; - -out: - options->err_stat = 1; +done: + opts->err_stat = opts->err_stat | ret_value; -out2: /*----------------------------------- * handle dangling link(s) */ /* both path1 and path2 are dangling links */ - if(is_dangle_link1 && is_dangle_link2) - { - if(print_objname(options, nfound)) - { - do_print_objname("dangling link", path1, path2, options); + if(is_dangle_link1 && is_dangle_link2) { + if(print_objname(opts, nfound)) { + do_print_objname("dangling link", path1, path2, opts); print_found(nfound); } } /* path1 is dangling link */ - else if (is_dangle_link1) - { - if(options->m_verbose) + else if (is_dangle_link1) { + if(opts->m_verbose) parallel_print("obj1 <%s> is a dangling link.\n", path1); nfound++; - if(print_objname(options, nfound)) + if(print_objname(opts, nfound)) print_found(nfound); } /* path2 is dangling link */ - else if (is_dangle_link2) - { - if(options->m_verbose) + else if (is_dangle_link2) { + if(opts->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", path2); nfound++; - if(print_objname(options, nfound)) + if(print_objname(opts, nfound)) print_found(nfound); } @@ -1906,13 +1760,16 @@ out2: /* close */ /* disable error reporting */ H5E_BEGIN_TRY { + H5Dclose(dset1_id); + H5Dclose(dset2_id); H5Tclose(type1_id); H5Tclose(type2_id); H5Gclose(grp1_id); - H5Tclose(grp2_id); + H5Gclose(grp2_id); /* enable error reporting */ } H5E_END_TRY; - h5difftrace("diff finish\n"); + + h5diffdebug3("diff finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 0226e83..26bcd95 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -38,7 +38,7 @@ /*------------------------------------------------------------------------- * This is used to pass multiple args into diff(). - * Passing this instead of several each arg provides smoother extensibility + * Passing this instead of several each arg provides smoother extensibility * through its members along with MPI code for ph5diff * as it doesn't require interface change. *------------------------------------------------------------------------*/ @@ -95,13 +95,13 @@ H5TOOLS_DLL hsize_t h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, - diff_opt_t *options); + diff_opt_t *opts); H5TOOLS_DLL hsize_t diff( hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, - diff_opt_t *options, + diff_opt_t *opts, diff_args_t *argdata); #ifdef H5_HAVE_PARALLEL @@ -125,18 +125,18 @@ hsize_t diff_dataset( hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, - diff_opt_t *options); + diff_opt_t *opts); hsize_t diff_datasetid( hid_t dset1_id, hid_t dset2_id, const char *obj1_name, const char *obj2_name, - diff_opt_t *options); + diff_opt_t *opts); hsize_t diff_match( hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, const char *grp2, trav_info_t *info2, - trav_table_t *table, diff_opt_t *options ); + trav_table_t *table, diff_opt_t *opts ); hsize_t diff_array( void *_mem1, void *_mem2, @@ -144,7 +144,7 @@ hsize_t diff_array( void *_mem1, hsize_t hyper_start, int rank, hsize_t *dims, - diff_opt_t *options, + diff_opt_t *opts, const char *name1, const char *name2, hid_t m_type, @@ -162,7 +162,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ hsize_t *maxdim2, const char *obj1_name, const char *obj2_name, - diff_opt_t *options, + diff_opt_t *opts, int is_compound); @@ -170,7 +170,7 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, - diff_opt_t *options); + diff_opt_t *opts); /*------------------------------------------------------------------------- @@ -187,10 +187,10 @@ const char* get_class(H5T_class_t tclass); const char* get_sign(H5T_sign_t sign); void print_dimensions (int rank, hsize_t *dims); herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, - hid_t *m_tid1, hid_t *m_tid2, + hid_t *m_tid1, hid_t *m_tid2, size_t *m_size1, size_t *m_size2); /* in h5diff.c */ -int print_objname(diff_opt_t *options, hsize_t nfound); +int print_objname(diff_opt_t *opts, hsize_t nfound); void do_print_objname (const char *OBJ, const char *path1, const char *path2, diff_opt_t * opts); void do_print_attrname (const char *attr, const char *path1, const char *path2); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1d53ec7..1125e45 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -131,21 +131,21 @@ typedef struct mcomp_t { *------------------------------------------------------------------------- */ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, - hid_t region2_id, diff_opt_t *options); + hid_t region2_id, diff_opt_t *opts); static hbool_t all_zero(const void *_mem, size_t size); static int ull2float(unsigned long long ull_value, float *f_value); static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, unsigned u, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, const char *obj1, const char *obj2, int *ph); + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, const char *obj1, const char *obj2, int *ph); -static hbool_t equal_float(float value, float expected, diff_opt_t *options); -static hbool_t equal_double(double value, double expected, diff_opt_t *options); + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); +static hbool_t equal_float(float value, float expected, diff_opt_t *opts); +static hbool_t equal_double(double value, double expected, diff_opt_t *opts); #if H5_SIZEOF_LONG_DOUBLE !=0 -static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options); +static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts); #endif -static int print_data(diff_opt_t *options); +static int print_data(diff_opt_t *opts); static void print_pos(int *ph, int pp, hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, const char *obj1, const char *obj2); static void print_char_pos(int *ph, int pp, hsize_t curr_pos, unsigned u, @@ -153,17 +153,17 @@ static void print_char_pos(int *ph, int pp, hsize_t curr_pos, unsigned u, static void h5diff_print_char(char ch); static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, const char *obj1, const char *obj2, + diff_opt_t *opts, const char *obj1, const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ int *ph, /*print header */ mcomp_t *members); /*compound members */ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); #if H5_SIZEOF_LONG_DOUBLE !=0 static hsize_t diff_ldouble(unsigned char *mem1, @@ -174,50 +174,50 @@ static hsize_t diff_ldouble(unsigned char *mem1, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); #endif static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph); /*------------------------------------------------------------------------- @@ -254,11 +254,6 @@ static void close_member_types(mcomp_t *members); * Purpose: compare two memory buffers; * * Return: number of differences found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 12, 2003 - * *------------------------------------------------------------------------- */ @@ -269,7 +264,7 @@ hsize_t diff_array( hsize_t hyper_start, int rank, hsize_t *dims, - diff_opt_t *options, + diff_opt_t *opts, const char *name1, const char *name2, hid_t m_type, @@ -288,7 +283,7 @@ hsize_t diff_array( mcomp_t members; H5T_class_t type_class; - h5difftrace("diff_array start\n"); + h5diffdebug2("diff_array start - errstat:%d\n", opts->err_stat); /* get the size. */ size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); @@ -327,36 +322,36 @@ hsize_t diff_array( */ case H5T_FLOAT: if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) - nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_float(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) - nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_double(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); #if H5_SIZEOF_LONG_DOUBLE != 0 else if (H5Tequal(m_type, H5T_NATIVE_LDOUBLE)) - nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ldouble(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); #endif break; case H5T_INTEGER: if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) - nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_schar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) - nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_uchar(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) - nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_short(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) - nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ushort(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_INT)) - nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_int(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_UINT)) - nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_uint(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LONG)) - nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_long(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) - nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ulong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) - nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_llong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) - nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, options, name1, name2, &ph); + nfound = diff_ullong(mem1, mem2, nelmts, hyper_start, rank, dims, acc, pos, opts, name1, name2, &ph); break; /*------------------------------------------------------------------------- @@ -374,16 +369,14 @@ hsize_t diff_array( HDmemset(&members, 0, sizeof(mcomp_t)); get_member_types(m_type, &members); for (i = 0; i < nelmts; i++) { - nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, options, + nfound += diff_datum(mem1 + i * size, mem2 + i * size, m_type, i, rank, dims, acc, pos, opts, name1, name2, container1_id, container2_id, &ph, &members); - if (options->n && nfound >= options->count) { - close_member_types(&members); - return nfound; - } + if (opts->n && nfound >= opts->count) + break; } /* i */ close_member_types(&members); } /* switch */ - h5difftrace("diff_array finish\n"); + h5diffdebug3("diff_array finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } @@ -395,10 +388,6 @@ hsize_t diff_array( * * Return: number of differences found * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: October 29, 2003 - * * The comparison of the 2 buffers read from the files is made datum by datum. * * H5T_INTEGER and H5T_FLOAT @@ -434,37 +423,35 @@ static hsize_t diff_datum( hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, + diff_opt_t *opts, const char *obj1, const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ - int *ph, /*print header */ - mcomp_t *members) /*compound members */ + int *ph, /*print header */ + mcomp_t *members) /*compound members */ { - unsigned char *mem1 = (unsigned char*) _mem1; - unsigned char *mem2 = (unsigned char*) _mem2; - unsigned u; - hid_t memb_type; - size_t type_size; - H5T_sign_t type_sign; - H5T_class_t type_class; - size_t offset; - unsigned nmembs; - unsigned j; - hsize_t nelmts; - size_t size = 0; - hbool_t iszero1; - hbool_t iszero2; - hid_t obj1_id; - hid_t obj2_id; - hsize_t nfound = 0; /* differences found */ - int ret = 0; /* check return error */ - float f1, f2; - double per; - hbool_t both_zero; + unsigned char *mem1 = (unsigned char*) _mem1; + unsigned char *mem2 = (unsigned char*) _mem2; + unsigned u; + size_t type_size; + H5T_sign_t type_sign; + H5T_class_t type_class; + size_t offset; + unsigned nmembs; + unsigned j; + hsize_t nelmts; + size_t size = 0; + hbool_t iszero1; + hbool_t iszero2; + hsize_t nfound = 0; /* differences found */ + hsize_t ret_value = opts->err_stat; + float f1, f2; + double per; + hbool_t both_zero; h5difftrace("diff_datum start\n"); + type_size = H5Tget_size(m_type); type_class = H5Tget_class(m_type); @@ -477,14 +464,14 @@ static hsize_t diff_datum( type_class != H5T_STRING && type_class != H5T_VLEN && HDmemcmp(mem1, mem2, type_size) == 0) - return 0; + HGOTO_DONE(opts->err_stat); switch (H5Tget_class(m_type)) { case H5T_NO_CLASS: case H5T_TIME: case H5T_NCLASSES: default: - HDassert(0); + HGOTO_ERROR(1, H5E_tools_min_id_g, "Invalid type class"); break; /*------------------------------------------------------------------------- @@ -493,15 +480,17 @@ static hsize_t diff_datum( */ case H5T_COMPOUND: h5difftrace("diff_datum H5T_COMPOUND\n"); + { + hid_t memb_type = -1; + nmembs = members->n; - nmembs = members->n; - - for (j = 0; j < nmembs; j++) { - offset = members->offsets[j]; - memb_type = members->ids[j]; + for (j = 0; j < nmembs; j++) { + offset = members->offsets[j]; + memb_type = members->ids[j]; - nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members->m[j]); + nfound += diff_datum(mem1 + offset, mem2 + offset, memb_type, index, + rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members->m[j]); + } } break; @@ -531,6 +520,7 @@ static hsize_t diff_datum( size1 = HDstrlen(s1); else size1 = 0; + /* Get pointer to second string */ s2 = *(char**) mem2; if (s2) @@ -546,14 +536,17 @@ static hsize_t diff_datum( size1 = HDstrlen(s1); else size1 = 0; + if (size1 > size_mtype) size1 = size_mtype; + /* Get pointer to second string */ s2 = (char*) mem2; if (s2) size2 = HDstrlen(s2); else size2 = 0; + if (size2 > size_mtype) size2 = size_mtype; } @@ -561,6 +554,7 @@ static hsize_t diff_datum( /* Get pointer to first string */ s1 = (char *) mem1; size1 = size_mtype; + /* Get pointer to second string */ s2 = (char *) mem2; size2 = size_mtype; @@ -572,6 +566,8 @@ static hsize_t diff_datum( * of length of strings. * For now mimic the previous way. */ + h5diffdebug2("diff_datum string size:%d\n", size1); + h5diffdebug2("diff_datum string size:%d\n", size2); if (size1 != size2) { h5difftrace("diff_datum string sizes\n"); nfound++; @@ -592,15 +588,15 @@ static hsize_t diff_datum( /* check for NULL pointer for string */ if (s != NULL) { /* try fast compare first */ - if (HDmemcmp(s1, s2, size) == 0) { + if (HDmemcmp(s, sx, size) == 0) { if (size1 != size2) - if (print_data(options)) + if (print_data(opts)) for (u = size; u < sizex; u++) - character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); + character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph); } else for (u = 0; u < size; u++) - nfound += character_compare(s1 + u, s2 + u, index, u, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare(s + u, sx + u, index, u, rank, dims, acc, pos, opts, obj1, obj2, ph); } /* end check for NULL pointer for string */ } break; @@ -613,7 +609,7 @@ static hsize_t diff_datum( h5difftrace("diff_datum H5T_BITFIELD\n"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); break; /*------------------------------------------------------------------------- @@ -624,7 +620,7 @@ static hsize_t diff_datum( h5difftrace("diff_datum H5T_OPAQUE\n"); /* byte-by-byte comparison */ for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); break; /*------------------------------------------------------------------------- @@ -664,7 +660,7 @@ static hsize_t diff_datum( * don't attempt to convert them - just report errors. */ nfound += 1; - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); @@ -674,7 +670,7 @@ static hsize_t diff_datum( /* Both enum values were valid */ if (HDstrcmp(enum_name1, enum_name2) != 0) { nfound = 1; - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(S_FORMAT, enum_name1, enum_name2); @@ -682,7 +678,7 @@ static hsize_t diff_datum( } else { for (u = 0; u < type_size; u++) - nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, options, obj1, obj2, ph); + nfound += character_compare_opt(mem1 + u, mem2 + u, index, rank, dims, acc, pos, opts, obj1, obj2, ph); } } /* enable error reporting */ @@ -696,8 +692,9 @@ static hsize_t diff_datum( */ case H5T_ARRAY: { + hid_t memb_type = -1; hsize_t adims[H5S_MAX_RANK]; - int ndims; + int ndims; /* get the array's base datatype for each element */ memb_type = H5Tget_super(m_type); @@ -711,7 +708,7 @@ static hsize_t diff_datum( nelmts *= adims[u]; for (u = 0; u < nelmts; u++) { nfound += diff_datum(mem1 + u * size, mem2 + u * size, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); + rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); } H5Tclose(memb_type); } @@ -725,7 +722,8 @@ static hsize_t diff_datum( iszero1 = all_zero(_mem1, H5Tget_size(m_type)); iszero2 = all_zero(_mem2, H5Tget_size(m_type)); if (iszero1 != iszero2) { - return 1; + nfound++; + HGOTO_DONE (opts->err_stat); } else if (!iszero1 && !iszero2) { /*------------------------------------------------------------------------- @@ -733,25 +731,32 @@ static hsize_t diff_datum( * Dataset region reference *------------------------------------------------------------------------- */ - if (type_size == H5R_DSET_REG_REF_BUF_SIZE) { - hid_t region1_id; - hid_t region2_id; + hid_t obj1_id = -1; + hid_t obj2_id = -1; - if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1)) < 0) - ret = -1; - if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2)) < 0) - ret = -1; - if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) - ret = -1; - if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) - ret = -1; + if (type_size == H5R_DSET_REG_REF_BUF_SIZE) { + hid_t region1_id = -1; + hid_t region2_id = -1; - if (ret == -1) { - options->err_stat = 1; - return 0; + if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference object 1 failed"); + } + if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference object 2 failed"); + } + if ((region1_id = H5Rget_region(container1_id, H5R_DATASET_REGION, _mem1)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 1 failed"); + } + if ((region2_id = H5Rget_region(container2_id, H5R_DATASET_REGION, _mem2)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_region object 2 failed"); } - nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, options); + nfound = diff_region(obj1_id, obj2_id, region1_id, region2_id, opts); + H5Oclose(obj1_id); H5Oclose(obj2_id); H5Sclose(region1_id); @@ -767,41 +772,41 @@ static hsize_t diff_datum( H5O_type_t obj1_type; H5O_type_t obj2_type; - if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) - ret = -1; - if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) - ret = -1; - if (ret == -1) { - options->err_stat = 1; - return 0; - } /* end if */ + if (H5Rget_obj_type2(container1_id, H5R_OBJECT, _mem1, &obj1_type) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 1 failed"); + } + if (H5Rget_obj_type2(container2_id, H5R_OBJECT, _mem2, &obj2_type) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rget_obj_type2 object 2 failed"); + } /* check object type */ - if (obj1_type != obj2_type) { - parallel_print( - "Different object types referenced: <%s> and <%s>", obj1, obj2); - options->not_cmp = 1; - return 0; - } + if (ret_value >= 0) + if (obj1_type != obj2_type) { + parallel_print("Different object types referenced: <%s> and <%s>", obj1, obj2); + opts->not_cmp = 1; + HGOTO_DONE (opts->err_stat); + } - if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0) - ret = -1; - if ((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0) - ret = -1; - if (ret == -1) { - options->err_stat = 1; - return 0; + if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference object 1 failed"); + } + if ((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2)) < 0) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "H5Rdereference object 2 failed"); } /* compare */ if (obj1_type == H5O_TYPE_DATASET) - nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, options); + nfound = diff_datasetid(obj1_id, obj2_id, NULL, NULL, opts); else { - if (options->m_verbose) + if (opts->m_verbose) parallel_print( "Warning: Comparison not possible of object types referenced: <%s> and <%s>\n", obj1, obj2); - options->not_cmp = 1; + opts->not_cmp = 1; } H5Oclose(obj1_id); @@ -815,18 +820,22 @@ static hsize_t diff_datum( *------------------------------------------------------------------------- */ case H5T_VLEN: - /* get the VL sequences's base datatype for each element */ - memb_type = H5Tget_super(m_type); - size = H5Tget_size(memb_type); + { + hid_t memb_type = -1; - /* get the number of sequence elements */ - nelmts = ((hvl_t *) mem1)->len; + /* get the VL sequences's base datatype for each element */ + memb_type = H5Tget_super(m_type); + size = H5Tget_size(memb_type); - for (j = 0; j < nelmts; j++) - nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, - rank, dims, acc, pos, options, obj1, obj2, container1_id, container2_id, ph, members); + /* get the number of sequence elements */ + nelmts = ((hvl_t *) mem1)->len; - H5Tclose(memb_type); + for (j = 0; j < nelmts; j++) + nfound += diff_datum(((char *) (((hvl_t *) mem1)->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, + rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); + + H5Tclose(memb_type); + } break; /*------------------------------------------------------------------------- @@ -842,13 +851,15 @@ static hsize_t diff_datum( if (type_size == 1 && type_sign != H5T_SGN_NONE) { char temp1_char; char temp2_char; - HDassert(type_size == sizeof(char)); + + if(type_size != sizeof(char)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not char size"); HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_char-temp2_char) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_char-temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -857,19 +868,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -878,19 +889,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent && ABS(temp1_char - temp2_char) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_char - temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -899,7 +910,7 @@ static hsize_t diff_datum( } } else if (temp1_char != temp2_char) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -915,14 +926,16 @@ static hsize_t diff_datum( else if (type_size == 1 && type_sign == H5T_SGN_NONE) { unsigned char temp1_uchar; unsigned char temp2_uchar; - HDassert(type_size == sizeof(unsigned char)); + + if(type_size != sizeof(unsigned char)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned char size"); HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_uchar, temp2_uchar) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -931,19 +944,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -952,19 +965,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_uchar, temp2_uchar) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_uchar, temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -973,7 +986,7 @@ static hsize_t diff_datum( } } else if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -989,14 +1002,16 @@ static hsize_t diff_datum( else if (type_size == 2 && type_sign != H5T_SGN_NONE) { short temp1_short; short temp2_short; - HDassert(type_size == sizeof(short)); + + if(type_size != sizeof(short)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not short size"); HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_short - temp2_short) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_short - temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -1005,19 +1020,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -1026,19 +1041,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent && ABS(temp1_short - temp2_short) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_short - temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -1047,7 +1062,7 @@ static hsize_t diff_datum( } } else if (temp1_short != temp2_short) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -1063,14 +1078,16 @@ static hsize_t diff_datum( else if (type_size == 2 && type_sign == H5T_SGN_NONE) { unsigned short temp1_ushort; unsigned short temp2_ushort; - HDassert(type_size == sizeof(short)); + + if(type_size != sizeof(unsigned short)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned short size"); HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_ushort, temp2_ushort) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -1079,19 +1096,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -1100,19 +1117,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_ushort, temp2_ushort) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_ushort, temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -1121,7 +1138,7 @@ static hsize_t diff_datum( } } else if (temp1_ushort != temp2_ushort) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -1137,14 +1154,16 @@ static hsize_t diff_datum( else if (type_size == 4 && type_sign != H5T_SGN_NONE) { int temp1_int; int temp2_int; - HDassert(type_size == sizeof(int)); + + if(type_size != sizeof(int)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not int size"); HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_int-temp2_int) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_int-temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -1153,19 +1172,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -1174,19 +1193,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent && ABS(temp1_int - temp2_int) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_int - temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -1195,7 +1214,7 @@ static hsize_t diff_datum( } } else if (temp1_int != temp2_int) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -1211,14 +1230,16 @@ static hsize_t diff_datum( else if (type_size == 4 && type_sign == H5T_SGN_NONE) { unsigned int temp1_uint; unsigned int temp2_uint; - HDassert(type_size == sizeof(int)); + + if(type_size != sizeof(unsigned int)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned int size"); HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_uint, temp2_uint) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_uint, temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -1227,19 +1248,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -1248,19 +1269,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_uint,temp2_uint) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_uint,temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -1269,7 +1290,7 @@ static hsize_t diff_datum( } } else if (temp1_uint != temp2_uint) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(UI_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -1285,14 +1306,16 @@ static hsize_t diff_datum( else if (type_size == 8 && type_sign != H5T_SGN_NONE) { long temp1_long; long temp2_long; - HDassert(type_size == sizeof(long)); + + if(type_size != sizeof(long)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long size"); HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -1301,19 +1324,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -1322,19 +1345,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -1343,7 +1366,7 @@ static hsize_t diff_datum( } } else if (temp1_long != temp2_long) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -1359,14 +1382,16 @@ static hsize_t diff_datum( else if (type_size == 8 && type_sign == H5T_SGN_NONE) { unsigned long temp1_ulong; unsigned long temp2_ulong; - HDassert(type_size == sizeof(unsigned long)); + + if(type_size != sizeof(unsigned long)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned long size"); HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_ulong, temp2_ulong) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_ulong, temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -1375,19 +1400,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -1396,19 +1421,19 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -1417,7 +1442,7 @@ static hsize_t diff_datum( } } else if (temp1_ulong != temp2_ulong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -1433,14 +1458,16 @@ static hsize_t diff_datum( else if (type_size == 8 && type_sign != H5T_SGN_NONE) { long long temp1_llong; long long temp2_llong; - HDassert(type_size == sizeof(long long)); + + if(type_size != sizeof(long long)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long long size"); HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); /* -d and !-p */ - if (options->d && !options->p) { - if (ABS(temp1_llong-temp2_llong) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (ABS(temp1_llong-temp2_llong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); @@ -1449,19 +1476,19 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER(temp1_llong, temp2_llong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); @@ -1470,11 +1497,11 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER(temp1_llong, temp2_llong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); @@ -1482,9 +1509,8 @@ static hsize_t diff_datum( nfound++; } - else if (per > options->percent - && ABS(temp1_llong-temp2_llong) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_llong-temp2_llong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); @@ -1493,7 +1519,7 @@ static hsize_t diff_datum( } } else if (temp1_llong != temp2_llong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); @@ -1511,14 +1537,16 @@ static hsize_t diff_datum( else if (type_size == 8 && type_sign == H5T_SGN_NONE) { unsigned long long temp1_ullong; unsigned long long temp2_ullong; - HDassert(type_size == sizeof(unsigned long long)); + + if(type_size != sizeof(unsigned long long)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not unsigned long long size"); HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); /* -d and !-p */ - if (options->d && !options->p) { - if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); @@ -1527,13 +1555,13 @@ static hsize_t diff_datum( } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { ull2float(temp1_ullong, &f1); ull2float(temp2_ullong, &f2); PER(f1, f2); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); @@ -1541,9 +1569,9 @@ static hsize_t diff_datum( nfound++; } - else if (per > options->percent) { + else if (per > opts->percent) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong),per); @@ -1552,21 +1580,21 @@ static hsize_t diff_datum( } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { ull2float(temp1_ullong, &f1); ull2float(temp2_ullong, &f2); PER(f1, f2); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong),per); @@ -1575,7 +1603,7 @@ static hsize_t diff_datum( } } else if (temp1_ullong != temp2_ullong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT, temp1_ullong, temp2_ullong, PDIFF(temp1_ullong, temp2_ullong)); @@ -1602,31 +1630,32 @@ static hsize_t diff_datum( hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - HDassert(type_size == sizeof(float)); + if(type_size != sizeof(float)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not float size"); HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - /* logic for detecting NaNs is different with options -d, -p and no options */ + /* logic for detecting NaNs is different with opts -d, -p and no opts */ /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_float-temp2_float) > (float) options->delta) { - if (print_data(options)) { + if (ABS(temp1_float-temp2_float) > (float) opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1636,7 +1665,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1648,12 +1677,12 @@ static hsize_t diff_datum( * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -1663,15 +1692,15 @@ static hsize_t diff_datum( PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -1682,7 +1711,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1694,12 +1723,12 @@ static hsize_t diff_datum( * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -1709,15 +1738,15 @@ static hsize_t diff_datum( PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -1728,7 +1757,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1740,8 +1769,8 @@ static hsize_t diff_datum( * no -d and -p *------------------------------------------------------------------------- */ - else if (equal_float(temp1_float, temp2_float, options) == FALSE) { - if (print_data(options)) { + else if (equal_float(temp1_float, temp2_float, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -1760,30 +1789,31 @@ static hsize_t diff_datum( hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - HDassert(type_size == sizeof(double)); + if(type_size != sizeof(double)) + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not double size"); HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - /* logic for detecting NaNs is different with options -d, -p and no options */ + /* logic for detecting NaNs is different with opts -d, -p and no opts */ /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1793,24 +1823,24 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - } /* options->d && !options->p */ + } /* opts->d && !opts->p */ /*------------------------------------------------------------------------- * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -1820,15 +1850,15 @@ static hsize_t diff_datum( PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1838,7 +1868,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1850,12 +1880,12 @@ static hsize_t diff_datum( * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -1865,16 +1895,16 @@ static hsize_t diff_datum( PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && - ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && + ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1884,7 +1914,7 @@ static hsize_t diff_datum( } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1896,8 +1926,8 @@ static hsize_t diff_datum( * no -d and -p *------------------------------------------------------------------------- */ - else if (equal_double(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + else if (equal_double(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1918,7 +1948,9 @@ static hsize_t diff_datum( hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; - HDassert(type_size == sizeof(long double)); + if(type_size != sizeof(long double)) { + HGOTO_ERROR(1, H5E_tools_min_id_g, "Type size is not long double size"); + } HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -1929,20 +1961,20 @@ static hsize_t diff_datum( * -d and !-p *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1952,7 +1984,7 @@ static hsize_t diff_datum( } /* NaN */ /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -1964,12 +1996,12 @@ static hsize_t diff_datum( * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } @@ -1979,15 +2011,15 @@ static hsize_t diff_datum( PER(temp1_double,temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -1997,7 +2029,7 @@ static hsize_t diff_datum( } /* NaN */ /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2009,30 +2041,30 @@ static hsize_t diff_datum( * -d and -p *------------------------------------------------------------------------- */ - else if ( options->d && options->p) { + else if (opts->d && opts->p) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } /* both not NaN, do the comparison */ - if ( !isnan1 && !isnan2) { + if (!isnan1 && !isnan2) { PER(temp1_double,temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1 - temp2_double / temp1_double)); @@ -2042,7 +2074,7 @@ static hsize_t diff_datum( } /* NaN */ /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2054,8 +2086,8 @@ static hsize_t diff_datum( * no -d and -p *------------------------------------------------------------------------- */ - else if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + else if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, index, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2068,7 +2100,11 @@ static hsize_t diff_datum( break; /* H5T_FLOAT class */ } /* switch */ - h5difftrace("diff_datum finish\n"); + +done: + opts->err_stat = opts->err_stat | ret_value; + + h5diffdebug3("diff_datum finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } @@ -2079,7 +2115,6 @@ static hsize_t diff_datum( * Purpose: Determines if memory is initialized to all zero bytes. * * Return: TRUE if all bytes are zero; FALSE otherwise - * *------------------------------------------------------------------------- */ @@ -2099,7 +2134,6 @@ static hbool_t all_zero(const void *_mem, size_t size) { * Purpose: print start coordinates and opposite corner of a region block * * Return: void - * *------------------------------------------------------------------------- */ @@ -2122,7 +2156,6 @@ void print_region_block(int i, hsize_t *ptdata, int ndims) { * Purpose: print points of a region reference * * Return: void - * *------------------------------------------------------------------------- */ @@ -2143,18 +2176,18 @@ void print_points(int i, hsize_t *ptdata, int ndims) { * Purpose: diff a dataspace region * * Return: number of differences - * *------------------------------------------------------------------------- */ -static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *options) +static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, diff_opt_t *opts) { + hsize_t ret_value = 0; hssize_t nblocks1, npoints1; hssize_t nblocks2, npoints2; hsize_t alloc_size; - hsize_t *ptdata1; - hsize_t *ptdata2; + hsize_t *ptdata1 = NULL; + hsize_t *ptdata2 = NULL; int ndims1; int ndims2; int i, j; @@ -2169,18 +2202,17 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t * respectively. They do not currently know how to translate from one to * the other. */ - H5E_BEGIN_TRY - { - nblocks1 = H5Sget_select_hyper_nblocks(region1_id); - nblocks2 = H5Sget_select_hyper_nblocks(region2_id); + H5E_BEGIN_TRY { + nblocks1 = H5Sget_select_hyper_nblocks(region1_id); + nblocks2 = H5Sget_select_hyper_nblocks(region2_id); - npoints1 = H5Sget_select_elem_npoints(region1_id); - npoints2 = H5Sget_select_elem_npoints(region2_id); - }H5E_END_TRY; + npoints1 = H5Sget_select_elem_npoints(region1_id); + npoints2 = H5Sget_select_elem_npoints(region2_id); + } H5E_END_TRY; if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) { - options->not_cmp = 1; - return 0; + opts->not_cmp = 1; + HGOTO_DONE (0); } /*------------------------------------------------------------------------- @@ -2189,57 +2221,62 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t */ if (nblocks1 > 0) { HDassert(ndims1 > 0); - alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 - * sizeof(ptdata1[0]); + alloc_size = (hsize_t) nblocks1 * (unsigned) ndims1 * 2 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, - (hsize_t) nblocks1, ptdata1); - - ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); - H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0, - (hsize_t) nblocks2, ptdata2); - - for (i = 0; i < nblocks1; i++) { - /* start coordinates and opposite corner */ - for (j = 0; j < ndims1; j++) { - hsize_t start1, start2, end1, end2; + if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); + } + else { + H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); + H5Sget_select_hyper_blocklist(region1_id, (hsize_t) 0, (hsize_t) nblocks1, ptdata1); - start1 = ptdata1[i * 2 * ndims1 + j]; - start2 = ptdata2[i * 2 * ndims1 + j]; - end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; - end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; - if (start1 != start2 || end1 != end2) - nfound_b++; + if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); } - } + else { + H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); + H5Sget_select_hyper_blocklist(region2_id, (hsize_t) 0, (hsize_t) nblocks2, ptdata2); + + for (i = 0; i < nblocks1; i++) { + /* start coordinates and opposite corner */ + for (j = 0; j < ndims1; j++) { + hsize_t start1, start2, end1, end2; + + start1 = ptdata1[i * 2 * ndims1 + j]; + start2 = ptdata2[i * 2 * ndims1 + j]; + end1 = ptdata1[i * 2 * ndims1 + j + ndims1]; + end2 = ptdata2[i * 2 * ndims1 + j + ndims1]; + if (start1 != start2 || end1 != end2) + nfound_b++; + } + } - /* print differences if found */ - if (nfound_b && options->m_verbose) { - H5O_info_t oi1, oi2; + /* print differences if found */ + if (nfound_b && opts->m_verbose) { + H5O_info_t oi1, oi2; - H5Oget_info(obj1_id, &oi1); - H5Oget_info(obj2_id, &oi2); + H5Oget_info(obj1_id, &oi1); + H5Oget_info(obj2_id, &oi2); - parallel_print("Referenced dataset %lu %lu\n", - (unsigned long) oi1.addr, (unsigned long) oi2.addr); - parallel_print( - "------------------------------------------------------------\n"); + parallel_print("Referenced dataset %lu %lu\n", (unsigned long) oi1.addr, (unsigned long) oi2.addr); + parallel_print( "------------------------------------------------------------\n"); - parallel_print("Region blocks\n"); - for (i = 0; i < nblocks1; i++) { - parallel_print("block #%d", i); - print_region_block(i, ptdata1, ndims1); - print_region_block(i, ptdata2, ndims1); - parallel_print("\n"); - } - } + parallel_print("Region blocks\n"); + for (i = 0; i < nblocks1; i++) { + parallel_print("block #%d", i); + print_region_block(i, ptdata1, ndims1); + print_region_block(i, ptdata2, ndims1); + parallel_print("\n"); + } + } + HDfree(ptdata2); + } /* else ptdata2 */ - HDfree(ptdata1); - HDfree(ptdata2); + HDfree(ptdata1); + } /* else ptdata1 */ } /*------------------------------------------------------------------------- @@ -2247,98 +2284,107 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t *------------------------------------------------------------------------- */ if (npoints1 > 0) { - alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 - * sizeof(ptdata1[0]); + alloc_size = (hsize_t) npoints1 * (unsigned) ndims1 * sizeof(ptdata1[0]); HDassert(alloc_size == (hsize_t)((size_t )alloc_size)); /*check for overflow*/ - ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); - H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, - (hsize_t) npoints1, ptdata1); - - ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size); - H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); - H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0, - (hsize_t) npoints2, ptdata2); - - for (i = 0; i < npoints1; i++) { - hsize_t pt1, pt2; + if((ptdata1 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); + } + else { + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region1_id, (hsize_t) 0, (hsize_t) npoints1, ptdata1); - for (j = 0; j < ndims1; j++) { - pt1 = ptdata1[i * ndims1 + j]; - pt2 = ptdata2[i * ndims1 + j]; - if (pt1 != pt2) - nfound_p++; + if((ptdata2 = (hsize_t *) HDmalloc((size_t )alloc_size)) == NULL) { + opts->err_stat = 1; + H5TOOLS_INFO(H5E_tools_min_id_g, "Buffer allocation failed"); } - } + else { + H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); + H5Sget_select_elem_pointlist(region2_id, (hsize_t) 0, (hsize_t) npoints2, ptdata2); - if (nfound_p && options->m_verbose) { - parallel_print("Region points\n"); - for (i = 0; i < npoints1; i++) { - hsize_t pt1, pt2; - int diff_data = 0; - - for (j = 0; j < ndims1; j++) { - pt1 = ptdata1[i * ndims1 + j]; - pt2 = ptdata2[i * ndims1 + j]; - if (pt1 != pt2) { - diff_data = 1; - break; + for (i = 0; i < npoints1; i++) { + hsize_t pt1, pt2; + + for (j = 0; j < ndims1; j++) { + pt1 = ptdata1[i * ndims1 + j]; + pt2 = ptdata2[i * ndims1 + j]; + if (pt1 != pt2) + nfound_p++; } } - if (diff_data) { - parallel_print("point #%d", i); - print_points(i, ptdata1, ndims1); - print_points(i, ptdata2, ndims1); - parallel_print("\n"); + + if (nfound_p && opts->m_verbose) { + parallel_print("Region points\n"); + for (i = 0; i < npoints1; i++) { + hsize_t pt1, pt2; + int diff_data = 0; + + for (j = 0; j < ndims1; j++) { + pt1 = ptdata1[i * ndims1 + j]; + pt2 = ptdata2[i * ndims1 + j]; + if (pt1 != pt2) { + diff_data = 1; + break; + } + } + if (diff_data) { + parallel_print("point #%d", i); + print_points(i, ptdata1, ndims1); + print_points(i, ptdata2, ndims1); + parallel_print("\n"); + } + } } - } - } + HDfree(ptdata2); + } /* else ptdata2 */ #if defined (H5DIFF_DEBUG) - for (i = 0; i < npoints1; i++) { - int j; - - parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); + for (i = 0; i < npoints1; i++) { + parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); - for (j = 0; j < ndims1; j++) - parallel_print("%s%lu", j ? "," : "(", - (unsigned long)(ptdata1[i * ndims1 + j])); + for (j = 0; j < ndims1; j++) + parallel_print("%s%lu", j ? "," : "(", (unsigned long)(ptdata1[i * ndims1 + j])); - parallel_print(")"); - } + parallel_print(")"); + } #endif - HDfree(ptdata1); - HDfree(ptdata2); + HDfree(ptdata1); + } /* else ptdata1 */ } nfound_b = nfound_b / (unsigned) ndims1; nfound_p = nfound_p / (unsigned) ndims1; - return (nfound_p + nfound_b); + + ret_value = nfound_p + nfound_b; + +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: character_compare * - * Purpose: do a byte-by-byte comparison and print in char format - * - * Return: number of differences found + * Purpose: do a byte-by-byte comparison and print in char format * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, unsigned u, - int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { + int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) +{ hsize_t nfound = 0; /* differences found */ char temp1_uchar; char temp2_uchar; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + h5diffdebug3("character_compare start %d=%d\n",temp1_uchar,temp2_uchar); if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_char_pos(ph, 0, i, u, acc, pos, rank, dims, obj1, obj2); parallel_print(" "); h5diff_print_char(temp1_uchar); @@ -2356,20 +2402,20 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, unsigned u, /*------------------------------------------------------------------------- * Function: character_compare_opt * - * Purpose: do a byte-by-byte comparison and print in numerical format - * - * Return: number of differences found + * Purpose: do a byte-by-byte comparison and print in numerical format * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, - hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* differences found */ + hsize_t i, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) +{ + hsize_t nfound = 0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - double per; - hbool_t both_zero; + double per; + hbool_t both_zero; HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -2377,9 +2423,9 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h5difftrace("character_compare_opt start\n"); /* -d and !-p */ - if (options->d && !options->p) { - if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + if (opts->d && !opts->p) { + if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -2388,10 +2434,10 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (per > options->percent) { - if (print_data(options)) { + if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -2400,10 +2446,10 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); - if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -2412,7 +2458,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, } } else if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -2426,14 +2472,14 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_float * - * Purpose: diff a H5T_NATIVE_FLOAT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_FLOAT type * + * Return: number of differences found +* *------------------------------------------------------------------------- */ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, - hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { @@ -2453,7 +2499,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -2462,15 +2508,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if ((double) ABS(temp1_float - temp2_float) > options->delta) { - if (print_data(options)) { + if ((double) ABS(temp1_float - temp2_float) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2480,7 +2526,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2490,7 +2536,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2498,7 +2544,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -2507,7 +2553,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -2516,15 +2562,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -2535,7 +2581,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2545,7 +2591,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2553,7 +2599,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); @@ -2562,7 +2608,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_FLOAT, &temp1_float); isnan2 = my_isnan(FLT_FLOAT, &temp2_float); } @@ -2572,15 +2618,15 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, PER(temp1_float, temp2_float); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); } nfound++; } - else if (per > options->percent && (double) ABS(temp1_float - temp2_float) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && (double) ABS(temp1_float - temp2_float) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, (double) temp1_float, (double) temp2_float, @@ -2592,7 +2638,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2602,7 +2648,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2616,8 +2662,8 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp1_float, mem1, sizeof(float)); HDmemcpy(&temp2_float, mem2, sizeof(float)); - if (equal_float(temp1_float, temp2_float, options) == FALSE) { - if (print_data(options)) { + if (equal_float(temp1_float, temp2_float, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, (double) temp1_float, (double) temp2_float, (double) ABS(temp1_float - temp2_float)); @@ -2627,7 +2673,7 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(float); mem2 += sizeof(float); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -2639,23 +2685,22 @@ static hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_double * - * Purpose: diff a H5T_NATIVE_DOUBLE type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_DOUBLE type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ - double temp1_double; - double temp2_double; + double temp1_double; + double temp2_double; hsize_t i; - double per; + double per; hbool_t both_zero; hbool_t isnan1 = FALSE; hbool_t isnan2 = FALSE; @@ -2666,7 +2711,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); @@ -2675,15 +2720,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2693,7 +2738,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2703,7 +2748,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2712,7 +2757,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); @@ -2721,7 +2766,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -2730,15 +2775,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, @@ -2749,7 +2794,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2759,7 +2804,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2767,7 +2812,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(double)); @@ -2777,7 +2822,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_DOUBLE, &temp1_double); isnan2 = my_isnan(FLT_DOUBLE, &temp2_double); } @@ -2787,15 +2832,15 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, @@ -2806,7 +2851,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2815,7 +2860,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2828,8 +2873,8 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp1_double, mem1, sizeof(double)); HDmemcpy(&temp2_double, mem2, sizeof(double)); - if (equal_double(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + if (equal_double(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2839,7 +2884,7 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(double); mem2 += sizeof(double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -2851,10 +2896,9 @@ static hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ldouble * - * Purpose: diff a H5T_NATIVE_LDOUBLE type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_LDOUBLE type * + * Return: number of differences found *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE !=0 @@ -2867,13 +2911,13 @@ static hsize_t diff_ldouble(unsigned char *mem1, hsize_t *dims, hsize_t *acc, hsize_t *pos, - diff_opt_t *options, + diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound=0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ long double temp1_double; long double temp2_double; hsize_t i; @@ -2889,7 +2933,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, *------------------------------------------------------------------------- */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for ( i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -2898,15 +2942,15 @@ static hsize_t diff_ldouble(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE,&temp1_double); isnan2 = my_isnan(FLT_LDOUBLE,&temp2_double); } /* both not NaN, do the comparison */ if (!isnan1 && !isnan2) { - if (ABS(temp1_double-temp2_double) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_double-temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2916,7 +2960,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -2926,7 +2970,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2935,7 +2979,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * !-d and -p *------------------------------------------------------------------------- */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -2944,7 +2988,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } @@ -2953,15 +2997,15 @@ static hsize_t diff_ldouble(unsigned char *mem1, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, @@ -2972,8 +3016,8 @@ static hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { - print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); + if (print_data(opts)) { + print_pos(ph, 0, hyper_start+i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } @@ -2981,7 +3025,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -2989,7 +3033,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * -d and -p *------------------------------------------------------------------------- */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); @@ -2998,7 +3042,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, * detect NaNs *------------------------------------------------------------------------- */ - if (options->do_nans) { + if (opts->do_nans) { isnan1 = my_isnan(FLT_LDOUBLE, &temp1_double); isnan2 = my_isnan(FLT_LDOUBLE, &temp2_double); } @@ -3008,15 +3052,15 @@ static hsize_t diff_ldouble(unsigned char *mem1, PER(temp1_double, temp2_double); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P_NOTCOMP, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); } nfound++; } - else if (per > options->percent && ABS(temp1_double - temp2_double) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_double - temp2_double) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT_P, temp1_double, temp2_double, ABS(temp1_double - temp2_double), ABS(1-temp2_double / temp1_double)); @@ -3026,7 +3070,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } /* only one is NaN, assume difference */ else if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -3035,7 +3079,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* i */ } @@ -3048,8 +3092,8 @@ static hsize_t diff_ldouble(unsigned char *mem1, HDmemcpy(&temp1_double, mem1, sizeof(long double)); HDmemcpy(&temp2_double, mem2, sizeof(long double)); - if (equal_ldouble(temp1_double, temp2_double, options) == FALSE) { - if (print_data(options)) { + if (equal_ldouble(temp1_double, temp2_double, opts) == FALSE) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double)); @@ -3058,7 +3102,7 @@ static hsize_t diff_ldouble(unsigned char *mem1, } mem1 += sizeof(long double); mem2 += sizeof(long double); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3071,34 +3115,33 @@ static hsize_t diff_ldouble(unsigned char *mem1, /*------------------------------------------------------------------------- * Function: diff_schar * - * Purpose: diff a H5T_NATIVE_SCHAR type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_SCHAR type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ - char temp1_char; - char temp2_char; + char temp1_char; + char temp2_char; hsize_t i; - double per; + double per; hbool_t both_zero; h5difftrace("diff_schar start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); - if (ABS(temp1_char-temp2_char) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_char-temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -3107,12 +3150,12 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); @@ -3120,15 +3163,15 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -3137,12 +3180,12 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_char, mem1, sizeof(char)); HDmemcpy(&temp2_char, mem2, sizeof(char)); @@ -3150,15 +3193,15 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, PER(temp1_char, temp2_char); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); } nfound++; } - else if (per > options->percent && ABS(temp1_char-temp2_char) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_char-temp2_char) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_char, temp2_char, ABS(temp1_char - temp2_char), per); @@ -3167,7 +3210,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3177,7 +3220,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_char, mem2, sizeof(char)); if (temp1_char != temp2_char) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_char, temp2_char, ABS(temp1_char - temp2_char)); @@ -3187,7 +3230,7 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(char); mem2 += sizeof(char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3199,33 +3242,32 @@ static hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_uchar * - * Purpose: diff a H5T_NATIVE_UCHAR type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_UCHAR type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_uchar start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - if (PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -3234,12 +3276,12 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -3247,15 +3289,15 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -3264,12 +3306,12 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -3277,15 +3319,15 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed char, temp1_uchar, temp2_uchar); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_uchar,temp2_uchar) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_uchar,temp2_uchar) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar), per); @@ -3294,7 +3336,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3304,7 +3346,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if (temp1_uchar != temp2_uchar) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uchar, temp2_uchar, PDIFF(temp1_uchar, temp2_uchar)); @@ -3314,7 +3356,7 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned char); mem2 += sizeof(unsigned char); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3326,33 +3368,32 @@ static hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_short * - * Purpose: diff a H5T_NATIVE_SHORT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_SHORT type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ - short temp1_short; - short temp2_short; + short temp1_short; + short temp2_short; hsize_t i; - double per; + double per; hbool_t both_zero; h5difftrace("diff_short start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); - if (ABS(temp1_short-temp2_short) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_short-temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -3361,12 +3402,12 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); @@ -3374,15 +3415,15 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -3391,12 +3432,12 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_short, mem1, sizeof(short)); HDmemcpy(&temp2_short, mem2, sizeof(short)); @@ -3404,15 +3445,15 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, PER(temp1_short, temp2_short); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); } nfound++; } - else if (per > options->percent && ABS(temp1_short-temp2_short) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_short-temp2_short) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_short, temp2_short, ABS(temp1_short - temp2_short), per); @@ -3421,7 +3462,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3431,7 +3472,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_short, mem2, sizeof(short)); if (temp1_short != temp2_short) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_short, temp2_short, ABS(temp1_short - temp2_short)); @@ -3441,7 +3482,7 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(short); mem2 += sizeof(short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3453,34 +3494,33 @@ static hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ushort * - * Purpose: diff a H5T_NATIVE_USHORT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_USHORT type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ushort start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - if (PDIFF(temp1_ushort,temp2_ushort) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_ushort,temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -3489,12 +3529,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); @@ -3502,15 +3542,15 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -3519,12 +3559,12 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); @@ -3532,15 +3572,15 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed short, temp1_ushort, temp2_ushort); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); } nfound++; } - else if (per > options->percent && PDIFF(temp1_ushort,temp2_ushort) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && PDIFF(temp1_ushort,temp2_ushort) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort), per); @@ -3549,7 +3589,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3559,7 +3599,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); if (temp1_ushort != temp2_ushort) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_ushort, temp2_ushort, PDIFF(temp1_ushort, temp2_ushort)); @@ -3569,7 +3609,7 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned short); mem2 += sizeof(unsigned short); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3579,35 +3619,34 @@ static hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, } /*------------------------------------------------------------------------- - * Function: diff_int + * Function: diff_int * - * Purpose: diff a H5T_NATIVE_INT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_INT type * - *------------------------------------------------------------------------- + * Return: number of differences found + *------------------------------------------------------------------------- */ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ - int temp1_int; - int temp2_int; + int temp1_int; + int temp2_int; hsize_t i; - double per; + double per; hbool_t both_zero; h5difftrace("diff_int start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); - if (ABS(temp1_int-temp2_int) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_int-temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -3616,12 +3655,12 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); @@ -3629,15 +3668,15 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -3646,12 +3685,12 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_int, mem1, sizeof(int)); HDmemcpy(&temp2_int, mem2, sizeof(int)); @@ -3659,15 +3698,15 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, PER(temp1_int, temp2_int); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); } nfound++; } - else if (per > options->percent && ABS(temp1_int-temp2_int) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_int-temp2_int) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_int, temp2_int, ABS(temp1_int - temp2_int), per); @@ -3676,7 +3715,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3686,7 +3725,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_int, mem2, sizeof(int)); if (temp1_int != temp2_int) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_int, temp2_int, ABS(temp1_int - temp2_int)); @@ -3696,7 +3735,7 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(int); mem2 += sizeof(int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ @@ -3708,15 +3747,14 @@ static hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_uint * - * Purpose: diff a H5T_NATIVE_UINT type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_UINT type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3728,13 +3766,13 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_uint start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); - if (PDIFF(temp1_uint,temp2_uint) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_uint,temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -3743,12 +3781,12 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); @@ -3756,15 +3794,15 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -3773,12 +3811,12 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); @@ -3786,16 +3824,16 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed int, temp1_uint, temp2_uint); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P_NOTCOMP, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); } nfound++; } - else if (per > options->percent - && PDIFF(temp1_uint,temp2_uint) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && PDIFF(temp1_uint,temp2_uint) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT_P, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint), per); @@ -3804,7 +3842,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3814,7 +3852,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); if (temp1_uint != temp2_uint) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(I_FORMAT, temp1_uint, temp2_uint, PDIFF(temp1_uint, temp2_uint)); @@ -3824,7 +3862,7 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned int); mem2 += sizeof(unsigned int); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3836,15 +3874,14 @@ static hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_long * - * Purpose: diff a H5T_NATIVE_LONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_LONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { hsize_t nfound = 0; /* number of differences found */ @@ -3856,14 +3893,14 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, h5difftrace("diff_long start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); - if (ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + if (ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -3872,13 +3909,13 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); @@ -3886,15 +3923,15 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -3903,12 +3940,12 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_long, mem1, sizeof(long)); HDmemcpy(&temp2_long, mem2, sizeof(long)); @@ -3916,15 +3953,15 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, PER(temp1_long, temp2_long); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P_NOTCOMP, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); } nfound++; } - else if (per > options->percent && ABS(temp1_long-temp2_long) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent && ABS(temp1_long-temp2_long) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_long, temp2_long, ABS(temp1_long - temp2_long), per); @@ -3933,7 +3970,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -3943,7 +3980,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_long, mem2, sizeof(long)); if (temp1_long != temp2_long) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_long, temp2_long, ABS(temp1_long - temp2_long)); @@ -3953,7 +3990,7 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(long); mem2 += sizeof(long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -3965,35 +4002,34 @@ static hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ulong * - * Purpose: diff a H5T_NATIVE_ULONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_ULONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned long temp1_ulong; unsigned long temp2_ulong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_ulong start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - if (PDIFF(temp1_ulong,temp2_ulong) > options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -4002,13 +4038,13 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); @@ -4016,15 +4052,15 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -4033,12 +4069,12 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); @@ -4046,16 +4082,16 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, PER_UNSIGN(signed long, temp1_ulong, temp2_ulong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULI_FORMAT_P_NOTCOMP, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); } nfound++; } - else if (per > options->percent - && PDIFF(temp1_ulong,temp2_ulong) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && PDIFF(temp1_ulong,temp2_ulong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT_P, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong), per); @@ -4064,7 +4100,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -4074,7 +4110,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); if (temp1_ulong != temp2_ulong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LI_FORMAT, temp1_ulong, temp2_ulong, PDIFF(temp1_ulong, temp2_ulong)); @@ -4084,7 +4120,7 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned long); mem2 += sizeof(unsigned long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -4096,33 +4132,32 @@ static hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_llong * - * Purpose: diff a H5T_NATIVE_LLONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_LLONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, - hsize_t *acc, hsize_t *pos, diff_opt_t *options, const char *obj1, + hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ long long temp1_llong; long long temp2_llong; - hsize_t i; - double per; - hbool_t both_zero; + hsize_t i; + double per; + hbool_t both_zero; h5difftrace("diff_llong start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); - if (ABS( temp1_llong-temp2_llong) > options->delta) { - if (print_data(options)) { + if (ABS( temp1_llong-temp2_llong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); @@ -4131,12 +4166,12 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); @@ -4144,15 +4179,15 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, PER(temp1_llong, temp2_llong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); @@ -4161,12 +4196,12 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_llong, mem1, sizeof(long long)); HDmemcpy(&temp2_llong, mem2, sizeof(long long)); @@ -4174,16 +4209,16 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, PER(temp1_llong, temp2_llong); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P_NOTCOMP, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); } nfound++; } - else if (per > options->percent - && ABS(temp1_llong-temp2_llong) > options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && ABS(temp1_llong-temp2_llong) > opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT_P, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong),per); @@ -4192,7 +4227,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -4202,7 +4237,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_llong, mem2, sizeof(long long)); if (temp1_llong != temp2_llong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(LLI_FORMAT, temp1_llong, temp2_llong, ABS(temp1_llong - temp2_llong)); @@ -4212,7 +4247,7 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(long long); mem2 += sizeof(long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -4224,34 +4259,33 @@ static hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, /*------------------------------------------------------------------------- * Function: diff_ullong * - * Purpose: diff a H5T_NATIVE_ULLONG type - * - * Return: number of differences found + * Purpose: diff a H5T_NATIVE_ULLONG type * + * Return: number of differences found *------------------------------------------------------------------------- */ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, hsize_t hyper_start, int rank, hsize_t *dims, hsize_t *acc, - hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, int *ph) + hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2, int *ph) { - hsize_t nfound = 0; /* number of differences found */ + hsize_t nfound = 0; /* number of differences found */ unsigned long long temp1_ullong; unsigned long long temp2_ullong; - hsize_t i; - float f1, f2; - double per; - hbool_t both_zero; + hsize_t i; + float f1, f2; + double per; + hbool_t both_zero; h5difftrace("diff_ullong start\n"); /* -d and !-p */ - if (options->d && !options->p) { + if (opts->d && !opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); - if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { - if (print_data(options)) { + if (PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); @@ -4260,12 +4294,12 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* !-d and -p */ - else if (!options->d && options->p) { + else if (!opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); @@ -4275,15 +4309,15 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, PER(f1, f2); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else if (per > options->percent) { - if (print_data(options)) { + else if (per > opts->percent) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); @@ -4292,12 +4326,12 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } /* -d and -p */ - else if (options->d && options->p) { + else if (opts->d && opts->p) { for (i = 0; i < nelmts; i++) { HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); @@ -4307,16 +4341,16 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, PER(f1, f2); if (not_comparable && !both_zero) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P_NOTCOMP,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); } nfound++; } - else if (per > options->percent - && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { - if (print_data(options)) { + else if (per > opts->percent + && PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) opts->delta) { + if (print_data(opts)) { print_pos(ph, 1, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT_P,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong),per); @@ -4325,7 +4359,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, } mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } } @@ -4335,7 +4369,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); if (temp1_ullong != temp2_ullong) { - if (print_data(options)) { + if (print_data(opts)) { print_pos(ph, 0, hyper_start + i, acc, pos, rank, dims, obj1, obj2); parallel_print(SPACES); parallel_print(ULLI_FORMAT,temp1_ullong,temp2_ullong,PDIFF(temp1_ullong,temp2_ullong)); @@ -4345,7 +4379,7 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, mem1 += sizeof(unsigned long long); mem2 += sizeof(unsigned long long); - if (options->n && nfound >= options->count) + if (opts->n && nfound >= opts->count) return nfound; } /* nelmts */ } @@ -4358,69 +4392,59 @@ static hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, * Function: ull2float * * Purpose: convert unsigned long long to float - * - * Programmer: pvn - * Mar 22, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ static -int ull2float(unsigned long long ull_value, float *f_value) { - hid_t dxpl_id; +int ull2float(unsigned long long ull_value, float *f_value) +{ + int ret_value = SUCCEED; + hid_t dxpl_id = -1; unsigned char *buf = NULL; - size_t src_size; - size_t dst_size; + size_t src_size; + size_t dst_size; h5difftrace("ull2float start\n"); if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed"); src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size)); - if (!buf) - goto error; + if((buf = (unsigned char*) HDcalloc((size_t )1, MAX(src_size, dst_size))) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); HDmemcpy(buf, &ull_value, src_size); /* do conversion */ if (H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t) 1, buf, NULL, dxpl_id) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tconvert failed"); HDmemcpy(f_value, buf, dst_size); if (buf) - HDfree(buf);h5difftrace("ull2float finish\n"); - - return 0; + HDfree(buf); -error: - H5E_BEGIN_TRY - { +done: + H5E_BEGIN_TRY { H5Pclose(dxpl_id); - }H5E_END_TRY; + } H5E_END_TRY; + if (buf) - HDfree(buf);h5difftrace("ull2float errored\n"); + HDfree(buf); + + h5difftrace("ull2float finish\n"); - return -1; + return ret_value; } /*------------------------------------------------------------------------- * Function: equal_double * - * Purpose: use a absolute error formula to deal with floating point - * uncertainty - * - * Modifications: - * 8/1/2007. handle NaNs - * + * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ -static hbool_t equal_double(double value, double expected, diff_opt_t *options) { +static hbool_t equal_double(double value, double expected, diff_opt_t *opts) { h5difftrace("equal_double start\n"); - if (options->do_nans) { + if (opts->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -4432,26 +4456,24 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options) * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if (isnan1 && isnan2) { + if (isnan1 && isnan2) return TRUE; - } /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) return FALSE; - } } if (value == expected) return TRUE; - if (options->use_system_epsilon) { - if ( ABS( (value-expected) ) < DBL_EPSILON) + if (opts->use_system_epsilon) + if (ABS((value-expected)) < DBL_EPSILON) return TRUE; - } + h5difftrace("equal_double finish\n"); return FALSE; @@ -4460,18 +4482,16 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *options) /*------------------------------------------------------------------------- * Function: equal_ldouble * - * Purpose: use a absolute error formula to deal with floating point - * uncertainty - * + * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE !=0 static -hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options) +hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts) { h5difftrace("equal_ldouble start\n"); - if (options->do_nans) { + if (opts->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -4483,26 +4503,24 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if (isnan1 && isnan2) { + if (isnan1 && isnan2) return TRUE; - } /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) return FALSE; - } } if (value == expected) return TRUE; - if (options->use_system_epsilon) { + if (opts->use_system_epsilon) if (ABS((value-expected)) < DBL_EPSILON) return TRUE; - } + h5difftrace("equal_ldouble finish\n"); return FALSE; @@ -4513,17 +4531,12 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *optio /*------------------------------------------------------------------------- * Function: equal_float * - * Purpose: use a absolute error formula to deal with floating point - * uncertainty - * - * Modifications: - * 8/1/2007. handle NaNs - * + * Purpose: use a absolute error formula to deal with floating point uncertainty *------------------------------------------------------------------------- */ -static hbool_t equal_float(float value, float expected, diff_opt_t *options) { +static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { h5difftrace("equal_float start\n"); - if (options->do_nans) { + if (opts->do_nans) { /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -4535,46 +4548,35 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *options) { * we consider NaN == NaN to be true *------------------------------------------------------------------------- */ - if (isnan1 && isnan2) { + if (isnan1 && isnan2) return TRUE; - } /*------------------------------------------------------------------------- * one is a NaN, do not compare but assume difference *------------------------------------------------------------------------- */ - if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) { + if ((isnan1 && !isnan2) || (!isnan1 && isnan2)) return FALSE; - } } if (value == expected) return TRUE; - if (options->use_system_epsilon) { - if ( ABS( (value-expected) ) < FLT_EPSILON) + if (opts->use_system_epsilon) + if (ABS( (value-expected) ) < FLT_EPSILON) return TRUE; - } + h5difftrace("equal_float finish\n"); return FALSE; - } /*------------------------------------------------------------------------- * Function: my_isnan * - * Purpose: Determines whether VAL points to NaN. - * - * Return: TRUE or FALSE - * - * Programmer: Robb Matzke - * Monday, July 6, 1998 - * - * Modifications: - * Pedro Vicente, 12 October 2007. - * Add a string detection type for WIN32 + * Purpose: Determines whether VAL points to NaN. * + * Return: TRUE or FALSE *------------------------------------------------------------------------- */ static hbool_t my_isnan(dtype_t type, void *val) { @@ -4602,9 +4604,8 @@ static hbool_t my_isnan(dtype_t type, void *val) { retval = (x!=x); } #endif - else { + else return FALSE; - } /* * Sometimes NaN==NaN (e.g., DEC Alpha) so we try to print it and see if @@ -4631,9 +4632,8 @@ static hbool_t my_isnan(dtype_t type, void *val) { HDsnprintf(s, sizeof(s), "%Lg", x); } #endif - else { + else return FALSE; - } if (HDstrstr(s, "NaN") || HDstrstr(s, "NAN") || @@ -4658,24 +4658,25 @@ static hbool_t my_isnan(dtype_t type, void *val) { /*------------------------------------------------------------------------- * Function: print_data * - * Purpose: print data only in report or verbose modes, and do not print in quiet mode + * Purpose: print data only in report or verbose modes, and do not print in quiet mode *------------------------------------------------------------------------- */ static -int print_data(diff_opt_t *options) { - return ((options->m_report || options->m_verbose) && !options->m_quiet) ? 1 : 0; +int print_data(diff_opt_t *opts) +{ + return ((opts->m_report || opts->m_verbose) && !opts->m_quiet) ? 1 : 0; } /*------------------------------------------------------------------------- * Function: print_header * - * Purpose: print header for difference - * + * Purpose: print header for difference *------------------------------------------------------------------------- */ static void print_header(int pp, /* print percentage */ - int rank, hsize_t *dims, const char *obj1, const char *obj2) { + int rank, hsize_t *dims, const char *obj1, const char *obj2) +{ /* print header */ parallel_print("%-16s", "size:"); print_dimensions(rank, dims); @@ -4685,8 +4686,7 @@ void print_header(int pp, /* print percentage */ if (pp) { parallel_print("%-15s %-15s %-15s %-15s %-15s\n", "position", - (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", - "relative"); + (obj1 != NULL) ? obj1 : " ", (obj2 != NULL) ? obj2 : " ", "difference", "relative"); parallel_print( "------------------------------------------------------------------------\n"); } @@ -4701,15 +4701,15 @@ void print_header(int pp, /* print percentage */ /*------------------------------------------------------------------------- * Function: print_pos * - * Purpose: print in matrix notation, converting from an array index position - * + * Purpose: print in matrix notation, converting from an array index position *------------------------------------------------------------------------- */ static void print_pos(int *ph, /* print header */ int pp, /* print percentage */ hsize_t curr_pos, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, - const char *obj1, const char *obj2) { + const char *obj1, const char *obj2) +{ int i; /* print header */ @@ -4733,30 +4733,22 @@ void print_pos(int *ph, /* print header */ } parallel_print("]"); } - else { + else parallel_print(" "); - } } /*------------------------------------------------------------------------- * Function: print_char_pos * - * Purpose: print character position in string - * + * Purpose: print character position in string *------------------------------------------------------------------------- */ static -void print_char_pos( - int *ph, /* print header */ +void print_char_pos(int *ph, /* print header */ int pp, /* print percentage */ - hsize_t curr_pos, - unsigned u, - hsize_t *acc, - hsize_t *pos, - int rank, - hsize_t *dims, - const char *obj1, - const char *obj2) { + hsize_t curr_pos, unsigned u, hsize_t *acc, hsize_t *pos, int rank, hsize_t *dims, + const char *obj1, const char *obj2) +{ int i; /* print header */ @@ -4780,20 +4772,20 @@ void print_char_pos( } } - else { + else parallel_print("%zu", u); - } + parallel_print("]"); } /*------------------------------------------------------------------------- - * Function: h5diff_print_char. Adapted from h5tools_print_char - * - * Purpose: Print a char + * Function: h5diff_print_char. Adapted from h5tools_print_char * + * Purpose: Print a char *------------------------------------------------------------------------- */ -static void h5diff_print_char(char ch) { +static void h5diff_print_char(char ch) +{ switch (ch) { case '"': parallel_print("\\\""); @@ -4826,12 +4818,13 @@ static void h5diff_print_char(char ch) { } /*------------------------------------------------------------------------- - * XCAO, 11/10/2010 * added to improve performance for compound datasets * set up compound datatype structures. + *------------------------------------------------------------------------- */ -static void get_member_types(hid_t tid, mcomp_t *members) { - int tclass; +static void get_member_types(hid_t tid, mcomp_t *members) +{ + int tclass; unsigned u; if (tid <= 0 || !members) @@ -4846,8 +4839,7 @@ static void get_member_types(hid_t tid, mcomp_t *members) { else if (tclass == H5T_COMPOUND) { int nmembs; - nmembs = H5Tget_nmembers(tid); - if (nmembs <= 0) + if ((nmembs = H5Tget_nmembers(tid)) <= 0) return; members->n = (unsigned) nmembs; @@ -4865,15 +4857,15 @@ static void get_member_types(hid_t tid, mcomp_t *members) { } return; - } /*------------------------------------------------------------------------- - * XCAO, 11/10/2010 * added to improve performance for compound datasets * clean and close compound members. + *------------------------------------------------------------------------- */ -static void close_member_types(mcomp_t *members) { +static void close_member_types(mcomp_t *members) +{ unsigned u; if (!members || members->n <= 0 || !members->ids) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index aa33727..6019738 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -136,52 +136,55 @@ static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *ta * * Parameter: * table_out [OUT] : return the list - * - * Programmer: Jonathan Kim - * - * Date: March 15, 2011 *------------------------------------------------------------------------*/ -static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *options) +static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t ** table_out, diff_opt_t *opts) { - H5O_info_t oinfo1, oinfo2; /* Object info */ - hid_t attr1_id=-1; /* attr ID */ - hid_t attr2_id=-1; /* attr ID */ - size_t curr1 = 0; - size_t curr2 = 0; - unsigned infile[2]; - char name1[ATTR_NAME_MAX]; - char name2[ATTR_NAME_MAX]; - int cmp; - unsigned i; + int ret_value = 0; + H5O_info_t oinfo1, oinfo2; /* Object info */ + hid_t attr1_id = -1; /* attr ID */ + hid_t attr2_id = -1; /* attr ID */ + size_t curr1 = 0; + size_t curr2 = 0; + unsigned infile[2]; + char name1[ATTR_NAME_MAX]; + char name2[ATTR_NAME_MAX]; + int cmp; + unsigned i; table_attrs_t *table_lp = NULL; + h5difftrace("build_match_list_attrs start\n"); + if(H5Oget_info(loc1_id, &oinfo1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info first object failed"); if(H5Oget_info(loc2_id, &oinfo2) < 0) - goto error; - - table_attrs_init( &table_lp ); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info second object failed"); + table_attrs_init(&table_lp); + if (table_lp == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Table allocation failed"); /*-------------------------------------------------- * build the list */ while(curr1 < oinfo1.num_attrs && curr2 < oinfo2.num_attrs) { + h5diffdebug3("build_match_list_attrs 1: %ld - %ld\n", curr1, oinfo1.num_attrs); + h5diffdebug3("build_match_list_attrs 2: %ld - %ld\n", curr2, oinfo2.num_attrs); + /*------------------ * open attribute1 */ if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx first attribute failed"); /* get name */ if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name first attribute failed"); /*------------------ * open attribute2 */ if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx second attribute failed"); /* get name */ if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name second attribute failed"); /* criteria is string compare */ cmp = HDstrcmp(name1, name2); @@ -219,13 +222,16 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t infile[0] = 1; infile[1] = 0; while(curr1 < oinfo1.num_attrs) { + h5diffdebug3("build_match_list_attrs 1: %ld - %ld\n", curr1, oinfo1.num_attrs); + /*------------------ * open attribute1 */ if((attr1_id = H5Aopen_by_idx(loc1_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr1, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx first attribute failed"); /* get name */ if(H5Aget_name(attr1_id, (size_t)ATTR_NAME_MAX, name1) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name first attribute failed"); + h5diffdebug2("build_match_list_attrs #1 name - %s\n", name1); table_attr_mark_exist(infile, name1, table_lp); table_lp->nattrs_only1++; @@ -240,13 +246,15 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t infile[0] = 0; infile[1] = 1; while(curr2 < oinfo2.num_attrs) { + h5diffdebug3("build_match_list_attrs 2: %ld - %ld\n", curr2, oinfo2.num_attrs); /*------------------ * open attribute2 */ if((attr2_id = H5Aopen_by_idx(loc2_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)curr2, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx second attribute failed"); /* get name */ if(H5Aget_name(attr2_id, (size_t)ATTR_NAME_MAX, name2) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_name second attribute failed"); + h5diffdebug2("build_match_list_attrs #2 name - %s\n", name2); table_attr_mark_exist(infile, name2, table_lp); table_lp->nattrs_only2++; @@ -254,12 +262,13 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t /* close for next turn */ H5Aclose(attr2_id); + attr2_id = -1; } /*------------------------------------------------------ * print the list */ - if(options->m_verbose_level == 2) { + if(opts->m_verbose_level == 2) { /* if '-v2' is detected */ parallel_print(" obj1 obj2\n"); parallel_print(" --------------------------------------\n"); @@ -271,42 +280,35 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t } /* end for */ } - if(options->m_verbose_level >= 1) + if(opts->m_verbose_level >= 1) parallel_print("Attributes status: %d common, %d only in obj1, %d only in obj2\n", table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2, table_lp->nattrs_only1, table_lp->nattrs_only2); +done: *table_out = table_lp; - return 0; - -error: - if (0 < attr1_id) + /* disable error reporting */ + H5E_BEGIN_TRY { H5Aclose(attr1_id); - if (0 < attr2_id) H5Aclose(attr2_id); + } H5E_END_TRY; + + h5diffdebug2("build_match_list_attrs end - errstat:%d\n", opts->err_stat); - return -1; + return ret_value; } /*------------------------------------------------------------------------- * Function: diff_attr * - * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are - * obtained either from - * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); - * loc_id = H5Dopen2(fid, name); - * loc_id = H5Topen2(fid, name, H5P_DEFAULT); - * - * Return: number of differences found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November, 03, 2003 - * - * Modifications: - * March, 02, 2007: return the number of differences found + * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are + * obtained either from + * loc_id = H5Gopen2(fid, name, H5P_DEFAULT); + * loc_id = H5Dopen2(fid, name); + * loc_id = H5Topen2(fid, name, H5P_DEFAULT); * + * Return: number of differences found *------------------------------------------------------------------------- */ @@ -314,107 +316,118 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *path2, - diff_opt_t *options) + diff_opt_t *opts) { - hid_t attr1_id=-1; /* attr ID */ - hid_t attr2_id=-1; /* attr ID */ - hid_t space1_id=-1; /* space ID */ - hid_t space2_id=-1; /* space ID */ - hid_t ftype1_id=-1; /* file data type ID */ - hid_t ftype2_id=-1; /* file data type ID */ - int vstrtype1=0; /* ftype1 is a variable string */ - int vstrtype2=0; /* ftype2 is a variable string */ - hid_t mtype1_id=-1; /* memory data type ID */ - hid_t mtype2_id=-1; /* memory data type ID */ - size_t msize1; /* memory size of memory type */ - size_t msize2; /* memory size of memory type */ - void *buf1=NULL; /* data buffer */ - void *buf2=NULL; /* data buffer */ - hbool_t buf1hasdata=FALSE; /* buffer has data */ - hbool_t buf2hasdata=FALSE; /* buffer has data */ - hsize_t nelmts1; /* number of elements in dataset */ - int rank1; /* rank of dataset */ - int rank2; /* rank of dataset */ - hsize_t dims1[H5S_MAX_RANK];/* dimensions of dataset */ - hsize_t dims2[H5S_MAX_RANK];/* dimensions of dataset */ - char *name1; - char *name2; + int ret_value = opts->err_stat; + hid_t attr1_id = -1; /* attr ID */ + hid_t attr2_id = -1; /* attr ID */ + hid_t space1_id = -1; /* space ID */ + hid_t space2_id = -1; /* space ID */ + hid_t ftype1_id = -1; /* file data type ID */ + hid_t ftype2_id = -1; /* file data type ID */ + int vstrtype1 = 0; /* ftype1 is a variable string */ + int vstrtype2 = 0; /* ftype2 is a variable string */ + hid_t mtype1_id = -1; /* memory data type ID */ + hid_t mtype2_id = -1; /* memory data type ID */ + size_t msize1; /* memory size of memory type */ + size_t msize2; /* memory size of memory type */ + void *buf1 = NULL; /* data buffer */ + void *buf2 = NULL; /* data buffer */ + hbool_t buf1hasdata = FALSE; /* buffer has data */ + hbool_t buf2hasdata = FALSE; /* buffer has data */ + hsize_t nelmts1; /* number of elements in dataset */ + int rank1; /* rank of dataset */ + int rank2; /* rank of dataset */ + hsize_t dims1[H5S_MAX_RANK]; /* dimensions of dataset */ + hsize_t dims2[H5S_MAX_RANK]; /* dimensions of dataset */ + char *name1 = NULL; + char *name2 = NULL; char np1[512]; char np2[512]; - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ hsize_t nfound = 0; hsize_t nfound_total = 0; int j; - table_attrs_t * match_list_attrs = NULL; - if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) - goto error; + table_attrs_t *match_list_attrs = NULL; + h5difftrace("diff_attr start\n"); + + if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) { + HGOTO_ERROR(1, H5E_tools_min_id_g, "build_match_list_attrs failed"); + } + h5diffdebug2("build_match_list_attrs - errstat:%d\n", opts->err_stat); /* if detect any unique extra attr */ if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) { + h5difftrace("diff_attr attributes only in one file\n"); /* exit will be 1 */ - options->contents = 0; + opts->contents = 0; } + h5diffdebug2("match_list_attrs info - errstat:%d\n", opts->err_stat); for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { + h5diffdebug3("match_list_attrs loop[%d] - errstat:%d\n", u, opts->err_stat); if((match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1])) { name1 = name2 = match_list_attrs->attrs[u].name; + h5diffdebug2("diff_attr name - %s\n", name1); /*-------------- * attribute 1 */ if((attr1_id = H5Aopen(loc1_id, name1, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aopen first attribute failed"); /*-------------- * attribute 2 */ if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aopen second attribute failed"); + h5difftrace("diff_attr got attributes\n"); /* get the datatypes */ if((ftype1_id = H5Aget_type(attr1_id)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); vstrtype1 = H5Tis_variable_str(ftype1_id); if((ftype2_id = H5Aget_type(attr2_id)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); vstrtype2 = H5Tis_variable_str(ftype2_id); + /* no compare if either one but not both are variable string type */ if (vstrtype1 != vstrtype2) { - if((options->m_verbose || options->m_list_not_cmp)) + if((opts->m_verbose || opts->m_list_not_cmp)) parallel_print("Not comparable: one of attribute <%s/%s> or <%s/%s> is of variable length type\n", path1, name1, path2, name2); - options->not_cmp = 1; + opts->not_cmp = 1; if (H5Tclose(ftype1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if (H5Tclose(ftype2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); if (H5Aclose(attr1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed"); if (H5Aclose(attr2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose second attribute failed"); continue; } if((mtype1_id = H5Tget_native_type(ftype1_id, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type first attribute ftype failed"); if((mtype2_id = H5Tget_native_type(ftype2_id, H5T_DIR_DEFAULT)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type second attribute ftype failed"); if((msize1 = H5Tget_size(mtype1_id)) == 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_size first attribute mtype failed"); if((msize2 = H5Tget_size(mtype2_id)) == 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_size second attribute mtype failed"); /* get the dataspace */ if((space1_id = H5Aget_space(attr1_id)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_space first attribute failed"); if((space2_id = H5Aget_space(attr2_id)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_space second attribute failed"); /* get dimensions */ if((rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims first attribute failed"); if((rank2 = H5Sget_simple_extent_dims(space2_id, dims2, NULL)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims second attribute failed"); /*---------------------------------------------------------------------- * check for comparable TYPE and SPACE @@ -424,23 +437,23 @@ hsize_t diff_attr(hid_t loc1_id, /* pass dims1 and dims2 for maxdims as well since attribute's maxdims * are always same */ if(diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, - dims1, dims2, name1, name2, options, 0) != 1) { + dims1, dims2, name1, name2, opts, 0) != 1) { if(H5Tclose(ftype1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute ftype failed"); if(H5Tclose(ftype2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute ftype failed"); if(H5Sclose(space1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sclose first attribute failed"); if(H5Sclose(space2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sclose second attribute failed"); if(H5Aclose(attr1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose first attribute failed"); if(H5Aclose(attr2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aclose second attribute failed"); if(H5Tclose(mtype1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); if(H5Tclose(mtype2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); continue; } @@ -451,7 +464,7 @@ hsize_t diff_attr(hid_t loc1_id, */ if(FAIL == match_up_memsize(ftype1_id, ftype2_id, &mtype1_id, &mtype2_id, &msize1, &msize2)) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "match_up_memsize failed"); /*--------------------------------------------------------------------- * read @@ -465,18 +478,18 @@ hsize_t diff_attr(hid_t loc1_id, buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2); if(buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "buffer allocation failed"); } if(H5Aread(attr1_id, mtype1_id, buf1) < 0) { parallel_print("Failed reading attribute1 %s/%s\n", path1, name1); - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); } else buf1hasdata = TRUE; if(H5Aread(attr2_id, mtype2_id, buf2) < 0) { parallel_print("Failed reading attribute2 %s/%s\n", path2, name2); - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); } else buf2hasdata = TRUE; @@ -492,22 +505,22 @@ hsize_t diff_attr(hid_t loc1_id, /* always print name */ /* verbose (-v) and report (-r) mode */ - if(options->m_verbose || options->m_report) { + if(opts->m_verbose || opts->m_report) { do_print_attrname("attribute", np1, np2); nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id); + dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); print_found(nfound); } /* quiet mode (-q), just count differences */ - else if(options->m_quiet) { + else if(opts->m_quiet) { nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id); + dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); } /* the rest (-c, none, ...) */ else { nfound = diff_array(buf1, buf2, nelmts1, (hsize_t) 0, rank1, - dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id); + dims1, opts, np1, np2, mtype1_id, attr1_id, attr2_id); /* print info if compatible and difference found */ if (nfound) { @@ -534,31 +547,29 @@ hsize_t diff_attr(hid_t loc1_id, buf2 = NULL; if(H5Tclose(ftype1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Tclose(ftype2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Sclose(space1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Sclose(space2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Aclose(attr1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type first attribute failed"); if(H5Aclose(attr2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Aget_type second attribute failed"); if(H5Tclose(mtype1_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose first attribute mtype failed"); if(H5Tclose(mtype2_id) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tclose second attribute mtype failed"); nfound_total += nfound; } } /* u */ - table_attrs_free(match_list_attrs); - - return nfound_total; +done: + opts->err_stat = opts->err_stat | ret_value; -error: H5E_BEGIN_TRY { if(buf1) { if(buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id)) @@ -583,7 +594,7 @@ error: H5Aclose(attr2_id); } H5E_END_TRY; - options->err_stat = 1; + h5diffdebug2("diff_attr end - errstat:%d\n", opts->err_stat); return nfound_total; } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 7125f5f..e74cbae 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -1,15 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -* Copyright by The HDF Group. * -* Copyright by the Board of Trustees of the University of Illinois. * -* All rights reserved. * -* * -* This file is part of HDF5. The full HDF5 copyright notice, including * -* terms governing use, modification, and redistribution, is contained in * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * -* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "H5private.h" #include "h5tools.h" @@ -19,25 +19,22 @@ /*------------------------------------------------------------------------- -* Function: diff_dataset -* -* Purpose: check for comparable datasets and read into a compatible -* memory type -* -* Return: Number of differences found -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: May 9, 2003 -* -*------------------------------------------------------------------------- -*/ -hsize_t diff_dataset( hid_t file1_id, - hid_t file2_id, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options) + * Function: diff_dataset + * + * Purpose: check for comparable datasets and read into a compatible + * memory type + * + * Return: Number of differences found + *------------------------------------------------------------------------- + */ +hsize_t diff_dataset(hid_t file1_id, + hid_t file2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *opts) { + int ret_value = opts->err_stat; + int status = -1; hid_t did1 = -1; hid_t did2 = -1; hid_t dcpl1 = -1; @@ -46,53 +43,45 @@ hsize_t diff_dataset( hid_t file1_id, h5difftrace("diff_dataset start\n"); /*------------------------------------------------------------------------- - * open the handles - *------------------------------------------------------------------------- - */ - /* disable error reporting */ - H5E_BEGIN_TRY - { - /* Open the datasets */ - if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) { - parallel_print("Cannot open dataset <%s>\n", obj1_name); - goto error; - } - if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) { - parallel_print("Cannot open dataset <%s>\n", obj2_name); - goto error; - } - /* enable error reporting */ - } H5E_END_TRY; - + * open the handles + *------------------------------------------------------------------------- + */ + /* Open the datasets */ + if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) { + parallel_print("Cannot open dataset <%s>\n", obj1_name); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 first dataset failed"); + } + if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) { + parallel_print("Cannot open dataset <%s>\n", obj2_name); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dopen2 second dataset failed"); + } if((dcpl1 = H5Dget_create_plist(did1)) < 0) - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist first dataset failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) - goto error; - - /*------------------------------------------------------------------------- - * check if the dataset creation property list has filters that - * are not registered in the current configuration - * 1) the external filters GZIP and SZIP might not be available - * 2) the internal filters might be turned off - *------------------------------------------------------------------------- - */ - if ((h5tools_canreadf((options->m_verbose ? obj1_name : NULL), dcpl1) == 1) && - (h5tools_canreadf((options->m_verbose ? obj2_name : NULL), dcpl2) == 1)) - nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, options); - else - goto error; + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist second dataset failed"); /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - goto done; - -error: - options->err_stat = 1; + * check if the dataset creation property list has filters that + * are not registered in the current configuration + * 1) the external filters GZIP and SZIP might not be available + * 2) the internal filters might be turned off + *------------------------------------------------------------------------- + */ + if ((status = h5tools_canreadf((opts->m_verbose ? obj1_name : NULL), dcpl1) == 1) && + (status = h5tools_canreadf((opts->m_verbose ? obj2_name : NULL), dcpl2) == 1)) + nfound = diff_datasetid(did1, did2, obj1_name, obj2_name, opts); + else if (status < 0) { + HGOTO_ERROR(1, H5E_tools_min_id_g, "h5tools_canreadf failed"); + } + else { + ret_value = 1; + opts->not_cmp = 1; + } done: + opts->err_stat = opts->err_stat | ret_value; + /* disable error reporting */ H5E_BEGIN_TRY { H5Pclose(dcpl1); @@ -102,82 +91,75 @@ done: /* enable error reporting */ } H5E_END_TRY; - h5difftrace("diff_dataset end\n"); + h5diffdebug3("diff_dataset finish:%d - errstat:%d\n", nfound, opts->err_stat); return nfound; } /*------------------------------------------------------------------------- -* Function: diff_datasetid -* -* Purpose: check for comparable datasets and read into a compatible -* memory type -* -* Return: Number of differences found -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: May 9, 2003 -* -* Modifications: -* -* -* October 2006: Read by hyperslabs for big datasets. -* -* A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done -* i.e., if the memory needed to read a dataset is greater than this limit, -* then hyperslab I/O is done instead of one operation I/O -* For each dataset, the memory needed is calculated according to -* -* memory needed = number of elements * size of each element -* -* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations -* are done -* -* H5Dread( input_dataset1 ) -* H5Dread( input_dataset2 ) -* -* with all elements in the datasets selected. If the memory needed is greater than -* H5TOOLS_MALLOCSIZE, then the following operations are done instead: -* -* a strip mine is defined for each dimension k (a strip mine is defined as a -* hyperslab whose size is memory manageable) according to the formula -* -* (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type) -* -* where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures -* that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip -* mine size k is simply defined as its dimension k, but for larger datasets the -* hyperslab size is still memory manageable. -* a cycle is done until the number of elements in the dataset is reached. In each -* iteration, two parameters are defined for the function H5Sselect_hyperslab, -* the start and size of each hyperslab, according to -* -* (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k]) -* -* where hyperslab_offset [k] is initially set to zero, and later incremented in -* hyperslab_size[k] offsets. The reason for the operation -* -* dimension[k] - hyperslab_offset[k] -* -* in (2) is that, when using the strip mine size, it assures that the "remaining" part -* of the dataset that does not fill an entire strip mine is processed. -* -*------------------------------------------------------------------------- -*/ -hsize_t diff_datasetid( hid_t did1, - hid_t did2, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options) + * Function: diff_datasetid + * + * Purpose: check for comparable datasets and read into a compatible + * memory type + * + * Return: Number of differences found + * + * October 2006: Read by hyperslabs for big datasets. + * + * A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done + * i.e., if the memory needed to read a dataset is greater than this limit, + * then hyperslab I/O is done instead of one operation I/O + * For each dataset, the memory needed is calculated according to + * + * memory needed = number of elements * size of each element + * + * if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations + * are done + * + * H5Dread( input_dataset1 ) + * H5Dread( input_dataset2 ) + * + * with all elements in the datasets selected. If the memory needed is greater than + * H5TOOLS_MALLOCSIZE, then the following operations are done instead: + * + * a strip mine is defined for each dimension k (a strip mine is defined as a + * hyperslab whose size is memory manageable) according to the formula + * + * (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type) + * + * where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures + * that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip + * mine size k is simply defined as its dimension k, but for larger datasets the + * hyperslab size is still memory manageable. + * a cycle is done until the number of elements in the dataset is reached. In each + * iteration, two parameters are defined for the function H5Sselect_hyperslab, + * the start and size of each hyperslab, according to + * + * (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k]) + * + * where hyperslab_offset [k] is initially set to zero, and later incremented in + * hyperslab_size[k] offsets. The reason for the operation + * + * dimension[k] - hyperslab_offset[k] + * + * in (2) is that, when using the strip mine size, it assures that the "remaining" part + * of the dataset that does not fill an entire strip mine is processed. + * + *------------------------------------------------------------------------- + */ +hsize_t diff_datasetid(hid_t did1, + hid_t did2, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *opts) { - int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t sid1=-1; - hid_t sid2=-1; - hid_t f_tid1=-1; - hid_t f_tid2=-1; - hid_t dam_tid=-1; /* m_tid for diff_array function */ - hid_t m_tid1=-1; - hid_t m_tid2=-1; + int ret_value = opts->err_stat; + hid_t sid1 = -1; + hid_t sid2 = -1; + hid_t f_tid1 = -1; + hid_t f_tid2 = -1; + hid_t dam_tid = -1; /* m_tid for diff_array function */ + hid_t m_tid1 = -1; + hid_t m_tid2 = -1; hid_t dcpl1 = -1; hid_t dcpl2 = -1; H5D_layout_t stl1 = -1; @@ -197,42 +179,41 @@ hsize_t diff_datasetid( hid_t did1, hsize_t dims2[H5S_MAX_RANK]; hsize_t maxdim1[H5S_MAX_RANK]; hsize_t maxdim2[H5S_MAX_RANK]; - const char *name1=NULL; /* relative names */ - const char *name2=NULL; + const char *name1 = NULL; /* relative names */ + const char *name2 = NULL; hsize_t storage_size1; hsize_t storage_size2; - hsize_t nfound=0; /* number of differences found */ - int can_compare=1; /* do diff or not */ - void *buf1=NULL; - void *buf2=NULL; - void *sm_buf1=NULL; - void *sm_buf2=NULL; - hid_t sm_space; /*stripmine data space */ - size_t need; /* bytes needed for malloc */ + hsize_t nfound = 0; /* number of differences found */ + int can_compare = 1; /* do diff or not */ + void *buf1 = NULL; + void *buf2 = NULL; + void *sm_buf1 = NULL; + void *sm_buf2 = NULL; + hid_t sm_space; /*stripmine data space */ + size_t need; /* bytes needed for malloc */ int i; - unsigned int vl_data = 0; /*contains VL datatypes */ + unsigned int vl_data = 0; /*contains VL datatypes */ - options->err_stat = 1; h5difftrace("diff_datasetid start\n"); /* Get the dataspace handle */ if((sid1 = H5Dget_space(did1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get the dataspace handle */ if((sid2 = H5Dget_space(did2)) < 0 ) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_space failed"); /* Get rank */ if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); /* Get dimensions */ if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0) @@ -240,36 +221,36 @@ hsize_t diff_datasetid( hid_t did1, h5diffdebug3("rank: %ld - %ld\n", rank1, rank2); /*------------------------------------------------------------------------- - * get the file data type - *------------------------------------------------------------------------- - */ + * get the file data type + *------------------------------------------------------------------------- + */ /* Get the data type */ if((f_tid1 = H5Dget_type(did1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_type failed"); /* Get the data type */ if((f_tid2 = H5Dget_type(did2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_type failed"); /*------------------------------------------------------------------------- - * get the storage layout type - *------------------------------------------------------------------------- - */ + * get the storage layout type + *------------------------------------------------------------------------- + */ if((dcpl1 = H5Dget_create_plist(did1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((dcpl2 = H5Dget_create_plist(did2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dget_create_plist failed"); if((stl1 = H5Pget_layout(dcpl1)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Pget_layout failed"); if((stl2 = H5Pget_layout(dcpl2)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Pget_layout failed"); /*------------------------------------------------------------------------- - * check for empty datasets - *------------------------------------------------------------------------- - */ + * check for empty datasets + *------------------------------------------------------------------------- + */ h5difftrace("check for empty datasets\n"); storage_size1 = H5Dget_storage_size(did1); @@ -277,66 +258,69 @@ hsize_t diff_datasetid( hid_t did1, h5diffdebug3("storage size: %ld - %ld\n", storage_size1, storage_size2); if(storage_size1 == 0 || storage_size2 == 0) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) - parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name); + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) + parallel_print("Not comparable: <%s> or <%s> is an empty dataset\n", obj1_name, obj2_name); can_compare = 0; - options->not_cmp = 1; + opts->not_cmp = 1; } /*------------------------------------------------------------------------- - * check for comparable TYPE and SPACE - *------------------------------------------------------------------------- - */ + * check for comparable TYPE and SPACE + *------------------------------------------------------------------------- + */ if (diff_can_type(f_tid1, f_tid2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, - options, 0) != 1) + opts, 0) != 1) can_compare = 0; + h5diffdebug2("diff_can_type - errstat:%d\n", opts->err_stat); /*------------------------------------------------------------------------- - * memory type and sizes - *------------------------------------------------------------------------- - */ + * memory type and sizes + *------------------------------------------------------------------------- + */ h5difftrace("check for memory type and sizes\n"); if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type failed"); if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Tget_native_type failed"); m_size1 = H5Tget_size(m_tid1); m_size2 = H5Tget_size(m_tid2); h5diffdebug3("type size: %ld - %ld\n", m_size1, m_size2); /*------------------------------------------------------------------------- - * check for different signed/unsigned types - *------------------------------------------------------------------------- - */ + * check for different signed/unsigned types + *------------------------------------------------------------------------- + */ if(can_compare) { h5difftrace("can_compare for sign\n"); sign1 = H5Tget_sign(m_tid1); sign2 = H5Tget_sign(m_tid2); if(sign1 != sign2) { h5difftrace("sign1 != sign2\n"); - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } can_compare = 0; - options->not_cmp = 1; + opts->not_cmp = 1; } } /* Check if type is either VLEN-data or VLEN-string to reclaim any - * VLEN memory buffer later */ + * VLEN memory buffer later + */ if(TRUE == h5tools_detect_vlen(m_tid1)) vl_data = TRUE; + h5diffdebug2("h5tools_detect_vlen - errstat:%d\n", opts->err_stat); /*------------------------------------------------------------------------ - * only attempt to compare if possible - *------------------------------------------------------------------------- - */ + * only attempt to compare if possible + *------------------------------------------------------------------------- + */ if(can_compare) { /* it is possible to compare */ H5T_class_t tclass = H5Tget_class(f_tid1); h5difftrace("can_compare attempt\n"); @@ -357,14 +341,14 @@ hsize_t diff_datasetid( hid_t did1, if(tclass != H5T_ARRAY) { /*----------------------------------------------------------------- - * "upgrade" the smaller memory size - *------------------------------------------------------------------ - */ + * "upgrade" the smaller memory size + *------------------------------------------------------------------ + */ h5difftrace("upgrade the smaller memory size?\n"); if (FAIL == match_up_memsize (f_tid1, f_tid2, &m_tid1, &m_tid2, &m_size1, &m_size2)) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "match_up_memsize failed"); h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2); dadims = dims1; dam_size = m_size1; @@ -395,12 +379,13 @@ hsize_t diff_datasetid( hid_t did1, name1 = diff_basename(obj1_name); if(obj2_name) name2 = diff_basename(obj2_name); + h5diffdebug3("obj_names: %s - %s\n", name1, name2); /*---------------------------------------------------------------- - * read/compare - *----------------------------------------------------------------- - */ + * read/compare + *----------------------------------------------------------------- + */ if(need < H5TOOLS_MALLOCSIZE) { buf1 = HDmalloc(need); buf2 = HDmalloc(need); @@ -409,17 +394,19 @@ hsize_t diff_datasetid( hid_t did1, if(buf1 != NULL && buf2 != NULL) { h5difftrace("buf1 != NULL && buf2 != NULL\n"); if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); h5difftrace("H5Dread did2\n"); if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); /* array diff */ nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims, - options, name1, name2, dam_tid, did1, did2); + opts, name1, name2, dam_tid, did1, did2); + h5diffdebug2("diff_array nfound:%d\n", nfound); /* reclaim any VL memory, if necessary */ if(vl_data) { + h5difftrace("check vl_data\n"); H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ @@ -462,6 +449,7 @@ hsize_t diff_datasetid( hid_t did1, size = 1; sm_size[i - 1] = MIN(dadims[i - 1], size); sm_nbytes *= sm_size[i - 1]; + h5diffdebug2("sm_nbytes: %ld\n", sm_nbytes); } /* end for */ /* malloc return code should be verified. @@ -472,9 +460,9 @@ hsize_t diff_datasetid( hid_t did1, * E.g., sm_space. */ if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "HDmalloc failed"); if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "HDmalloc failed"); sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); @@ -491,24 +479,24 @@ hsize_t diff_datasetid( hid_t did1, hs_nelmts *= hs_size[i]; } /* end for */ if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); } /* end if */ else hs_nelmts = 1; if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(1, H5E_tools_min_id_g, "H5Dread failed"); /* get array differences. in the case of hyperslab read, increment the number of differences found in each hyperslab and pass the position at the beginning for printing */ nfound += diff_array(sm_buf1, sm_buf2, hs_nelmts, elmtno, rank1, - dadims, options, name1, name2, dam_tid, did1, did2); + dadims, opts, name1, name2, dam_tid, did1, did2); /* reclaim any VL memory, if necessary */ if(vl_data) { @@ -543,11 +531,10 @@ hsize_t diff_datasetid( hid_t did1, * close *------------------------------------------------------------------------- */ - h5difftrace("reclaim any VL memory\n"); + h5diffdebug2("reclaim any VL memory - errstat:%d\n", opts->err_stat); done: - - options->err_stat = ret_value; + opts->err_stat = opts->err_stat | ret_value; /* free */ if(buf1 != NULL) { @@ -589,60 +576,55 @@ done: H5Tclose(m_tid2); /* enable error reporting */ } H5E_END_TRY; - h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound); + h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound); return nfound; } /*------------------------------------------------------------------------- -* Function: diff_can_type -* -* Purpose: check for comparable TYPE and SPACE -* -* Return: -* 1, can compare -* 0, cannot compare -* -1, error -* -* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu -* -* Date: November 3, 2003 -* -*------------------------------------------------------------------------- -*/ - -int diff_can_type( hid_t f_tid1, /* file data type */ - hid_t f_tid2, /* file data type */ - int rank1, - int rank2, - hsize_t *dims1, - hsize_t *dims2, - hsize_t *maxdim1, - hsize_t *maxdim2, - const char *obj1_name, - const char *obj2_name, - diff_opt_t *options, - int is_compound) + * Function: diff_can_type + * + * Purpose: check for comparable TYPE and SPACE + * + * Return: + * 1, can compare + * 0, cannot compare + * -1, error + *------------------------------------------------------------------------- + */ + +int diff_can_type(hid_t f_tid1, /* file data type */ + hid_t f_tid2, /* file data type */ + int rank1, + int rank2, + hsize_t *dims1, + hsize_t *dims2, + hsize_t *maxdim1, + hsize_t *maxdim2, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *opts, + int is_compound) { + int ret_value = 1; /* can_compare value */ H5T_class_t tclass1; H5T_class_t tclass2; int maxdim_diff = 0; /* maximum dimensions are different */ int dim_diff = 0; /* current dimensions are different */ int i; - int can_compare = 1; /* return value */ h5difftrace("diff_can_type start\n"); /*------------------------------------------------------------------------- - * check for the same class - *------------------------------------------------------------------------- - */ + * check for the same class + *------------------------------------------------------------------------- + */ if((tclass1 = H5Tget_class(f_tid1)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_class first object failed"); if((tclass2 = H5Tget_class(f_tid2)) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_class second object failed"); if(tclass1 != tclass2) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { if(is_compound) { parallel_print("Not comparable: <%s> has a class %s and <%s> has a class %s\n", obj1_name, get_class(tclass1), @@ -654,24 +636,22 @@ int diff_can_type( hid_t f_tid1, /* file data type */ obj2_name, get_class(tclass2)); } } - can_compare = 0; - options->not_cmp = 1; - goto done; + opts->not_cmp = 1; + HGOTO_DONE(0); } /*------------------------------------------------------------------------- - * check for non supported classes - *------------------------------------------------------------------------- - */ + * check for non supported classes + *------------------------------------------------------------------------- + */ switch (tclass1) { case H5T_TIME: - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> and <%s> are of class %s\n", obj1_name, obj2_name, get_class(tclass2)); } /* end if */ - can_compare = 0; - options->not_cmp = 1; - goto done; + opts->not_cmp = 1; + HGOTO_DONE(0); case H5T_INTEGER: case H5T_FLOAT: @@ -691,10 +671,10 @@ int diff_can_type( hid_t f_tid1, /* file data type */ } /* end switch */ /*------------------------------------------------------------------------- - * check for equal file datatype; warning only - *------------------------------------------------------------------------- - */ - if((H5Tequal(f_tid1, f_tid2) == 0) && (options->m_verbose) && obj1_name && obj2_name) { + * check for equal file datatype; warning only + *------------------------------------------------------------------------- + */ + if((H5Tequal(f_tid1, f_tid2) == 0) && (opts->m_verbose) && obj1_name && obj2_name) { H5T_class_t cl = H5Tget_class(f_tid1); parallel_print("Warning: different storage datatype\n"); @@ -709,11 +689,11 @@ int diff_can_type( hid_t f_tid1, /* file data type */ } /*------------------------------------------------------------------------- - * check for the same rank - *------------------------------------------------------------------------- - */ + * check for the same rank + *------------------------------------------------------------------------- + */ if(rank1 != rank2) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dimensions(rank1, dims1); parallel_print(", max dimensions "); @@ -725,15 +705,14 @@ int diff_can_type( hid_t f_tid1, /* file data type */ print_dimensions(rank2, maxdim2); parallel_print("\n"); } - can_compare = 0; - options->not_cmp = 1; - goto done; + opts->not_cmp = 1; + HGOTO_DONE(0); } /*------------------------------------------------------------------------- - * check for different dimensions - *------------------------------------------------------------------------- - */ + * check for different dimensions + *------------------------------------------------------------------------- + */ for(i = 0; im_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dimensions(rank1, dims1); if(maxdim1 && maxdim2) { @@ -762,17 +741,16 @@ int diff_can_type( hid_t f_tid1, /* file data type */ parallel_print("\n"); } } - can_compare = 0; - options->not_cmp = 1; - goto done; + opts->not_cmp = 1; + HGOTO_DONE(0); } /*------------------------------------------------------------------------- - * maximum dimensions; just give a warning - *------------------------------------------------------------------------- - */ + * maximum dimensions; just give a warning + *------------------------------------------------------------------------- + */ if(maxdim1 && maxdim2 && maxdim_diff == 1 && obj1_name) { - if(options->m_verbose) { + if(opts->m_verbose) { parallel_print( "Warning: different maximum dimensions\n"); parallel_print("<%s> has max dimensions ", obj1_name); print_dimensions(rank1, maxdim1); @@ -787,21 +765,20 @@ int diff_can_type( hid_t f_tid1, /* file data type */ int nmembs1; int nmembs2; int j; - hid_t memb_type1; - hid_t memb_type2; + hid_t memb_type1 = -1; + hid_t memb_type2 = -1; nmembs1 = H5Tget_nmembers(f_tid1); nmembs2 = H5Tget_nmembers(f_tid2); if(nmembs1 != nmembs2) { - if((options->m_verbose || options->m_list_not_cmp) && obj1_name && obj2_name) { + if((opts->m_verbose || opts->m_list_not_cmp) && obj1_name && obj2_name) { parallel_print("Not comparable: <%s> has %d members ", obj1_name, nmembs1); parallel_print("<%s> has %d members ", obj2_name, nmembs2); parallel_print("\n"); } - can_compare = 0; - options->not_cmp = 1; - goto done; + opts->not_cmp = 1; + HGOTO_DONE(0); } for (j = 0; j < nmembs1; j++) { @@ -810,30 +787,31 @@ int diff_can_type( hid_t f_tid1, /* file data type */ if (diff_can_type(memb_type1, memb_type2, rank1, rank2, dims1, dims2, maxdim1, maxdim2, obj1_name, obj2_name, - options, 1) != 1) { - can_compare = 0; - options->not_cmp = 1; + opts, 1) != 1) { + opts->not_cmp = 1; H5Tclose(memb_type1); H5Tclose(memb_type2); - goto done; + HGOTO_DONE(0); } H5Tclose(memb_type1); H5Tclose(memb_type2); } } done: - h5diffdebug2("diff_can_type end - %d\n", can_compare); - return can_compare; + if (ret_value < 0) + opts->err_stat = 1; + + h5diffdebug2("diff_can_type end - %d\n", ret_value); + return ret_value; } /*------------------------------------------------------------------------- -* Function: print_sizes -* -* Purpose: Print datatype sizes -* -*------------------------------------------------------------------------- -*/ + * Function: print_sizes + * + * Purpose: Print datatype sizes + *------------------------------------------------------------------------- + */ #if defined (H5DIFF_DEBUG) void print_sizes( const char *obj1, const char *obj2, diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 7a09ada..0f0fd14 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -24,8 +24,7 @@ int g_nTasks = 1; /*------------------------------------------------------------------------- * Function: print_dimensions * - * Purpose: print dimensions - * + * Purpose: print dimensions *------------------------------------------------------------------------- */ void @@ -33,14 +32,14 @@ print_dimensions (int rank, hsize_t *dims) { int i; - if( rank <= 0 ) + if(rank <= 0) parallel_print("H5S_SCALAR" ); else { if (!dims) parallel_print("dimension is NULL"); else { parallel_print("["); - for ( i = 0; i < rank-1; i++) { + for (i = 0; i < rank-1; i++) { parallel_print(HSIZE_T_FORMAT, dims[i]); parallel_print("x"); } @@ -55,16 +54,11 @@ print_dimensions (int rank, hsize_t *dims) /*------------------------------------------------------------------------- * Function: print_type * - * Purpose: Print name of datatype - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 + * Purpose: Print name of datatype * - * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only + * Return: void * + * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only *------------------------------------------------------------------------- */ void print_type(hid_t type) @@ -188,15 +182,10 @@ void print_type(hid_t type) /*------------------------------------------------------------------------- * Function: diff_basename * - * Purpose: Returns a pointer to the last component absolute name - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * + * Purpose: Returns a pointer to the last component absolute name *------------------------------------------------------------------------- */ -const char* + const char* diff_basename(const char *name) { size_t i; @@ -219,12 +208,7 @@ diff_basename(const char *name) /*------------------------------------------------------------------------- * Function: get_type * - * Purpose: Returns the type as a string - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * + * Purpose: Returns the type as a string *------------------------------------------------------------------------- */ const char* @@ -255,21 +239,13 @@ get_type(h5trav_type_t type) /*------------------------------------------------------------------------- * Function: get_sign * - * Purpose: Returns the sign as a string - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * - * Comments: - * + * Purpose: Returns the sign as a string *------------------------------------------------------------------------- */ -const char* + const char* get_sign(H5T_sign_t sign) { - switch(sign) - { + switch(sign) { case H5T_SGN_NONE: return "H5T_SGN_NONE"; @@ -291,15 +267,10 @@ get_sign(H5T_sign_t sign) /*------------------------------------------------------------------------- * Function: get_class * - * Purpose: Returns the class as a string - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 - * + * Purpose: Returns the class as a string *------------------------------------------------------------------------- */ -const char* + const char* get_class(H5T_class_t tclass) { switch(tclass) { @@ -346,8 +317,7 @@ get_class(H5T_class_t tclass) /*------------------------------------------------------------------------- * Function: print_found * - * Purpose: print number of differences found - * + * Purpose: print number of differences found *------------------------------------------------------------------------- */ void print_found(hsize_t nfound) @@ -362,43 +332,37 @@ void print_found(hsize_t nfound) /*----------------------------------------------------------------- * Function: match_up_memsize * - * Purpose: match smaller memory size up to bigger memory size + * Purpose: match smaller memory size up to bigger memory size *------------------------------------------------------------------ */ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, hid_t *m_tid1, hid_t *m_tid2, size_t *m_size1, size_t *m_size2) { - herr_t ret = SUCCEED; + herr_t ret_value = SUCCEED; if((*m_size1) != (*m_size2)) { if((*m_size1) < (*m_size2)) { - H5Tclose( *m_tid1 ); + H5Tclose(*m_tid1); - if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) { - ret = FAIL; - goto out; - } + if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); - *m_size1 = H5Tget_size( *m_tid1 ); + *m_size1 = H5Tget_size(*m_tid1); } /* end if */ else { H5Tclose(*m_tid2); - if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) { - ret = FAIL; - goto out; - } + if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed"); *m_size2 = H5Tget_size(*m_tid2); } /* end else */ } /* end if */ - if((*m_size1) != (*m_size2)) { - ret = FAIL; - goto out; - } + if((*m_size1) != (*m_size2)) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "native type sizes do not compare"); -out: - return ret; +done: + return ret_value; } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index c9b0807..57b6ef6 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -625,8 +625,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) - { + if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) { HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); HGOTO_DONE(dimension_break); } @@ -1890,9 +1889,8 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ obj = search_obj(h5dump_type_table, oinfo.addr); if(obj) { - if(!obj->recorded) { + if(!obj->recorded) h5tools_str_append(buffer,"\"/#"H5_PRINTF_HADDR_FMT"\"", obj->objno); - } else h5tools_str_append(buffer, "\"%s\"", obj->objname); } @@ -1909,121 +1907,86 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ switch (type_class) { case H5T_INTEGER: - if (H5Tequal(type, H5T_STD_I8BE) == TRUE) { + if (H5Tequal(type, H5T_STD_I8BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I8BE"); - } - else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I8LE"); - } - else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I16BE"); - } - else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I16LE"); - } - else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I32BE"); - } - else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I32LE"); - } - else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I64BE"); - } - else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_I64LE"); - } - else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U8BE"); - } - else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U8LE"); - } - else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U16BE"); - } - else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U16LE"); - } - else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U32BE"); - } - else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U32LE"); - } - else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U64BE"); - } - else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_U64LE"); - } - else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_SCHAR"); - } - else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_UCHAR"); - } - else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_SHORT"); - } - else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_USHORT"); - } - else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_INT"); - } - else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_UINT"); - } - else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_LONG"); - } - else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_ULONG"); - } - else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_LLONG"); - } - else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_ULLONG"); - } else { /* byte order */ if (H5Tget_size(type) > 1) { order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { + if (H5T_ORDER_LE == order) order_s = " little-endian"; - } - else if (H5T_ORDER_BE == order) { + else if (H5T_ORDER_BE == order) order_s = " big-endian"; - } - else if (H5T_ORDER_VAX == order) { + else if (H5T_ORDER_VAX == order) order_s = " mixed-endian"; - } - else { + else order_s = " unknown-byte-order"; - } } - else { + else order_s = ""; - } /* sign */ if ((sign = H5Tget_sign(type)) >= 0) { - if (H5T_SGN_NONE == sign) { + if (H5T_SGN_NONE == sign) sign_s = " unsigned"; - } - else if (H5T_SGN_2 == sign) { + else if (H5T_SGN_2 == sign) sign_s = ""; - } - else { + else sign_s = " unknown-sign"; - } } - else { + else sign_s = " unknown-sign"; - } /* print size, order, and sign */ h5tools_str_append(buffer, "%lu-bit%s%s integer", @@ -2032,56 +1995,42 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; case H5T_FLOAT: - if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) { + if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F32BE"); - } - else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) { + else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F32LE"); - } - else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) { + else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F64BE"); - } - else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) { + else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) h5tools_str_append(buffer, "H5T_IEEE_F64LE"); - } - else if (H5Tequal(type, H5T_VAX_F32) == TRUE) { + else if (H5Tequal(type, H5T_VAX_F32) == TRUE) h5tools_str_append(buffer, "H5T_VAX_F32"); - } - else if (H5Tequal(type, H5T_VAX_F64) == TRUE) { + else if (H5Tequal(type, H5T_VAX_F64) == TRUE) h5tools_str_append(buffer, "H5T_VAX_F64"); - } - else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_FLOAT"); - } - else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE !=0 - } - else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) { + else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) h5tools_str_append(buffer, "H5T_NATIVE_LDOUBLE"); #endif - } else { /* byte order */ if (H5Tget_size(type) > 1) { order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { + if (H5T_ORDER_LE == order) order_s = " little-endian"; - } - else if (H5T_ORDER_BE == order) { + else if (H5T_ORDER_BE == order) order_s = " big-endian"; - } - else if (H5T_ORDER_VAX == order) { + else if (H5T_ORDER_VAX == order) order_s = " mixed-endian"; - } - else { + else order_s = " unknown-byte-order"; - } } - else { + else order_s = ""; - } /* print size and byte order */ h5tools_str_append(buffer, "%lu-bit%s floating-point", @@ -2288,33 +2237,24 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE) == TRUE) { + if (H5Tequal(type, H5T_STD_B8BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B8BE"); - } - else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B8LE"); - } - else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B16BE"); - } - else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B16LE"); - } - else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B32BE"); - } - else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B32LE"); - } - else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B64BE"); - } - else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) { + else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) h5tools_str_append(buffer, "H5T_STD_B64LE"); - } - else { + else h5tools_str_append(buffer, "undefined bitfield"); - } break; case H5T_OPAQUE: diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 9b5df25..457d1af 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -18,28 +18,32 @@ * print a warning message *------------------------------------------------------------------------- */ -static void print_warning(const char *dname, const char *fname) +static void print_filter_warning(const char *dname, const char *fname) { fprintf(stderr, - "warning: dataset <%s> cannot be read, %s filter is not available\n", + "Warning: dataset <%s> cannot be read, %s filter is not available\n", dname, fname); } /*------------------------------------------------------------------------- * Function: h5tools_canreadf * - * Purpose: check if the dataset creation property list has filters that - * are not registered in the current configuration - * 1) the external filters GZIP and SZIP might not be available - * 2) the internal filters might be turned off + * Purpose: check if the dataset creation property list has filters that + * are not registered in the current configuration + * 1) the external filters GZIP and SZIP might not be available + * 2) the internal filters might be turned off * - * Return: 1, can read, 0, cannot, -1 error + * Return: + * 1 can read, + * 0 cannot, + * -1 error *------------------------------------------------------------------------- */ -int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */ +int +h5tools_canreadf(const char* name, /* object name, serves also as boolean print */ hid_t dcpl_id) /* dataset creation property list */ { - int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ + int ret_value = 1; int nfilters; /* number of filters */ H5Z_filter_t filtn; /* filter identification number */ int i; /* index */ @@ -69,7 +73,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr } else if (!udfilter_avail) { if (name) - print_warning(name, "user defined"); + print_filter_warning(name, "user defined"); ret_value = 0; } break; @@ -81,7 +85,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE if (name) - print_warning(name,"deflate"); + print_filter_warning(name,"deflate"); ret_value = 0; #endif break; @@ -92,7 +96,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP if (name) - print_warning(name,"SZIP"); + print_filter_warning(name,"SZIP"); ret_value = 0; #endif break; @@ -130,56 +134,58 @@ done: /*------------------------------------------------------------------------- * Function: h5tools_canwritef * - * Purpose: check if the filter is available and can write data. - * At this time, all filters that are available can write data, - * except SZIP, which may be configured decoder-only. + * Purpose: check if the filter is available and can write data. * - * Return: 1, can write, 0, cannot, -1 error + * Return: 1 can write, + * 0 cannot, + * -1 error *------------------------------------------------------------------------- */ int -h5tools_can_encode(H5Z_filter_t filtn) { +h5tools_can_encode(H5Z_filter_t filtn) +{ + int ret_value = 1; + switch (filtn) { /* user defined filter */ default: - return 0; - + HGOTO_DONE(0) case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - return 0; + HGOTO_DONE(0) #endif break; case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - return 0; + HGOTO_DONE(0) #else - { + { unsigned int filter_config_flags; if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zget_filter_info failed"); if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { /* filter present but neither encode nor decode is supported (???) */ - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "neither encode nor decode is supported"); } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { /* decoder only: read but not write */ - return 0; + HGOTO_DONE(0) } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { /* encoder only: write but not read (???) */ - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "encoder only: write but not read"); } else if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { - return 1; + HGOTO_DONE(1) } - } + } #endif break; @@ -196,6 +202,7 @@ h5tools_can_encode(H5Z_filter_t filtn) { break; }/*switch*/ - return 1; +done: + return ret_value; } diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index ee58ccb..f63c228 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -21,12 +21,6 @@ * * Return: Success: datatype ID * Failure: FAIL - * - * Programmer: Pedro Vicente Nunes - * Tuesday, July 18, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t @@ -43,40 +37,40 @@ h5tools_get_little_endian_type(hid_t tid) switch(type_class) { case H5T_INTEGER: - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8LE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16LE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32LE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64LE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8LE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16LE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32LE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64LE); + if (size == 1 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I8LE); + else if (size == 2 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I16LE); + else if (size == 4 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I32LE); + else if (size == 8 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I64LE); + else if (size == 1 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U8LE); + else if (size == 2 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U16LE); + else if (size == 4 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U32LE); + else if (size == 8 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U64LE); break; case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32LE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64LE); + if (size == 4) + p_type = H5Tcopy(H5T_IEEE_F32LE); + else if (size == 8) + p_type = H5Tcopy(H5T_IEEE_F64LE); break; case H5T_BITFIELD: - if ( size == 1) - p_type=H5Tcopy(H5T_STD_B8LE); - else if ( size == 2) - p_type=H5Tcopy(H5T_STD_B16LE); - else if ( size == 4) - p_type=H5Tcopy(H5T_STD_B32LE); - else if ( size == 8) - p_type=H5Tcopy(H5T_STD_B64LE); + if (size == 1) + p_type = H5Tcopy(H5T_STD_B8LE); + else if (size == 2) + p_type = H5Tcopy(H5T_STD_B16LE); + else if (size == 4) + p_type = H5Tcopy(H5T_STD_B32LE); + else if (size == 8) + p_type = H5Tcopy(H5T_STD_B64LE); break; case H5T_TIME: @@ -107,18 +101,12 @@ h5tools_get_little_endian_type(hid_t tid) * * Return: Success: datatype ID * Failure: FAIL - * - * Programmer: Pedro Vicente Nunes - * Tuesday, July 18, 2006 - * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t h5tools_get_big_endian_type(hid_t tid) { - hid_t p_type=-1; + hid_t p_type = -1; H5T_class_t type_class; size_t size; H5T_sign_t sign; @@ -129,39 +117,39 @@ h5tools_get_big_endian_type(hid_t tid) switch(type_class) { case H5T_INTEGER: - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8BE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16BE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32BE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64BE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8BE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16BE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32BE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64BE); + if (size == 1 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I8BE); + else if (size == 2 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I16BE); + else if (size == 4 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I32BE); + else if (size == 8 && sign == H5T_SGN_2) + p_type = H5Tcopy(H5T_STD_I64BE); + else if (size == 1 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U8BE); + else if (size == 2 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U16BE); + else if (size == 4 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U32BE); + else if (size == 8 && sign == H5T_SGN_NONE) + p_type = H5Tcopy(H5T_STD_U64BE); break; case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32BE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64BE); + if (size == 4) + p_type = H5Tcopy(H5T_IEEE_F32BE); + else if (size == 8) + p_type = H5Tcopy(H5T_IEEE_F64BE); break; case H5T_BITFIELD: - if ( size == 1) - p_type=H5Tcopy(H5T_STD_B8BE); - else if ( size == 2) - p_type=H5Tcopy(H5T_STD_B16BE); - else if ( size == 4) - p_type=H5Tcopy(H5T_STD_B32BE); - else if ( size == 8) + if (size == 1) + p_type = H5Tcopy(H5T_STD_B8BE); + else if (size == 2) + p_type = H5Tcopy(H5T_STD_B16BE); + else if (size == 4) + p_type = H5Tcopy(H5T_STD_B32BE); + else if (size == 8) p_type=H5Tcopy(H5T_STD_B64BE); break; diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 60d7732..c9bafd2 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -58,15 +58,11 @@ static void add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t /*------------------------------------------------------------------------- * Function: parallel_print * - * Purpose: wrapper for printf for use in parallel mode. - * - * Programmer: Leon Arber - * - * Date: December 1, 2004 - * + * Purpose: wrapper for printf for use in parallel mode. *------------------------------------------------------------------------- */ -void parallel_print(const char* format, ...) +void +parallel_print(const char* format, ...) { int bytes_written; va_list ap; @@ -103,18 +99,12 @@ void parallel_print(const char* format, ...) /*------------------------------------------------------------------------- - * Function: error_msg + * Function: error_msg * - * Purpose: Print a nicely formatted error message to stderr flushing the + * Purpose: Print a nicely formatted error message to stderr flushing the * stdout stream first. * - * Return: Nothing - * - * Programmer: Bill Wendling - * Tuesday, 20. February 2001 - * - * Modifications: - * + * Return: Nothing *------------------------------------------------------------------------- */ void @@ -134,18 +124,12 @@ error_msg(const char *fmt, ...) /*------------------------------------------------------------------------- - * Function: warn_msg + * Function: warn_msg * - * Purpose: Print a nicely formatted warning message to stderr flushing + * Purpose: Print a nicely formatted warning message to stderr flushing * the stdout stream first. * - * Return: Nothing - * - * Programmer: Bill Wendling - * Tuesday, 20. February 2001 - * - * Modifications: - * + * Return: Nothing *------------------------------------------------------------------------- */ void @@ -163,14 +147,11 @@ warn_msg(const char *fmt, ...) } /*------------------------------------------------------------------------- - * Function: help_ref_msg - * - * Purpose: Print a message to refer help page + * Function: help_ref_msg * - * Return: Nothing - * - * Modifications: + * Purpose: Print a message to refer help page * + * Return: Nothing *------------------------------------------------------------------------- */ void @@ -182,24 +163,16 @@ help_ref_msg(FILE *output) /*------------------------------------------------------------------------- - * Function: get_option + * Function: get_option * - * Purpose: Determine the command-line options a user specified. We can - * accept both short and long type command-lines. + * Purpose: Determine the command-line options a user specified. We can + * accept both short and long type command-lines. * * Return: Success: The short valued "name" of the command line * parameter or EOF if there are no more * parameters to process. * - * Failure: A question mark. - * - * Programmer: Bill Wendling - * Friday, 5. January 2001 - * - * Modifications: Pedro Vicente - * October, 27 2008 - * Wilcard "*" argument type - * + * Failure: A question mark. *------------------------------------------------------------------------- */ int @@ -351,16 +324,11 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti /*------------------------------------------------------------------------- - * Function: indentation - * - * Purpose: Print spaces for indentation - * - * Return: void - * - * Programmer: Ruey-Hsia Li + * Function: indentation * - * Modifications: + * Purpose: Print spaces for indentation * + * Return: void *------------------------------------------------------------------------- */ void @@ -378,17 +346,12 @@ indentation(unsigned x) /*------------------------------------------------------------------------- - * Function: print_version - * - * Purpose: Print the program name and the version information which is - * defined the same as the HDF5 library version. - * - * Return: void + * Function: print_version * - * Programmer: unknown - * - * Modifications: + * Purpose: Print the program name and the version information which is + * defined the same as the HDF5 library version. * + * Return: void *------------------------------------------------------------------------- */ void @@ -407,11 +370,6 @@ print_version(const char *progname) * and committed types * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -434,11 +392,6 @@ init_table(table_t **tbl) * and committed types * * Return: void - * - * Programmer: Paul Harten - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -462,11 +415,6 @@ free_table(table_t *table) * Purpose: display the contents of tables for debugging purposes * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -488,11 +436,6 @@ dump_table(char* tablename, table_t *table) * Purpose: display the contents of tables for debugging purposes * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -513,14 +456,9 @@ dump_tables(find_objs_t *info) * Return: Success: an integer, the location of the object * * Failure: FAIL if object is not found - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ -obj_t * + obj_t * search_obj(table_t *table, haddr_t objno) { unsigned u; @@ -541,11 +479,6 @@ search_obj(table_t *table, haddr_t objno) * Return: Success: SUCCEED * * Failure: FAIL - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -623,11 +556,6 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen * Return: Success: SUCCEED * * Failure: FAIL - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -657,11 +585,6 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table, * realloc the table if necessary * * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -695,11 +618,6 @@ add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t record) * * Return: a stream description when succeeds. * NULL if fails. - * - * Programmer: Albert Cheng, 2005/8/9 - * - * Modifications: - * *------------------------------------------------------------------------- */ FILE * @@ -723,70 +641,61 @@ tmpfile(void) * * Return: * 2 : given pathname is object - * 1 : Succed to get link info. + * 1 : Succeed to get link info. * 0 : Detected as a dangling link * -1 : H5 API failed. * * NOTE: * link_info->trg_path must be freed out of this function - * - * Programmer: Jonathan Kim - * - * Date: Feb 8, 2010 *-------------------------------------------------------------------------*/ int -H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, - hbool_t get_obj_type) +H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type) { htri_t l_ret; H5O_info_t trg_oinfo; hid_t fapl = H5P_DEFAULT; hid_t lapl = H5P_DEFAULT; - int ret = -1; /* init to fail */ + int ret_value = -1; /* init to fail */ /* init */ link_info->trg_type = H5O_TYPE_UNKNOWN; /* if path is root, return group type */ - if(!HDstrcmp(linkpath,"/")) - { + if(!HDstrcmp(linkpath,"/")) { link_info->trg_type = H5O_TYPE_GROUP; - ret = 2; - goto out; + HGOTO_DONE(2); } /* check if link itself exist */ if(H5Lexists(file_id, linkpath, H5P_DEFAULT) <= 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: link <%s> doesn't exist \n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* get info from link */ if(H5Lget_info(file_id, linkpath, &(link_info->linfo), H5P_DEFAULT) < 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to get link info from <%s>\n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* given path is hard link (object) */ - if(link_info->linfo.type == H5L_TYPE_HARD) { - ret = 2; - goto out; - } /* end if */ + if(link_info->linfo.type == H5L_TYPE_HARD) + HGOTO_DONE(2); /* trg_path must be freed out of this function when finished using */ if((link_info->trg_path = (char*)HDcalloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to allocate buffer for <%s>\n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* get link value */ if(H5Lget_val(file_id, linkpath, (void *)link_info->trg_path, link_info->linfo.u.val_size, H5P_DEFAULT) < 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to get link value from <%s>\n",linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /*----------------------------------------------------- @@ -795,13 +704,13 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ */ if(link_info->linfo.type == H5L_TYPE_EXTERNAL) { if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto out; + HGOTO_DONE(FAIL); if(H5Pset_fapl_sec2(fapl) < 0) - goto out; + HGOTO_DONE(FAIL); if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0) - goto out; + HGOTO_DONE(FAIL); if(H5Pset_elink_fapl(lapl, fapl) < 0) - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* Check for retrieving object info */ @@ -814,25 +723,24 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ /* detect dangling link */ if(l_ret == FALSE) { - ret = 0; - goto out; - } /* end if */ - /* function failed */ - else if(l_ret < 0) - goto out; + HGOTO_DONE(0); + } + else if(l_ret < 0) { /* function failed */ + HGOTO_DONE(FAIL); + } /* get target object info */ if(H5Oget_info_by_name(file_id, linkpath, &trg_oinfo, lapl) < 0) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: unable to get object information for <%s>\n", linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* check unknown type */ if(trg_oinfo.type < H5O_TYPE_GROUP || trg_oinfo.type >=H5O_TYPE_NTYPES) { if(link_info->opt.msg_mode == 1) parallel_print("Warning: target object of <%s> is unknown type\n", linkpath); - goto out; + HGOTO_DONE(FAIL); } /* end if */ /* set target obj type to return */ @@ -844,41 +752,46 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ link_info->trg_type = H5O_TYPE_UNKNOWN; /* succeed */ - ret = 1; + ret_value = 1; -out: +done: if(fapl != H5P_DEFAULT) H5Pclose(fapl); if(lapl != H5P_DEFAULT) H5Pclose(lapl); - return ret; + return ret_value; } /* end H5tools_get_symlink_info() */ /*------------------------------------------------------------------------- * Audience: Public - * Chapter: H5Tools Library + * * Purpose: Initialize the name and operation status of the H5 Tools library + * * Description: * These are utility functions to set/get the program name and operation status. *------------------------------------------------------------------------- */ -void h5tools_setprogname(const char *Progname) +void +h5tools_setprogname(const char *Progname) { h5tools_progname = Progname; } -void h5tools_setstatus(int D_status) +void +h5tools_setstatus(int D_status) { h5tools_d_status = D_status; } -const char*h5tools_getprogname(void) +const char * +h5tools_getprogname(void) { return h5tools_progname; } -int h5tools_getstatus(void) +int +h5tools_getstatus(void) { return h5tools_d_status; } @@ -890,25 +803,19 @@ int h5tools_getstatus(void) * This can be called from each tools main() as part of initial act. * Note: this is more of debugging purpose for now. */ -int h5tools_getenv_update_hyperslab_bufsize(void) +int +h5tools_getenv_update_hyperslab_bufsize(void) { const char *env_str = NULL; long hyperslab_bufsize_mb; + int ret_value = 1; /* check if environment variable is set for the hyperslab buffer size */ - if (NULL != (env_str = HDgetenv ("H5TOOLS_BUFSIZE"))) - { + if (NULL != (env_str = HDgetenv ("H5TOOLS_BUFSIZE"))) { errno = 0; hyperslab_bufsize_mb = HDstrtol(env_str, (char**)NULL, 10); if (errno != 0 || hyperslab_bufsize_mb <= 0) - { - /* TODO: later when pubilshed - HDfprintf(rawerrorstream,"Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str); - */ - - goto error; - } - + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "hyperslab buffer size failed"); /* convert MB to byte */ H5TOOLS_BUFSIZE = (hsize_t)hyperslab_bufsize_mb * 1024 * 1024; @@ -916,9 +823,7 @@ int h5tools_getenv_update_hyperslab_bufsize(void) H5TOOLS_MALLOCSIZE = MAX(H5TOOLS_BUFSIZE, H5TOOLS_MALLOCSIZE); } - return (1); - -error: - return (-1); +done: + return ret_value; } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 079a4ea..ce47f4f 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -13,6 +13,7 @@ #include "h5trav.h" +#include "h5tools.h" #include "H5private.h" /*------------------------------------------------------------------------- @@ -81,10 +82,9 @@ static int trav_verbosity = 0; /*------------------------------------------------------------------------- * Function: h5trav_set_index * - * Purpose: Set indexing properties for the objects & links in the file - * - * Return: none + * Purpose: Set indexing properties for the objects & links in the file * + * Return: none *------------------------------------------------------------------------- */ void @@ -97,10 +97,9 @@ h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order) /*------------------------------------------------------------------------- * Function: h5trav_set_verbose * - * Purpose: Set verbosity of file contents 1=>attributes - * - * Return: none + * Purpose: Set verbosity of file contents 1=>attributes * + * Return: none *------------------------------------------------------------------------- */ void @@ -118,14 +117,9 @@ h5trav_set_verbose(int print_verbose) /*------------------------------------------------------------------------- * Function: trav_addr_add * - * Purpose: Add a hardlink address to visited data structure - * - * Return: void - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Add a hardlink address to visited data structure * + * Return: void *------------------------------------------------------------------------- */ static void @@ -149,14 +143,9 @@ trav_addr_add(trav_addr_t *visited, haddr_t addr, const char *path) /*------------------------------------------------------------------------- * Function: trav_addr_visited * - * Purpose: Check if an address has already been visited - * - * Return: TRUE/FALSE - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Check if an address has already been visited * + * Return: TRUE/FALSE *------------------------------------------------------------------------- */ static const char * @@ -178,12 +167,7 @@ trav_addr_visited(trav_addr_t *visited, haddr_t addr) /*------------------------------------------------------------------------- * Function: traverse_cb * - * Purpose: Iterator callback for traversing objects in file - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 - * + * Purpose: Iterator callback for traversing objects in file *------------------------------------------------------------------------- */ static herr_t @@ -258,26 +242,23 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, /*------------------------------------------------------------------------- * Function: traverse * - * Purpose: Iterate over all the objects/links in a file. Conforms to the - * "visitor" pattern. - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Iterate over all the objects/links in a file. Conforms to the + * "visitor" pattern. * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ static int traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, - hbool_t recurse, const trav_visitor_t *visitor) + hbool_t recurse, const trav_visitor_t *visitor) { H5O_info_t oinfo; /* Object info for starting group */ + int ret_value = SUCCEED; /* Get info for starting object */ if(H5Oget_info_by_name(file_id, grp_name, &oinfo, H5P_DEFAULT) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Oget_info_by_name failed"); /* Visit the starting object */ if(visit_start && visitor->visit_obj) @@ -306,12 +287,12 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, if(recurse) { /* Visit all links in group, recursively */ if(H5Lvisit_by_name(file_id, grp_name, trav_index_by, trav_index_order, traverse_cb, &udata, H5P_DEFAULT) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lvisit_by_name failed"); } /* end if */ else { /* Iterate over links in group */ if(H5Literate_by_name(file_id, grp_name, trav_index_by, trav_index_order, NULL, traverse_cb, &udata, H5P_DEFAULT) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Literate_by_name failed"); } /* end else */ /* Free visited addresses table */ @@ -325,21 +306,17 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, } /* end if */ } /* end if */ - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: trav_info_add * - * Purpose: Add a link path & type to info struct - * - * Return: void - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Add a link path & type to info struct * + * Return: void *------------------------------------------------------------------------- */ void @@ -347,18 +324,20 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) { size_t idx; /* Index of address to use */ - /* Allocate space if necessary */ - if(info->nused == info->nalloc) { - info->nalloc = MAX(1, info->nalloc * 2);; - info->paths = (trav_path_t *)HDrealloc(info->paths, info->nalloc * sizeof(trav_path_t)); - } /* end if */ + if (info) { + /* Allocate space if necessary */ + if(info->nused == info->nalloc) { + info->nalloc = MAX(1, info->nalloc * 2);; + info->paths = (trav_path_t *)HDrealloc(info->paths, info->nalloc * sizeof(trav_path_t)); + } /* end if */ - /* Append it */ - idx = info->nused++; - info->paths[idx].path = HDstrdup(path); - info->paths[idx].type = obj_type; - info->paths[idx].fileno = 0; - info->paths[idx].objno = HADDR_UNDEF; + /* Append it */ + idx = info->nused++; + info->paths[idx].path = HDstrdup(path); + info->paths[idx].type = obj_type; + info->paths[idx].fileno = 0; + info->paths[idx].objno = HADDR_UNDEF; + } } /* end trav_info_add() */ @@ -368,7 +347,6 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) * Purpose: Add a file addr & fileno to info struct * * Return: void - * *------------------------------------------------------------------------- */ void @@ -390,22 +368,19 @@ trav_fileinfo_add(trav_info_t *info, hid_t loc_id) /*------------------------------------------------------------------------- * Function: trav_info_visit_obj * - * Purpose: Callback for visiting object, with 'info' structure - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Callback for visiting object, with 'info' structure * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ int trav_info_visit_obj(const char *path, const H5O_info_t *oinfo, - const char H5_ATTR_UNUSED *already_visited, void *udata) + const char H5_ATTR_UNUSED *already_visited, void *udata) { size_t idx; trav_info_t *info_p; + /* Add the object to the 'info' struct */ /* (object types map directly to "traversal" types) */ trav_info_add((trav_info_t *)udata, path, (h5trav_type_t)oinfo->type); @@ -423,14 +398,10 @@ trav_info_visit_obj(const char *path, const H5O_info_t *oinfo, /*------------------------------------------------------------------------- * Function: trav_info_visit_lnk * - * Purpose: Callback for visiting link, with 'info' structure - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Callback for visiting link, with 'info' structure * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ int @@ -446,21 +417,18 @@ trav_info_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) /*------------------------------------------------------------------------- * Function: h5trav_getinfo * - * Purpose: get an array of "trav_info_t" , containing the name and type of - * objects in the file - * - * Return: number of object names in file - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 6, 2002 + * Purpose: get an array of "trav_info_t" , containing the name and type of + * objects in the file * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ int h5trav_getinfo(hid_t file_id, trav_info_t *info) { trav_visitor_t info_visitor; /* Visitor structure for trav_info_t's */ + int ret_value = SUCCEED; /* Init visitor structure */ info_visitor.visit_obj = trav_info_visit_obj; @@ -469,25 +437,21 @@ h5trav_getinfo(hid_t file_id, trav_info_t *info) /* Traverse all objects in the file, visiting each object & link */ if(traverse(file_id, "/", TRUE, TRUE, &info_visitor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: h5trav_getindex * - * Purpose: get index of OBJ in list - * - * Return: index, -1 if not found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: May 9, 2003 + * Purpose: get index of OBJ in list * + * Return: index on success, + * -1 if not found *------------------------------------------------------------------------- */ - ssize_t h5trav_getindex(const trav_info_t *info, const char *obj) { @@ -511,17 +475,11 @@ h5trav_getindex(const trav_info_t *info, const char *obj) /*------------------------------------------------------------------------- * Function: trav_info_init * - * Purpose: Initialize the info - * - * Return: void - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 6, 2007 + * Purpose: Initialize the info * + * Return: void *------------------------------------------------------------------------- */ - void trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info) { @@ -545,11 +503,9 @@ trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info) /*------------------------------------------------------------------------- * Function: trav_info_free * - * Purpose: free info memory - * + * Purpose: free info memory *------------------------------------------------------------------------- */ - void trav_info_free(trav_info_t *info) { @@ -557,11 +513,9 @@ trav_info_free(trav_info_t *info) if(info) { /* Free visited symbolic links path and file (if alloc) */ - for(u=0; u < info->symlink_visited.nused; u++) - { + for(u = 0; u < info->symlink_visited.nused; u++) { if (info->symlink_visited.objs[u].file) HDfree(info->symlink_visited.objs[u].file); - HDfree(info->symlink_visited.objs[u].path); } HDfree(info->symlink_visited.objs); @@ -586,12 +540,8 @@ trav_info_free(trav_info_t *info) * * Purpose: Callback for visiting object, with 'table' sructure * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 - * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ static int @@ -608,21 +558,17 @@ trav_table_visit_obj(const char *path, const H5O_info_t *oinfo, /* Add alias for object to table */ trav_table_addlink(table, oinfo->addr, path); - return(0); + return 0; } /* end trav_table_visit_obj() */ /*------------------------------------------------------------------------- * Function: trav_table_visit_lnk * - * Purpose: Callback for visiting link, with 'table' sructure - * - * Return: 0 on success, -1 on failure - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 1, 2007 + * Purpose: Callback for visiting link, with 'table' sructure * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ static int @@ -631,28 +577,24 @@ trav_table_visit_lnk(const char *path, const H5L_info_t H5_ATTR_UNUSED *linfo, v /* Add the link to the 'table' struct */ trav_table_add((trav_table_t *)udata, path, NULL); - return(0); + return 0; } /* end trav_table_visit_lnk() */ /*------------------------------------------------------------------------- * Function: h5trav_gettable * - * Purpose: get the trav_table_t struct - * - * Return: 0, -1 on error - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 17, 2003 + * Purpose: get the trav_table_t struct * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ - int h5trav_gettable(hid_t fid, trav_table_t *table) { trav_visitor_t table_visitor; /* Visitor structure for trav_table_t's */ + int ret_value = SUCCEED; /* Init visitor structure */ table_visitor.visit_obj = trav_table_visit_obj; @@ -661,71 +603,63 @@ h5trav_gettable(hid_t fid, trav_table_t *table) /* Traverse all objects in the file, visiting each object & link */ if(traverse(fid, "/", TRUE, TRUE, &table_visitor) < 0) - return -1; - return 0; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); + +done: + return ret_value; } /*------------------------------------------------------------------------- * Function: h5trav_getindext * - * Purpose: get index of NAME in list - * - * Return: index, -1 if not found - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 18, 2003 + * Purpose: get index of NAME in list * + * Return: index on success, + * -1 if not found *------------------------------------------------------------------------- */ - int h5trav_getindext(const char *name, const trav_table_t *table) { unsigned int i; - for(i = 0; i < table->nobjs; i++) { - /* Check for object name having full path (with leading '/') */ - if(HDstrcmp(name, table->objs[i].name) == 0) - return((int)i); - - /* Check for object name without leading '/' */ - if(HDstrcmp(name, table->objs[i].name + 1) == 0) - return((int)i); + if(table) { + for(i = 0; i < table->nobjs; i++) { + /* Check for object name having full path (with leading '/') */ + if(HDstrcmp(name, table->objs[i].name) == 0) + return((int)i); - /* search also in the list of links */ - if(table->objs[i].nlinks) { - unsigned int j; + /* Check for object name without leading '/' */ + if(HDstrcmp(name, table->objs[i].name + 1) == 0) + return((int)i); - for ( j=0; jobjs[i].nlinks; j++) { - /* Check for object name having full path (with leading '/') */ - if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) - return((int)i); + /* search also in the list of links */ + if(table->objs[i].nlinks) { + unsigned int j; - /* Check for object name without leading '/' */ - if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) - return((int)i); - } /* end for */ - } /* end if */ - } /* end for */ + for ( j=0; jobjs[i].nlinks; j++) { + /* Check for object name having full path (with leading '/') */ + if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) + return((int)i); + /* Check for object name without leading '/' */ + if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) + return((int)i); + } /* end for */ + } /* end if */ + } /* end for */ + } return -1; } /*------------------------------------------------------------------------- * Function: trav_table_add * - * Purpose: Add OBJNO, NAME and TYPE of object to table - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: Add OBJNO, NAME and TYPE of object to table * + * Return: void *------------------------------------------------------------------------- */ - static void trav_table_add(trav_table_t *table, const char *path, @@ -733,20 +667,22 @@ trav_table_add(trav_table_t *table, { size_t new_obj; - if(table->nobjs == table->size) { - table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); - } /* end if */ + if(table) { + if(table->nobjs == table->size) { + table->size = MAX(1, table->size * 2); + table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + } /* end if */ - new_obj = table->nobjs++; - table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF; - table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0; - table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(path); - table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; - table->objs[new_obj].nlinks = 0; - table->objs[new_obj].sizelinks = 0; - table->objs[new_obj].links = NULL; + new_obj = table->nobjs++; + table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF; + table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0; + table->objs[new_obj].is_same_trgobj = 0; + table->objs[new_obj].name = (char *)HDstrdup(path); + table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; + table->objs[new_obj].nlinks = 0; + table->objs[new_obj].sizelinks = 0; + table->objs[new_obj].links = NULL; + } } /*------------------------------------------------------------------------- @@ -755,58 +691,47 @@ trav_table_add(trav_table_t *table, * Purpose: Add a hardlink name to the object * * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: December 17, 2003 - * *------------------------------------------------------------------------- */ - static void trav_table_addlink(trav_table_t *table, haddr_t objno, const char *path) { size_t i; /* Local index variable */ - for(i = 0; i < table->nobjs; i++) { - if(table->objs[i].objno == objno) { - size_t n; + if(table) { + for(i = 0; i < table->nobjs; i++) { + if(table->objs[i].objno == objno) { + size_t n; - /* already inserted? */ - if(HDstrcmp(table->objs[i].name, path) == 0) - return; + /* already inserted? */ + if(HDstrcmp(table->objs[i].name, path) == 0) + return; - /* allocate space if necessary */ - if(table->objs[i].nlinks == (unsigned)table->objs[i].sizelinks) { - table->objs[i].sizelinks = MAX(1, table->objs[i].sizelinks * 2); - table->objs[i].links = (trav_link_t *)HDrealloc(table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); - } /* end if */ + /* allocate space if necessary */ + if(table->objs[i].nlinks == (unsigned)table->objs[i].sizelinks) { + table->objs[i].sizelinks = MAX(1, table->objs[i].sizelinks * 2); + table->objs[i].links = (trav_link_t *)HDrealloc(table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); + } /* end if */ - /* insert it */ - n = table->objs[i].nlinks++; - table->objs[i].links[n].new_name = (char *)HDstrdup(path); + /* insert it */ + n = table->objs[i].nlinks++; + table->objs[i].links[n].new_name = (char *)HDstrdup(path); - return; + return; + } /* end for */ } /* end for */ - } /* end for */ + } } - /*------------------------------------------------------------------------- * Function: trav_table_addflags * - * Purpose: Add FLAGS, NAME and TYPE of object to table - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: Add FLAGS, NAME and TYPE of object to table * + * Return: void *------------------------------------------------------------------------- */ - void trav_table_addflags(unsigned *flags, char *name, h5trav_type_t type, @@ -814,92 +739,83 @@ void trav_table_addflags(unsigned *flags, { size_t new_obj; - if(table->nobjs == table->size) { - table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); - } /* end if */ + if(table) { + if(table->nobjs == table->size) { + table->size = MAX(1, table->size * 2); + table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + } /* end if */ - new_obj = table->nobjs++; - table->objs[new_obj].objno = 0; - table->objs[new_obj].flags[0] = flags[0]; - table->objs[new_obj].flags[1] = flags[1]; - table->objs[new_obj].is_same_trgobj = 0; - table->objs[new_obj].name = (char *)HDstrdup(name); - table->objs[new_obj].type = type; - table->objs[new_obj].nlinks = 0; - table->objs[new_obj].sizelinks = 0; - table->objs[new_obj].links = NULL; + new_obj = table->nobjs++; + table->objs[new_obj].objno = 0; + table->objs[new_obj].flags[0] = flags[0]; + table->objs[new_obj].flags[1] = flags[1]; + table->objs[new_obj].is_same_trgobj = 0; + table->objs[new_obj].name = (char *)HDstrdup(name); + table->objs[new_obj].type = type; + table->objs[new_obj].nlinks = 0; + table->objs[new_obj].sizelinks = 0; + table->objs[new_obj].links = NULL; + } } /*------------------------------------------------------------------------- * Function: trav_table_init * - * Purpose: Initialize the table - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: Initialize the table * + * Return: void *------------------------------------------------------------------------- */ - void trav_table_init(trav_table_t **tbl) { trav_table_t* table = (trav_table_t*) HDmalloc(sizeof(trav_table_t)); - - table->size = 0; - table->nobjs = 0; - table->objs = NULL; - + if(table) { + table->size = 0; + table->nobjs = 0; + table->objs = NULL; + } *tbl = table; } - /*------------------------------------------------------------------------- * Function: trav_table_free * - * Purpose: free table memory - * - * Return: void - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: November 4, 2002 + * Purpose: free table memory * + * Return: void *------------------------------------------------------------------------- */ - -void trav_table_free( trav_table_t *table ) +void trav_table_free(trav_table_t *table) { - if(table->objs) { - unsigned int i; + if(table) { + if(table->objs) { + unsigned int i; - for(i = 0; i < table->nobjs; i++) { - HDfree(table->objs[i].name ); - if(table->objs[i].nlinks) { - unsigned int j; + for(i = 0; i < table->nobjs; i++) { + HDfree(table->objs[i].name ); + if(table->objs[i].nlinks) { + unsigned int j; - for(j = 0; j < table->objs[i].nlinks; j++) - HDfree(table->objs[i].links[j].new_name); + for(j = 0; j < table->objs[i].nlinks; j++) + HDfree(table->objs[i].links[j].new_name); - HDfree(table->objs[i].links); - } /* end if */ - } /* end for */ - HDfree(table->objs); - } /* end if */ - HDfree(table); + HDfree(table->objs[i].links); + } /* end if */ + } /* end for */ + HDfree(table->objs); + } /* end if */ + HDfree(table); + } } static herr_t trav_attr(hid_t #ifndef H5TRAV_PRINT_SPACE -H5_ATTR_UNUSED + H5_ATTR_UNUSED #endif /* H5TRAV_PRINT_SPACE */ -obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data) + obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_data) { trav_path_op_data_t *op_data = (trav_path_op_data_t *)_op_data; const char *buf = op_data->path; @@ -938,7 +854,7 @@ obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ainfo, void *_op_da case H5S_SIMPLE: /* simple dataspace */ printf(" {"); - for (i=0; iu.val_size > 0) { - char *targbuf; + char *targbuf = NULL; const char *filename = NULL; const char *objname = NULL; @@ -1097,22 +1005,18 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) /*------------------------------------------------------------------------- * Function: h5trav_print * - * Purpose: Print information about the objects & links in the file - * - * Return: 0, -1 on error - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: September 6, 2007 + * Purpose: Print information about the objects & links in the file * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ - int h5trav_print(hid_t fid) { trav_print_udata_t print_udata; /* User data for traversal */ trav_visitor_t print_visitor; /* Visitor structure for printing objects */ + int ret_value = SUCCEED; /* Init user data for printing */ print_udata.fid = fid; @@ -1124,9 +1028,10 @@ h5trav_print(hid_t fid) /* Traverse all objects in the file, visiting each object & link */ if(traverse(fid, "/", TRUE, TRUE, &print_visitor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); - return 0; +done: + return ret_value; } @@ -1135,21 +1040,17 @@ h5trav_print(hid_t fid) * * Purpose: Generic traversal routine for visiting objects and links * - * Return: 0, -1 on error - * - * Programmer: Quincey Koziol, koziol@hdfgroup.org - * - * Date: November 6, 2007 - * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ - int h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, hbool_t recurse, h5trav_obj_func_t visit_obj, h5trav_lnk_func_t visit_lnk, void *udata) { trav_visitor_t visitor; /* Visitor structure for objects */ + int ret_value = SUCCEED; /* Init visitor structure */ visitor.visit_obj = visit_obj; @@ -1158,9 +1059,10 @@ h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, /* Traverse all objects in the file, visiting each object & link */ if(traverse(fid, grp_name, visit_start, recurse, &visitor) < 0) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "traverse failed"); - return 0; +done: + return ret_value; } /*------------------------------------------------------------------------- @@ -1168,19 +1070,15 @@ h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, * * Purpose: Add an symbolic link to visited data structure * - * Return: 0 on success, -1 on failure - * - * Programmer: Neil Fortner, nfortne2@hdfgroup.org - * Adapted from trav_addr_add in h5trav.c by Quincey Koziol - * - * Date: September 5, 2008 - * + * Return: 0 on success, + * -1 on failure *------------------------------------------------------------------------- */ herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path) { - size_t idx; /* Index of address to use */ + herr_t ret_value = SUCCEED; + size_t idx; /* Index of address to use */ /* Allocate space if necessary */ if(visited->nused == visited->nalloc) { @@ -1188,7 +1086,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co visited->nalloc = MAX(1, visited->nalloc * 2); if(NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t)))) - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure realloc failed"); visited->objs = (symlink_trav_path_t *)tmp_ptr; } /* end if */ @@ -1202,7 +1100,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co if(type == H5L_TYPE_EXTERNAL) { if(NULL == (visited->objs[idx].file = HDstrdup(file))) { visited->nused--; - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure name allocation failed"); } /* end if */ } /* end if */ @@ -1210,25 +1108,20 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co visited->nused--; if(visited->objs[idx].file) HDfree (visited->objs[idx].file); - return -1; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "visited data structure path allocation failed"); } /* end if */ - return 0; +done: + return ret_value; } /* end symlink_visit_add() */ /*------------------------------------------------------------------------- * Function: symlink_is_visited * - * Purpose: Check if an symbolic link has already been visited - * - * Return: TRUE/FALSE - * - * Programmer: Neil Fortner, nfortne2@hdfgroup.org - * Adapted from trav_addr_visited in h5trav.c by Quincey Koziol - * - * Date: September 5, 2008 + * Purpose: Check if an symbolic link has already been visited * + * Return: TRUE/FALSE *------------------------------------------------------------------------- */ hbool_t diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 9628d45..21d7d00 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -32,7 +32,7 @@ struct diff_mpi_args { char name1[256]; char name2[256]; - diff_opt_t options; + diff_opt_t opts; diff_args_t argdata; /* rest args */ }; -- cgit v0.12 From 21b0878f33f4613dc22934c673c91c28f14ad33a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 19 Oct 2017 16:56:11 -0500 Subject: Avoid double free --- tools/lib/h5diff_array.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 1125e45..955819e 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -4420,9 +4420,6 @@ int ull2float(unsigned long long ull_value, float *f_value) HDmemcpy(f_value, buf, dst_size); - if (buf) - HDfree(buf); - done: H5E_BEGIN_TRY { H5Pclose(dxpl_id); -- cgit v0.12 From 118326833483e67a5b87f86e44b7bc2040188ac1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 23 Oct 2017 09:46:12 -0500 Subject: HDFFV-10297 - Cleanup, Initialize variables --- tools/h5repack/h5repack.c | 8 +- tools/h5repack/h5repack_copy.c | 28 +-- tools/h5repack/h5repack_refs.c | 18 +- tools/lib/h5diff_dset.c | 2 +- tools/lib/h5tools.c | 464 +++++++++++++++++------------------------ tools/lib/h5tools_dump.c | 11 +- tools/lib/h5tools_str.c | 8 +- tools/lib/h5tools_utils.c | 2 +- 8 files changed, 225 insertions(+), 316 deletions(-) diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 61bf097..e8c3409 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -374,7 +374,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, if ((is_named = H5Tcommitted(ftype_id)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommitted failed"); if (is_named && travt) { - hid_t fidout; + hid_t fidout = -1; /* Create out file id */ if ((fidout = H5Iget_file_id(loc_out)) < 0) @@ -704,9 +704,9 @@ done: */ static int check_objects(const char* fname, pack_opt_t *options) { int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ - hid_t fid; - hid_t did; - hid_t sid; + hid_t fid = -1; + hid_t did = -1; + hid_t sid = -1; unsigned int i; unsigned int uf; trav_table_t *travt = NULL; diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index fada1a8..86fa91d 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -1047,7 +1047,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, *------------------------------------------------------------------------- */ else { - hid_t pid; + hid_t pid = -1; /* create property to pass copy options */ if ((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) @@ -1385,51 +1385,51 @@ void print_user_block(const char *filename, hid_t fid) { int ret_value = 0; - int fh; /* file handle */ - hsize_t ub_size; /* user block size */ - hsize_t size; /* size read */ - hid_t fcpl; /* file creation property list ID for HDF5 file */ + hid_t fh = -1; /* file handle */ + hsize_t ub_size; /* user block size */ + hsize_t size; /* size read */ + hid_t fcpl = -1; /* file creation property list ID for HDF5 file */ int i; /* get user block size */ - if(( fcpl = H5Fget_create_plist(fid)) < 0) { + if ((fcpl = H5Fget_create_plist(fid)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list"); } - if(H5Pget_userblock(fcpl, &ub_size) < 0) { + if (H5Pget_userblock(fcpl, &ub_size) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size"); } - if(H5Pclose(fcpl) < 0) { + if (H5Pclose(fcpl) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Pclose failed to close property list"); } /* open file */ - if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { + if ((fh = HDopen(filename, O_RDONLY)) < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed to open file <%s>", filename); } size = ub_size; /* read file */ - while(size > 0) { + while (size > 0) { ssize_t nread; /* # of bytes read */ char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ /* read buffer */ - if(size > USERBLOCK_XFER_SIZE) + if (size > USERBLOCK_XFER_SIZE) nread = HDread(fh, rbuf, (size_t)USERBLOCK_XFER_SIZE); else nread = HDread(fh, rbuf, (size_t)size); - for(i = 0; i < nread; i++) { + for (i = 0; i < nread; i++) { printf("%c ", rbuf[i]); } printf("\n"); - if(nread < 0) { + if (nread < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0"); } @@ -1438,7 +1438,7 @@ print_user_block(const char *filename, hid_t fid) } done: - if(fh > 0) + if (fh > 0) HDclose(fh); return; diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 5133966..59b652c 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -145,7 +145,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { - hid_t refobj_id; + hid_t refobj_id = -1; hobj_ref_t *refbuf = NULL; /* buffer for object references */ hobj_ref_t *buf = NULL; const char* refname; @@ -221,7 +221,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { - hid_t refobj_id; + hid_t refobj_id = -1; hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */ hdset_reg_ref_t *buf = NULL; /* output buffer */ const char* refname; @@ -260,7 +260,7 @@ int do_copy_refobjs(hid_t fidin, * in the second traversal of the file */ if((refname = MapIdToName(refobj_id, travt)) != NULL) { - hid_t region_id; /* region id of the referenced dataset */ + hid_t region_id = -1; /* region id of the referenced dataset */ if((region_id = H5Rget_region(dset_in, H5R_DATASET_REGION, &buf[u])) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rget_region failed"); @@ -379,7 +379,8 @@ int do_copy_refobjs(hid_t fidin, * This function is paired with copy_named_datatype() which is called * in copy_attr(), so need to free. */ - named_datatype_free(&named_dt_head, 0); + if (named_datatype_free(&named_dt_head, 0) < 0) + H5TOOLS_INFO(H5E_tools_min_id_g, "named_datatype_free failed"); return ret_value; @@ -480,18 +481,16 @@ static int copy_refs_attr(hid_t loc_in, is_ref = (type_class == H5T_REFERENCE); if(type_class == H5T_VLEN ) { - hid_t base_type; + hid_t base_type = H5Tget_super(ftype_id); - base_type = H5Tget_super(ftype_id); is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); if (H5Tclose(base_type) < 0) H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); } else if(type_class == H5T_ARRAY ) { - hid_t base_type; + hid_t base_type = H5Tget_super(ftype_id); - base_type = H5Tget_super(ftype_id); is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE); msize = H5Tget_size(base_type); if (H5Tclose(base_type) < 0) @@ -572,9 +571,8 @@ static int copy_refs_attr(hid_t loc_in, unsigned array_rank = 0; hsize_t array_size = 1; hsize_t array_dims[H5S_MAX_RANK]; - hid_t base_type; + hid_t base_type = H5Tget_super(ftype_id); - base_type = H5Tget_super(ftype_id); msize = H5Tget_size(base_type); if (H5Tclose(base_type) < 0) H5TOOLS_INFO(H5E_tools_min_id_g, "H5Tclose base_type failed"); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index e74cbae..9d0462d 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -189,7 +189,7 @@ hsize_t diff_datasetid(hid_t did1, void *buf2 = NULL; void *sm_buf1 = NULL; void *sm_buf2 = NULL; - hid_t sm_space; /*stripmine data space */ + hid_t sm_space = -1; /*stripmine data space */ size_t need; /* bytes needed for malloc */ int i; unsigned int vl_data = 0; /*contains VL datatypes */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 62495f9..8da2f96 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -23,10 +23,10 @@ #include "H5private.h" /* global variables */ -hid_t H5tools_ERR_STACK_g = 0; -hid_t H5tools_ERR_CLS_g = -1; -hid_t H5E_tools_g = -1; -hid_t H5E_tools_min_id_g = -1; +hid_t H5tools_ERR_STACK_g = 0; +hid_t H5tools_ERR_CLS_g = -1; +hid_t H5E_tools_g = -1; +hid_t H5E_tools_min_id_g = -1; int compound_data; FILE *rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */ FILE *rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */ @@ -77,18 +77,13 @@ typedef enum { #define NUM_DRIVERS (sizeof(drivernames) / sizeof(drivernames[0])) /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Initialize the H5 Tools library - * Description: - * This should be called before any other h5tools function is called. - * Effect of any h5tools function called before this has been called is - * undetermined. - * Return: - * None - * Programmer: - * Albert Cheng, 2000-10-31 - * Modifications: + * Function: h5tools_init + * + * Purpose: This should be called before any other h5tools function is called. + * Effect of any h5tools function called before this has been called is + * undetermined. + * + * Return None *------------------------------------------------------------------------- */ void @@ -121,19 +116,14 @@ h5tools_init(void) } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Close the H5 Tools library - * Description: - * Close or release resources such as files opened by the library. This - * should be called after all other h5tools functions have been called. - * Effect of any h5tools function called after this has been called is - * undetermined. - * Return: - * None - * Programmer: - * Albert Cheng, 2000-10-31 - * Modifications: + * Function: h5tools_close + * + * Purpose: Close or release resources such as files opened by the library. This + * should be called after all other h5tools functions have been called. + * Effect of any h5tools function called after this has been called is + * undetermined. + * + * Return: None *------------------------------------------------------------------------- */ void @@ -193,19 +183,13 @@ h5tools_close(void) } /*------------------------------------------------------------------------- - * Function: h5tools_set_data_output_file - * - * Purpose: Open fname as the output file for dataset raw data. - * Set rawdatastream as its file stream. + * Function: h5tools_set_data_output_file * - * Return: 0 -- succeeded - * negative -- failed - * - * Programmer: Albert Cheng, 2000/09/30 - * - * Modifications: - * pvn June, 1, 2006. Add a switch for binary output + * Purpose: Open fname as the output file for dataset raw data. + * Set rawdatastream as its file stream. * + * Return: 0 -- succeeded + * negative -- failed *------------------------------------------------------------------------- */ int @@ -247,14 +231,13 @@ h5tools_set_data_output_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_attr_output_file + * Function: h5tools_set_attr_output_file * - * Purpose: Open fname as the output file for attribute raw data. - * Set rawattrstream as its file stream. - * - * Return: 0 -- succeeded - * negative -- failed + * Purpose: Open fname as the output file for attribute raw data. + * Set rawattrstream as its file stream. * + * Return: 0 -- succeeded + * negative -- failed *------------------------------------------------------------------------- */ int @@ -296,13 +279,13 @@ h5tools_set_attr_output_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_input_file + * Function: h5tools_set_input_file * - * Purpose: Open fname as the input file for raw input. - * Set rawinstream as its file stream. + * Purpose: Open fname as the input file for raw input. + * Set rawinstream as its file stream. * - * Return: 0 -- succeeded - * negative -- failed + * Return: 0 -- succeeded + * negative -- failed * *------------------------------------------------------------------------- */ @@ -344,13 +327,13 @@ h5tools_set_input_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_output_file + * Function: h5tools_set_output_file * - * Purpose: Open fname as the output file for raw output. - * Set rawoutstream as its file stream. + * Purpose: Open fname as the output file for raw output. + * Set rawoutstream as its file stream. * - * Return: 0 -- succeeded - * negative -- failed + * Return: 0 -- succeeded + * negative -- failed * *------------------------------------------------------------------------- */ @@ -392,14 +375,13 @@ h5tools_set_output_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Function: h5tools_set_error_file - * - * Purpose: Open fname as the error output file for dataset raw error. - * Set rawerrorstream as its file stream. + * Function: h5tools_set_error_file * - * Return: 0 -- succeeded - * negative -- failed + * Purpose: Open fname as the error output file for dataset raw error. + * Set rawerrorstream as its file stream. * + * Return: 0 -- succeeded + * negative -- failed *------------------------------------------------------------------------- */ int @@ -441,33 +423,28 @@ h5tools_set_error_file(const char *fname, int is_bin) } /*------------------------------------------------------------------------- - * Audience: Private - * Chapter: H5Tools Library - * Purpose: Get a FAPL for a driver - * Description: - * Get a FAPL for a given VFL driver name. - * Return: - * None - * Programmer: - * Quincey Koziol, 2004-02-04 - * Modifications: - * Pedro Vicente Nunes, Thursday, July 27, 2006 - * Added error return conditions for the H5Pset_fapl calls + * Function: h5tools_get_fapl + * + * Purpose: Get a FAPL for a given VFL driver name. + * + * Return: positive - succeeded + * negative - failed *------------------------------------------------------------------------- */ static hid_t h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) { - hid_t new_fapl; /* Copy of file access property list passed in, or new property list */ + hid_t new_fapl = -1; /* Copy of file access property list passed in, or new property list */ + int ret_value = SUCCEED; /* Make a copy of the FAPL, for the file open call to use, eventually */ if (fapl == H5P_DEFAULT) { if ((new_fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed"); } /* end if */ else { if ((new_fapl = H5Pcopy(fapl)) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed"); } /* end else */ /* Determine which driver the user wants to open the file with. Try @@ -475,7 +452,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) if (!HDstrcmp(driver, drivernames[SEC2_IDX])) { /* SEC2 driver */ if (H5Pset_fapl_sec2(new_fapl) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_sec2 failed"); if (drivernum) *drivernum = SEC2_IDX; @@ -487,7 +464,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) * is the member size. */ if (H5Pset_fapl_family(new_fapl, (hsize_t) 0, H5P_DEFAULT) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_family failed"); if (drivernum) *drivernum = FAMILY_IDX; @@ -495,7 +472,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) else if (!HDstrcmp(driver, drivernames[SPLIT_IDX])) { /* SPLIT Driver */ if (H5Pset_fapl_split(new_fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_split failed"); if (drivernum) *drivernum = SPLIT_IDX; @@ -503,7 +480,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) else if (!HDstrcmp(driver, drivernames[MULTI_IDX])) { /* MULTI Driver */ if (H5Pset_fapl_multi(new_fapl, NULL, NULL, NULL, NULL, TRUE) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_multi failed"); if(drivernum) *drivernum = MULTI_IDX; @@ -519,29 +496,28 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) if(mpi_initialized && !mpi_finalized) { if(H5Pset_fapl_mpio(new_fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) - goto error; + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fapl_mpio failed"); if(drivernum) *drivernum = MPIO_IDX; } /* end if */ } #endif /* H5_HAVE_PARALLEL */ else - goto error; + ret_value = -1; - return(new_fapl); - -error: - if(new_fapl != H5P_DEFAULT) +done: + if((new_fapl != H5P_DEFAULT) && (ret_value < 0)) { H5Pclose(new_fapl); - return -1; + new_fapl = -1; + } + + return(new_fapl); } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Open a file with various VFL drivers. - * Description: - * Loop through the various types of VFL drivers trying to open FNAME. + * Function: h5tools_fopen + * + * Purpose: Loop through the various types of VFL drivers trying to open FNAME. * If the HDF5 library is version 1.2 or less, then we have only the SEC2 * driver to try out. If the HDF5 library is greater than version 1.2, * then we have the FAMILY, SPLIT, and MULTI drivers to play with. @@ -549,6 +525,7 @@ error: * If DRIVER is non-NULL, then it will try to open the file with that * driver first. We assume that the user knows what they are doing so, if * we fail, then we won't try other file drivers. + * * Return: * On success, returns a file id for the opened file. If DRIVERNAME is * non-null then the first DRIVERNAME_SIZE-1 characters of the driver @@ -556,38 +533,6 @@ error: * * Otherwise, the function returns FAIL. If DRIVERNAME is non-null then * the first byte is set to the null terminator. - * Programmer: - * Lost in the mists of time. - * Modifications: - * Robb Matzke, 2000-06-23 - * We only have to initialize driver[] on the first call, thereby - * preventing memory leaks from repeated calls to H5Pcreate(). - * - * Robb Matzke, 2000-06-23 - * Added DRIVERNAME_SIZE arg to prevent overflows when writing to - * DRIVERNAME. - * - * Robb Matzke, 2000-06-23 - * Added test to prevent coredump when the file could not be opened by - * any driver. - * - * Robb Matzke, 2000-06-23 - * Changed name from H5ToolsFopen() so it jives better with the names we - * already have at the top of this source file. - * - * Thomas Radke, 2000-09-12 - * Added Stream VFD to the driver[] array. - * - * Bill Wendling, 2001-01-10 - * Changed macro behavior so that if we have a version other than 1.2.x - * (i.e., > 1.2), then we do the drivers check. - * - * Bill Wendling, 2001-07-30 - * Added DRIVER parameter so that the user can specify "try this driver" - * instead of the default behaviour. If it fails to open the file with - * that driver, this will fail completely (i.e., we won't try the other - * drivers). We're assuming the user knows what they're doing. How UNIX - * of us. *------------------------------------------------------------------------- */ hid_t @@ -652,18 +597,13 @@ done: } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Count the number of columns in a string. - * Description: - * Count the number of columns in a string. This is the number of - * characters in the string not counting line-control characters. - * Return: - * On success, returns the width of the string. Otherwise this function - * returns 0. - * Programmer: - * Robb Matzke, Tuesday, April 27, 1999 - * Modifications: + * Function: h5tools_count_ncols + * + * Purpose: Count the number of columns in a string. This is the number of + * characters in the string not counting line-control characters. + * + * Return: success - returns the width of the string. + * failure - 0. *------------------------------------------------------------------------- */ static size_t @@ -681,20 +621,17 @@ h5tools_count_ncols(const char *s) /*------------------------------------------------------------------------- * Function: h5tools_detect_vlen * - * Purpose: Recursive check for any variable length data in given type. + * Purpose: Recursive check for any variable length data in given type. * - * Return: - * TRUE : type conatains any variable length data - * FALSE : type doesn't contain any variable length data - * Negative value: error occur - * - * Programmer: Jonathan Kim March 18, 2011 + * Return: TRUE : type conatains any variable length data + * FALSE : type doesn't contain any variable length data + * Negative value: error occur *------------------------------------------------------------------------- */ htri_t h5tools_detect_vlen(hid_t tid) { - htri_t ret; + htri_t ret = FALSE; /* recursive detect any vlen data values in type (compound, array ...) */ ret = H5Tdetect_class(tid, H5T_VLEN); @@ -713,20 +650,18 @@ done: /*------------------------------------------------------------------------- * Function: h5tools_detect_vlen_str * - * Purpose: Recursive check for variable length string of a datatype. - * - * Return: - * TRUE : type conatains any variable length string - * FALSE : type doesn't contain any variable length string - * Negative value: error occur + * Purpose: Recursive check for variable length string of a datatype. * + * Return: TRUE : type conatains any variable length string + * FALSE : type doesn't contain any variable length string + * Negative value: error occur *------------------------------------------------------------------------- */ htri_t h5tools_detect_vlen_str(hid_t tid) { H5T_class_t tclass = -1; - htri_t ret = FALSE; + htri_t ret = FALSE; ret = H5Tis_variable_str(tid); if((ret == TRUE) || (ret < 0)) @@ -774,25 +709,13 @@ done: } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Emit a simple prefix to STREAM. - * Description: - * If /ctx->need_prefix/ is set then terminate the current line (if - * applicable), calculate the prefix string, and display it at the start - * of a line. - * Return: - * None - * Programmer: - * Robb Matzke, Monday, April 26, 1999 - * Modifications: - * Robb Matzke, 1999-09-29 - * If a new prefix is printed then the current element number is set back - * to zero. - * pvn, 2004-07-08 - * Added support for printing array indices: - * the indentation is printed before the prefix (printed one indentation - * level before) + * Function: h5tools_simple_prefix + * + * Purpose: If /ctx->need_prefix/ is set then terminate the current line (if + * applicable), calculate the prefix string, and display it at the start + * of a line. + * + * Return: None *------------------------------------------------------------------------- */ void @@ -800,7 +723,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hsize_t elmtno, int secnum) { h5tools_str_t prefix; - h5tools_str_t str; /*temporary for indentation */ + h5tools_str_t str; /*temporary for indentation */ size_t templength = 0; unsigned u, indentlevel = 0; @@ -871,15 +794,13 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Emit a simple prefix to STREAM. - * Description: - * If /ctx->need_prefix/ is set then terminate the current line (if - * applicable), calculate the prefix string, and display it at the start - * of a line. Calls region specific function. - * Return: - * None + * Function: h5tools_region_simple_prefix + * + * Purpose: If /ctx->need_prefix/ is set then terminate the current line (if + * applicable), calculate the prefix string, and display it at the start + * of a line. Calls region specific function. + * + * Return: None *------------------------------------------------------------------------- */ void @@ -887,7 +808,7 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum) { h5tools_str_t prefix; - h5tools_str_t str; /*temporary for indentation */ + h5tools_str_t str; /*temporary for indentation */ size_t templength = 0; unsigned u, indentlevel = 0; @@ -958,28 +879,26 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Render an element to output STREAM. - * Description: - * Prints the string buffer to the output STREAM. The string is - * printed according to the format described in INFO. The CTX struct - * contains context information shared between calls to this function. + * Function: h5tools_render_element * - * Return: - * False if a dimension end is reached, otherwise true + * Purpose: Prints the string buffer to the output STREAM. The string is + * printed according to the format described in INFO. The CTX struct + * contains context information shared between calls to this function. + * + * Return: False if a dimension end is reached + * True otherwise * * In/Out: - * h5tools_context_t *ctx - * h5tools_str_t *buffer - * hsize_t *curr_pos + * h5tools_context_t *ctx + * h5tools_str_t *buffer + * hsize_t *curr_pos * * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * hsize_t curr_pos is the total data element position - * size_t ncols - * hsize_t local_elmt_counter is the local element loop counter - * hsize_t elmt_count is the data element loop counter + * h5tools_str_t *buffer is the string into which to render + * hsize_t curr_pos is the total data element position + * size_t ncols + * hsize_t local_elmt_counter is the local element loop counter + * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ hbool_t @@ -988,10 +907,10 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter) { hbool_t dimension_break = TRUE; - char *s; - char *section; /*a section of output */ - int secnum; /*section sequence number */ - int multiline; /*datum was multiline */ + char *s = NULL; + char *section = NULL; /* a section of output */ + int secnum; /* section sequence number */ + int multiline; /* datum was multiline */ if (stream == NULL) return dimension_break; @@ -1114,29 +1033,28 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Render a region element to output STREAM. - * Description: - * Prints the string buffer to the output STREAM. The string is - * printed according to the format described in INFO. The CTX struct - * contains context information shared between calls to this function. + * Function: h5tools_render_region_element + * + * Purpose: Prints the string buffer to the output STREAM. The string is + * printed according to the format described in INFO. The CTX struct + * contains context information shared between calls to this function. * * Return: - * False if a dimension end is reached, otherwise true + * False if a dimension end is reached + * True otherwise * * In/Out: - * h5tools_context_t *ctx - * h5tools_str_t *buffer - * hsize_t *curr_pos + * h5tools_context_t *ctx + * h5tools_str_t *buffer + * hsize_t *curr_pos * * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * hsize_t curr_pos is the total data element position - * size_t ncols - * hsize_t *ptdata - * hsize_t local_elmt_counter is the local element loop counter - * hsize_t elmt_count is the data element loop counter + * h5tools_str_t *buffer is the string into which to render + * hsize_t curr_pos is the total data element position + * size_t ncols + * hsize_t *ptdata + * hsize_t local_elmt_counter is the local element loop counter + * hsize_t elmt_count is the data element loop counter *------------------------------------------------------------------------- */ hbool_t @@ -1145,10 +1063,10 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, size_t ncols, hsize_t *ptdata, hsize_t local_elmt_counter, hsize_t elmt_counter) { hbool_t dimension_break = TRUE; - char *s; - char *section; /*a section of output */ - int secnum; /*section sequence number */ - int multiline; /*datum was multiline */ + char *s = NULL; + char *section = NULL; /* a section of output */ + int secnum; /* section sequence number */ + int multiline; /* datum was multiline */ s = h5tools_str_fmt(buffer, (size_t)0, "%s"); @@ -1270,11 +1188,11 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Function: init_acc_pos + * Function: init_acc_pos * - * Purpose: initialize accumulator and matrix position + * Purpose: initialize accumulator and matrix position * - * Return: void + * Return: void *------------------------------------------------------------------------- */ void @@ -1295,10 +1213,10 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) /*------------------------------------------------------------------------- * Function: render_bin_output * - * Purpose: Write one element of memory buffer to a binary file stream + * Purpose: Write one element of memory buffer to a binary file stream * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ int @@ -1344,7 +1262,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t { unsigned int i; H5T_str_t pad; - char *s; + char *s = NULL; unsigned char tempuchar; pad = H5Tget_strpad(tid); @@ -1372,7 +1290,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t break; case H5T_COMPOUND: { - int snmembs; + int snmembs; unsigned nmembs; if((snmembs = H5Tget_nmembers(tid)) < 0) @@ -1384,7 +1302,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t mem = ((unsigned char*)_mem) + block_index * size; for (j = 0; j < nmembs; j++) { - hid_t memb; + hid_t memb = -1; size_t offset; offset = H5Tget_member_offset(tid, j); @@ -1404,7 +1322,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t { int k, ndims; hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts; - hid_t memb; + hid_t memb = -1; /* get the array's base datatype for each element */ memb = H5Tget_super(tid); @@ -1437,7 +1355,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t case H5T_VLEN: { hsize_t nelmts; - hid_t memb; + hid_t memb = -1; /* get the VL sequences's base datatype for each element */ memb = H5Tget_super(tid); @@ -1462,7 +1380,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t /* if (H5Tequal(tid, H5T_STD_REF_DSETREG)) */ if (region_output) { /* region data */ - hid_t region_id, region_space; + hid_t region_id = -1; + hid_t region_space = -1; H5S_sel_type region_type; for (block_index = 0; block_index < block_nelmts; block_index++) { @@ -1512,15 +1431,13 @@ CATCH } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print the data values from a dataset referenced by region blocks. + * Function: render_bin_output_region_data_blocks * - * Description: - * This is a special case subfunction to print the data in a region reference of type blocks. + * Purpose: Print the data values from a dataset referenced by region blocks. + * This is a special case subfunction to print the data in a region reference of type blocks. * - * Return: - * The function returns FAIL if there was an error, otherwise SUCEED + * Return: FAIL if there was an error + * SUCCEED otherwise * *------------------------------------------------------------------------- */ @@ -1609,16 +1526,13 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print some values from a dataset referenced by region blocks. - * - * Description: - * This is a special case subfunction to dump a region reference using blocks. + * Function: render_bin_output_region_blocks * - * Return: - * The function returns False if ERROR, otherwise True + * Purpose: Print some values from a dataset referenced by region blocks. + * This is a special case subfunction to dump a region reference using blocks. * + * Return: False if ERROR + * True otherwise *------------------------------------------------------------------------- */ hbool_t @@ -1629,7 +1543,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, hssize_t snblocks; hsize_t nblocks; hsize_t alloc_size; - hsize_t *ptdata; + hsize_t *ptdata = NULL; int sndims; unsigned ndims; hid_t dtype = -1; @@ -1675,8 +1589,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library + * Function: H5Tools Library * Purpose: Print the data values from a dataset referenced by region points. * * Description: @@ -1736,16 +1649,13 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print some values from a dataset referenced by region points. + * Function: render_bin_output_region_points * - * Description: - * This is a special case subfunction to dump a region reference using points. - * - * Return: - * The function returns False if the last dimension has been reached, otherwise True + * Purpose: Print some values from a dataset referenced by region points. + * This is a special case subfunction to dump a region reference using points. * + * Return: False if the last dimension has been reached + * True otherwise *------------------------------------------------------------------------- */ hbool_t @@ -1791,11 +1701,12 @@ CATCH } /*------------------------------------------------------------------------- - * Function: h5tools_is_zero + * Function: h5tools_is_zero * - * Purpose: Determines if memory is initialized to all zero bytes. + * Purpose: Determines if memory is initialized to all zero bytes. * - * Return: TRUE if all bytes are zero; FALSE otherwise + * Return: TRUE if all bytes are zero + * FALSE otherwise *------------------------------------------------------------------------- */ hbool_t @@ -1811,23 +1722,20 @@ h5tools_is_zero(const void *_mem, size_t size) } /*------------------------------------------------------------------------- - * Function: h5tools_is_obj_same + * Function: h5tools_is_obj_same * - * Purpose: Check if two given object IDs or link names point to the same object. + * Purpose: Check if two given object IDs or link names point to the same object. * * Parameters: - * hid_t loc_id1: location of the first object - * char *name1: link name of the first object. - * Use "." or NULL if loc_id1 is the object to be compared. - * hid_t loc_id2: location of the second object - * char *name1: link name of the first object. - * Use "." or NULL if loc_id2 is the object to be compared. - * - * Return: TRUE if it is the same object; FALSE otherwise. + * hid_t loc_id1: location of the first object + * char *name1: link name of the first object. + * Use "." or NULL if loc_id1 is the object to be compared. + * hid_t loc_id2: location of the second object + * char *name1: link name of the first object. + * Use "." or NULL if loc_id2 is the object to be compared. * - * Programmer: Peter Cao - * 4/27/2011 - * + * Return: TRUE if it is the same object + * FALSE otherwise. *------------------------------------------------------------------------- */ hbool_t diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 57b6ef6..31c54d3 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2794,7 +2794,7 @@ void h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id) { size_t size; - hid_t n_type; + hid_t n_type = -1; void *buf = NULL; n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT); @@ -3435,7 +3435,8 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, error_msg("unable to open attribute \"%s\"\n", attr_name); } else { - hid_t type, space; + hid_t type = -1; + hid_t space = -1; ctx->indent_level++; @@ -3654,9 +3655,9 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, H5S_class_t space_type; int ndims; int i; - hid_t space; - hid_t type; - hid_t p_type; + hid_t space = -1; + hid_t type = -1; + hid_t p_type = -1; hsize_t size[64]; hsize_t alloc_size; hsize_t nelmts = 1; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index c4df03a..fdd88ed 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -637,10 +637,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { size_t nsize, offset, size=0, nelmts, start; H5T_sign_t nsign; - char *name; + char *name = NULL; unsigned char *ucp_vp = (unsigned char *)vp; char *cp_vp = (char *)vp; - hid_t memb, obj; + hid_t memb = -1; + hid_t obj = -1; static char fmt_llong[8], fmt_ullong[8]; H5T_str_t pad; H5T_class_t type_class; @@ -1176,7 +1177,8 @@ void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, void *vp) { - hid_t obj, region; + hid_t obj = -1; + hid_t region = -1; char ref_name[1024]; H5S_sel_type region_type; diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index c9bafd2..3f66ef6 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -496,7 +496,7 @@ find_objs_cb(const char *name, const H5O_info_t *oinfo, const char *already_seen case H5O_TYPE_DATASET: if(NULL == already_seen) { - hid_t dset; + hid_t dset = -1; /* Add the dataset to the list of objects */ add_obj(info->dset_table, oinfo->addr, name, TRUE); -- cgit v0.12 From 7dbf569af90f098a702da84f439c85acb92635df Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 23 Oct 2017 12:41:17 -0500 Subject: HDFFV-10297 Free buffer used in loop --- tools/h5repack/h5repack_copy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 86fa91d..772a9fe 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -877,7 +877,12 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if (TRUE == H5Tdetect_class(wtype_id, H5T_VLEN)) if (H5Dvlen_reclaim(wtype_id, f_space_id, H5P_DEFAULT, buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dvlen_reclaim failed"); - } + /* free */ + if (buf != NULL) { + HDfree(buf); + buf = NULL; + } + } else { /* possibly not enough memory, read/write by hyperslabs */ size_t p_type_nbytes = msize; /*size of memory type */ hsize_t p_nelmts = nelmts; /*total elements */ -- cgit v0.12 From 1854f9979364fc55b74f5de4709d443e393cb5bf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 24 Oct 2017 11:07:10 -0500 Subject: Fix typos --- tools/h5repack/h5repack_copy.c | 2 +- tools/lib/h5tools.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 772a9fe..48743c3 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -1390,7 +1390,7 @@ void print_user_block(const char *filename, hid_t fid) { int ret_value = 0; - hid_t fh = -1; /* file handle */ + int fh = -1; /* file handle */ hsize_t ub_size; /* user block size */ hsize_t size; /* size read */ hid_t fcpl = -1; /* file creation property list ID for HDF5 file */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 8da2f96..9230bb1 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -623,9 +623,9 @@ h5tools_count_ncols(const char *s) * * Purpose: Recursive check for any variable length data in given type. * - * Return: TRUE : type conatains any variable length data + * Return: TRUE : type contains any variable length data * FALSE : type doesn't contain any variable length data - * Negative value: error occur + * Negative value: failed *------------------------------------------------------------------------- */ htri_t @@ -652,9 +652,9 @@ done: * * Purpose: Recursive check for variable length string of a datatype. * - * Return: TRUE : type conatains any variable length string + * Return: TRUE : type contains any variable length string * FALSE : type doesn't contain any variable length string - * Negative value: error occur + * Negative value: failed *------------------------------------------------------------------------- */ htri_t @@ -1652,7 +1652,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, * Function: render_bin_output_region_points * * Purpose: Print some values from a dataset referenced by region points. - * This is a special case subfunction to dump a region reference using points. + * This is a special case function to dump a region reference using points. * * Return: False if the last dimension has been reached * True otherwise -- cgit v0.12 From 9a92d408e137dc0e05ac0dd43810868a6a23ce7d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 24 Oct 2017 14:19:35 -0500 Subject: Fix typo --- tools/h5repack/h5repack_copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 48743c3..63233b8 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -870,7 +870,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if(H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); /* Check if we have VL data in the dataset's * datatype that must be reclaimed */ @@ -961,7 +961,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); if(H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed"); /* reclaim any VL memory, if necessary */ if (vl_data) -- cgit v0.12 From c9da4809fac8466747745c26c804832ba6ddfb1f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 09:07:19 -0500 Subject: Fix test DEPENDS --- tools/perform/CMakeTests.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perform/CMakeTests.cmake b/tools/perform/CMakeTests.cmake index 2bd8d46..1f67abe 100644 --- a/tools/perform/CMakeTests.cmake +++ b/tools/perform/CMakeTests.cmake @@ -167,8 +167,7 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS PERFORM_zip_perf_help) -set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects") if (H5_HAVE_PARALLEL) add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -- cgit v0.12 From 31543659c122169811498ba5dc08932dc1a61df7 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 25 Oct 2017 10:33:33 -0500 Subject: HDFFV-10037: fixed wrong C link flags --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index aac3681..d4c8551 100644 --- a/configure.ac +++ b/configure.ac @@ -3048,7 +3048,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then - cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; esac -- cgit v0.12 From 01a092a911cba3800bb839122b7c5217cec12de3 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 25 Oct 2017 12:55:02 -0500 Subject: HDFFV-10037: fixed wrong C link flags --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d4c8551..4164718 100644 --- a/configure.ac +++ b/configure.ac @@ -3048,7 +3048,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then - cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; esac -- cgit v0.12 From 5d98481706c6f498ea979f2c191e90377012ae1a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 14:13:08 -0500 Subject: HDFFV-10297 Update release note --- release_docs/RELEASE.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 061d1d8..08c780e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -203,6 +203,7 @@ Bug Fixes since HDF5-1.8.19 Modified H5Zfilter_avail and private function, H5Z_filter_avail. Moved check for plugin from public to private function. Updated H5P__set_filter due to change in H5Z_filter_avail. Updated tests. + Note that the output display of h5repack has changed. (ADB - 2017/10/10, HDFFV-10297) -- cgit v0.12 From 2ec67d3e6cc4f20cc25b62c53642c424cb7d14dc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 15:11:02 -0500 Subject: HDFFV-10297 - clarify note. --- release_docs/RELEASE.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 08c780e..b8da0be 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -178,7 +178,7 @@ Bug Fixes since HDF5-1.8.19 block size. (2) Fix other places in the library that call this routine to detect error routine. - + (HDFFV-10216, VC, 2017/09/05) @@ -203,7 +203,10 @@ Bug Fixes since HDF5-1.8.19 Modified H5Zfilter_avail and private function, H5Z_filter_avail. Moved check for plugin from public to private function. Updated H5P__set_filter due to change in H5Z_filter_avail. Updated tests. - Note that the output display of h5repack has changed. + Note, h5repack output display has changed to clarify the individual + steps of the repack process. The output indicates if an operation + applies to all objects. Lines with notation and no information + has removed. (ADB - 2017/10/10, HDFFV-10297) -- cgit v0.12 From 886e2e5c3d0355df903173285f6c8c2370c51a24 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Oct 2017 15:50:18 -0500 Subject: HDFFV-10297 fix grammar --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b8da0be..66633d7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -206,7 +206,7 @@ Bug Fixes since HDF5-1.8.19 Note, h5repack output display has changed to clarify the individual steps of the repack process. The output indicates if an operation applies to all objects. Lines with notation and no information - has removed. + have been removed. (ADB - 2017/10/10, HDFFV-10297) -- cgit v0.12 From 89cfc8617c6dd0fd89c73e40a1b2993bff13858a Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 27 Oct 2017 09:17:46 -0500 Subject: updated configure changes with bin/reconfig --- configure | 2 +- hl/src/H5LTparse.c | 144 ++++++++++++++++++++++++++--------------------------- hl/src/H5LTparse.h | 4 +- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/configure b/configure index f581c44..0859d57 100755 --- a/configure +++ b/configure @@ -33750,7 +33750,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then case "`uname`" in Linux*) if test "X$FC_BASENAME" = "Xnagfor"; then - cat libtool | awk '/NAG_Fortran/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool + cat libtool | awk '/BEGIN LIBTOOL TAG CONFIG: FC/{flag=1}flag&&/wl=/{$NF="wl=\"-Wl,-Wl,,\"";flag=0}1' > libtool.tmp && mv -f libtool.tmp libtool && chmod 755 libtool fi ;; esac diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 2a0f267..16a0bcf 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1641,229 +1641,229 @@ yyreduce: switch (yyn) { case 2: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 99 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 100 "H5LTparse.y" { return (yyval.hid);} break; case 13: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 114 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 115 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 116 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 117 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 118 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 119 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 120 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 121 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 122 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 123 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 124 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 125 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 126 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 127 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 128 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 129 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 130 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 131 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 132 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 133 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 134 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 135 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 136 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 137 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 138 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 139 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 140 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 143 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 144 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 145 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 146 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 147 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 148 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 149 "H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 153 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 155 "H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; @@ -1873,13 +1873,13 @@ yyreduce: break; case 51: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 164 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 166 "H5LTparse.y" { size_t origin_size, new_size; @@ -1915,7 +1915,7 @@ yyreduce: break; case 53: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 199 "H5LTparse.y" { (yyval.sval) = yylval.sval; @@ -1923,25 +1923,25 @@ yyreduce: break; case 54: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 204 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 206 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 210 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 212 "H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); @@ -1952,13 +1952,13 @@ yyreduce: break; case 61: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 222 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 223 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; @@ -1968,19 +1968,19 @@ yyreduce: break; case 65: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 234 "H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 239 "H5LTparse.y" { is_opq_size = 1; } break; case 67: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 240 "H5LTparse.y" { size_t size = (size_t)yylval.ival; @@ -1990,13 +1990,13 @@ yyreduce: break; case 68: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 245 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 246 "H5LTparse.y" { H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); @@ -2005,19 +2005,19 @@ yyreduce: break; case 70: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 250 "H5LTparse.y" { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 258 "H5LTparse.y" { is_str_size = 1; } break; case 74: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 259 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) @@ -2029,7 +2029,7 @@ yyreduce: break; case 75: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 267 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) @@ -2042,7 +2042,7 @@ yyreduce: break; case 76: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 276 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) @@ -2053,7 +2053,7 @@ yyreduce: break; case 77: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 283 "H5LTparse.y" { if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) @@ -2064,7 +2064,7 @@ yyreduce: break; case 78: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 290 "H5LTparse.y" { hid_t str_id = (yyvsp[(19) - (20)].hid); @@ -2085,67 +2085,67 @@ yyreduce: break; case 79: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 307 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 310 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 311 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 314 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 315 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 317 "H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 318 "H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 322 "H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 324 "H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 329 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ @@ -2158,7 +2158,7 @@ yyreduce: break; case 93: -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 338 "H5LTparse.y" { char char_val=(char)yylval.ival; @@ -2205,7 +2205,7 @@ yyreduce: break; -/* Line 1807 of yacc.c */ +/* Line 1792 of yacc.c */ #line 2191 "H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 2af0172..7481a45 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -109,7 +109,7 @@ extern int H5LTyydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 66 "H5LTparse.y" int ival; /*for integer token*/ @@ -117,7 +117,7 @@ typedef union YYSTYPE hid_t hid; /*for hid_t token*/ -/* Line 2065 of yacc.c */ +/* Line 2058 of yacc.c */ #line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -- cgit v0.12 From aea5e1f5d5c4e76c97e964f0f25f25a866d4d563 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 30 Oct 2017 14:37:03 -0500 Subject: Update version string to hdf5 1.8.20-pre0 for newly created hdf5_1_8_20 branch. --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.txt b/README.txt index fc5bda1..edebe2e 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap8 currently under development +HDF5 version 1.8.20-pre0 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 8b950eb..39489f2 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-snap8, currently under development" +PROJECT_NUMBER = "1.8.20-pre0, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 5b7b5f5..394c98b 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-snap8") +set (CTEST_SOURCE_VERSEXT "-pre0") ############################################################################## # handle input parameters to script. diff --git a/configure b/configure index 0859d57..ce996f2 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-snap8. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-pre0. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-snap8' -PACKAGE_STRING='HDF5 1.8.20-snap8' +PACKAGE_VERSION='1.8.20-pre0' +PACKAGE_STRING='HDF5 1.8.20-pre0' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,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.8.20-snap8 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-pre0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-snap8:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-pre0:";; esac cat <<\_ACEOF @@ -1745,7 +1745,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-snap8 +HDF5 configure 1.8.20-pre0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2682,7 +2682,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.8.20-snap8, which was +It was created by HDF5 $as_me 1.8.20-pre0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3553,7 +3553,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-snap8' + VERSION='1.8.20-pre0' cat >>confdefs.h <<_ACEOF @@ -29313,7 +29313,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-snap8 +HDF5 config.lt 1.8.20-pre0 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31373,7 +31373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-snap8, which was +This file was extended by HDF5 $as_me 1.8.20-pre0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31439,7 +31439,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-snap8 +HDF5 config.status 1.8.20-pre0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 4164718..f5de134 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-snap8], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-pre0], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 66633d7..851ea11 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-snap8 currently under development +HDF5 version 1.8.20-pre0 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index c6193a3..151047e 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "snap8" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "pre0" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-snap8" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-pre0" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 3a2b04a2c71f50b1bec7c1f637a975c5e3e3bf8c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 31 Oct 2017 11:29:40 -0500 Subject: Update H5Zfilter_avail note --- release_docs/RELEASE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 851ea11..d34ff8b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -170,7 +170,7 @@ Bug Fixes since HDF5-1.8.19 Moved check for plugin from public to private function. Updated H5P__set_filter due to change in H5Z_filter_avail. Updated tests. - (ADB - 2017/10/10, HDFFV-10297) + (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) - Fix H5HL_offset_into() @@ -208,7 +208,7 @@ Bug Fixes since HDF5-1.8.19 applies to all objects. Lines with notation and no information have been removed. - (ADB - 2017/10/10, HDFFV-10297) + (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) - h5repack -- cgit v0.12 From 5c12a531c6df15c2a7f600a6ad7f066ba51ab2d5 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 31 Oct 2017 16:45:35 -0500 Subject: Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. --- c++/src/Makefile.in | 14 +++++++------- config/lt_vers.am | 14 +++++++------- fortran/src/Makefile.in | 14 +++++++------- hl/c++/src/Makefile.in | 14 +++++++------- hl/fortran/src/Makefile.in | 14 +++++++------- hl/src/Makefile.in | 14 +++++++------- src/Makefile.in | 14 +++++++------- 7 files changed, 49 insertions(+), 49 deletions(-) diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index b096c9f..11fb9b4 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -683,25 +683,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # This is our main target diff --git a/config/lt_vers.am b/config/lt_vers.am index 9612772..bf5ad87 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 ## If the API changes *at all*, increment LT_VERS_INTERFACE and @@ -39,27 +39,27 @@ LT_VERS_AGE = 3 ## the effects of the H5_V1_x_COMPAT flag. ## Version numbers for wrapper shared library files. -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 300cb0b..a182618 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -735,25 +735,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index fc57136..14ce2a1 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -674,25 +674,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 2399369..0d02034 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -692,25 +692,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 965457f..9aea58a 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -673,25 +673,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # This library is our main target. diff --git a/src/Makefile.in b/src/Makefile.in index 9af0c2f..f6a7526 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -731,25 +731,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From ea8751ca948bfb0a26e8057bbf323abc7ecc2ded Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 31 Oct 2017 16:46:55 -0500 Subject: updated issues related to Fortran --- release_docs/RELEASE.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 851ea11..a06124f 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -156,7 +156,9 @@ Bug Fixes since HDF5-1.8.19 Configuration ------------- - - None + - Fixed Fortran linker flags when using the NAG Fortran compiler (autotools). + + (HDFFV-10037, MSB, 2017/10/21) Library -- cgit v0.12 From 70d7c7f926f24f3ed2bd48a938cf39527084993d Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 31 Oct 2017 16:45:35 -0500 Subject: Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. --- c++/src/Makefile.in | 14 +++++++------- config/lt_vers.am | 14 +++++++------- fortran/src/Makefile.in | 14 +++++++------- hl/c++/src/Makefile.in | 14 +++++++------- hl/fortran/src/Makefile.in | 14 +++++++------- hl/src/Makefile.in | 14 +++++++------- src/Makefile.in | 14 +++++++------- 7 files changed, 49 insertions(+), 49 deletions(-) diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index b096c9f..11fb9b4 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -683,25 +683,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # This is our main target diff --git a/config/lt_vers.am b/config/lt_vers.am index 9612772..bf5ad87 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 ## If the API changes *at all*, increment LT_VERS_INTERFACE and @@ -39,27 +39,27 @@ LT_VERS_AGE = 3 ## the effects of the H5_V1_x_COMPAT flag. ## Version numbers for wrapper shared library files. -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 300cb0b..a182618 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -735,25 +735,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 AM_FCLIBS = $(LIBHDF5) diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index fc57136..14ce2a1 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -674,25 +674,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # This is our main target diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 2399369..0d02034 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -692,25 +692,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # Our main target, the high-level fortran library diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 965457f..9aea58a 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -673,25 +673,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # This library is our main target. diff --git a/src/Makefile.in b/src/Makefile.in index 9af0c2f..f6a7526 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -731,25 +731,25 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 13 -LT_VERS_REVISION = 0 +LT_VERS_REVISION = 1 LT_VERS_AGE = 3 -LT_CXX_VERS_INTERFACE = 14 +LT_CXX_VERS_INTERFACE = 15 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 10 -LT_F_VERS_REVISION = 4 +LT_F_VERS_REVISION = 5 LT_F_VERS_AGE = 0 LT_HL_VERS_INTERFACE = 12 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 2 LT_HL_CXX_VERS_INTERFACE = 12 -LT_HL_CXX_VERS_REVISION = 0 +LT_HL_CXX_VERS_REVISION = 1 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 10 -LT_HL_F_VERS_REVISION = 3 +LT_HL_F_VERS_REVISION = 4 LT_HL_F_VERS_AGE = 0 LT_TOOLS_VERS_INTERFACE = 10 -LT_TOOLS_VERS_REVISION = 5 +LT_TOOLS_VERS_REVISION = 6 LT_TOOLS_VERS_AGE = 0 # Our main target, the HDF5 library -- cgit v0.12 From c4b899a9ed617078e9a8f9a11a03e09d9eb02491 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 2 Nov 2017 13:46:13 -0500 Subject: HDFFV-10321 Merge from 1.8 --- CMakeLists.txt | 30 +- CTestConfig.cmake | 2 +- MANIFEST | 6 + config/cmake/UserMacros/Windows_MT.cmake | 2 +- config/cmake/scripts/HDF5config.cmake | 16 +- config/cmake/scripts/HDF5options.cmake | 2 +- config/cmake/userblockTest.cmake | 2 +- config/cmake/vfdTest.cmake | 8 +- config/cmake_ext_mod/FindMPI.cmake | 1754 ++++++++++++++------ .../cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in | 4 + config/cmake_ext_mod/FindMPI/libver_mpi.c | 19 + config/cmake_ext_mod/FindMPI/libver_mpi.f90.in | 7 + config/cmake_ext_mod/FindMPI/mpiver.f90.in | 10 + config/cmake_ext_mod/FindMPI/test_mpi.c | 37 + config/cmake_ext_mod/FindMPI/test_mpi.f90.in | 6 + config/cmake_ext_mod/grepTest.cmake | 6 +- config/cmake_ext_mod/runTest.cmake | 28 +- fortran/CMakeLists.txt | 2 - fortran/examples/CMakeLists.txt | 2 - fortran/examples/CMakeTests.cmake | 6 +- fortran/src/CMakeLists.txt | 8 +- fortran/test/CMakeTests.cmake | 2 +- fortran/testpar/CMakeLists.txt | 4 +- fortran/testpar/CMakeTests.cmake | 4 +- hl/c++/examples/CMakeTests.cmake | 2 +- hl/c++/test/CMakeTests.cmake | 2 +- hl/examples/CMakeTests.cmake | 2 +- hl/fortran/examples/CMakeTests.cmake | 2 +- hl/fortran/test/CMakeTests.cmake | 2 +- hl/test/CMakeTests.cmake | 2 +- release_docs/RELEASE.txt | 22 + src/CMakeLists.txt | 14 +- test/CMakeLists.txt | 2 +- test/CMakeTests.cmake | 12 +- testpar/CMakeLists.txt | 4 +- testpar/CMakeTests.cmake | 6 +- tools/h5diff/CMakeTests.cmake | 4 +- 37 files changed, 1443 insertions(+), 600 deletions(-) create mode 100644 config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in create mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.c create mode 100644 config/cmake_ext_mod/FindMPI/libver_mpi.f90.in create mode 100644 config/cmake_ext_mod/FindMPI/mpiver.f90.in create mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.c create mode 100644 config/cmake_ext_mod/FindMPI/test_mpi.f90.in diff --git a/CMakeLists.txt b/CMakeLists.txt index eeae1b5..d45c0b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -534,16 +534,15 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_D set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH}) option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) if (HDF5_ENABLE_PARALLEL) - include (FindMPI) - INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) + find_package(MPI REQUIRED) if (MPI_C_FOUND) set (H5_HAVE_PARALLEL 1) # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail # and once set, they are cached as false and not regenerated set (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) # Used by Fortran + MPI - CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) - CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) + CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) else () message (STATUS "Parallel libraries not found") endif () @@ -762,12 +761,25 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) + + set (LINK_Fortran_LIBS ${LINK_LIBS}) + set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS}) + if (HDF5_ENABLE_F2003) if (NOT FORTRAN_HAVE_ISO_C_BINDING) set (HDF5_ENABLE_F2003 OFF) endif () endif () + # Parallel IO usage requires MPI to be Linked and Included + if (H5_HAVE_PARALLEL) + set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES}) + set (LINK_Fortran_SHARED_LIBS ${LINK_Fortran_SHARED_LIBS} ${MPI_Fortran_LIBRARIES}) + if (MPI_Fortran_LINK_FLAGS) + set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") + endif () + endif () + add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") @@ -809,11 +821,11 @@ endif () # Check if Fortran's default real is double precision. If it is and HL is # being built then configure should fail due to bug HDFFV-889. #----------------------------------------------------------------------------- - if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB ) - if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) - message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ") - endif () - endif () +if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB) + if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ") + endif () +endif () #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation diff --git a/CTestConfig.cmake b/CTestConfig.cmake index c031dcb..5880d83 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ## This file should be placed in the root directory of your project. ## Then modify the CMakeLists.txt file in the root directory of your ## project to incorporate the testing dashboard. diff --git a/MANIFEST b/MANIFEST index 8a1aa31..0e4f8fb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2355,6 +2355,12 @@ ./config/cmake_ext_mod/NSIS.template.in ./config/cmake_ext_mod/runTest.cmake ./config/cmake_ext_mod/version.plist.in +./config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in +./config/cmake_ext_mod/FindMPI/libver_mpi.c +./config/cmake_ext_mod/FindMPI/libver_mpi.f90.in +./config/cmake_ext_mod/FindMPI/mpiver.f90.in +./config/cmake_ext_mod/FindMPI/test_mpi.c +./config/cmake_ext_mod/FindMPI/test_mpi.f90.in # CMake-specific User Files ./config/cmake/UserMacros/Windows_MT.cmake diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 6eaa070..b6cc513 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ######################################################## # Include file for user options ######################################################## diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 394c98b..0492ab0 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -21,13 +21,13 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) # ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: -# Unix * Unix Makefiles +# Unix * Unix Makefiles # VS2017 * Visual Studio 15 2017 -# VS201764 * Visual Studio 15 2017 Win64 -# VS2015 * Visual Studio 14 2015 -# VS201564 * Visual Studio 14 2015 Win64 -# VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 +# VS201764 * Visual Studio 15 2017 Win64 +# VS2015 * Visual Studio 14 2015 +# VS201564 * Visual Studio 14 2015 Win64 +# VS2013 * Visual Studio 12 2013 +# VS201364 * Visual Studio 12 2013 Win64 # # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc @@ -45,7 +45,7 @@ set (CTEST_SOURCE_VERSEXT "-pre0") #BUILD_GENERATOR - which CMake generator to use, required #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5-1.8.16 +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.8.20 #STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac @@ -199,7 +199,7 @@ set (MODEL "Experimental") ##### Following controls source update ##### #set (LOCAL_UPDATE "TRUE") set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git") -set (REPOSITORY_BRANCH "hdf5_1_8_19") +set (REPOSITORY_BRANCH "hdf5_1_8_20") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index e0bc22f..b090434 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################################# #### Change default configuration of options in config/cmake/cacheinit.cmake file ### #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 6319610..9af7e5b 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # userblockTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index c514731..66a97c0 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# # vfdTest.cmake executes a command and captures the output in a file. Command uses specified VFD. # Exit status of command can also be compared. @@ -60,12 +60,12 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out) file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) - message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") - endif () + message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") + endif () endif () message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") endif () diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index f566ade..8084472 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -4,27 +4,45 @@ # FindMPI # ------- # -# Find a Message Passing Interface (MPI) implementation +# Find a Message Passing Interface (MPI) implementation. # # The Message Passing Interface (MPI) is a library used to write # high-performance distributed-memory parallel applications, and is # typically deployed on a cluster. MPI is a standard interface (defined # by the MPI forum) for which many implementations are available. # -# Variables -# ^^^^^^^^^ +# Variables for using MPI +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``. +# Each of these controls the various MPI languages to search for. +# The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the +# MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API +# that was removed again in MPI-3. +# +# Depending on the enabled components the following variables will be set: +# +# ``MPI_FOUND`` +# Variable indicating that MPI settings for all requested languages have been found. +# If no components are specified, this is true if MPI settings for all enabled languages +# were detected. Note that the ``MPICXX`` component does not affect this variable. +# ``MPI_VERSION`` +# Minimal version of MPI detected among the requested languages, or all enabled languages +# if no components were specified. # # This module will set the following variables per language in your # project, where ```` is one of C, CXX, or Fortran: # # ``MPI__FOUND`` -# Variable indicating the MPI settings for ```` were found. +# Variable indicating the MPI settings for ```` were found and that +# simple MPI test programs compile with the provided settings. # ``MPI__COMPILER`` -# MPI Compiler wrapper for ````. -# ``MPI__COMPILE_FLAGS`` -# Compilation flags for MPI programs, separated by spaces. -# This is *not* a :ref:`;-list `. -# ``MPI__INCLUDE_PATH`` +# MPI compiler for ```` if such a program exists. +# ``MPI__COMPILE_OPTIONS`` +# Compilation options for MPI programs in ````, given as a :ref:`;-list `. +# ``MPI__COMPILE_DEFINITIONS`` +# Compilation definitions for MPI programs in ````, given as a :ref:`;-list `. +# ``MPI__INCLUDE_DIRS`` # Include path(s) for MPI header. # ``MPI__LINK_FLAGS`` # Linker flags for MPI programs. @@ -36,53 +54,172 @@ # ``MPI::MPI_`` # Target for using MPI from ````. # -# Additionally, FindMPI sets the following variables for running MPI -# programs from the command line: +# The following variables indicating which bindings are present will be defined: # -# ``MPIEXEC`` -# Executable for running MPI programs, if provided. +# ``MPI_MPICXX_FOUND`` +# Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3). +# ``MPI_Fortran_HAVE_F77_HEADER`` +# True if the Fortran 77 header ``mpif.h`` is available. +# ``MPI_Fortran_HAVE_F90_MODULE`` +# True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only). +# ``MPI_Fortran_HAVE_F08_MODULE`` +# True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only). +# +# If possible, the MPI version will be determined by this module. The facilities to detect the MPI version +# were introduced with MPI-1.2, and therefore cannot be found for older MPI versions. +# +# ``MPI__VERSION_MAJOR`` +# Major version of MPI implemented for ```` by the MPI distribution. +# ``MPI__VERSION_MINOR`` +# Minor version of MPI implemented for ```` by the MPI distribution. +# ``MPI__VERSION`` +# MPI version implemented for ```` by the MPI distribution. +# +# Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards +# always have required this binding to work in both C and C++ code. +# +# For running MPI programs, the module sets the following variables +# +# ``MPIEXEC_EXECUTABLE`` +# Executable for running MPI programs, if such exists. # ``MPIEXEC_NUMPROC_FLAG`` -# Flag to pass to ``MPIEXEC`` before giving it the number of processors to run on. +# Flag to pass to ``mpiexec`` before giving it the number of processors to run on. # ``MPIEXEC_MAX_NUMPROCS`` # Number of MPI processors to utilize. Defaults to the number # of processors detected on the host system. # ``MPIEXEC_PREFLAGS`` -# Flags to pass to ``MPIEXEC`` directly before the executable to run. +# Flags to pass to ``mpiexec`` directly before the executable to run. # ``MPIEXEC_POSTFLAGS`` -# Flags to pass to ``MPIEXEC`` after other flags. +# Flags to pass to ``mpiexec`` after other flags. +# +# Variables for locating MPI +# ^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# This module performs a three step search for an MPI implementation: +# +# 1. Check if the compiler has MPI support built-in. This is the case if the user passed a +# compiler wrapper as ``CMAKE__COMPILER`` or if they're on a Cray system. +# 2. Attempt to find an MPI compiler wrapper and determine the compiler information from it. +# 3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings. +# Currently, only Microsoft MPI and MPICH2 on Windows are supported. +# +# For controlling the second step, the following variables may be set: +# +# ``MPI__COMPILER`` +# Search for the specified compiler wrapper and use it. +# ``MPI__COMPILER_FLAGS`` +# Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers +# support linking debug or tracing libraries if a specific flag is passed and this variable +# may be used to obtain them. +# ``MPI_COMPILER_FLAGS`` +# Used to initialize ``MPI__COMPILER_FLAGS`` if no language specific flag has been given. +# Empty by default. +# ``MPI_EXECUTABLE_SUFFIX`` +# A suffix which is appended to all names that are being looked for. For instance you may set this +# to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives. +# +# In order to control the guessing step, the following variable may be set: # -# Usage -# ^^^^^ +# ``MPI_GUESS_LIBRARY_NAME`` +# Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for. +# By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available. +# This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden. # -# To use this module, call ``find_package(MPI)``. If you are happy with the -# auto-detected configuration for your language, then you're done. If -# not, you have two options: +# Each of the search steps may be skipped with the following control variables: # -# 1. Set ``MPI__COMPILER`` to the MPI wrapper (e.g. ``mpicc``) of your -# choice and reconfigure. FindMPI will attempt to determine all the -# necessary variables using *that* compiler's compile and link flags. -# 2. If this fails, or if your MPI implementation does not come with -# a compiler wrapper, then set both ``MPI__LIBRARIES`` and -# ``MPI__INCLUDE_PATH``. You may also set any other variables -# listed above, but these two are required. This will circumvent -# autodetection entirely. +# ``MPI_ASSUME_NO_BUILTIN_MPI`` +# If true, the module assumes that the compiler itself does not provide an MPI implementation and +# skips to step 2. +# ``MPI_SKIP_COMPILER_WRAPPER`` +# If true, no compiler wrapper will be searched for. +# ``MPI_SKIP_GUESSING`` +# If true, the guessing step will be skipped. # -# When configuration is successful, ``MPI__COMPILER`` will be set to -# the compiler wrapper for ````, if it was found. ``MPI__FOUND`` -# and other variables above will be set if any MPI implementation was -# found for ````, regardless of whether a compiler was found. +# Additionally, the following control variable is available to change search behavior: # -# When using ``MPIEXEC`` to execute MPI applications, you should typically -# use all of the ``MPIEXEC`` flags as follows: +# ``MPI_CXX_SKIP_MPICXX`` +# Add some definitions that will disable the MPI-2 C++ bindings. +# Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof, +# for example MVAPICH or Intel MPI. +# +# If the find procedure fails for a variable ``MPI__WORKS``, then the settings detected by or passed to +# the module did not work and even a simple MPI test program failed to compile. +# +# If all of these parameters were not sufficient to find the right MPI implementation, a user may +# disable the entire autodetection process by specifying both a list of libraries in ``MPI__LIBRARIES`` +# and a list of include directories in ``MPI__ADDITIONAL_INCLUDE_DIRS``. +# Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the +# settings in the cache. +# +# Cache variables for MPI +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +# The variable ``MPI__INCLUDE_DIRS`` will be assembled from the following variables. +# For C and CXX: +# +# ``MPI__HEADER_DIR`` +# Location of the ``mpi.h`` header on disk. +# +# For Fortran: +# +# ``MPI_Fortran_F77_HEADER_DIR`` +# Location of the Fortran 77 header ``mpif.h``, if it exists. +# ``MPI_Fortran_MODULE_DIR`` +# Location of the ``mpi`` or ``mpi_f08`` modules, if available. +# +# For all languages the following variables are additionally considered: +# +# ``MPI__ADDITIONAL_INCLUDE_DIRS`` +# A :ref:`;-list ` of paths needed in addition to the normal include directories. +# ``MPI__INCLUDE_DIR`` +# Path variables for include folders referred to by ````. +# ``MPI__ADDITIONAL_INCLUDE_VARS`` +# A :ref:`;-list ` of ```` that will be added to the include locations of ````. +# +# The variable ``MPI__LIBRARIES`` will be assembled from the following variables: +# +# ``MPI__LIBRARY`` +# The location of a library called ```` for use with MPI. +# ``MPI__LIB_NAMES`` +# A :ref:`;-list ` of ```` that will be added to the include locations of ````. +# +# Usage of mpiexec +# ^^^^^^^^^^^^^^^^ +# +# When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically +# use all of the ``MPIEXEC_EXECUTABLE`` flags as follows: # # :: # -# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} +# ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} # ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS # # where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to # pass to the MPI program. # +# Advanced variables for using MPI +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# The module can perform some advanced feature detections upon explicit request. +# +# **Important notice:** The following checks cannot be performed without *executing* an MPI test program. +# Consider the special considerations for the behavior of :command:`try_run` during cross compilation. +# Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems. +# You should only enable these detections if you absolutely need the information. +# +# If the following variables are set to true, the respective search will be performed: +# +# ``MPI_DETERMINE_Fortran_CAPABILITIES`` +# Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and +# ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran__SUBARRAYS`` +# and ``MPI_Fortran__ASYNCPROT``, where ```` is one of ``F77_HEADER``, ``F90_MODULE`` and +# ``F08_MODULE``. +# ``MPI_DETERMINE_LIBRARY_VERSION`` +# For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI__LIBRARY_VERSION``. +# This information is usually tied to the runtime component of an MPI implementation and might differ depending on ````. +# Note that the return value is entirely implementation defined. This information might be used to identify +# the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor. +# # Backward Compatibility # ^^^^^^^^^^^^^^^^^^^^^^ # @@ -91,54 +228,62 @@ # # :: # -# MPI_FOUND MPI_COMPILER MPI_LIBRARY -# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY -# MPI_LINK_FLAGS MPI_LIBRARIES +# MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY +# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS +# MPI_LIBRARIES # # In new projects, please use the ``MPI__XXX`` equivalents. +# Additionally, the following variables are deprecated: +# +# ``MPI__COMPILE_FLAGS`` +# Use ``MPI__COMPILE_OPTIONS`` and ``MPI__COMPILE_DEFINITIONS`` instead. +# ``MPI__INCLUDE_PATH`` +# For consumption use ``MPI__INCLUDE_DIRS`` and for specifying folders use ``MPI__ADDITIONAL_INCLUDE_DIRS`` instead. +# ``MPIEXEC`` +# Use ``MPIEXEC_EXECUTABLE`` instead. + +cmake_policy(PUSH) +cmake_policy(SET CMP0057 NEW) # if IN_LIST # include this to handle the QUIETLY and REQUIRED arguments include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) include(GetPrerequisites) -# -# This part detects MPI compilers, attempting to wade through the mess of compiler names in -# a sensible way. -# -# The compilers are detected in this order: -# -# 1. Try to find the most generic available MPI compiler, as this is usually set up by -# cluster admins, e.g. if plain old mpicc is available, we'll use it and assume it's -# the right compiler. -# -# 2. If a generic mpicc is NOT found, then we attempt to find one that matches -# CMAKE__COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc -# and company, but not mpiicc. This hopefully prevents toolchain mismatches. -# -# If you want to force a particular MPI compiler other than what we autodetect (e.g. if you -# want to compile regular stuff with GNU and parallel stuff with Intel), you can always set -# your favorite MPI__COMPILER explicitly and this stuff will be ignored. -# - -# Start out with the generic MPI compiler names, as these are most commonly used. -set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r mpicc.bat) -set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r - mpicxx.bat) -set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r +# Generic compiler names +set(_MPI_C_GENERIC_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_CXX_GENERIC_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) +set(_MPI_Fortran_GENERIC_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r mpif90 mpif90_r mpf90 mpf90_r - mpif77 mpif77_r mpf77 mpf77_r) + mpif77 mpif77_r mpf77 mpf77_r + mpifc) # GNU compiler names set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) -set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r) +set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r mpigxx) set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r mpig77 mpig77_r mpg77 mpg77_r) -# Intel MPI compiler names -set(_MPI_Intel_C_COMPILER_NAMES mpiicc mpiicc.bat) -set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC mpiicpc.bat) -set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77 mpiifort.bat) +# Intel MPI compiler names on Windows +if(WIN32) + list(APPEND _MPI_C_GENERIC_COMPILER_NAMES mpicc.bat) + list(APPEND _MPI_CXX_GENERIC_COMPILER_NAMES mpicxx.bat) + list(APPEND _MPI_Fortran_GENERIC_COMPILER_NAMES mpifc.bat) + + # Intel MPI compiler names + set(_MPI_Intel_C_COMPILER_NAMES mpiicc.bat) + set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc.bat) + set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort.bat mpif77.bat mpif90.bat) + + # Intel MPI compiler names for MSMPI + set(_MPI_MSVC_C_COMPILER_NAMES mpicl.bat) + set(_MPI_MSVC_CXX_COMPILER_NAMES mpicl.bat) +else() + # Intel compiler names + set(_MPI_Intel_C_COMPILER_NAMES mpiicc) + set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++) + set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) +endif() # PGI compiler names set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) @@ -154,548 +299,1127 @@ set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95 mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r mpixlf mpixlf_r mpxlf mpxlf_r) -# append vendor-specific compilers to the list if we either don't know the compiler id, -# or if we know it matches the regular compiler. -foreach (lang C CXX Fortran) - foreach (id GNU Intel PGI XL) - if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID STREQUAL id) - list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES}) +# Prepend vendor-specific compiler wrappers to the list. If we don't know the compiler, +# attempt all of them. +# By attempting vendor-specific compiler names first, we should avoid situations where the compiler wrapper +# stems from a proprietary MPI and won't know which compiler it's being used for. For instance, Intel MPI +# controls its settings via the I_MPI_CC environment variables if the generic name is being used. +# If we know which compiler we're working with, we can use the most specialized wrapper there is in order to +# pick up the right settings for it. +foreach (LANG IN ITEMS C CXX Fortran) + set(_MPI_${LANG}_COMPILER_NAMES "") + foreach (id IN ITEMS GNU Intel MSVC PGI XL) + if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id) + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) endif() - unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here + unset(_MPI_${id}_${LANG}_COMPILER_NAMES) endforeach() + list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX}) + unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES) endforeach() +# Names to try for mpiexec +# Only mpiexec commands are guaranteed to behave as described in the standard, +# mpirun commands are not covered by the standard in any way whatsoever. +# lamexec is the executable for LAM/MPI, srun is for SLURM or Open MPI with SLURM support. +# srun -n X is however a valid command, so it behaves 'like' mpiexec. +set(_MPIEXEC_NAMES_BASE mpiexec mpiexec.hydra mpiexec.mpd mpirun lamexec srun) -# Names to try for MPI exec -set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) - -# Grab the path to MPI from the registry if we're on windows. -set(_MPI_PREFIX_PATH) -if(WIN32) - # MSMPI - file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. - list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") - unset(msmpi_bin_path) - list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") - list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime - # MPICH - list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") - list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") - list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") - # INTEL MPI - list(APPEND _MPI_PREFIX_PATH "$ENV{I_MPI_ROOT}/intel64/") - -endif() - -# Build a list of prefixes to search for MPI. -foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH}) - foreach(MpiPackageDir ${_MPI_PREFIX_PATH}) - if(EXISTS ${SystemPrefixDir}/${MpiPackageDir}) - list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}") - endif() - endforeach() +unset(_MPIEXEC_NAMES) +foreach(_MPIEXEC_NAME IN LISTS _MPIEXEC_NAMES_BASE) + list(APPEND _MPIEXEC_NAMES "${_MPIEXEC_NAME}${MPI_EXECUTABLE_SUFFIX}") endforeach() +unset(_MPIEXEC_NAMES_BASE) -function (_mpi_check_compiler compiler options cmdvar resvar) +function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE) + if(DEFINED MPI_${LANG}_COMPILER_FLAGS) + separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_${LANG}_COMPILER_FLAGS}") + else() + separate_arguments(_MPI_COMPILER_WRAPPER_OPTIONS NATIVE_COMMAND "${MPI_COMPILER_FLAGS}") + endif() execute_process( - COMMAND "${compiler}" ${options} - OUTPUT_VARIABLE cmdline OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE cmdline ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE success) - # Intel MPI 5.0.1 will return a zero return code even when the - # argument to the MPI compiler wrapper is unknown. Attempt to - # catch this case. - if(cmdline MATCHES "undefined reference" OR cmdline MATCHES "unrecognized") - set(success 255 ) - endif() - set(${cmdvar} "${cmdline}" PARENT_SCOPE) - set(${resvar} "${success}" PARENT_SCOPE) + COMMAND ${MPI_${LANG}_COMPILER} ${_MPI_COMPILER_WRAPPER_OPTIONS} ${QUERY_FLAG} + OUTPUT_VARIABLE WRAPPER_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE WRAPPER_OUTPUT ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE WRAPPER_RETURN) + # Some compiler wrappers will yield spurious zero return values, for example + # Intel MPI tolerates unknown arguments and if the MPI wrappers loads a shared + # library that has invalid or missing version information there would be warning + # messages emitted by ld.so in the compiler output. In either case, we'll treat + # the output as invalid. + if("${WRAPPER_OUTPUT}" MATCHES "undefined reference|unrecognized|need to set|no version information available") + set(WRAPPER_RETURN 255) + endif() + # Ensure that no error output might be passed upwards. + if(NOT WRAPPER_RETURN EQUAL 0) + unset(WRAPPER_OUTPUT) + endif() + set(${OUTPUT_VARIABLE} "${WRAPPER_OUTPUT}" PARENT_SCOPE) + set(${RESULT_VARIABLE} "${WRAPPER_RETURN}" PARENT_SCOPE) endfunction() -# -# interrogate_mpi_compiler(lang try_libs) -# -# Attempts to extract compiler and linker args from an MPI compiler. The arguments set -# by this function are: -# -# MPI__INCLUDE_PATH MPI__LINK_FLAGS MPI__FOUND -# MPI__COMPILE_FLAGS MPI__LIBRARIES -# -# MPI__COMPILER must be set beforehand to the absolute path to an MPI compiler for -# . Additionally, MPI__INCLUDE_PATH and MPI__LIBRARIES may be set -# to skip autodetection. -# -# If try_libs is TRUE, this will also attempt to find plain MPI libraries in the usual -# way. In general, this is not as effective as interrogating the compilers, as it -# ignores language-specific flags and libraries. However, some MPI implementations -# (Windows implementations) do not have compiler wrappers, so this approach must be used. -# -function (interrogate_mpi_compiler lang try_libs) - # MPI_${lang}_NO_INTERROGATE will be set to a compiler name when the *regular* compiler was - # discovered to be the MPI compiler. This happens on machines like the Cray XE6 that use - # modules to set cc, CC, and ftn to the MPI compilers. If the user force-sets another MPI - # compiler, MPI_${lang}_COMPILER won't be equal to MPI_${lang}_NO_INTERROGATE, and we'll - # inspect that compiler anew. This allows users to set new compilers w/o rm'ing cache. - string(COMPARE NOTEQUAL "${MPI_${lang}_NO_INTERROGATE}" "${MPI_${lang}_COMPILER}" interrogate) - - # If MPI is set already in the cache, don't bother with interrogating the compiler. - if (interrogate AND ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))) - if (MPI_${lang}_COMPILER) - # Check whether the -showme:compile option works. This indicates that we have either OpenMPI - # or a newer version of LAM-MPI, and implies that -showme:link will also work. - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - if (MPI_COMPILER_RETURN EQUAL 0) - # If we appear to have -showme:compile, then we should - # also have -showme:link. Try it. - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -showme:link - OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE MPI_COMPILER_RETURN) - - if (MPI_COMPILER_RETURN EQUAL 0) - # We probably have -showme:incdirs and -showme:libdirs as well, - # so grab that while we're at it. - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -showme:incdirs - OUTPUT_VARIABLE MPI_INCDIRS OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_INCDIRS ERROR_STRIP_TRAILING_WHITESPACE) - - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -showme:libdirs - OUTPUT_VARIABLE MPI_LIBDIRS OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_LIBDIRS ERROR_STRIP_TRAILING_WHITESPACE) +function (_MPI_interrogate_compiler lang) + unset(MPI_COMPILE_CMDLINE) + unset(MPI_LINK_CMDLINE) + + unset(MPI_COMPILE_OPTIONS_WORK) + unset(MPI_COMPILE_DEFINITIONS_WORK) + unset(MPI_INCLUDE_DIRS_WORK) + unset(MPI_LINK_FLAGS_WORK) + unset(MPI_LIB_NAMES_WORK) + unset(MPI_LIB_FULLPATHS_WORK) + + # Check whether the -showme:compile option works. This indicates that we have either Open MPI + # or a newer version of LAM/MPI, and implies that -showme:link will also work. + # Open MPI also supports -show, but separates linker and compiler information + _MPI_check_compiler(${LANG} "-showme:compile" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + if (MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-showme:link" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) + + if (NOT MPI_COMPILER_RETURN EQUAL 0) + unset(MPI_COMPILE_CMDLINE) + endif() + endif() - else() - # reset things here if something went wrong. - set(MPI_COMPILE_CMDLINE) - set(MPI_LINK_CMDLINE) - endif() - endif () + # MPICH and MVAPICH offer -compile-info and -link-info. + # For modern versions, both do the same as -show. However, for old versions, they do differ + # when called for mpicxx and mpif90 and it's necessary to use them over -show in order to find the + # removed MPI C++ bindings. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-link-info" MPI_LINK_CMDLINE MPI_COMPILER_RETURN) - # Older versions of LAM-MPI have "-showme". Try to find that. if (NOT MPI_COMPILER_RETURN EQUAL 0) - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + unset(MPI_COMPILE_CMDLINE) endif() + endif() + endif() - # MVAPICH uses -compile-info and -link-info. Try them. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-compile-info" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - - # If we have compile-info, also have link-info. - if (MPI_COMPILER_RETURN EQUAL 0) - execute_process( - COMMAND ${MPI_${lang}_COMPILER} -link-info - OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE MPI_COMPILER_RETURN) - endif() + # MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the + # -showme commands are more specialized. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() - # make sure we got compile and link. Reset vars if something's wrong. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - set(MPI_COMPILE_CMDLINE) - set(MPI_LINK_CMDLINE) - endif() - endif() + # Older versions of LAM/MPI have "-showme". Open MPI also supports this. + # Unknown to MPICH, MVAPICH and Intel MPI. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + _MPI_check_compiler(${LANG} "-showme" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) + endif() - # MPICH just uses "-show". Try it. - if (NOT MPI_COMPILER_RETURN EQUAL 0) - _mpi_check_compiler("${MPI_${lang}_COMPILER}" "-show" MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN) - endif() + if (NOT (MPI_COMPILER_RETURN EQUAL 0) OR NOT (DEFINED MPI_COMPILE_CMDLINE)) + # Cannot interrogate this compiler, so exit. + set(MPI_${LANG}_WRAPPER_FOUND FALSE PARENT_SCOPE) + return() + endif() + unset(MPI_COMPILER_RETURN) - if (MPI_COMPILER_RETURN EQUAL 0) - # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE - # into MPI_LINK_CMDLINE, if we didn't find the link line. - if (NOT MPI_LINK_CMDLINE) - set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE}) - endif() + # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE + # into MPI_LINK_CMDLINE, if we didn't find the link line. + if (NOT DEFINED MPI_LINK_CMDLINE) + set(MPI_LINK_CMDLINE "${MPI_COMPILE_CMDLINE}") + endif() + + # At this point, we obtained some output from a compiler wrapper that works. + # We'll now try to parse it into variables with meaning to us. + if("${LANG}" STREQUAL "Fortran") + # Some MPICH-1 and MVAPICH-1 versions return a three command answer for Fortran, consisting + # out of a symlink command for mpif.h, the actual compiler command and a deletion of the + # created symlink. We need to detect that case, remember the include path and drop the + # symlink/deletion operation to obtain the link/compile lines we'd usually expect. + if("${MPI_COMPILE_CMDLINE}" MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h") + get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY) + string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + endif() + endif() + + # The Intel MPI wrapper on Linux will emit some objcopy commands after its compile command + # if -static_mpi was passed to the wrapper. To avoid spurious matches, we need to drop these lines. + if(UNIX) + string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}") + string(REGEX REPLACE "(^|\n)objcopy[^\n]+(\n|$)" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}") + endif() + + # Extract compile options from the compile command line. + string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}") + + foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS) + string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}") + # Ignore -fstack-protector directives: These occur on MPICH and MVAPICH when the libraries + # themselves were built with this flag. However, this flag is unrelated to using MPI, and + # we won't match the accompanying --param-ssp-size and -Wp,-D_FORTIFY_SOURCE flags and therefore + # produce inconsistent results with the regularly flags. + # Similarly, aliasing flags do not belong into our flag array. + if(NOT "${_MPI_COMPILE_OPTION}" MATCHES "^-f(stack-protector|(no-|)strict-aliasing|PI[CE]|pi[ce])") + list(APPEND MPI_COMPILE_OPTIONS_WORK "${_MPI_COMPILE_OPTION}") + endif() + endforeach() + + # Same deal, with the definitions. We also treat arguments passed to the preprocessor directly. + string(REGEX MATCHALL "(^| )(-Wp,|-Xpreprocessor |)[-/]D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}") + + foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS) + string(REGEX REPLACE "^ ?(-Wp,|-Xpreprocessor )?[-/]D" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") + string(REPLACE "\"" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}") + if(NOT "${_MPI_COMPILE_DEFINITION}" MATCHES "^_FORTIFY_SOURCE.*") + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${_MPI_COMPILE_DEFINITION}") + endif() + endforeach() + + # Extract include paths from compile command line + string(REGEX MATCHALL "(^| )[-/]I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + + # If extracting failed to work, we'll try using -showme:incdirs. + if (NOT MPI_ALL_INCLUDE_PATHS) + _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN) + if(MPI_INCDIRS_COMPILER_RETURN) + separate_arguments(MPI_ALL_INCLUDE_PATHS NATIVE_COMMAND "${MPI_INCDIRS_CMDLINE}") + endif() + endif() + + foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS) + string(REGEX REPLACE "^ ?[-/]I" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") + string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}") + get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH) + list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}") + endforeach() + + # Extract linker paths from the link command line + string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker |)(-L|[/-]LIBPATH:|[/-]libpath:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") + + # If extracting failed to work, we'll try using -showme:libdirs. + if (NOT MPI_ALL_LINK_PATHS) + _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN) + if(MPI_LIBDIRS_COMPILER_RETURN) + separate_arguments(MPI_ALL_LINK_PATHS NATIVE_COMMAND "${MPI_LIBDIRS_CMDLINE}") + endif() + endif() + + foreach(_MPI_LPATH IN LISTS MPI_ALL_LINK_PATHS) + string(REGEX REPLACE "^ ?(-Wl,|-Xlinker )?(-L|[/-]LIBPATH:|[/-]libpath:)" "" _MPI_LPATH "${_MPI_LPATH}") + string(REPLACE "\"" "" _MPI_LPATH "${_MPI_LPATH}") + get_filename_component(_MPI_LPATH "${_MPI_LPATH}" REALPATH) + list(APPEND MPI_LINK_DIRECTORIES_WORK "${_MPI_LPATH}") + endforeach() + + # Extract linker flags from the link command line + string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") + + foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS) + string(STRIP "${_MPI_LINK_FLAG}" _MPI_LINK_FLAG) + # MPI might be marked to build with non-executable stacks but this should not propagate. + if (NOT "${_MPI_LINK_FLAG}" MATCHES "(-Wl,|-Xlinker )-z,noexecstack") + if (MPI_LINK_FLAGS_WORK) + string(APPEND MPI_LINK_FLAGS_WORK " ${_MPI_LINK_FLAG}") else() - message(STATUS "Unable to determine MPI from MPI driver ${MPI_${lang}_COMPILER}") - set(MPI_COMPILE_CMDLINE) - set(MPI_LINK_CMDLINE) + set(MPI_LINK_FLAGS_WORK "${_MPI_LINK_FLAG}") endif() + endif() + endforeach() - # Here, we're done with the interrogation part, and we'll try to extract args we care - # about from what we learned from the compiler wrapper scripts. - - # If interrogation came back with something, extract our variable from the MPI command line - if (MPI_COMPILE_CMDLINE OR MPI_LINK_CMDLINE) - # Extract compile flags from the compile command line. - string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") - set(MPI_COMPILE_FLAGS_WORK) + # Extract the set of libraries to link against from the link command + # line + string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) - string(REGEX REPLACE "^ " "" FLAG ${FLAG}) - if (MPI_COMPILE_FLAGS_WORK) - set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") - else() - set(MPI_COMPILE_FLAGS_WORK ${FLAG}) - endif() - endforeach() + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) + string(REGEX REPLACE "^ ?-l" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() - # Extract include paths from compile command line - string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") - set(MPI_INCLUDE_PATH_WORK) + if(WIN32) + # A compiler wrapper on Windows will just have the name of the + # library to link on its link line, potentially with a full path + string(REGEX MATCHALL "(^| )([^\" ]+\\.lib|\"[^\"]+\\.lib\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES) + string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() + else() + # On UNIX platforms, archive libraries can be given with full path. + string(REGEX MATCHALL "(^| )([^\" ]+\\.a|\"[^\"]+\\.a\")" MPI_LIBFULLPATHS "${MPI_LINK_CMDLINE}") + foreach(_MPI_LIB_NAME IN LISTS MPI_LIBFULLPATHS) + string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}") + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY) + if(NOT "${_MPI_LIB_PATH}" STREQUAL "") + list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}") + else() + list(APPEND MPI_LIB_NAMES_WORK "${_MPI_LIB_NAME}") + endif() + endforeach() + endif() - foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) - string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) - string(REPLACE "//" "/" IPATH ${IPATH}) - string(REPLACE "\"" "" IPATH ${IPATH}) - file(TO_CMAKE_PATH "${IPATH}" IPATH) - list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) - endforeach() + # An MPI compiler wrapper could have its MPI libraries in the implictly + # linked directories of the compiler itself. + if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}") + endif() - # try using showme:incdirs if extracting didn't work. - if (NOT MPI_INCLUDE_PATH_WORK) - set(MPI_INCLUDE_PATH_WORK ${MPI_INCDIRS}) - separate_arguments(MPI_INCLUDE_PATH_WORK) - endif() + # Determine full path names for all of the libraries that one needs + # to link against in an MPI program + unset(MPI_PLAIN_LIB_NAMES_WORK) + foreach(_MPI_LIB_NAME IN LISTS MPI_LIB_NAMES_WORK) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_NAME}" NAME_WE) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${MPI_LINK_DIRECTORIES_WORK} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() - # If all else fails, just search for mpi.h in the normal include paths. - if (NOT MPI_INCLUDE_PATH_WORK) - set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_path(MPI_HEADER_PATH mpi.h - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include) - set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - endif() + # Deal with the libraries given with full path next + unset(MPI_DIRECT_LIB_NAMES_WORK) + foreach(_MPI_LIB_FULLPATH IN LISTS MPI_LIB_FULLPATHS_WORK) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB_FULLPATH}" NAME) + get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_FULLPATH}" DIRECTORY) + list(APPEND MPI_DIRECT_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_PATH} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() + if(MPI_DIRECT_LIB_NAMES_WORK) + set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}") + endif() - # Extract linker paths from the link command line - string(REGEX MATCHALL "(^| |-Wl,)(-L|/LIBPATH:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") - set(MPI_LINK_PATH) - foreach(LPATH ${MPI_ALL_LINK_PATHS}) - string(REGEX REPLACE "^(| |-Wl,)(-L|/LIBPATH:)" "" LPATH ${LPATH}) - string(REPLACE "//" "/" LPATH ${LPATH}) - list(APPEND MPI_LINK_PATH ${LPATH}) - endforeach() + # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to + # link it in that case. -lpthread is covered by the normal library treatment on the other hand. + if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread") + list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread") + if(MPI_LINK_FLAGS_WORK) + string(APPEND MPI_LINK_FLAGS_WORK " -pthread") + else() + set(MPI_LINK_FLAGS_WORK "-pthread") + endif() + endif() - # try using showme:libdirs if extracting didn't work. - if (NOT MPI_LINK_PATH) - set(MPI_LINK_PATH ${MPI_LIBDIRS}) - separate_arguments(MPI_LINK_PATH) - endif() + # If we found MPI, set up all of the appropriate cache entries + if(NOT MPI_${LANG}_COMPILE_OPTIONS) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) + endif() + if(NOT MPI_${LANG}_COMPILE_DEFINITIONS) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_COMPILE_DEFINITIONS_WORK} CACHE STRING "MPI ${LANG} compilation definitions" FORCE) + endif() + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_INCLUDE_DIRS_WORK} CACHE STRING "MPI ${LANG} additional include directories" FORCE) + endif() + if(NOT MPI_${LANG}_LINK_FLAGS) + set(MPI_${LANG}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${LANG} linker flags" FORCE) + endif() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES ${MPI_PLAIN_LIB_NAMES_WORK} CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + set(MPI_${LANG}_WRAPPER_FOUND TRUE PARENT_SCOPE) +endfunction() - # Extract linker flags from the link command line - string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") - set(MPI_LINK_FLAGS_WORK) - foreach(FLAG ${MPI_ALL_LINK_FLAGS}) - string(REGEX REPLACE "^ " "" FLAG ${FLAG}) - if (MPI_LINK_FLAGS_WORK) - set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") - else() - set(MPI_LINK_FLAGS_WORK ${FLAG}) - endif() - endforeach() +function(_MPI_guess_settings LANG) + set(MPI_GUESS_FOUND FALSE) + # Currently only MSMPI and MPICH2 on Windows are supported, so we can skip this search if we're not targeting that. + if(WIN32) + # MSMPI + + # The environment variables MSMPI_INC and MSMPILIB32/64 are the only ways of locating the MSMPI_SDK, + # which is installed separately from the runtime. Thus it's possible to have mpiexec but not MPI headers + # or import libraries and vice versa. + if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MSMPI") + # We first attempt to locate the msmpi.lib. Should be find it, we'll assume that the MPI present is indeed + # Microsoft MPI. + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB64}") + set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x64") + else() + set(MPI_MSMPI_LIB_PATH "$ENV{MSMPI_LIB32}") + set(MPI_MSMPI_INC_PATH_EXTRA "$ENV{MSMPI_INC}/x86") + endif() - # Extract the set of libraries to link against from the link command - # line - string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - if(WIN32) - # The intel wrappers on windows link against static versions of the MPI libraries. - # The static libraries are simply listed on the command line without -l. - # For instance: " icl ... impi.lib " - string(REGEX MATCHALL "(^| )([^\" ]+)\\.lib" tmp "${MPI_LINK_CMDLINE}") - list(APPEND MPI_LIBNAMES ${tmp}) + find_library(MPI_msmpi_LIBRARY + NAMES msmpi + HINTS ${MPI_MSMPI_LIB_PATH} + DOC "Location of the msmpi library for Microsoft MPI") + mark_as_advanced(MPI_msmpi_LIBRARY) + + if(MPI_msmpi_LIBRARY) + # Next, we attempt to locate the MPI header. Note that for Fortran we know that mpif.h is a way + # MSMPI can be used and therefore that header has to be present. + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + get_filename_component(MPI_MSMPI_INC_DIR "$ENV{MSMPI_INC}" REALPATH) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MSMPI_INC_DIR}" CACHE STRING "MPI ${LANG} additional include directories" FORCE) + unset(MPI_MSMPI_INC_DIR) endif() - # add the compiler implicit directories because some compilers - # such as the intel compiler have libraries that show up - # in the showme list that can only be found in the implicit - # link directories of the compiler. - if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES) - set(MPI_LINK_PATH "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") - endif () - - # Determine full path names for all of the libraries that one needs - # to link against in an MPI program - foreach(LIB ${MPI_LIBNAMES}) - string(REGEX REPLACE "^ ?-l" "" LIB ${LIB}) - if(WIN32) - string(REGEX REPLACE "\\.lib$" "" LIB ${LIB}) + # For MSMPI, one can compile the MPI module by building the mpi.f90 shipped with the MSMPI SDK, + # thus it might be present or provided by the user. Figuring out which is supported is done later on. + # The PGI Fortran compiler for instance ships a prebuilt set of modules in its own include folder. + # Should a user be employing PGI or have built its own set and provided it via cache variables, the + # splitting routine would have located the module files. + + # For C and C++, we're done here (MSMPI does not ship the MPI-2 C++ bindings) - however, for Fortran + # we need some extra library to glue Fortran support together: + # MSMPI ships 2-4 Fortran libraries, each for different Fortran compiler behaviors. The library names + # ending with a c are using the cdecl calling convention, whereas those ending with an s are for Fortran + # implementations using stdcall. Therefore, the 64-bit MSMPI only ships those ending in 'c', whereas the 32-bit + # has both variants available. + # The second difference is the last but one letter, if it's an e(nd), the length of a string argument is + # passed by the Fortran compiler after all other arguments on the parameter list, if it's an m(ixed), + # it's passed immediately after the string address. + + # To summarize: + # - msmpifec: CHARACTER length passed after the parameter list and using cdecl calling convention + # - msmpifmc: CHARACTER length passed directly after string address and using cdecl calling convention + # - msmpifes: CHARACTER length passed after the parameter list and using stdcall calling convention + # - msmpifms: CHARACTER length passed directly after string address and using stdcall calling convention + # 32-bit MSMPI ships all four libraries, 64-bit MSMPI ships only the first two. + + # As is, Intel Fortran and PGI Fortran both use the 'ec' variant of the calling convention, whereas + # the old Compaq Visual Fortran compiler defaulted to the 'ms' version. It's possible to make Intel Fortran + # use the CVF calling convention using /iface:cvf, but we assume - and this is also assumed in FortranCInterface - + # this isn't the case. It's also possible to make CVF use the 'ec' variant, using /iface=(cref,nomixed_str_len_arg). + + # Our strategy is now to locate all libraries, but enter msmpifec into the LIB_NAMES array. + # Should this not be adequate it's a straightforward way for a user to change the LIB_NAMES array and + # have his library found. Still, this should not be necessary outside of exceptional cases, as reasoned. + if ("${LANG}" STREQUAL "Fortran") + set(MPI_MSMPI_CALLINGCONVS c) + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) + list(APPEND MPI_MSMPI_CALLINGCONVS s) endif() - string(STRIP ${LIB} LIB) - # MPI_LIB is cached by find_library, but we don't want that. Clear it first. - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH}) - - if (MPI_LIB) - list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) - elseif (NOT MPI_FIND_QUIETLY) - message(WARNING "Unable to find MPI library ${LIB}") + foreach(mpistrlenpos IN ITEMS e m) + foreach(mpicallingconv IN LISTS MPI_MSMPI_CALLINGCONVS) + find_library(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY + NAMES msmpif${mpistrlenpos}${mpicallingconv} + HINTS "${MPI_MSMPI_LIB_PATH}" + DOC "Location of the msmpi${mpistrlenpos}${mpicallingconv} library for Microsoft MPI") + mark_as_advanced(MPI_msmpif${mpistrlenpos}${mpicallingconv}_LIBRARY) + endforeach() + endforeach() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "msmpi;msmpifec" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) endif() - endforeach() - # Sanity check MPI_LIBRARIES to make sure there are enough libraries - list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS) - list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED) - if (NOT MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) - set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + # At this point we're *not* done. MSMPI requires an additional include file for Fortran giving the value + # of MPI_AINT. This file is called mpifptr.h located in the x64 and x86 subfolders, respectively. + find_path(MPI_mpifptr_INCLUDE_DIR + NAMES "mpifptr.h" + HINTS "${MPI_MSMPI_INC_PATH_EXTRA}" + DOC "Location of the mpifptr.h extra header for Microsoft MPI") + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS "mpifptr" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) + endif() + mark_as_advanced(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS MPI_mpifptr_INCLUDE_DIR) + else() + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "msmpi" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() endif() + mark_as_advanced(MPI_${LANG}_LIB_NAMES) + set(MPI_GUESS_FOUND TRUE) endif() + endif() - elseif(try_libs) - # If we didn't have an MPI compiler script to interrogate, attempt to find everything - # with plain old find functions. This is nasty because MPI implementations have LOTS of - # different library names, so this section isn't going to be very generic. We need to - # make sure it works for MS MPI, though, since there are no compiler wrappers for that. - find_path(MPI_HEADER_PATH mpi.h - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include Inc) - set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - - # Decide between 32-bit and 64-bit libraries for Microsoft's MPI - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MS_MPI_ARCH_DIR x64) - set(MS_MPI_ARCH_DIR2 amd64) - else() - set(MS_MPI_ARCH_DIR x86) - set(MS_MPI_ARCH_DIR2 i386) - endif() + # At this point there's not many MPIs that we could still consider. + # OpenMPI 1.6.x and below supported Windows, but these ship compiler wrappers that still work. + # The only other relevant MPI implementation without a wrapper is MPICH2, which had Windows support in 1.4.1p1 and older. + if(NOT MPI_GUESS_LIBRARY_NAME OR "${MPI_GUESS_LIBRARY_NAME}" STREQUAL "MPICH2") + set(MPI_MPICH_PREFIX_PATHS + "$ENV{ProgramW6432}/MPICH2/lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/../lib" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]/lib" + ) - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB - NAMES mpi mpich mpich2 msmpi - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR} lib/${MS_MPI_ARCH_DIR2} Lib/${MS_MPI_ARCH_DIR2}) - set(MPI_LIBRARIES_WORK ${MPI_LIB}) - - # Right now, we only know about the extra libs for C++. - # We could add Fortran here (as there is usually libfmpich, etc.), but - # this really only has to work with MS MPI on Windows. - # Assume that other MPI's are covered by the compiler wrappers. - if (${lang} STREQUAL CXX) - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB - NAMES mpi++ mpicxx cxx mpi_cxx - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib) - if (MPI_LIBRARIES_WORK AND MPI_LIB) - list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + # All of C, C++ and Fortran will need mpi.lib, so we'll look for this first + find_library(MPI_mpi_LIBRARY + NAMES mpi + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_mpi_LIBRARY) + # If we found mpi.lib, we detect the rest of MPICH2 + if(MPI_mpi_LIBRARY) + set(MPI_MPICH_LIB_NAMES "mpi") + # If MPI-2 C++ bindings are requested, we need to locate cxx.lib as well. + # Otherwise, MPICH_SKIP_MPICXX will be defined and these bindings aren't needed. + if("${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX) + find_library(MPI_cxx_LIBRARY + NAMES cxx + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_cxx_LIBRARY) + list(APPEND MPI_MPICH_LIB_NAMES "cxx") + # For Fortran, MPICH2 provides three different libraries: + # fmpich2.lib which uses uppercase symbols and cdecl, + # fmpich2s.lib which uses uppercase symbols and stdcall (32-bit only), + # fmpich2g.lib which uses lowercase symbols with double underscores and cdecl. + # fmpich2s.lib would be useful for Compaq Visual Fortran, fmpich2g.lib has to be used with GNU g77 and is also + # provided in the form of an .a archive for MinGW and Cygwin. From our perspective, fmpich2.lib is the only one + # we need to try, and if it doesn't work with the given Fortran compiler we'd find out later on during validation + elseif("${LANG}" STREQUAL "Fortran") + find_library(MPI_fmpich2_LIBRARY + NAMES fmpich2 + HINTS ${MPI_MPICH_PREFIX_PATHS}) + find_library(MPI_fmpich2s_LIBRARY + NAMES fmpich2s + HINTS ${MPI_MPICH_PREFIX_PATHS}) + find_library(MPI_fmpich2g_LIBRARY + NAMES fmpich2g + HINTS ${MPI_MPICH_PREFIX_PATHS}) + mark_as_advanced(MPI_fmpich2_LIBRARY MPI_fmpich2s_LIBRARY MPI_fmpich2g_LIBRARY) + list(APPEND MPI_MPICH_LIB_NAMES "fmpich2") endif() - endif() - if (${lang} STREQUAL Fortran) - set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_path(MPI_HEADER_PATH mpifptr.h - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include Include include/${MS_MPI_ARCH_DIR} Include/${MS_MPI_ARCH_DIR2} Include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) - if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) - list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) - endif () - - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB - NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) - if (MPI_LIBRARIES_WORK AND MPI_LIB) - list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) - endif () - endif () - - if (NOT MPI_LIBRARIES_WORK) - set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + if(NOT MPI_${LANG}_LIB_NAMES) + set(MPI_${LANG}_LIB_NAMES "${MPI_MPICH_LIB_NAMES}" CACHE STRING "MPI ${LANG} libraries to link against" FORCE) + endif() + unset(MPI_MPICH_LIB_NAMES) + + if(NOT MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + # For MPICH2, the include folder would be in ../include relative to the library folder. + get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_mpi_LIBRARY}" DIRECTORY) + get_filename_component(MPI_MPICH_ROOT_DIR "${MPI_MPICH_ROOT_DIR}" DIRECTORY) + if(IS_DIRECTORY "${MPI_MPICH_ROOT_DIR}/include") + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_MPICH_ROOT_DIR}/include" CACHE STRING "MPI ${LANG} additional include directory variables, given in the form MPI__INCLUDE_DIR." FORCE) + endif() + unset(MPI_MPICH_ROOT_DIR) + endif() + set(MPI_GUESS_FOUND TRUE) endif() + unset(MPI_MPICH_PREFIX_PATHS) endif() + endif() + set(MPI_${LANG}_GUESS_FOUND "${MPI_GUESS_FOUND}" PARENT_SCOPE) +endfunction() - # If we found MPI, set up all of the appropriate cache entries - set(MPI_${lang}_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI ${lang} compilation flags" FORCE) - set(MPI_${lang}_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI ${lang} include path" FORCE) - set(MPI_${lang}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${lang} linking flags" FORCE) - set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE) - mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES) +function(_MPI_adjust_compile_definitions LANG) + if("${LANG}" STREQUAL "CXX") + # To disable the C++ bindings, we need to pass some definitions since the mpi.h header has to deal with both C and C++ + # bindings in MPI-2. + if(MPI_CXX_SKIP_MPICXX AND NOT MPI_${LANG}_COMPILE_DEFINITIONS MATCHES "SKIP_MPICXX") + # MPICH_SKIP_MPICXX is being used in MPICH and derivatives like MVAPICH or Intel MPI + # OMPI_SKIP_MPICXX is being used in Open MPI + # _MPICC_H is being used for IBM Platform MPI + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX" "OMPI_SKIP_MPICXX" "_MPICC_H") + set(MPI_${LANG}_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}" CACHE STRING "MPI ${LANG} compilation definitions" FORCE) + endif() + endif() +endfunction() + +macro(_MPI_assemble_libraries LANG) + set(MPI_${LANG}_LIBRARIES "") + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() +endmacro() - # clear out our temporary lib/header detection variable here. - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE) - set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE) +macro(_MPI_assemble_include_dirs LANG) + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") + endforeach() + endif() +endmacro() - # finally set a found variable for each MPI language - if (MPI_${lang}_INCLUDE_PATH AND MPI_${lang}_LIBRARIES) - set(MPI_${lang}_FOUND TRUE PARENT_SCOPE) - else() - set(MPI_${lang}_FOUND FALSE PARENT_SCOPE) +function(_MPI_split_include_dirs LANG) + # Backwards compatibility: Search INCLUDE_PATH if given. + if(MPI_${LANG}_INCLUDE_PATH) + list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") endif() + + # We try to find the headers/modules among those paths (and system paths) + # For C/C++, we just need to have a look for mpi.h. + if("${LANG}" MATCHES "(C|CXX)") + find_path(MPI_${LANG}_HEADER_DIR "mpi.h" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + mark_as_advanced(MPI_${LANG}_HEADER_DIR) + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + # Fortran is more complicated here: An implementation could provide + # any of the Fortran 77/90/2008 APIs for MPI. For example, MSMPI + # only provides Fortran 77 and - if mpi.f90 is built - potentially + # a Fortran 90 module. + elseif("${LANG}" STREQUAL "Fortran") + find_path(MPI_${LANG}_F77_HEADER_DIR "mpif.h" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + find_path(MPI_${LANG}_MODULE_DIR + NAMES "mpi.mod" "mpi_f08.mod" + HINTS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} + ) + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS + "${MPI_${LANG}_F77_HEADER_DIR}" + "${MPI_${LANG}_MODULE_DIR}" + ) + endif() + mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) + endif() + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() +macro(_MPI_create_imported_target LANG) + if(NOT TARGET MPI::MPI_${LANG}) + add_library(MPI::MPI_${LANG} INTERFACE IMPORTED) + endif() + + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}") + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}") -# This function attempts to compile with the regular compiler, to see if MPI programs -# work with it. This is a last ditch attempt after we've tried interrogating mpicc and -# friends, and after we've tried to find generic libraries. Works on machines like -# Cray XE6, where the modules environment changes what MPI version cc, CC, and ftn use. -function(try_regular_compiler lang success) - set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) - if (${lang} STREQUAL Fortran) - set(test_file ${scratch_directory}/cmake_mpi_test.f90) - file(WRITE ${test_file} - "program hello\n" - "include 'mpif.h'\n" - "integer ierror\n" - "call MPI_INIT(ierror)\n" - "call MPI_FINALIZE(ierror)\n" - "end\n") + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") + if(MPI_${LANG}_LINK_FLAGS) + set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LINK_FLAGS}") + endif() + # If the compiler links MPI implicitly, no libraries will be found as they're contained within + # CMAKE__IMPLICIT_LINK_LIBRARIES already. + if(MPI_${LANG}_LIBRARIES) + set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}") + endif() + # Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking. + set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}") +endmacro() + +function(_MPI_try_staged_settings LANG MPI_TEST_FILE_NAME MODE RUN_BINARY) + set(WORK_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI") + set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/FindMPI") + set(BIN_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI/${MPI_TEST_FILE_NAME}_${LANG}.bin") + unset(MPI_TEST_COMPILE_DEFINITIONS) + if("${LANG}" STREQUAL "Fortran") + if("${MODE}" STREQUAL "F90_MODULE") + set(MPI_Fortran_INCLUDE_LINE "use mpi\n implicit none") + elseif("${MODE}" STREQUAL "F08_MODULE") + set(MPI_Fortran_INCLUDE_LINE "use mpi_f08\n implicit none") + else() # F77 header + set(MPI_Fortran_INCLUDE_LINE "implicit none\n include 'mpif.h'") + endif() + configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.f90.in" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90" @ONLY) + set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.f90") + elseif("${LANG}" STREQUAL "CXX") + configure_file("${SRC_DIR}/${MPI_TEST_FILE_NAME}.c" "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp" COPYONLY) + set(MPI_TEST_SOURCE_FILE "${WORK_DIR}/${MPI_TEST_FILE_NAME}.cpp") + if("${MODE}" STREQUAL "TEST_MPICXX") + set(MPI_TEST_COMPILE_DEFINITIONS TEST_MPI_MPICXX) + endif() + else() # C + set(MPI_TEST_SOURCE_FILE "${SRC_DIR}/${MPI_TEST_FILE_NAME}.c") + endif() + if(RUN_BINARY) + try_run(MPI_RUN_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} + "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" + COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} + LINK_LIBRARIES MPI::MPI_${LANG} + RUN_OUTPUT_VARIABLE MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}) + set(MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} "${MPI_RUN_OUTPUT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE}}" PARENT_SCOPE) else() - if (${lang} STREQUAL CXX) - set(test_file ${scratch_directory}/cmake_mpi_test.cpp) - else() - set(test_file ${scratch_directory}/cmake_mpi_test.c) - endif() - file(WRITE ${test_file} - "#include \n" - "int main(int argc, char **argv) {\n" - " MPI_Init(&argc, &argv);\n" - " MPI_Finalize();\n" - "}\n") - endif() - try_compile(compiler_has_mpi ${scratch_directory} ${test_file}) - if (compiler_has_mpi) - set(MPI_${lang}_NO_INTERROGATE ${CMAKE_${lang}_COMPILER} CACHE STRING "Whether to interrogate MPI ${lang} compiler" FORCE) - set(MPI_${lang}_COMPILER ${CMAKE_${lang}_COMPILER} CACHE STRING "MPI ${lang} compiler" FORCE) - set(MPI_${lang}_COMPILE_FLAGS "" CACHE STRING "MPI ${lang} compilation flags" FORCE) - set(MPI_${lang}_INCLUDE_PATH "" CACHE STRING "MPI ${lang} include path" FORCE) - set(MPI_${lang}_LINK_FLAGS "" CACHE STRING "MPI ${lang} linking flags" FORCE) - set(MPI_${lang}_LIBRARIES "" CACHE STRING "MPI ${lang} libraries to link against" FORCE) - endif() - set(${success} ${compiler_has_mpi} PARENT_SCOPE) - unset(compiler_has_mpi CACHE) + try_compile(MPI_RESULT_${LANG}_${MPI_TEST_FILE_NAME}_${MODE} + "${CMAKE_BINARY_DIR}" SOURCES "${MPI_TEST_SOURCE_FILE}" + COMPILE_DEFINITIONS ${MPI_TEST_COMPILE_DEFINITIONS} + LINK_LIBRARIES MPI::MPI_${LANG} + COPY_FILE "${BIN_FILE}") + endif() endfunction() -# End definitions, commence real work here. +macro(_MPI_check_lang_works LANG) + # For Fortran we may have by the MPI-3 standard an implementation that provides: + # - the mpi_f08 module + # - *both*, the mpi module and 'mpif.h' + # Since older MPI standards (MPI-1) did not define anything but 'mpif.h', we need to check all three individually. + if( NOT MPI_${LANG}_WORKS ) + if("${LANG}" STREQUAL "Fortran") + set(MPI_Fortran_INTEGER_LINE "(kind=MPI_INTEGER_KIND)") + _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER FALSE) + _MPI_try_staged_settings(${LANG} test_mpi F90_MODULE FALSE) + _MPI_try_staged_settings(${LANG} test_mpi F08_MODULE FALSE) + + set(MPI_${LANG}_WORKS FALSE) + + foreach(mpimethod IN ITEMS F77_HEADER F08_MODULE F90_MODULE) + if(MPI_RESULT_${LANG}_test_mpi_${mpimethod}) + set(MPI_${LANG}_WORKS TRUE) + set(MPI_${LANG}_HAVE_${mpimethod} TRUE) + else() + set(MPI_${LANG}_HAVE_${mpimethod} FALSE) + endif() + endforeach() + # MPI-1 versions had no MPI_INTGER_KIND defined, so we need to try without it. + # However, MPI-1 also did not define the Fortran 90 and 08 modules, so we only try the F77 header. + unset(MPI_Fortran_INTEGER_LINE) + if(NOT MPI_${LANG}_WORKS) + _MPI_try_staged_settings(${LANG} test_mpi F77_HEADER_NOKIND FALSE) + if(MPI_RESULT_${LANG}_test_mpi_F77_HEADER_NOKIND) + set(MPI_${LANG}_WORKS TRUE) + set(MPI_${LANG}_HAVE_F77_HEADER TRUE) + endif() + endif() + else() + _MPI_try_staged_settings(${LANG} test_mpi normal FALSE) + # If 'test_mpi' built correctly, we've found valid MPI settings. There might not be MPI-2 C++ support, but there can't + # be MPI-2 C++ support without the C bindings being present, so checking for them is sufficient. + set(MPI_${LANG}_WORKS "${MPI_RESULT_${LANG}_test_mpi_normal}") + endif() + endif() +endmacro() + +# Some systems install various MPI implementations in separate folders in some MPI prefix +# This macro enumerates all such subfolders and adds them to the list of hints that will be searched. +macro(MPI_search_mpi_prefix_folder PREFIX_FOLDER) + if(EXISTS "${PREFIX_FOLDER}") + file(GLOB _MPI_folder_children RELATIVE "${PREFIX_FOLDER}" "${PREFIX_FOLDER}/*") + foreach(_MPI_folder_child IN LISTS _MPI_folder_children) + if(IS_DIRECTORY "${PREFIX_FOLDER}/${_MPI_folder_child}") + list(APPEND MPI_HINT_DIRS "${PREFIX_FOLDER}/${_MPI_folder_child}") + endif() + endforeach() + endif() +endmacro() + +set(MPI_HINT_DIRS ${MPI_HOME} $ENV{MPI_HOME} $ENV{I_MPI_ROOT}) +if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") + # SUSE Linux Enterprise Server stores its MPI implementations under /usr/lib64/mpi/gcc/ + # We enumerate the subfolders and append each as a prefix + MPI_search_mpi_prefix_folder("/usr/lib64/mpi/gcc") +elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") + # MSMPI stores its runtime in a special folder, this adds the possible locations to the hints. + list(APPEND MPI_HINT_DIRS $ENV{MSMPI_BIN} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]") +elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") + # FreeBSD ships mpich under the normal system paths - but available openmpi implementations + # will be found in /usr/local/mpi/ + MPI_search_mpi_prefix_folder("/usr/local/mpi/") +endif() -# Most mpi distros have some form of mpiexec which gives us something we can reliably look for. -find_program(MPIEXEC - NAMES ${_MPI_EXEC_NAMES} - HINTS ${MPI_HOME} $ENV{MPI_HOME} - PATHS ${_MPI_PREFIX_PATH} - PATH_SUFFIXES bin +# Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. +# The MPI standard does not mandate the existence of either, but instead only makes requirements if a distribution +# ships an mpiexec program (mpirun executables are not regulated by the standard). +find_program(MPIEXEC_EXECUTABLE + NAMES ${_MPIEXEC_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${MPI_HINT_DIRS} DOC "Executable for running MPI programs.") # call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). # This gives us a fairly reliable base directory to search for /bin /lib and /include from. -get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH) +get_filename_component(_MPI_BASE_DIR "${MPIEXEC_EXECUTABLE}" PATH) get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) # According to the MPI standard, section 8.8 -n is a guaranteed, and the only guaranteed way to # launch an MPI process using mpiexec if such a program exists. -set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") -set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.") -set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.") - -# Set the number of processes to the processor count and the previous default -# of 2 if that couldn't be determined. -include(${CMAKE_ROOT}/Modules/ProcessorCount.cmake) -ProcessorCount(_MPIEXEC_NUMPROCS) -if("${_MPIEXEC_NUMPROCS}" EQUAL "0") - set(_MPIEXEC_NUMPROCS 2) -endif() -set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") -unset(_MPIEXEC_NUMPROCS) -mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "Flag used by MPI to specify the number of processes for mpiexec; the next option will be the number of processes.") +set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by mpiexec.") +set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will be placed after all flags passed to mpiexec.") +# Set the number of processes to the physical processor count +cmake_host_system_information(RESULT _MPIEXEC_NUMPROCS QUERY NUMBER_OF_PHYSICAL_CORES) +set(MPIEXEC_MAX_NUMPROCS "${_MPIEXEC_NUMPROCS}" CACHE STRING "Maximum number of processors available to run MPI applications.") +unset(_MPIEXEC_NUMPROCS) +mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) #============================================================================= # Backward compatibility input hacks. Propagate the FindMPI hints to C and # CXX if the respective new versions are not defined. Translate the old -# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES. +# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${LANG}_LIBRARIES. # # Once we find the new variables, we translate them back into their old # equivalents below. -foreach (lang C CXX) +foreach (LANG IN ITEMS C CXX) # Old input variables. set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) # Set new vars based on their old equivalents, if the new versions are not already set. foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${lang}_${var} AND MPI_${var}) - set(MPI_${lang}_${var} "${MPI_${var}}") + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") endif() endforeach() - # Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the - # new FindMPI. These need to be merged into MPI__LIBRARIES - if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY)) - set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) + # Chop the old compile flags into options and definitions + if(MPI_${LANG}_COMPILE_FLAGS) + unset(MPI_${LANG}_COMPILE_OPTIONS) + unset(MPI_${LANG}_COMPILE_DEFINITIONS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endforeach() endif() endforeach() #============================================================================= +unset(MPI_VERSION) +unset(MPI_VERSION_MAJOR) +unset(MPI_VERSION_MINOR) + +unset(_MPI_MIN_VERSION) # This loop finds the compilers and sends them off for interrogation. -foreach (lang C CXX Fortran) - if (CMAKE_${lang}_COMPILER_WORKS) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (MPI_${lang}_COMPILER) - if (NOT IS_ABSOLUTE "${MPI_${lang}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER}) - set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(try_libs FALSE) +foreach(LANG IN ITEMS C CXX Fortran) + if(CMAKE_${LANG}_COMPILER_LOADED) + if(NOT MPI_FIND_COMPONENTS) + set(_MPI_FIND_${LANG} TRUE) + elseif( ${LANG} IN_LIST MPI_FIND_COMPONENTS) + set(_MPI_FIND_${LANG} TRUE) + elseif( ${LANG} STREQUAL CXX AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) + set(_MPI_FIND_${LANG} TRUE) else() - set(try_libs TRUE) + set(_MPI_FIND_${LANG} FALSE) endif() + else() + set(_MPI_FIND_${LANG} FALSE) + endif() + if(_MPI_FIND_${LANG}) + if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) + set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.") + mark_as_advanced(MPI_CXX_SKIP_MPICXX) + endif() + if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) + # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. + # Cray PrgEnv. + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + + # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. + if(MPI_${LANG}_WORKS) + set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + endif() + endif() - find_program(MPI_${lang}_COMPILER - NAMES ${_MPI_${lang}_COMPILER_NAMES} - HINTS ${_MPI_BASE_DIR}/bin - PATHS ${_MPI_PREFIX_PATH} - ) - interrogate_mpi_compiler(${lang} ${try_libs}) - mark_as_advanced(MPI_${lang}_COMPILER) + # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. + if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) + endif() + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + else() + set(MPI_PINNED_COMPILER FALSE) + endif() - # last ditch try -- if nothing works so far, just try running the regular compiler and - # see if we can create an MPI executable. - set(regular_compiler_worked 0) - if (NOT MPI_${lang}_LIBRARIES OR NOT MPI_${lang}_INCLUDE_PATH) - try_regular_compiler(${lang} regular_compiler_worked) - endif() + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) + endif() + + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + DOC "MPI compiler for ${LANG}" + ) + + if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_SKIP_GUESSING TRUE) + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + endif() + else() + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + endif() - # add fortran mpi module path if ENV VAR exists - set (MPI_${lang}_INCLUDE_PATH "${MPI_${lang}_INCLUDE_PATH};$ENV{MPI_FORTRAN_MOD_DIR}") + if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + set(MPI_${LANG}_WRAPPER_FOUND TRUE) + elseif(NOT MPI_SKIP_GUESSING) + _MPI_guess_settings(${LANG}) + endif() + endif() + endif() - set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) - set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) - set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) - set(MPI_${lang}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) + _MPI_split_include_dirs(${LANG}) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + endif() + _MPI_adjust_compile_definitions(${LANG}) + # We always create imported targets even if they're empty + _MPI_create_imported_target(${LANG}) - if (regular_compiler_worked) - find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER) - else() - find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) + if(NOT MPI_${LANG}_WORKS) + _MPI_check_lang_works(${LANG}) endif() - if(MPI_${lang}_FOUND) - if(NOT TARGET MPI::MPI_${lang}) - add_library(MPI::MPI_${lang} INTERFACE IMPORTED) + # Next, we'll initialize the MPI variables that have not been previously set. + set(MPI_${LANG}_COMPILE_OPTIONS "" CACHE STRING "MPI ${LANG} compilation flags" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS + MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) + + # If we've found MPI, then we'll perform additional analysis: Determine the MPI version, MPI library version, supported + # MPI APIs (i.e. MPI-2 C++ bindings). For Fortran we also need to find specific parameters if we're under MPI-3. + if(MPI_${LANG}_WORKS) + if("${LANG}" STREQUAL "CXX" AND NOT DEFINED MPI_MPICXX_FOUND) + if(NOT MPI_CXX_SKIP_MPICXX AND NOT MPI_CXX_VALIDATE_SKIP_MPICXX) + _MPI_try_staged_settings(${LANG} test_mpi MPICXX FALSE) + if(MPI_RESULT_${LANG}_test_mpi_MPICXX) + set(MPI_MPICXX_FOUND TRUE) + else() + set(MPI_MPICXX_FOUND FALSE) + endif() + else() + set(MPI_MPICXX_FOUND FALSE) + endif() + endif() + + # At this point, we know the bindings present but not the MPI version or anything else. + if(NOT DEFINED MPI_${LANG}_VERSION) + unset(MPI_${LANG}_VERSION_MAJOR) + unset(MPI_${LANG}_VERSION_MINOR) + endif() + set(MPI_BIN_FOLDER ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindMPI) + + # For Fortran, we'll want to use the most modern MPI binding to test capabilities other than the + # Fortran parameters, since those depend on the method of consumption. + # For C++, we can always use the C bindings, and should do so, since the C++ bindings do not exist in MPI-3 + # whereas the C bindings do, and the C++ bindings never offered any feature advantage over their C counterparts. + if("${LANG}" STREQUAL "Fortran") + if(MPI_${LANG}_HAVE_F08_MODULE) + set(MPI_${LANG}_HIGHEST_METHOD F08_MODULE) + elseif(MPI_${LANG}_HAVE_F90_MODULE) + set(MPI_${LANG}_HIGHEST_METHOD F90_MODULE) + else() + set(MPI_${LANG}_HIGHEST_METHOD F77_HEADER) + endif() + + # Another difference between C and Fortran is that we can't use the preprocessor to determine whether MPI_VERSION + # and MPI_SUBVERSION are provided. These defines did not exist in MPI 1.0 and 1.1 and therefore might not + # exist. For C/C++, test_mpi.c will handle the MPI_VERSION extraction, but for Fortran, we need mpiver.f90. + if(NOT DEFINED MPI_${LANG}_VERSION) + _MPI_try_staged_settings(${LANG} mpiver ${MPI_${LANG}_HIGHEST_METHOD} FALSE) + if(MPI_RESULT_${LANG}_mpiver_${MPI_${LANG}_HIGHEST_METHOD}) + file(STRINGS ${MPI_BIN_FOLDER}/mpiver_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") + if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") + set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") + endif() + endif() + endif() + + # Finally, we want to find out which capabilities a given interface supports, compare the MPI-3 standard. + # This is determined by interface specific parameters MPI_SUBARRAYS_SUPPORTED and MPI_ASYNC_PROTECTS_NONBLOCKING + # and might vary between the different methods of consumption. + if(MPI_DETERMINE_Fortran_CAPABILITIES AND NOT MPI_Fortran_CAPABILITIES_DETERMINED) + foreach(mpimethod IN ITEMS F08_MODULE F90_MODULE F77_HEADER) + if(MPI_${LANG}_HAVE_${mpimethod}) + set(MPI_${LANG}_${mpimethod}_SUBARRAYS FALSE) + set(MPI_${LANG}_${mpimethod}_ASYNCPROT FALSE) + _MPI_try_staged_settings(${LANG} fortranparam_mpi ${mpimethod} TRUE) + if(MPI_RESULT_${LANG}_fortranparam_mpi_${mpimethod} AND + NOT "${MPI_RUN_RESULT_${LANG}_fortranparam_mpi_${mpimethod}}" STREQUAL "FAILED_TO_RUN") + if("${MPI_RUN_OUTPUT_${LANG}_fortranparam_mpi_${mpimethod}}" MATCHES + ".*INFO:SUBARRAYS\\[ *([TF]) *\\]-ASYNCPROT\\[ *([TF]) *\\].*") + if("${CMAKE_MATCH_1}" STREQUAL "T") + set(MPI_${LANG}_${mpimethod}_SUBARRAYS TRUE) + endif() + if("${CMAKE_MATCH_2}" STREQUAL "T") + set(MPI_${LANG}_${mpimethod}_ASYNCPROT TRUE) + endif() + endif() + endif() + endif() + endforeach() + set(MPI_Fortran_CAPABILITIES_DETERMINED TRUE) + endif() + else() + set(MPI_${LANG}_HIGHEST_METHOD normal) + + # By the MPI-2 standard, MPI_VERSION and MPI_SUBVERSION are valid for both C and C++ bindings. + if(NOT DEFINED MPI_${LANG}_VERSION) + file(STRINGS ${MPI_BIN_FOLDER}/test_mpi_${LANG}.bin _MPI_VERSION_STRING LIMIT_COUNT 1 REGEX "INFO:MPI-VER") + if("${_MPI_VERSION_STRING}" MATCHES ".*INFO:MPI-VER\\[([0-9]+)\\.([0-9]+)\\].*") + set(MPI_${LANG}_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(MPI_${LANG}_VERSION_MINOR "${CMAKE_MATCH_2}") + set(MPI_${LANG}_VERSION "${MPI_${LANG}_VERSION_MAJOR}.${MPI_${LANG}_VERSION_MINOR}") + endif() + endif() endif() - if(MPI_${lang}_COMPILE_FLAGS) - separate_arguments(_MPI_${lang}_COMPILE_OPTIONS NATIVE_COMMAND "${MPI_${lang}_COMPILE_FLAGS}") - set_property(TARGET MPI::MPI_${lang} PROPERTY - INTERFACE_COMPILE_OPTIONS "${_MPI_${lang}_COMPILE_OPTIONS}") + + unset(MPI_BIN_FOLDER) + + # At this point, we have dealt with determining the MPI version and parameters for each Fortran method available. + # The one remaining issue is to determine which MPI library is installed. + # Determining the version and vendor of the MPI library is only possible via MPI_Get_library_version() at runtime, + # and therefore we cannot do this while cross-compiling (a user may still define MPI__LIBRARY_VERSION_STRING + # themselves and we'll attempt splitting it, which is equivalent to provide the try_run output). + # It's also worth noting that the installed version string can depend on the language, or on the system the binary + # runs on if MPI is not statically linked. + if(MPI_DETERMINE_LIBRARY_VERSION AND NOT MPI_${LANG}_LIBRARY_VERSION_STRING) + _MPI_try_staged_settings(${LANG} libver_mpi ${MPI_${LANG}_HIGHEST_METHOD} TRUE) + if(MPI_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD} AND + "${MPI_RUN_RESULT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" EQUAL "0") + string(STRIP "${MPI_RUN_OUTPUT_${LANG}_libver_mpi_${MPI_${LANG}_HIGHEST_METHOD}}" + MPI_${LANG}_LIBRARY_VERSION_STRING) + else() + set(MPI_${LANG}_LIBRARY_VERSION_STRING "NOTFOUND") + endif() endif() + endif() - unset(_MPI_${lang}_LINK_LINE) - if(MPI_${lang}_LINK_FLAGS) - list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LINK_FLAGS}") + set(MPI_${LANG}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) + set(MPI_${LANG}_FIND_VERSION ${MPI_FIND_VERSION}) + set(MPI_${LANG}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) + + unset(MPI_${LANG}_REQUIRED_VARS) + if (MPI_${LANG}_WRAPPER_FOUND OR MPI_${LANG}_GUESS_FOUND) + foreach(mpilibname IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpilibname}_LIBRARY") + endforeach() + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_LIB_NAMES") + if("${LANG}" STREQUAL "Fortran") + # For Fortran we only need one of the module or header directories to have *some* support for MPI. + if(NOT MPI_${LANG}_MODULE_DIR) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_F77_HEADER_DIR") + endif() + if(NOT MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_MODULE_DIR") + endif() + else() + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_HEADER_DIR") + endif() + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(mpiincvar IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${mpiincvar}_INCLUDE_DIR") + endforeach() + endif() + # Append the works variable now. If the settings did not work, this will show up properly. + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") + else() + # If the compiler worked implicitly, use its path as output. + # Should the compiler variable be set, we also require it to work. + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_COMPILER") + if(MPI_${LANG}_COMPILER) + list(APPEND MPI_${LANG}_REQUIRED_VARS "MPI_${LANG}_WORKS") endif() - list(APPEND _MPI_${lang}_LINK_LINE "${MPI_${lang}_LIBRARIES}") - set_property(TARGET MPI::MPI_${lang} PROPERTY - INTERFACE_LINK_LIBRARIES "${_MPI_${lang}_LINK_LINE}") + endif() + find_package_handle_standard_args(MPI_${LANG} REQUIRED_VARS ${MPI_${LANG}_REQUIRED_VARS} + VERSION_VAR MPI_${LANG}_VERSION) - set_property(TARGET MPI::MPI_${lang} PROPERTY - INTERFACE_INCLUDE_DIRECTORIES "${MPI_${lang}_INCLUDE_PATH}") + if(DEFINED MPI_${LANG}_VERSION) + if(NOT _MPI_MIN_VERSION OR _MPI_MIN_VERSION VERSION_GREATER MPI_${LANG}_VERSION) + set(_MPI_MIN_VERSION MPI_${LANG}_VERSION) + endif() endif() endif() endforeach() +unset(_MPI_REQ_VARS) +foreach(LANG IN ITEMS C CXX Fortran) + if((NOT MPI_FIND_COMPONENTS AND CMAKE_${LANG}_COMPILER_LOADED) OR LANG IN_LIST MPI_FIND_COMPONENTS) + list(APPEND _MPI_REQ_VARS "MPI_${LANG}_FOUND") + endif() +endforeach() + +if(MPICXX IN_LIST MPI_FIND_COMPONENTS) + list(APPEND _MPI_REQ_VARS "MPI_MPICXX_FOUND") +endif() + +find_package_handle_standard_args(MPI + REQUIRED_VARS ${_MPI_REQ_VARS} + VERSION_VAR ${_MPI_MIN_VERSION} + HANDLE_COMPONENTS) #============================================================================= # More backward compatibility stuff -# -# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found. + +# For compatibility reasons, we also define MPIEXEC +set(MPIEXEC "${MPIEXEC_EXECUTABLE}") + +# Copy over MPI__INCLUDE_PATH from the assembled INCLUDE_DIRS. +foreach(LANG IN ITEMS C CXX Fortran) + if(MPI_${LANG}_FOUND) + set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}") + unset(MPI_${LANG}_COMPILE_FLAGS) + if(MPI_${LANG}_COMPILE_OPTIONS) + set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_COMPILE_DEFINITIONS) + foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS) + string(APPEND MPI_${LANG}_COMPILE_FLAGS " -D${_MPI_DEF}") + endforeach() + endif() + endif() +endforeach() + +# Bare MPI sans ${LANG} vars are set to CXX then C, depending on what was found. # This mimics the behavior of the old language-oblivious FindMPI. -set(_MPI_OLD_VARS FOUND COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) +set(_MPI_OLD_VARS COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) if (MPI_CXX_FOUND) foreach (var ${_MPI_OLD_VARS}) set(MPI_${var} ${MPI_CXX_${var}}) @@ -704,28 +1428,26 @@ elseif (MPI_C_FOUND) foreach (var ${_MPI_OLD_VARS}) set(MPI_${var} ${MPI_C_${var}}) endforeach() -else() - # Note that we might still have found Fortran, but you'll need to use MPI_Fortran_FOUND - set(MPI_FOUND FALSE) endif() # Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. if (MPI_LIBRARIES) list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) - set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE) + set(MPI_LIBRARY "${MPI_LIBRARY_WORK}") + unset(MPI_LIBRARY_WORK) else() - set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE) + set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND") endif() list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) if (MPI_NUMLIBS GREATER 1) - set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES}) + set(MPI_EXTRA_LIBRARY_WORK "${MPI_LIBRARIES}") list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) - set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE) + set(MPI_EXTRA_LIBRARY "${MPI_EXTRA_LIBRARY_WORK}") + unset(MPI_EXTRA_LIBRARY_WORK) else() - set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) + set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() -mark_as_advanced(MPI_LIBRARY MPI_EXTRA_LIBRARY) #============================================================================= # unset these vars to cleanup namespace @@ -733,5 +1455,7 @@ unset(_MPI_OLD_VARS) unset(_MPI_PREFIX_PATH) unset(_MPI_BASE_DIR) foreach (lang C CXX Fortran) - unset(_MPI_${lang}_COMPILER_NAMES) + unset(_MPI_${LANG}_COMPILER_NAMES) endforeach() + +cmake_policy(POP) diff --git a/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in b/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in new file mode 100644 index 0000000..30f912c --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/fortranparam_mpi.f90.in @@ -0,0 +1,4 @@ + program mpi_ver + @MPI_Fortran_INCLUDE_LINE@ + print *, 'INFO:SUBARRAYS[', MPI_SUBARRAYS_SUPPORTED, ']-ASYNCPROT[', MPI_ASYNC_PROTECTS_NONBLOCKING, ']' + end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.c b/config/cmake_ext_mod/FindMPI/libver_mpi.c new file mode 100644 index 0000000..be9d19d --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/libver_mpi.c @@ -0,0 +1,19 @@ +#include + +#ifdef __cplusplus +#include +#else +#include +#endif + +int main(int argc, char* argv[]) +{ + char mpilibver_str[MPI_MAX_LIBRARY_VERSION_STRING]; + int mpilibver_len; + MPI_Get_library_version(mpilibver_str, &mpilibver_len); +#ifdef __cplusplus + std::puts(mpilibver_str); +#else + puts(mpilibver_str); +#endif +} diff --git a/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in b/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in new file mode 100644 index 0000000..7938587 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/libver_mpi.f90.in @@ -0,0 +1,7 @@ + program mpi_ver + @MPI_Fortran_INCLUDE_LINE@ + character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: mpilibver_str + integer(kind=MPI_INTEGER_KIND) :: ierror, reslen + call MPI_GET_LIBRARY_VERSION(mpilibver_str, reslen, ierror) + print *, mpilibver_str + end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/mpiver.f90.in b/config/cmake_ext_mod/FindMPI/mpiver.f90.in new file mode 100644 index 0000000..a254523 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/mpiver.f90.in @@ -0,0 +1,10 @@ + program mpi_ver + @MPI_Fortran_INCLUDE_LINE@ + integer(kind=kind(MPI_VERSION)), parameter :: zero = ichar('0') + character, dimension(17), parameter :: mpiver_str =& + (/ 'I', 'N', 'F', 'O', ':', 'M', 'P', 'I', '-', 'V', 'E', 'R', '[', & + char(zero + MPI_VERSION), & + '.', & + char(zero + MPI_SUBVERSION), ']' /) + print *, mpiver_str + end program mpi_ver diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.c b/config/cmake_ext_mod/FindMPI/test_mpi.c new file mode 100644 index 0000000..b8a308a --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/test_mpi.c @@ -0,0 +1,37 @@ +#include + +#ifdef __cplusplus +#include +#else +#include +#endif + +#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) +const char mpiver_str[] = { 'I', 'N', + 'F', 'O', + ':', 'M', + 'P', 'I', + '-', 'V', + 'E', 'R', + '[', ('0' + MPI_VERSION), + '.', ('0' + MPI_SUBVERSION), + ']', '\0' }; +#endif + +int main(int argc, char* argv[]) +{ +#if defined(MPI_VERSION) && defined(MPI_SUBVERSION) +#ifdef __cplusplus + std::puts(mpiver_str); +#else + puts(mpiver_str); +#endif +#endif +#ifdef TEST_MPI_MPICXX + MPI::MPI_Init(&argc, &argv); + MPI::MPI_Finalize(); +#else + MPI_Init(&argc, &argv); + MPI_Finalize(); +#endif +} diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.f90.in b/config/cmake_ext_mod/FindMPI/test_mpi.f90.in new file mode 100644 index 0000000..4d43a04 --- /dev/null +++ b/config/cmake_ext_mod/FindMPI/test_mpi.f90.in @@ -0,0 +1,6 @@ + program hello + @MPI_Fortran_INCLUDE_LINE@ + integer@MPI_Fortran_INTEGER_LINE@ ierror + call MPI_INIT(ierror) + call MPI_FINALIZE(ierror) + end program diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 5b0e8fd..b812d73 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -57,15 +57,15 @@ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -if (${TEST_RESULT} STREQUAL "0") +if ("${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -if (${TEST_EXPECT} STREQUAL "1") +if ("${TEST_EXPECT}" STREQUAL "1") # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (NOT ${TEST_RESULT} STREQUAL "0") + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 3a02614..2479728 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -87,7 +87,7 @@ if (TEST_REGEX) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM}) string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT) - if (${REGEX_RESULT} STREQUAL "0") + if ("${REGEX_RESULT}" STREQUAL "0") message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}") endif () endif () @@ -106,7 +106,7 @@ if (TEST_APPEND) endif () # if the return value is !=${TEST_EXPECT} bail out -if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") if (NOT TEST_NOERRDISPLAY) if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -193,13 +193,13 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) list (LENGTH test_ref len_ref) - if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") + if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -212,14 +212,14 @@ if (NOT TEST_SKIP_COMPARE) endif () endforeach () else () - if (${len_act} STREQUAL "0") + if ("${len_act}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if (${len_ref} STREQUAL "0") + if ("${len_ref}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () endif () - if (NOT ${len_act} STREQUAL ${len_ref}) + if (NOT "${len_act}" STREQUAL "${len_ref}") set (TEST_RESULT 1) endif () endif () @@ -227,7 +227,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () @@ -243,14 +243,14 @@ if (NOT TEST_SKIP_COMPARE) COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0") + if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0") math (EXPR _FP_LEN "${len_ref} - 1") foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) @@ -263,14 +263,14 @@ if (NOT TEST_SKIP_COMPARE) endif () endforeach () else () - if (${len_act} STREQUAL "0") + if ("${len_act}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if (${len_ref} STREQUAL "0") + if ("${len_ref}" STREQUAL "0") message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - if (NOT ${len_act} STREQUAL ${len_ref}) + if (NOT "${len_act}" STREQUAL "${len_ref}") set (TEST_RESULT 1) endif () endif () @@ -278,7 +278,7 @@ if (NOT TEST_SKIP_COMPARE) message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - if (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT "${TEST_RESULT}" STREQUAL "0") message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index f7179cf..075e1da 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required (VERSION 3.2.2) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) - INCLUDE (FindMPI) - set (LINK_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES}) if (MPI_Fortran_LINK_FLAGS) set (CMAKE_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") endif () diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 6030f83..cd5da0e 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -109,7 +109,6 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ${MPI_Fortran_LIBRARIES} ) target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (f90_ex_ph5example PROPERTIES @@ -124,7 +123,6 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (f90_ex_ph5example-shared ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} - ${MPI_Fortran_LIBRARIES} ) target_include_directories (f90_ex_ph5example-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) set_target_properties (f90_ex_ph5example-shared PROPERTIES diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 31dc836..af6b994 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## @@ -149,8 +149,8 @@ if (HDF5_ENABLE_F2003) endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) - add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endif () endif () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 689439c..9527bc0 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -291,9 +291,9 @@ set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran) add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SRCS}) set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) + target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} STATIC) @@ -317,9 +317,9 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") endif () TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) - target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${MPI_Fortran_LIBRARIES}) + target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_LIB_NAME} SHARED ${HDF5_F_PACKAGE_SOVERSION}) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index c363b04..e4d8cc1 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 909cbaf..4aa7f43 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${MPI_Fortran_INCLUDE_PATH} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${CMAKE_Fortran_MODULE_DIRECTORY}/static ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -27,7 +27,7 @@ target_link_libraries (parallel_test if (WIN32 AND MSVC) target_link_libraries (parallel_test "ws2_32.lib") endif () -target_include_directories (parallel_test PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +target_include_directories (parallel_test PRIVATE ${TESTPAR_INCLUDES}) set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) diff --git a/fortran/testpar/CMakeTests.cmake b/fortran/testpar/CMakeTests.cmake index 70ce541..d00a6fc 100644 --- a/fortran/testpar/CMakeTests.cmake +++ b/fortran/testpar/CMakeTests.cmake @@ -8,11 +8,11 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## ### T E S T I N G ### ############################################################################## ############################################################################## -add_test (NAME FORT_parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +add_test (NAME FORT_parallel_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index 84f5611..103ec2b 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index 0df6d3d..785abca 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 0a40b96..166fa7c 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 97b2dbb..254c8fe 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 0edbbb3..e516187 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 70f79b5..c4b0814 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6bddfe7..1f8ba54 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -156,10 +156,32 @@ Bug Fixes since HDF5-1.8.19 Configuration ------------- + - cmake MPI + + CMake implementation for MPI was problematic and would create incorrect + MPI library references in the hdf5 libraries. + + Reworked the CMake MPI code to properly create CMake targets.Also merged + the latest CMake FindMPI.cmake changes to the local copy. This is necessary + until HDF changes the CMake minimum to 3.9 or greater. + + (ADB - 2017/11/02, HDFFV-10321) + + - Fixed Fortran linker flags when using the NAG Fortran compiler (autotools). (HDFFV-10037, MSB, 2017/10/21) + - cmake + + Too many commands for POST_BUILD step caused command line to be + too big on windows. + + Changed foreach of copy command to use a custom command with the + use of the HDFTEST_COPY_FILE macro. + + (ADB - 2017/07/12, HDFFV-10254) + Library ------- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d343208..a6f7ddc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -694,12 +694,12 @@ set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${LINK_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIB_TARGET} dl) + target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) + target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC) @@ -720,12 +720,12 @@ set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${LINK_SHARED_LIBS}) if (NOT WIN32) - target_link_libraries (${HDF5_LIBSH_TARGET} dl) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () if (H5_HAVE_PARALLEL AND MPI_C_FOUND) - target_link_libraries (${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) + target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS}) endif () set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) @@ -740,7 +740,7 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) - target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) + target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC Threads::Threads) endif () if (HDF5_ENABLE_DEBUG_APIS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 29857e5..612d13d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -74,7 +74,7 @@ endif () file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") #----------------------------------------------------------------------------- - # Define Test Library Sources + # Define Plugin Test Sources #----------------------------------------------------------------------------- set (TEST_PLUGIN_LIBS dynlib1 diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 8e2c48b..85a49fc 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## @@ -345,7 +345,7 @@ add_test (NAME H5TEST-clear-objects ) foreach (test ${H5_TESTS}) - if (${test} STREQUAL "big" AND CYGWIN) + if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}" ) @@ -376,7 +376,7 @@ if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS) ) foreach (test ${H5_TESTS}) - if (${test} STREQUAL "big" AND CYGWIN) + if ("${test}" STREQUAL "big" AND CYGWIN) add_test (NAME H5TEST-shared-${test} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" ) @@ -789,8 +789,8 @@ if (HDF5_TEST_VFD) # Windows only macro macro (CHECK_VFD_TEST vfdtest vfdname resultcode) - if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") - if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") + if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2") + if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split") if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) add_test (NAME VFD-${vfdname}-${vfdtest} COMMAND "${CMAKE_COMMAND}" @@ -879,7 +879,7 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) - if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS AND NOT ${vfdtest} STREQUAL "cache") + if (BUILD_SHARED_LIBS AND TEST_SHARED_PROGRAMS AND NOT "${vfdtest}" STREQUAL "cache") add_test (NAME VFD-${vfdname}-${vfdtest}-shared COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 5655bb0..0be5961 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -29,14 +29,14 @@ set (testphdf5_SRCS add_executable (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") -target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 6612b7f..87470f3 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -8,7 +8,7 @@ # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. - +# ############################################################################## ############################################################################## @@ -16,10 +16,10 @@ ############################################################################## ############################################################################## -add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) foreach (testp ${H5P_TESTS}) - add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endforeach () # The following will only be correct on windows shared diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index caf1298..14fc534 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -412,7 +412,7 @@ macro (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) + add_test (NAME PH5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS} ${ARGN}) set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles") if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") @@ -435,7 +435,7 @@ add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" + -D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$;${MPIEXEC_POSTFLAGS}" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/PAR/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -- cgit v0.12 From fdf4d8809ffb01bedb475e9265a8a65d6241e221 Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 2 Nov 2017 16:15:52 -0500 Subject: Update supported and tested platforms in RELEASE.txt. --- release_docs/RELEASE.txt | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6bddfe7..8207788 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -300,13 +300,13 @@ They are built with the configure process unless specified otherwise. Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: (platypus/mayll) Version 4.4.7 20120313 - Versions 4.9.3, 5.2.0, 6.2.0 + Versions 4.9.3, 5.3.0, 6.2.0 PGI C, Fortran, C++ for 64-bit target on x86-64; Version 16.10-0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: - Version 17.0.0.098 Build 20160721 + Version 17.0.0.196 Build 20160721 MPICH 3.1.4 compiled with GCC 4.9.3 OpenMPI 2.0.1 compiled with GCC 4.9.3 @@ -349,10 +349,6 @@ They are built with the configure process unless specified otherwise. Windows 10 x64 Visual Studio 2015 w/ Intel Fortran 16 (cmake) - Mac OS X Mt. Lion 10.8.5 Apple LLVM version 5.1 (clang-503.0.40) - 64-bit gfortran GNU Fortran (GCC) 4.8.2 - (swallow/kite) Intel icc/icpc/ifort version 15.0.3 - Mac OS X Mavericks 10.9.5 Apple LLVM version 6.0 (clang-600.0.57) 64-bit gfortran GNU Fortran (GCC) 4.9.2 (wren/quail) Intel icc/icpc/ifort version 15.0.3 @@ -361,10 +357,14 @@ They are built with the configure process unless specified otherwise. 64-bit gfortran GNU Fortran (GCC) 4.9.2 (osx1010dev/osx1010test) Intel icc/icpc/ifort version 15.0.3 - Mac OS X El Capitan 10.11.4 Apple LLVM version 7.3.0 (clang-703.0.29) + Mac OS X El Capitan 10.11.6 Apple LLVM version 7.3.0 (clang-703.0.29) 64-bit gfortran GNU Fortran (GCC) 5.2.0 (VM osx1011dev/osx1011test) Intel icc/icpc/ifort version 16.0.2 + Mac OS Sierra 10.12.6 Apple LLVM version 8.1 (clang-802.0.42) + 64-bit gfortran GNU Fortran (GCC) 7.1.0 + (kite) Intel icc/icpc/ifort version 17.0.2 + Tested Configuration Features Summary ===================================== @@ -389,9 +389,10 @@ Windows 7 Cygwin n y/n n y y y Windows 7 x64 Cygwin n y/n n y y y Windows 10 y y/y n y y y Windows 10 x64 y y/y n y y y -Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y Mac OS X Mavericks 10.9.5 64-bit n y/y n y y y Mac OS X Yosemite 10.10.5 64-bit n y/y n y y y +Mac OS X El Capitan 10.11.6 64-bit n y/y n y y y +Mac OS Sierra 10.12.6 64-bit n y/y n y y y AIX 6.1 32- and 64-bit n y/n n y y y CentOS 6.7 Linux 2.6.32 x86_64 GNU y y/y y y y y CentOS 6.7 Linux 2.6.32 x86_64 Intel n y/y n y y y @@ -410,9 +411,10 @@ Windows 7 Cygwin n n n y Windows 7 x64 Cygwin n n n y Windows 10 y y y y Windows 10 x64 y y y y -Mac OS X Mountain Lion 10.8.5 64-bit y n y y Mac OS X Mavericks 10.9.5 64-bit y n y y Mac OS X Yosemite 10.10.5 64-bit y n y y +Mac OS X El Capitan 10.11.6 64-bit y n y y +Mac OS Sierra 10.12.6 64-bit y n y y AIX 6.1 32- and 64-bit y n n y CentOS 6.7 Linux 2.6.32 x86_64 GNU y y y y CentOS 6.7 Linux 2.6.32 x86_64 Intel y y y y @@ -463,6 +465,12 @@ Known Problems found a solution that satisfies both. Therefore the dynamically loaded plugin tests have been disabled on CYGWIN. + Mac OS X 10.13 added additional subdirectory structure in .libs for shared + libraries. Consequently "make check" will fail testing java and dynamically + loaded plugin test libraries attempting to copy files from the previous + locations in .libs directories. This will be addressed in the next release + when support for the Mac OS X 10.13 platform is added. + Known problems in previous releases can be found in the HISTORY*.txt files in the HDF5 source. Please report any new problems found to help@hdfgroup.org. -- cgit v0.12 From 62c8c314c0cb8c10926f244b60832a8ed4315ca3 Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 2 Nov 2017 16:18:18 -0500 Subject: Set version to 1.8.20-pre1 --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.txt b/README.txt index edebe2e..1a82f8a 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-pre0 currently under development +HDF5 version 1.8.20-pre1 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 39489f2..30f9c87 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-pre0, currently under development" +PROJECT_NUMBER = "1.8.20-pre1, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 394c98b..95ca9ca 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-pre0") +set (CTEST_SOURCE_VERSEXT "-pre1") ############################################################################## # handle input parameters to script. diff --git a/configure b/configure index ce996f2..35dfa26 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-pre0. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-pre1. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-pre0' -PACKAGE_STRING='HDF5 1.8.20-pre0' +PACKAGE_VERSION='1.8.20-pre1' +PACKAGE_STRING='HDF5 1.8.20-pre1' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,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.8.20-pre0 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-pre1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-pre0:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-pre1:";; esac cat <<\_ACEOF @@ -1745,7 +1745,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-pre0 +HDF5 configure 1.8.20-pre1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2682,7 +2682,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.8.20-pre0, which was +It was created by HDF5 $as_me 1.8.20-pre1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3553,7 +3553,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-pre0' + VERSION='1.8.20-pre1' cat >>confdefs.h <<_ACEOF @@ -29313,7 +29313,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-pre0 +HDF5 config.lt 1.8.20-pre1 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31373,7 +31373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-pre0, which was +This file was extended by HDF5 $as_me 1.8.20-pre1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31439,7 +31439,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-pre0 +HDF5 config.status 1.8.20-pre1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index f5de134..0d9d79e 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-pre0], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-pre1], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 8207788..fd8098a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-pre0 currently under development +HDF5 version 1.8.20-pre1 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 151047e..9ff88f2 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "pre0" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "pre1" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-pre0" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-pre1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 6a5fff36f3c48cba3ab21a1fb29a8a1470297c5a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 6 Nov 2017 09:29:56 -0600 Subject: Correct issue number --- release_docs/RELEASE.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 95e4902..05014b9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -168,9 +168,9 @@ Bug Fixes since HDF5-1.8.19 (ADB - 2017/11/02, HDFFV-10321) - - Fixed Fortran linker flags when using the NAG Fortran compiler (autotools). + - Fixed Fortran linker flags when using the NAG Fortran compiler (autotools). - (HDFFV-10037, MSB, 2017/10/21) + (HDFFV-10037, MSB, 2017/10/21) - cmake @@ -241,7 +241,7 @@ Bug Fixes since HDF5-1.8.19 Added another parameter to the 'UD=' option to set the flag by default to '0' or H5Z_FLAG_MANDATORY, the other choice is '1' or H5Z_FLAG_OPTIONAL. - (ADB - 2017/08/31, HDFFV-10276) + (ADB - 2017/08/31, HDFFV-10269) - h5ls @@ -488,8 +488,8 @@ Known Problems plugin tests have been disabled on CYGWIN. Mac OS X 10.13 added additional subdirectory structure in .libs for shared - libraries. Consequently "make check" will fail testing java and dynamically - loaded plugin test libraries attempting to copy files from the previous + libraries. Consequently "make check" will fail testing java and dynamically + loaded plugin test libraries attempting to copy files from the previous locations in .libs directories. This will be addressed in the next release when support for the Mac OS X 10.13 platform is added. -- cgit v0.12 From acfbc8afd5490d2179546b4e8534dfa70ea834ba Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Mon, 6 Nov 2017 13:19:16 -0600 Subject: Add description to RELEASE.txt for HDFFV-10323 --- release_docs/RELEASE.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 05014b9..1d5456e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -196,6 +196,13 @@ Bug Fixes since HDF5-1.8.19 (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + - Fix H5Sencode bug when num points selected is >2^32 + + Modified to fail if the 32 bit limit is exceeded when encoding either + offsets or counts in the selection. + + (HDFFV-10323, VC, 2017/09/07) + - Fix H5HL_offset_into() (1) Fix H5HL_offset_into() to return error when offset exceeds heap data -- cgit v0.12 From 9b5d85f40a2235c5455c06691357f84e31a518a2 Mon Sep 17 00:00:00 2001 From: lrknox Date: Mon, 6 Nov 2017 16:56:06 -0600 Subject: iAdd NAG to supported compilers in RELEASE.txt. --- release_docs/RELEASE.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1d5456e..938f9bb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -149,6 +149,7 @@ New Features Support for New Platforms, Languages, and Compilers =================================================== + - Added NAG compiler Bug Fixes since HDF5-1.8.19 @@ -347,12 +348,13 @@ They are built with the configure process unless specified otherwise. Linux 3.10.0-327.10.1.el7 GNU C (gcc), Fortran (gfortran), C++ (g++) #1 SMP x86_64 GNU/Linux compilers: - (kituo/moohan) Version 4.8.5 20150623 (Red Hat 4.8.5-4) - Versions 4.9.3, 5.3.0, 6.2.0 + (kituo/moohan/jelly Version 4.8.5 20150623 (Red Hat 4.8.5-4) + Versions 4.9.3, 5.3.0, 6.2.0 Intel(R) C (icc), C++ (icpc), Fortran (icc) compilers: Version 17.0.4.196 Build 20170411 MPICH 3.1.4 compiled with GCC 4.9.3 + NAG Fortran Compiler Release 6.1(Tozai) Build 6116 SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc (emu) Sun Fortran 95 8.6 SunOS_sparc -- cgit v0.12 From 2ffebb670ccc04daa1388f1bdf59844332d9b382 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 13 Nov 2017 21:06:38 -0600 Subject: Changed file path to relative. --- c++/src/H5CppDoc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index bfab9cd..c922ab5 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -51,7 +51,7 @@ Datatype Interface (H5T) DataType and subclasses \endverbatim * - * This + * This * table provides a map from the C APIs to the C++ member functions. *
* \section install_sec Installation -- cgit v0.12 From 63c7dbde0104af59884747afdfa37dfe01de0dae Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 14 Nov 2017 15:13:11 -0600 Subject: Fix linking of libs --- CMakeLists.txt | 1 - fortran/src/CMakeLists.txt | 10 ++++++---- src/CMakeLists.txt | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d45c0b6..4f78257 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -401,7 +401,6 @@ option (BUILD_SHARED_LIBS "Build Shared Libraries" ON) set (H5_ENABLE_SHARED_LIB NO) if (BUILD_SHARED_LIBS) set (H5_ENABLE_SHARED_LIB YES) - set (LINK_SHARED_LIBS ${LINK_LIBS}) endif () set (H5_ENABLE_STATIC_LIB YES) set (CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 9527bc0..89fc1a5 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -184,7 +184,7 @@ set (f90CStub_C_HDRS add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} STATIC) set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES @@ -197,7 +197,7 @@ set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) + target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIB_NAME} SHARED ${HDF5_F_PACKAGE_SOVERSION}) set_target_properties (${HDF5_F90_C_LIBSH_TARGET} PROPERTIES @@ -291,7 +291,8 @@ set_source_files_properties (${f90_F_SRCS} PROPERTIES LANGUAGE Fortran) add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SRCS}) set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS}) +target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET}) +target_link_libraries (${HDF5_F90_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () @@ -317,7 +318,8 @@ if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") endif () TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) - target_link_libraries (${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS}) + target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET}) + target_link_libraries (${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6f7ddc..e8b9444 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -694,7 +694,7 @@ set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () @@ -720,7 +720,7 @@ set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${LINK_SHARED_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () -- cgit v0.12 From 60f913cd5ced9e36c2d522a9f41a520aa4a43d52 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 10 Nov 2017 16:37:40 -0600 Subject: Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af) --- src/H5Oalloc.c | 15 ++++----- test/tattr.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 7 deletions(-) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index c81bdf9..25052e7 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -2200,16 +2200,17 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) oh->nmesgs++; /* Initialize new null message to make the chunk large enough */ - oh->mesg[oh->nmesgs].type = H5O_MSG_NULL; - oh->mesg[oh->nmesgs].dirty = TRUE; - oh->mesg[oh->nmesgs].native = NULL; - oh->mesg[oh->nmesgs].raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; - oh->mesg[oh->nmesgs].raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), + curr_msg = &oh->mesg[oh->nmesgs - 1]; + curr_msg->type = H5O_MSG_NULL; + curr_msg->dirty = TRUE; + curr_msg->native = NULL; + curr_msg->raw = old_image + new_size + sizeof_msghdr - sizeof_chksum; + curr_msg->raw_size = MAX(H5O_ALIGN_OH(oh, min_chunk_size - total_msg_size), sizeof_msghdr) - sizeof_msghdr; - oh->mesg[oh->nmesgs].chunkno = chunkno; + curr_msg->chunkno = chunkno; /* update the new chunk size */ - new_size += oh->mesg[oh->nmesgs].raw_size + sizeof_msghdr; + new_size += curr_msg->raw_size + sizeof_msghdr; } /* end if */ /* Check for changing the chunk #0 data size enough to need adjusting the flags */ diff --git a/test/tattr.c b/test/tattr.c index 283874a..73962c5 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -10552,6 +10552,102 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) /**************************************************************** ** +** test_attr_bug9(): Test basic H5A (attribute) code. +** (Really tests object header code). +** Tests adding several large attributes to an object until +** they convert to dense storage. The total size of all +** attributes is larger than 64K, causing the internal +** object header code to, after merging the deleted +** messages in to a NULL message, shrink the object header +** chunk. Do this twice: once with only attributes in the +** object header chunk and once with a (small) soft link in +** the chunk as well. In both cases, the shrunk chunk will +** initally be too small and a new NULL message must be +** created. +** +****************************************************************/ +static void +test_attr_bug9(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t gid; /* Group ID */ + hid_t aid; /* Attribute ID */ + hid_t sid; /* Dataspace ID */ + hsize_t dims[1] = {32768}; /* Attribute dimensions */ + int create_link; /* Whether to create a soft link */ + unsigned max_compact; /* Setting from fcpl */ + unsigned min_dense; /* Setting from fcpl */ + char aname[11]; /* Attribute name */ + unsigned i; /* Local index variable */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing that attributes can always be added to named datatypes\n")); + + /* Create dataspace */ + sid = H5Screate_simple(1, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Obtain attribute phase change settings */ + ret = H5Pget_attr_phase_change(fcpl, &max_compact, &min_dense); + CHECK(ret, FAIL, "H5Pget_attr_phase_change"); + + /* Run with and without the soft link */ + for(create_link = 0; create_link < 2; create_link++) { + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create second group */ + gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Close second group */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open root group */ + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + + /* Create enough attributes to cause a change to dense storage */ + for(i = 0; i < max_compact + 1; i++) { + /* Create attribute */ + snprintf(aname, sizeof(aname), "%u", i); + aid = H5Acreate2(gid, aname, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close attribute */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + + /* Create enough soft links that exactly one goes into chunk 1 if + * requested */ + if(i == 0 && create_link) { + ret = H5Lcreate_soft("b", gid, "a", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_soft"); + ret = H5Lcreate_soft("d", gid, "c", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_soft"); + ret = H5Lcreate_soft("f", gid, "e", H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_soft"); + } /* end if */ + } /* end for */ + + /* Close IDs */ + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } /* end for */ + + /* Close dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_attr_bug9() */ + +/**************************************************************** +** ** test_attr(): Main H5A (attribute) testing routine. ** ****************************************************************/ @@ -10698,6 +10794,7 @@ test_attr(void) test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */ test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */ test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ + test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */ } /* end for */ } /* end if */ else { @@ -10726,6 +10823,7 @@ test_attr(void) * header format and in fact fails if used with the old format, due * to the attributes being larger than 64K */ test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ + test_attr_bug9(fcpl, my_fapl); /* Test large attributes converting to dense storage */ } /* end else */ } /* end for */ -- cgit v0.12 From 281e282671e80b789bc1dd5460ef6dcddb4c5e34 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Mon, 13 Nov 2017 13:43:32 -0600 Subject: Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0) --- test/tattr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tattr.c b/test/tattr.c index 73962c5..85e82b0 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -10569,10 +10569,10 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) static void test_attr_bug9(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t gid; /* Group ID */ - hid_t aid; /* Attribute ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid = -1; /* File ID */ + hid_t gid = -1; /* Group ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t sid = -1; /* Dataspace ID */ hsize_t dims[1] = {32768}; /* Attribute dimensions */ int create_link; /* Whether to create a soft link */ unsigned max_compact; /* Setting from fcpl */ -- cgit v0.12 From ae9c1bf4199d7ae0f5587485eb4e4d85c5c4cfc4 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 14 Nov 2017 16:24:44 -0600 Subject: Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797) --- release_docs/RELEASE.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 938f9bb..b9435bb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -186,6 +186,14 @@ Bug Fixes since HDF5-1.8.19 Library ------- + - Fix rare object header corruption bug + + In certain cases, such as when converting large attributes to dense + storage, an error could occur which would either fail an assertion or + cause file corruption. Fixed and added test. + + (NAF - 2017/11/14, HDFFV-10274) + - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From ec34b34767482ceccd87159c401a7db13c7dc505 Mon Sep 17 00:00:00 2001 From: lrknox Date: Fri, 17 Nov 2017 16:06:31 -0600 Subject: Switch default build mode from development to production. Increment version string to pre2. --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/cmake/scripts/HDF5config.cmake | 2 +- configure | 28 +++++++++++++++------------- configure.ac | 8 +++++--- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 7 files changed, 26 insertions(+), 22 deletions(-) diff --git a/README.txt b/README.txt index 1a82f8a..4a3b7eb 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-pre1 currently under development +HDF5 version 1.8.20-pre2 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index 30f9c87..d9b36c6 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-pre1, currently under development" +PROJECT_NUMBER = "1.8.20-pre2, currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index f1becd6..04f01dd 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-pre1") +set (CTEST_SOURCE_VERSEXT "-pre2") ############################################################################## # handle input parameters to script. diff --git a/configure b/configure index 35dfa26..fca5f47 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-pre1. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-pre2. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-pre1' -PACKAGE_STRING='HDF5 1.8.20-pre1' +PACKAGE_VERSION='1.8.20-pre2' +PACKAGE_STRING='HDF5 1.8.20-pre2' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,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.8.20-pre1 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20-pre2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-pre1:";; + short | recursive ) echo "Configuration of HDF5 1.8.20-pre2:";; esac cat <<\_ACEOF @@ -1745,7 +1745,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-pre1 +HDF5 configure 1.8.20-pre2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2682,7 +2682,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.8.20-pre1, which was +It was created by HDF5 $as_me 1.8.20-pre2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3553,7 +3553,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-pre1' + VERSION='1.8.20-pre2' cat >>confdefs.h <<_ACEOF @@ -22385,6 +22385,8 @@ fi ## ---------------------------------------------------------------------- ## Production flags? Save the value in $CONFIG_MODE so we have it for ## the record. +## To switch the default between production and development, move X-| +## to X-yes) or X-no) ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for production mode" >&5 $as_echo_n "checking for production mode... " >&6; } @@ -22395,7 +22397,7 @@ fi case "X-$enable_production" in - X-yes) + X-|X-yes) enable_production="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: result: production" >&5 $as_echo "production" >&6; } @@ -22405,7 +22407,7 @@ $as_echo "production" >&6; } H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" ;; - X-|X-no) + X-no) enable_production="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: development" >&5 $as_echo "development" >&6; } @@ -29313,7 +29315,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-pre1 +HDF5 config.lt 1.8.20-pre2 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31373,7 +31375,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-pre1, which was +This file was extended by HDF5 $as_me 1.8.20-pre2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31439,7 +31441,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-pre1 +HDF5 config.status 1.8.20-pre2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 0d9d79e..4564a0f 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-pre1], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20-pre2], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) @@ -777,6 +777,8 @@ fi ## ---------------------------------------------------------------------- ## Production flags? Save the value in $CONFIG_MODE so we have it for ## the record. +## To switch the default between production and development, move X-| +## to X-yes) or X-no) ## AC_MSG_CHECKING([for production mode]) AC_ARG_ENABLE([production], @@ -784,7 +786,7 @@ AC_ARG_ENABLE([production], [Determines how to run the compiler.])]) case "X-$enable_production" in - X-yes) + X-|X-yes) enable_production="yes" AC_MSG_RESULT([production]) CONFIG_MODE=production @@ -793,7 +795,7 @@ case "X-$enable_production" in H5_CXXFLAGS="$H5_CXXFLAGS $PROD_CXXFLAGS" H5_FCFLAGS="$H5_FCFLAGS $PROD_FCFLAGS" ;; - X-|X-no) + X-no) enable_production="no" AC_MSG_RESULT([development]) CONFIG_MODE=development diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b9435bb..3ed5046 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-pre1 currently under development +HDF5 version 1.8.20-pre2 currently under development ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 9ff88f2..6336b5a 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "pre1" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "pre2" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-pre1" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20-pre2" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 3698029cca64856918f2554039063178d45d63ab Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 20 Nov 2017 12:32:37 -0600 Subject: HDFFV-10329 Correct LINK INTERFACE and VS20013 compile --- CMakeFilters.cmake | 16 +- CMakeLists.txt | 2 + release_docs/RELEASE.txt | 23 ++ src/CMakeLists.txt | 4 +- test/CMakeLists.txt | 4 +- test/dsets.c | 2 +- test/tattr.c | 740 ++++++++++++++++++++--------------------- tools/perform/CMakeTests.cmake | 4 +- 8 files changed, 410 insertions(+), 385 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 804b16b..71dabb1 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -45,8 +45,8 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (NOT ZLIB_FOUND) find_package (ZLIB) # Legacy find if (ZLIB_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) endif () endif () endif () @@ -78,9 +78,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") endif () @@ -96,8 +96,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (NOT SZIP_FOUND) find_package (SZIP) # Legacy find if (SZIP_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) endif () endif () endif () @@ -119,9 +119,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) endif () endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f78257..02bb516 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -575,6 +575,8 @@ include (UserMacros.cmake) #----------------------------------------------------------------------------- # Include filter (zlib, szip, etc.) macros #----------------------------------------------------------------------------- +set (LINK_COMP_LIBS) +set (LINK_COMP_SHARED_LIBS) include (CMakeFilters.cmake) #----------------------------------------------------------------------------- diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b9435bb..65b531b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -157,6 +157,18 @@ Bug Fixes since HDF5-1.8.19 Configuration ------------- + - cmake + + The hdf5 library used shared szip and zlib, which needlessly required + applications to link with the same szip and zlib libraries. + + Changed the target_link_libraries commands to use the static libs. + Removed improper link duplication of szip and zlib. + Adjusted the link dependencies and the link interface values of + the target_link_libraries commands. + + (ADB - 2017/11/14, HDFFV-10329) + - cmake MPI CMake implementation for MPI was problematic and would create incorrect @@ -186,6 +198,17 @@ Bug Fixes since HDF5-1.8.19 Library ------- + - filter plugin handling in H5PL.c and H5Z.c + + It was discovered that the dynamic loading process used by + filter plugins had issues with library dependencies. + + CMake build process changed to use LINK INTERFACE keywords, which + allowed HDF5 C library to make dependent libraries private. The + filter plugin libraries no longer require dependent libraries + (such as szip or zlib) to be available. + (ADB - 2017/11/16, HDFFV-10328) + - Fix rare object header corruption bug In certain cases, such as when converting large attributes to dense diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8b9444..a825958 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -694,7 +694,7 @@ set_source_files_properties (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () @@ -720,7 +720,7 @@ set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 612d13d..8d889e4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,7 +34,7 @@ endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test @@ -50,7 +50,7 @@ if (BUILD_SHARED_LIBS) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test diff --git a/test/dsets.c b/test/dsets.c index c936e3c..5e8785b 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -2030,7 +2030,7 @@ test_get_filter_info(void) #ifdef H5_HAVE_FILTER_SZIP if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR - if(SZ_encoder_enabled()) { + if(H5Z_SZIP->encoder_present) { if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR diff --git a/test/tattr.c b/test/tattr.c index 85e82b0..135b46c 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tattr +* Test program: tattr * * Test the attribute functionality * @@ -29,7 +29,7 @@ */ #define H5O_PACKAGE #define H5O_TESTING -#include "H5Opkg.h" /* Object headers */ +#include "H5Opkg.h" /* Object headers */ /* * This file needs to access private information from the H5A package. @@ -37,7 +37,7 @@ */ #define H5A_PACKAGE #define H5A_TESTING -#include "H5Apkg.h" /* Attributes */ +#include "H5Apkg.h" /* Attributes */ /* * This file needs to access private information from the H5F package. @@ -45,7 +45,7 @@ */ #define H5F_PACKAGE #define H5F_TESTING -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ #define FILENAME "tattr.h5" #define NAME_BUF_SIZE 1024 @@ -55,10 +55,10 @@ #define CORDER_ITER_STOP 3 /* 3-D dataset with fixed dimensions */ -#define SPACE1_RANK 3 -#define SPACE1_DIM1 3 -#define SPACE1_DIM2 15 -#define SPACE1_DIM3 13 +#define SPACE1_RANK 3 +#define SPACE1_DIM1 3 +#define SPACE1_DIM2 15 +#define SPACE1_DIM3 13 /* Dataset Information */ #define DSET1_NAME "Dataset1" @@ -76,8 +76,8 @@ /* Attribute Rank & Dimensions */ #define ATTR1_NAME "Attr1" -#define ATTR1_RANK 1 -#define ATTR1_DIM1 3 +#define ATTR1_RANK 1 +#define ATTR1_DIM1 3 int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ /* rank & dimensions for another attribute */ @@ -85,25 +85,25 @@ int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; #define ATTR2_NAME "Attr2" -#define ATTR2_RANK 2 -#define ATTR2_DIM1 2 -#define ATTR2_DIM2 2 +#define ATTR2_RANK 2 +#define ATTR2_DIM1 2 +#define ATTR2_DIM2 2 int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */ #define ATTR3_NAME "Attr3" -#define ATTR3_RANK 3 -#define ATTR3_DIM1 2 -#define ATTR3_DIM2 2 -#define ATTR3_DIM3 2 +#define ATTR3_RANK 3 +#define ATTR3_DIM1 2 +#define ATTR3_DIM2 2 +#define ATTR3_DIM3 2 double attr_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{2.3F,-26.1F}, {0.123F,-10.0F}},{{973.23F,-0.91827F},{2.0F,23.0F}}}; /* Test data for 3rd attribute */ #define ATTR4_NAME "Attr4" -#define ATTR4_RANK 2 -#define ATTR4_DIM1 2 -#define ATTR4_DIM2 2 -#define ATTR4_FIELDNAME1 "i" -#define ATTR4_FIELDNAME2 "d" -#define ATTR4_FIELDNAME3 "c" +#define ATTR4_RANK 2 +#define ATTR4_DIM1 2 +#define ATTR4_DIM2 2 +#define ATTR4_FIELDNAME1 "i" +#define ATTR4_FIELDNAME2 "d" +#define ATTR4_FIELDNAME3 "c" size_t attr4_field1_off=0; size_t attr4_field2_off=0; size_t attr4_field3_off=0; @@ -115,13 +115,13 @@ struct attr4_struct { {{-23,981724.2F,'Q'},{0,2.0F,'\n'}}}; /* Test data for 4th attribute */ #define ATTR5_NAME "Attr5" -#define ATTR5_RANK 0 +#define ATTR5_RANK 0 float attr_data5=-5.123F; /* Test data for 5th attribute */ -#define ATTR6_RANK 3 -#define ATTR6_DIM1 100 -#define ATTR6_DIM2 100 -#define ATTR6_DIM3 100 +#define ATTR6_RANK 3 +#define ATTR6_DIM1 100 +#define ATTR6_DIM2 100 +#define ATTR6_DIM3 100 #define ATTR7_NAME "attr 1 - 000000" #define ATTR8_NAME "attr 2" @@ -163,20 +163,20 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, static void test_attr_basic_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ hsize_t attr_size; /* storage size for attribute */ ssize_t attr_name_size; /* size of attribute name */ char *attr_name=NULL; /* name of attribute */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ int i; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n")); @@ -277,7 +277,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); CHECK(attr_name, NULL, "HDcalloc"); - + if(attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); CHECK(ret, FAIL, "H5Aget_name"); @@ -313,7 +313,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); CHECK(attr_name, NULL, "HDcalloc"); - + if(attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); CHECK(ret, FAIL, "H5Aget_name"); @@ -401,15 +401,15 @@ test_attr_basic_write(hid_t fapl) static void test_attr_basic_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t attr; /* Attribute ID */ H5O_info_t oinfo; /* Object info */ int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -499,7 +499,7 @@ test_attr_flush(hid_t fapl) set; /* Dataset ID */ double wdata=3.14159F; /* Data to write */ double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); @@ -559,15 +559,15 @@ test_attr_flush(hid_t fapl) static void test_attr_plist(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ hid_t plist; /* Property list ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; H5T_cset_t cset; /* Character set for attributes */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Property Lists\n")); @@ -673,14 +673,14 @@ test_attr_plist(hid_t fapl) static void test_attr_compound_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ hid_t tid1; /* Attribute datatype ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; - herr_t ret; /* Generic return value */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -760,11 +760,11 @@ test_attr_compound_write(hid_t fapl) static void test_attr_compound_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid1; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ int rank; /* Attribute rank */ hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */ @@ -779,7 +779,7 @@ test_attr_compound_read(hid_t fapl) size_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -910,12 +910,12 @@ test_attr_compound_read(hid_t fapl) static void test_attr_scalar_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -975,14 +975,14 @@ test_attr_scalar_write(hid_t fapl) static void test_attr_scalar_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ H5S_class_t stype; /* Dataspace class */ float rdata = 0.0F; /* Buffer for reading 1st attribute */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n")); @@ -1010,8 +1010,8 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", attr_data5, rdata, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Aread", attr_data5, rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); @@ -1047,15 +1047,15 @@ test_attr_scalar_read(hid_t fapl) static void test_attr_mult_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -1166,11 +1166,11 @@ test_attr_mult_write(hid_t fapl) static void test_attr_mult_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid1; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ char temp_name[ATTR_NAME_LEN]; /* Buffer for mangling attribute names */ int rank; /* Attribute rank */ @@ -1184,7 +1184,7 @@ test_attr_mult_read(hid_t fapl) size_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j, k; /* Local index values */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1428,12 +1428,12 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR static void test_attr_iterate(hid_t fapl) { - hid_t file; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t file; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ int count; /* operator data for the iterator */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1500,13 +1500,13 @@ test_attr_iterate(hid_t fapl) static void test_attr_delete(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t attr; /* Attribute ID */ + hid_t fid1; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ size_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1631,7 +1631,7 @@ test_attr_dtype_shared(hid_t fapl) H5O_info_t oinfo; /* Object's information */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Shared Datatypes with Attributes\n")); @@ -1798,17 +1798,17 @@ test_attr_dtype_shared(hid_t fapl) static void test_attr_duplicate_ids(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ int i; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two ID handles\n")); @@ -2043,12 +2043,12 @@ test_attr_duplicate_ids(hid_t fapl) static int test_attr_dense_verify(hid_t loc_id, unsigned max_attr) { - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ unsigned value; /* Attribute value */ unsigned u; /* Local index variable */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -2113,19 +2113,19 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) static void test_attr_dense_create(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Attribute Storage Creation\n")); @@ -2244,19 +2244,19 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) static void test_attr_dense_open(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n")); @@ -2383,20 +2383,20 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) static void test_attr_dense_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n")); @@ -2561,21 +2561,21 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) static void test_attr_dense_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n")); @@ -2720,21 +2720,21 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) static void test_attr_dense_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ size_t mesg_count; /* # of shared messages */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n")); @@ -2850,19 +2850,19 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) static void test_attr_dense_limits(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact, rmax_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n")); @@ -3015,23 +3015,23 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) static void test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ - hid_t sid, sid2; /* Dataspace ID */ - hid_t attr, attr2, add_attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hsize_t dims[] = {ATTR1_DIM1}; + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ + hid_t sid, sid2; /* Dataspace ID */ + hid_t attr, attr2, add_attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hsize_t dims[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ unsigned scalar_data = 1317; /* scalar data for attribute */ unsigned read_scalar; /* variable for reading attribute*/ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u, i; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n")); @@ -3538,24 +3538,24 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) static void test_attr_big(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t big_sid; /* "Big" dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t big_sid; /* "Big" dataspace ID */ hsize_t dims[ATTR6_RANK] = {ATTR6_DIM1, ATTR6_DIM2, ATTR6_DIM3}; /* Attribute dimensions */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ unsigned nshared_indices; /* # of shared message indices */ H5F_libver_t low, high; /* File format bounds */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing 'Big' Attributes in Dense Storage\n")); @@ -3808,20 +3808,20 @@ test_attr_big(hid_t fcpl, hid_t fapl) static void test_attr_null_space(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t null_sid; /* "null" dataspace ID */ - hid_t attr_sid; /* Attribute's dataspace ID */ - hid_t attr; /* Attribute ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t null_sid; /* "null" dataspace ID */ + hid_t attr_sid; /* Attribute's dataspace ID */ + hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned value; /* Attribute value */ htri_t cmp; /* Results of comparison */ hsize_t storage_size; /* Size of storage for attribute */ H5A_info_t ainfo; /* Attribute info */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing Attributes with 'null' dataspace\n")); @@ -4027,11 +4027,11 @@ static void test_attr_deprec(hid_t fcpl, hid_t fapl) { #ifndef H5_NO_DEPRECATED_SYMBOLS - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - herr_t ret; /* Generic return value */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Attribute Routines\n")); @@ -4135,15 +4135,15 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) static void test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t gid; /* Group ID */ - hid_t sid; /* Dataspace ID */ - hid_t aid; /* Attribute ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t gid; /* Group ID */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned nattr = (new_format ? NATTR_MANY_NEW : NATTR_MANY_OLD); /* Number of attributes */ htri_t exists; /* Whether the attribute exists or not */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storing Many Attributes\n")); @@ -4264,14 +4264,14 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned crt_order_flags;/* Creation order flags */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ - herr_t ret; /* Generic return value */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Code for Attributes with Creation Order Info\n")); @@ -4380,21 +4380,21 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) static void test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compact Storage of Attributes with Creation Order Info\n")); @@ -4578,23 +4578,23 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) static void test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Storage of Attributes with Creation Order Info\n")); @@ -4812,7 +4812,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) hid_t sid = -1; /* Dataspace ID */ hid_t aid = -1; /* Attribute ID */ int buf; /* Attribute data */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Creating Attributes w/New & Old Format\n")); @@ -4913,23 +4913,23 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) static void test_attr_corder_transition(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Storage Transitions of Attributes with Creation Order Info\n")); @@ -5319,28 +5319,28 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) static void test_attr_corder_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ hbool_t reopen_file; /* Whether to re-open the file before deleting group */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ #ifdef LATER h5_stat_size_t empty_size; /* Size of empty file */ h5_stat_size_t file_size; /* Size of file after operating on it */ #endif /* LATER */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Object w/Dense Attribute Storage and Creation Order Info\n")); @@ -5517,7 +5517,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) * Purpose: Support routine for attr_info_by_idx, to verify the attribute * info is correct for a attribute * - * Note: This routine assumes that the attributes have been added to the + * Note: This routine assumes that the attributes have been added to the * object in alphabetical order. * * Return: Success: 0 @@ -5535,7 +5535,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ H5A_info_t ainfo; /* Attribute info struct */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -5667,26 +5667,26 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, static void test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ H5A_info_t ainfo; /* Attribute information */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ hbool_t use_index; /* Use index on creation order values */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -5877,28 +5877,28 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ H5A_info_t ainfo; /* Attribute information */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ hbool_t use_index; /* Use index on creation order values */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -6818,16 +6818,16 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, static void test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ @@ -6838,10 +6838,10 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t idx; /* Start index for iteration */ hbool_t use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7134,7 +7134,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5A_info_t ainfo; /* Attribute info */ int old_nerrs; /* Number of errors when entering this check */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -7182,26 +7182,26 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, static void test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ hbool_t use_index; /* Use index on creation order values */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7453,10 +7453,10 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, { hid_t attr_id; /* ID of attribute to test */ H5A_info_t ainfo; /* Attribute info */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ int old_nerrs; /* Number of errors when entering this check */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -7529,25 +7529,25 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, static void test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ hbool_t use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -7783,25 +7783,25 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dset1, dset2, dset3; /* Dataset IDs */ - hid_t my_dataset; /* Current dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dset1, dset2, dset3; /* Dataset IDs */ + hid_t my_dataset; /* Current dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ - htri_t is_empty; /* Are there any attributes? */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_empty; /* Are there any attributes? */ + htri_t is_dense; /* Are attributes stored densely? */ hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ hbool_t use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); @@ -8006,28 +8006,28 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) static void test_attr_shared_write(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset IDs */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset IDs */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ + unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Writing Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -8331,29 +8331,29 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) static void test_attr_shared_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset ID2 */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ - char attrname2[NAME_BUF_SIZE]; /* Name of attribute on second dataset */ + hid_t fid; /* HDF5 File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset ID2 */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ + char attrname2[NAME_BUF_SIZE]; /* Name of attribute on second dataset */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ + unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -8773,28 +8773,28 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) static void test_attr_shared_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset IDs */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ + hid_t fid; /* File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset IDs */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ + unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage\n")); @@ -9137,28 +9137,28 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) static void test_attr_shared_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* File ID */ - hid_t my_fcpl; /* File creation property list ID */ - hid_t dataset, dataset2; /* Dataset IDs */ - hid_t attr_tid; /* Attribute's datatype ID */ - hid_t sid, big_sid; /* Dataspace IDs */ - hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ + hid_t fid; /* File ID */ + hid_t my_fcpl; /* File creation property list ID */ + hid_t dataset, dataset2; /* Dataset IDs */ + hid_t attr_tid; /* Attribute's datatype ID */ + hid_t sid, big_sid; /* Dataspace IDs */ + hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ - htri_t is_shared; /* Is attributes shared? */ + htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_shared; /* Is attributes shared? */ hsize_t shared_refcount; /* Reference count of shared attribute */ unsigned attr_value; /* Attribute value */ - unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ + unsigned big_value[SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3]; /* Data for "big" attribute */ size_t mesg_count; /* # of shared messages */ unsigned test_shared; /* Index over shared component type */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Shared Attributes in Compact & Dense Storage\n")); @@ -10613,7 +10613,7 @@ test_attr_bug9(hid_t fcpl, hid_t fapl) /* Create enough attributes to cause a change to dense storage */ for(i = 0; i < max_compact + 1; i++) { /* Create attribute */ - snprintf(aname, sizeof(aname), "%u", i); + HDsnprintf(aname, sizeof(aname), "%u", i); aid = H5Acreate2(gid, aname, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT); CHECK(aid, FAIL, "H5Acreate2"); @@ -10654,8 +10654,8 @@ test_attr_bug9(hid_t fcpl, hid_t fapl) void test_attr(void) { - hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ + hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ + hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ hbool_t new_format; /* Whether to use the new format or not */ hbool_t use_shared; /* Whether to use shared attributes or not */ herr_t ret; /* Generic return value */ @@ -10842,13 +10842,13 @@ test_attr(void) /*------------------------------------------------------------------------- - * Function: cleanup_attr + * Function: cleanup_attr * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/tools/perform/CMakeTests.cmake b/tools/perform/CMakeTests.cmake index 1f67abe..450667a 100644 --- a/tools/perform/CMakeTests.cmake +++ b/tools/perform/CMakeTests.cmake @@ -170,9 +170,9 @@ endif () set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects") if (H5_HAVE_PARALLEL) - add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) if (HDF5_BUILD_PERFORM_STANDALONE) - add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endif () endif () -- cgit v0.12 From 4cb9945cdb39f4a195b70277c31d0ba6bb6562b1 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 22 Nov 2017 17:24:14 -0600 Subject: Fixed documentation warnings --- c++/src/H5DataType.cpp | 106 ++++++++++++++++++++++++------------------------- c++/src/H5DataType.h | 3 +- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index ffa2a21..d4f4e70 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -243,35 +243,6 @@ void DataType::copy(const DataSet& dset) } //-------------------------------------------------------------------------- -// Function: DataType::p_decode -// Purpose Returns an id of a type by decoding the binary object -/// description of this datatype. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Sept 2017 -//-------------------------------------------------------------------------- -hid_t DataType::p_decode() const -{ - // Make sure that the buffer can be decoded - if (encoded_buf == NULL) - { - throw DataTypeIException("DataType::p_decode", "No encoded buffer"); - } - - // Call C function to decode the binary object description - hid_t encoded_dtype_id = H5Tdecode(encoded_buf); - - // If H5Tdecode fails, raise exception - if (encoded_dtype_id < 0) - { - throw DataTypeIException("DataType::p_decode", "H5Tdecode failed"); - } - else - { - return(encoded_dtype_id); - } -} - -//-------------------------------------------------------------------------- // Function: DataType::decode ///\brief Returns a DataType instance by decoding the binary object /// description of this datatype. @@ -391,28 +362,6 @@ bool DataType::operator==(const DataType& compared_type) const } //-------------------------------------------------------------------------- -// Function: DataType::p_commit (private) -//\brief Commits a transient datatype to a file, creating a new -// named datatype -//\param loc_id - IN: The id of either a file, group, dataset, named -// datatype, or attribute. -//\param name - IN: Name of the datatype -//\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -// Modification: -// Copied from DataType::commit and made into private function -// to be commonly used by several overloads of DataType::commit. -// BMR - Jan, 2007 -//-------------------------------------------------------------------------- -void DataType::p_commit(hid_t loc_id, const char* name) -{ - // Call C routine to commit the transient datatype - herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if(ret_value < 0) - throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); -} - -//-------------------------------------------------------------------------- // Function: DataType::commit ///\brief Commits a transient datatype to a file, creating a new /// named datatype @@ -857,7 +806,58 @@ hid_t DataType::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataType::p_opentype (private) +// Function: DataType::p_commit (private) +//\brief Commits a transient datatype to a file, creating a new +// named datatype +//\param loc_id - IN: The id of either a file, group, dataset, named +// datatype, or attribute. +//\param name - IN: Name of the datatype +//\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +// Modification: +// Copied from DataType::commit and made into private function +// to be commonly used by several overloads of DataType::commit. +// BMR - Jan, 2007 +//-------------------------------------------------------------------------- +void DataType::p_commit(hid_t loc_id, const char* name) +{ + // Call C routine to commit the transient datatype + herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(ret_value < 0) + throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); +} + +//-------------------------------------------------------------------------- +// Function: DataType::p_decode (protected) +// Purpose Returns an id of a type by decoding the binary object +/// description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +hid_t DataType::p_decode() const +{ + // Make sure that the buffer can be decoded + if (encoded_buf == NULL) + { + throw DataTypeIException("DataType::p_decode", "No encoded buffer"); + } + + // Call C function to decode the binary object description + hid_t encoded_dtype_id = H5Tdecode(encoded_buf); + + // If H5Tdecode fails, raise exception + if (encoded_dtype_id < 0) + { + throw DataTypeIException("DataType::p_decode", "H5Tdecode failed"); + } + else + { + return(encoded_dtype_id); + } +} + +//-------------------------------------------------------------------------- +// Function: DataType::p_opentype (protected) ///\brief Opens an HDF5 datatype given its name ///\param loc - IN: Location of the type ///\param type_name - IN: Datatype name @@ -877,7 +877,7 @@ hid_t DataType::p_opentype(const H5Location& loc, const char *type_name) const } //-------------------------------------------------------------------------- -// Function: DataType::p_setId +// Function: DataType::p_setId (protected) ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 5e10c20..29cc990 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -150,7 +150,6 @@ class H5_DLLCPP DataType : public H5Object { // Opens a datatype and returns the id. hid_t p_opentype(const H5Location& loc, const char* dtype_name) const; - #endif // DOXYGEN_SHOULD_SKIP_THIS private: @@ -162,7 +161,9 @@ class H5_DLLCPP DataType : public H5Object { // Friend function to set DataType id. For library use only. friend void f_DataType_setId(DataType* dtype, hid_t new_id); +#ifndef DOXYGEN_SHOULD_SKIP_THIS void p_commit(hid_t loc_id, const char* name); +#endif // DOXYGEN_SHOULD_SKIP_THIS }; // end of DataType } // namespace H5 -- cgit v0.12 From 24b8884c0b7429b393835ecab0d93a63b1049b64 Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 22 Nov 2017 20:31:13 -0600 Subject: Update version for 1.8.20 release. --- README.txt | 2 +- c++/src/cpp_doc_config | 5 ++--- config/cmake/scripts/HDF5config.cmake | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.txt b/README.txt index 4a3b7eb..6c54dbe 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-pre2 currently under development +HDF5 version 1.8.20 released on 2017-11-22 Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index d9b36c6..a2bb544 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -49,7 +49,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.8.20-pre2, currently under development" +PROJECT_NUMBER = "1.8.20" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -1150,8 +1150,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = ./header_files/help.jpg \ - ./C2Cppfunction_map.mht +HTML_EXTRA_FILES = ./header_files/help.jpg # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 04f01dd..1bc1e9f 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -38,7 +38,7 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) ############################################################################## set (CTEST_SOURCE_VERSION "1.8.20") -set (CTEST_SOURCE_VERSEXT "-pre2") +set (CTEST_SOURCE_VERSEXT "") ############################################################################## # handle input parameters to script. diff --git a/configure b/configure index fca5f47..5557893 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.8.20-pre2. +# Generated by GNU Autoconf 2.69 for HDF5 1.8.20. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.8.20-pre2' -PACKAGE_STRING='HDF5 1.8.20-pre2' +PACKAGE_VERSION='1.8.20' +PACKAGE_STRING='HDF5 1.8.20' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1480,7 +1480,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.8.20-pre2 to adapt to many kinds of systems. +\`configure' configures HDF5 1.8.20 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1550,7 +1550,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.8.20-pre2:";; + short | recursive ) echo "Configuration of HDF5 1.8.20:";; esac cat <<\_ACEOF @@ -1745,7 +1745,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.8.20-pre2 +HDF5 configure 1.8.20 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2682,7 +2682,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.8.20-pre2, which was +It was created by HDF5 $as_me 1.8.20, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3553,7 +3553,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.8.20-pre2' + VERSION='1.8.20' cat >>confdefs.h <<_ACEOF @@ -29315,7 +29315,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.8.20-pre2 +HDF5 config.lt 1.8.20 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -31375,7 +31375,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.8.20-pre2, which was +This file was extended by HDF5 $as_me 1.8.20, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31441,7 +31441,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.8.20-pre2 +HDF5 config.status 1.8.20 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 4564a0f..30c04c9 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.8.20-pre2], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.8.20], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADERS([src/H5config.h]) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 3f7abfb..0168b88 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20-pre2 currently under development +HDF5 version 1.8.20 released on 2017-11-22 ================================================================================ INTRODUCTION diff --git a/src/H5public.h b/src/H5public.h index 6336b5a..ba98cf2 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -93,9 +93,9 @@ extern "C" { #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 8 /* For minor interface/format changes */ #define H5_VERS_RELEASE 20 /* For tweaks, bug-fixes, or development */ -#define H5_VERS_SUBRELEASE "pre2" /* For pre-releases like snap0 */ +#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.8.20-pre2" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.8.20" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From a4344a3cab791ff5db26629d2e2f96eae0325368 Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 22 Nov 2017 20:35:49 -0600 Subject: Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES. --- c++/src/cpp_doc_config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index a2bb544..1cf7fee 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -1150,7 +1150,8 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = ./header_files/help.jpg +HTML_EXTRA_FILES = ./header_files/help.jpg \ + ./C2Cppfunction_map.mht # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to -- cgit v0.12 From 65fdd393619e8ab4612cae4eb8f287c375924210 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 28 Nov 2017 15:10:12 -0600 Subject: Update version numbers and remove empty sections in RELEASE.txt. --- README.txt | 2 +- release_docs/RELEASE.txt | 70 +++++++----------------------------------------- 2 files changed, 11 insertions(+), 61 deletions(-) diff --git a/README.txt b/README.txt index 6c54dbe..0365af6 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.8.20 released on 2017-11-22 +HDF5 version 1.8.20 released on 2017-11-28 Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 0168b88..2050a1c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,25 +1,25 @@ -HDF5 version 1.8.20 released on 2017-11-22 +HDF5 version 1.8.20 released on 2017-11-28 ================================================================================ INTRODUCTION ============ -This document describes the differences between HDF5-1.8.18 and -HDF5-1.8.19, and contains information on the platforms tested and -known problems in HDF5-1.8.19. +This document describes the differences between HDF5-1.8.19 and +HDF5-1.8.20, and contains information on the platforms tested and +known problems in HDF5-1.8.20. For more details, see the files HISTORY-1_0-1_8_0_rc3.txt and HISTORY-1_8.txt in the release_docs/ directory of the HDF5 source. -Links to the HDF5 1.8.19 source code, documentation, and additional materials +Links to the HDF5 1.8.20 source code, documentation, and additional materials can be found on the HDF5 web page at: https://support.hdfgroup.org/HDF5/ -The HDF5 1.8.19 release can be obtained from: +The HDF5 1.8.20 release can be obtained from: https://support.hdfgroup.org/HDF5/release/obtain518.html -User documentation for 1.8.19 can be accessed directly at this location: +User documentation for 1.8.20 can be accessed directly at this location: https://support.hdfgroup.org/HDF5/doc1.8/ @@ -30,8 +30,8 @@ in 1.8.0?" document: https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew180.html All new and modified APIs are listed in detail in the "HDF5 Software Changes -from Release to Release" document, in the section "Release 1.8.19 (current -release) versus Release 1.8.18 +from Release to Release" document, in the section "Release 1.8.20 (current +release) versus Release 1.8.19 https://support.hdfgroup.org/HDF5/doc1.8/ADGuide/Changes.html @@ -45,7 +45,7 @@ CONTENTS - New Features - Support for New Platforms, Languages, and Compilers -- Bug Fixes since HDF5-1.8.19 +- Bug Fixes since HDF5-1.8.20 - Supported Platforms - Supported Configuration Features Summary - More Tested Platforms @@ -55,21 +55,6 @@ CONTENTS New Features ============ - Configuration - ------------- - - None - - - Library - ------- - - None - - - Parallel Library - ---------------- - - None - - Tools ----- - h5diff @@ -84,16 +69,6 @@ New Features (ADB - 2017/08/30, HDFFV-9774) - High-Level APIs - --------------- - - None - - - Fortran API - ----------- - - None - - C++ API ------- - The following C++ API wrappers have been added to the C++ Library: @@ -245,16 +220,6 @@ Bug Fixes since HDF5-1.8.19 (HDFFV-10216, VC, 2017/09/05) - Parallel Library - ---------------- - - None - - - Performance - ------------- - - None - - Tools ----- - h5repack @@ -324,11 +289,6 @@ Bug Fixes since HDF5-1.8.19 (ADB - 2017/06/15, HDFFV-10219) - Fortran API - ----------- - - None - - C++ API ------- - Marked the following functions deprecated because they were moved to @@ -343,16 +303,6 @@ Bug Fixes since HDF5-1.8.19 (BMR - 2017/10/17) - High-Level APIs: - --------------- - - None - - - Packet Table APIs: - ------------------ - - None - - Supported Platforms =================== The following platforms are supported and have been tested for this release. -- cgit v0.12