diff options
Diffstat (limited to 'tools')
104 files changed, 7488 insertions, 3422 deletions
diff --git a/tools/h5copy/testfiles/h5copy_ref.out.ls b/tools/h5copy/testfiles/h5copy_ref.out.ls index 0769dc8..d685af2 100644 --- a/tools/h5copy/testfiles/h5copy_ref.out.ls +++ b/tools/h5copy/testfiles/h5copy_ref.out.ls @@ -21,7 +21,7 @@ Opened "./testfiles/h5copy_ref.out.h5" with sec2 driver. Storage: <details removed for portability> Type: object reference /COPY/Dset_REGREF Dataset {2/2} - Location: 1:9400 + Location: 1:5304 Links: 1 Storage: <details removed for portability> Type: dataset region reference diff --git a/tools/h5copy/testfiles/h5copytst.out.ls b/tools/h5copy/testfiles/h5copytst.out.ls index 62c860b..4044aaf 100644 --- a/tools/h5copy/testfiles/h5copytst.out.ls +++ b/tools/h5copy/testfiles/h5copytst.out.ls @@ -3,57 +3,57 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Location: 1:96 Links: 1 /A Group - Location: 1:88336 + Location: 1:84304 Links: 1 /A/B1 Group - Location: 1:89040 + Location: 1:85008 Links: 1 /A/B1/simple Dataset {6/6} - Location: 1:88208 + Location: 1:84176 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /A/B2 Group - Location: 1:92576 + Location: 1:88544 Links: 1 /A/B2/simple2 Dataset {6/6} - Location: 1:92448 + Location: 1:88416 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /C Group - Location: 1:95784 + Location: 1:91752 Links: 1 /C/D Group - Location: 1:96488 + Location: 1:92456 Links: 1 /C/D/simple Dataset {6/6} - Location: 1:95656 + Location: 1:91624 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /E Group - Location: 1:110400 + Location: 1:106368 Links: 1 /E/F Group - Location: 1:111104 + Location: 1:107072 Links: 1 /E/F/grp_dsets Group - Location: 1:98600 + Location: 1:94568 Links: 1 /E/F/grp_dsets/chunk Dataset {6/6} - Location: 1:102784 + Location: 1:98752 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Type: 32-bit little-endian integer /E/F/grp_dsets/compact Dataset {6/6} - Location: 1:103240 + Location: 1:99208 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /E/F/grp_dsets/compound Dataset {2/2} - Location: 1:103376 + Location: 1:99344 Links: 1 Storage: <details removed for portability> Type: struct { @@ -61,60 +61,60 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /E/F/grp_dsets/compressed Dataset {6/6} - Location: 1:105688 + Location: 1:101656 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /E/F/grp_dsets/named_vl Dataset {2/2} - Location: 1:109952 + Location: 1:105920 Links: 1 Storage: <details removed for portability> - Type: shared-1:110080 variable length of + Type: shared-1:106048 variable length of 32-bit little-endian integer /E/F/grp_dsets/nested_vl Dataset {2/2} - Location: 1:110128 + Location: 1:106096 Links: 1 Storage: <details removed for portability> Type: variable length of variable length of 32-bit little-endian integer /E/F/grp_dsets/simple Dataset {6/6} - Location: 1:110272 + Location: 1:106240 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /E/F/grp_dsets/vl Type - Location: 1:110080 + Location: 1:106048 Links: 2 - Type: shared-1:110080 variable length of + Type: shared-1:106048 variable length of 32-bit little-endian integer /G Group - Location: 1:126048 + Location: 1:122016 Links: 1 /G/H Group - Location: 1:126752 + Location: 1:122720 Links: 1 /G/H/grp_nested Group - Location: 1:113128 + Location: 1:109096 Links: 1 /G/H/grp_nested/grp_dsets Group - Location: 1:113920 + Location: 1:109888 Links: 1 /G/H/grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:118104 + Location: 1:114072 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:118560 + Location: 1:114528 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:118696 + Location: 1:114664 Links: 1 Storage: <details removed for portability> Type: struct { @@ -122,34 +122,34 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /G/H/grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:121008 + Location: 1:116976 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:125272 + Location: 1:121240 Links: 1 Storage: <details removed for portability> - Type: shared-1:125400 variable length of + Type: shared-1:121368 variable length of 32-bit little-endian integer /G/H/grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:125448 + Location: 1:121416 Links: 1 Storage: <details removed for portability> Type: variable length of variable length of 32-bit little-endian integer /G/H/grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:125592 + Location: 1:121560 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/vl Type - Location: 1:125400 + Location: 1:121368 Links: 2 - Type: shared-1:125400 variable length of + Type: shared-1:121368 variable length of 32-bit little-endian integer /chunk Dataset {6/6} Location: 1:6312 @@ -178,21 +178,21 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_dsets Group - Location: 1:32160 + Location: 1:28128 Links: 1 /grp_dsets/chunk Dataset {6/6} - Location: 1:36344 + Location: 1:32312 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_dsets/compact Dataset {6/6} - Location: 1:36800 + Location: 1:32768 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_dsets/compound Dataset {2/2} - Location: 1:36936 + Location: 1:32904 Links: 1 Storage: <details removed for portability> Type: struct { @@ -200,62 +200,62 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_dsets/compressed Dataset {6/6} - Location: 1:39248 + Location: 1:35216 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_dsets/named_vl Dataset {2/2} - Location: 1:43512 + Location: 1:39480 Links: 1 Storage: <details removed for portability> - Type: shared-1:43640 variable length of + Type: shared-1:39608 variable length of 32-bit little-endian integer /grp_dsets/nested_vl Dataset {2/2} - Location: 1:43688 + Location: 1:39656 Links: 1 Storage: <details removed for portability> Type: variable length of variable length of 32-bit little-endian integer /grp_dsets/simple Dataset {6/6} - Location: 1:43832 + Location: 1:39800 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_dsets/simple_group Dataset {6/6} - Location: 1:59944 + Location: 1:55912 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_dsets/vl Type - Location: 1:43640 + Location: 1:39608 Links: 2 - Type: shared-1:43640 variable length of + Type: shared-1:39608 variable length of 32-bit little-endian integer /grp_empty Group - Location: 1:31368 + Location: 1:27336 Links: 1 /grp_nested Group - Location: 1:44624 + Location: 1:40592 Links: 1 /grp_nested/grp_dsets Group - Location: 1:45416 + Location: 1:41384 Links: 1 /grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:49600 + Location: 1:45568 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:50056 + Location: 1:46024 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:50192 + Location: 1:46160 Links: 1 Storage: <details removed for portability> Type: struct { @@ -263,51 +263,51 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:52504 + Location: 1:48472 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:56768 + Location: 1:52736 Links: 1 Storage: <details removed for portability> - Type: shared-1:56896 variable length of + Type: shared-1:52864 variable length of 32-bit little-endian integer /grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:56944 + Location: 1:52912 Links: 1 Storage: <details removed for portability> Type: variable length of variable length of 32-bit little-endian integer /grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:57088 + Location: 1:53056 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_nested/grp_dsets/vl Type - Location: 1:56896 + Location: 1:52864 Links: 2 - Type: shared-1:56896 variable length of + Type: shared-1:52864 variable length of 32-bit little-endian integer /grp_rename Group - Location: 1:61152 + Location: 1:57120 Links: 1 /grp_rename/chunk Dataset {6/6} - Location: 1:65336 + Location: 1:61304 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_rename/compact Dataset {6/6} - Location: 1:65792 + Location: 1:61760 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_rename/compound Dataset {2/2} - Location: 1:65928 + Location: 1:61896 Links: 1 Storage: <details removed for portability> Type: struct { @@ -315,28 +315,28 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_rename/compressed Dataset {6/6} - Location: 1:68240 + Location: 1:64208 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_rename/grp_dsets Group - Location: 1:74032 + Location: 1:70000 Links: 1 /grp_rename/grp_dsets/chunk Dataset {6/6} - Location: 1:78216 + Location: 1:74184 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_rename/grp_dsets/compact Dataset {6/6} - Location: 1:78672 + Location: 1:74640 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_rename/grp_dsets/compound Dataset {2/2} - Location: 1:78808 + Location: 1:74776 Links: 1 Storage: <details removed for portability> Type: struct { @@ -344,73 +344,73 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_rename/grp_dsets/compressed Dataset {6/6} - Location: 1:81120 + Location: 1:77088 Links: 1 Chunks: {2} 8 bytes Storage: <details removed for portability> Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_rename/grp_dsets/named_vl Dataset {2/2} - Location: 1:85384 + Location: 1:81352 Links: 1 Storage: <details removed for portability> - Type: shared-1:85512 variable length of + Type: shared-1:81480 variable length of 32-bit little-endian integer /grp_rename/grp_dsets/nested_vl Dataset {2/2} - Location: 1:85560 + Location: 1:81528 Links: 1 Storage: <details removed for portability> Type: variable length of variable length of 32-bit little-endian integer /grp_rename/grp_dsets/simple Dataset {6/6} - Location: 1:85704 + Location: 1:81672 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_rename/grp_dsets/vl Type - Location: 1:85512 + Location: 1:81480 Links: 2 - Type: shared-1:85512 variable length of + Type: shared-1:81480 variable length of 32-bit little-endian integer /grp_rename/named_vl Dataset {2/2} - Location: 1:72504 + Location: 1:68472 Links: 1 Storage: <details removed for portability> - Type: shared-1:72632 variable length of + Type: shared-1:68600 variable length of 32-bit little-endian integer /grp_rename/nested_vl Dataset {2/2} - Location: 1:72680 + Location: 1:68648 Links: 1 Storage: <details removed for portability> Type: variable length of variable length of 32-bit little-endian integer /grp_rename/simple Dataset {6/6} - Location: 1:72824 + Location: 1:68792 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer /grp_rename/vl Type - Location: 1:72632 + Location: 1:68600 Links: 2 - Type: shared-1:72632 variable length of + Type: shared-1:68600 variable length of 32-bit little-endian integer /named_vl Dataset {2/2} - Location: 1:19296 + Location: 1:17280 Links: 1 Storage: <details removed for portability> - Type: shared-1:19424 variable length of + Type: shared-1:17408 variable length of 32-bit little-endian integer /nested_vl Dataset {2/2} - Location: 1:25792 + Location: 1:21760 Links: 1 Storage: <details removed for portability> Type: variable length of variable length of 32-bit little-endian integer /rename Dataset {2/2} - Location: 1:30160 + Location: 1:26128 Links: 1 Storage: <details removed for portability> Type: struct { @@ -423,7 +423,7 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Storage: <details removed for portability> Type: 32-bit little-endian integer /simple_top Dataset {6/6} - Location: 1:27984 + Location: 1:23952 Links: 1 Storage: <details removed for portability> Type: 32-bit little-endian integer diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 8b62d38..fb44eb4 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -2351,7 +2351,7 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } - status = H5Lcreate_external("no_file1.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); + status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); @@ -2384,7 +2384,7 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } - status = H5Lcreate_external("no_file2.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); + status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index ef472bb..be6a28e 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -320,11 +320,9 @@ COPY_TESTFILES_TO_TESTDIR() echo $tstfile | tr -d ' ' | grep '^#' > /dev/null RET=$? if [ $RET -eq 1 ]; then - if [ -a $tstfile ]; then - $CP -f $tstfile $TESTDIR - else + $CP -f $tstfile $TESTDIR + if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - echo " $tstfile doesn't exist!" # Comment out this to CREATE expected file exit $EXIT_FAILURE @@ -829,9 +827,10 @@ TOOLTEST h5diff_221.txt -c non_comparables1.h5 non_comparables2.h5 /g2 # entire file # All the comparables should display differences. -if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then +if test -n "$pmode"; then # parallel mode: - # skip due to ph5diff hangs on koala (linux64-LE) randomly. + # skip due to ph5diff hangs on koala (linux64-LE) and ember intermittently. + # (HDFFV-8003 - TBD) SKIP -c non_comparables1.h5 non_comparables2.h5 else TOOLTEST h5diff_222.txt -c non_comparables1.h5 non_comparables2.h5 diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 3bc481d..cf442d4 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -43,362 +43,420 @@ IF (BUILD_TESTING) # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- SET (HDF5_REFERENCE_FILES - charsets.ddl - file_space.ddl - filter_fail.ddl - packedbits.ddl - tall-1.ddl - tall-2.ddl - tall-2A.ddl - tall-2B.ddl - tall-3.ddl - tall-4s.ddl - tall-5s.ddl - tall-6.ddl - tallfilters.ddl - tarray1.ddl - tarray1_big.ddl - tarray2.ddl - tarray3.ddl - tarray4.ddl - tarray5.ddl - tarray6.ddl - tarray7.ddl - tarray8.ddl - tattr-1.ddl - tattrintsize.ddl - tattr-2.ddl - tattr-3.ddl - tattr-4_be.ddl - tattrreg.ddl - tattrregR.ddl - tbin1.ddl - tbin1.ddl - tbin2.ddl - tbin3.ddl - tbin4.ddl - tbinregR.ddl - tbigdims.ddl - tboot1.ddl - tboot2.ddl - tchar1.ddl - tchunked.ddl - tcmpdattrintsize.ddl - tcmpdintsize.ddl - tcomp-1.ddl - tcomp-2.ddl - tcomp-3.ddl - tcomp-4.ddl - tcompact.ddl - tcontents.ddl - tcontiguos.ddl - tdatareg.ddl - tdataregR.ddl - tdeflate.ddl - tdset-1.ddl - tdset-2.ddl - tdset-3s.ddl - tempty.ddl - texceedsubstart.ddl - texceedsubcount.ddl - texceedsubstride.ddl - texceedsubblock.ddl - texternal.ddl - textlinksrc.ddl - textlinkfar.ddl - textlink.ddl - tfamily.ddl - tfill.ddl - tfletcher32.ddl - tfpformat.ddl - tgroup-1.ddl - tgroup-2.ddl - tgrp_comments.ddl - thlink-1.ddl - thlink-2.ddl - thlink-3.ddl - thlink-4.ddl - thlink-5.ddl - thyperslab.ddl - tindicesno.ddl - tindicessub1.ddl - tindicessub2.ddl - tindicessub3.ddl - tindicessub4.ddl - tindicesyes.ddl - tlarge_objname.ddl - #tldouble.ddl - tlonglinks.ddl - tloop-1.ddl - tmulti.ddl - tmultifile.ddl -# tqmarkfile.ddl -# tstarfile.ddl - tnamed_dtype_attr.ddl - tnestcomp-1.ddl - tnbit.ddl - tno-subset.ddl - tnullspace.ddl - zerodim.ddl - tordergr1.ddl - tordergr2.ddl - tordergr3.ddl - tordergr4.ddl - tordergr5.ddl - torderattr1.ddl - torderattr2.ddl - torderattr3.ddl - torderattr4.ddl - tperror.ddl - treference.ddl - tsaf.ddl - tscaleoffset.ddl - tshuffle.ddl - tslink-1.ddl - tslink-2.ddl - tslink-D.ddl - tsplit_file.ddl - tstr-1.ddl - tstr-2.ddl - tstring.ddl - tstring2.ddl - tstringe.ddl - tszip.ddl - tudlink-1.ddl - tudlink-2.ddl - tuserfilter.ddl - tvldtypes1.ddl - tvldtypes2.ddl - tvldtypes3.ddl - tvldtypes4.ddl - tvldtypes5.ddl - tvlstr.ddl - tvms.ddl - h5dump-help.txt - out3.h5import - ) - SET (HDF5_XML_REFERENCE_FILES - tall.h5.xml - tall-2A.h5.xml - tarray1.h5.xml - tarray2.h5.xml - tarray3.h5.xml - tarray6.h5.xml - tarray7.h5.xml - tattr.h5.xml - tbitfields.h5.xml - tcompound_complex.h5.xml - tcompound.h5.xml - tcompound2.h5.xml - tdatareg.h5.xml - tdset.h5.xml - tdset2.h5.xml - tempty.h5.xml - tempty-dtd.h5.xml - tempty-dtd-2.h5.xml - tempty-dtd-uri.h5.xml - tempty-nons.h5.xml - tempty-nons-2.h5.xml - tempty-nons-uri.h5.xml - tempty-ns.h5.xml - tempty-ns-2.h5.xml - tenum.h5.xml - textlink.h5.xml - tfpformat.h5.xml - tgroup.h5.xml - thlink.h5.xml - tloop.h5.xml - tloop2.h5.xml - tmany.h5.xml - tname-amp.h5.xml - tname-apos.h5.xml - tnamed_dtype_attr.h5.xml - tname-gt.h5.xml - tname-lt.h5.xml - tname-quot.h5.xml - tname-sp.h5.xml - tnestedcomp.h5.xml - tnodata.h5.xml - tobjref.h5.xml - topaque.h5.xml - torderattr1.h5.xml - torderattr2.h5.xml - torderattr3.h5.xml - torderattr4.h5.xml - tref.h5.xml - tref-escapes.h5.xml - tref-escapes-at.h5.xml - tsaf.h5.xml - tslink.h5.xml - tstr.h5.xml - tstr2.h5.xml - tstring.h5.xml - tstring-at.h5.xml - tudlink.h5.xml - tvldtypes1.h5.xml - tvldtypes2.h5.xml - tvldtypes3.h5.xml - tvldtypes4.h5.xml - tvldtypes5.h5.xml - tvlstr.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2B.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-5s.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-6.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tallfilters.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1_big.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray5.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-4_be.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrcontents1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrcontents2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrregR.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbigdims.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tboot1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tboot2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tchar1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tchunked.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompact.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcontents.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcontiguos.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregR.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdeflate.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-3s.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubstart.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubcount.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubstride.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubblock.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texternal.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinkfar.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfill.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfletcher32.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.ddl + ${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/thlink-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-5.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicesno.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicesyes.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.ddl + #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlonglinks.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ddl + #${HDF5_TOOLS_SRC_DIR}/testfiles/tqmarkfile.ddl + #${HDF5_TOOLS_SRC_DIR}/testfiles/tstarfile.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcmpddt.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnbit.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr5.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordercontents1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordercontents2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderlinks1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderlinks2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tperror.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/treference.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscaleoffset.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tshuffle.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-D.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstringe.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tszip.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tuserfilter.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/twidedisplay.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/h5dump-help.txt + ${HDF5_TOOLS_SRC_DIR}/testfiles/out3.h5import ) SET (HDF5_REFERENCE_TEST_FILES - charsets.h5 - file_space.h5 - filter_fail.h5 - packedbits.h5 - taindices.h5 - tall.h5 - tarray1.h5 - tarray1_big.h5 - tarray2.h5 - tarray3.h5 - tarray4.h5 - tarray5.h5 - tarray6.h5 - tarray7.h5 - tarray8.h5 - tattr.h5 - tattr2.h5 - tattr4_be.h5 - tattrintsize.h5 - tattrreg.h5 - tbigdims.h5 - tbinary.h5 - tchar.h5 - tcmpdattrintsize.h5 - tcmpdintsize.h5 - tcompound.h5 - tcompound_complex.h5 - tdatareg.h5 - tdset.h5 - tempty.h5 - tsoftlinks.h5 - textlinkfar.h5 - textlinksrc.h5 - textlinktar.h5 - textlink.h5 - tfamily00000.h5 - tfamily00001.h5 - tfamily00002.h5 - tfamily00003.h5 - tfamily00004.h5 - tfamily00005.h5 - tfamily00006.h5 - tfamily00007.h5 - tfamily00008.h5 - tfamily00009.h5 - tfamily00010.h5 - tfcontents1.h5 - tfcontents2.h5 - tfilters.h5 - tfpformat.h5 - tfvalues.h5 - tgroup.h5 - tgrp_comments.h5 - thlink.h5 - thyperslab.h5 - tlarge_objname.h5 - #tldouble.h5 - tlonglinks.h5 - tloop.h5 - tmulti-b.h5 - tmulti-g.h5 - tmulti-l.h5 - tmulti-o.h5 - tmulti-r.h5 - tmulti-s.h5 - tnamed_dtype_attr.h5 - tnestedcomp.h5 - tno-subset.h5 - tnullspace.h5 - zerodim.h5 - torderattr.h5 - tordergr.h5 - tsaf.h5 - tslink.h5 - tsplit_file-m.h5 - tsplit_file-r.h5 - tstr.h5 - tstr2.h5 - tstr3.h5 - tudlink.h5 - tvldtypes1.h5 - tvldtypes2.h5 - tvldtypes3.h5 - tvldtypes4.h5 - tvldtypes5.h5 - tvlstr.h5 - tvms.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/taindices.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1_big.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray4.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray5.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray8.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr4_be.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbigdims.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinary.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tchar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound_complex.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinkfar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00000.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00001.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00002.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00003.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00004.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00005.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00006.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00007.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00008.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00009.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfcontents1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfcontents2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfilters.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5 + ${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/thlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.h5 + #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlonglinks.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-b.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-g.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-l.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-o.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-r.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-s.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcmpddt.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file-m.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file-r.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr3.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.h5 ) - SET (HDF5_XML_REFERENCE_TEST_FILES - tbitfields.h5 - tcompound2.h5 - tdset2.h5 - tenum.h5 - textlink.h5 - tloop2.h5 - tmany.h5 - tname-amp.h5 - tname-apos.h5 - tname-gt.h5 - tname-lt.h5 - tname-quot.h5 - tname-sp.h5 - tnodata.h5 - tobjref.h5 - topaque.h5 - tref.h5 - tref-escapes.h5 - tref-escapes-at.h5 - tstring.h5 - tstring-at.h5 + SET (HDF5_ERROR_REFERENCE_TEST_FILES + ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2B.err + ${PROJECT_SOURCE_DIR}/errfiles/tarray1_big.err + ${PROJECT_SOURCE_DIR}/errfiles/tattrregR.err + ${PROJECT_SOURCE_DIR}/errfiles/tattr-3.err + ${PROJECT_SOURCE_DIR}/errfiles/tcomp-3.err + ${PROJECT_SOURCE_DIR}/errfiles/tdataregR.err + ${PROJECT_SOURCE_DIR}/errfiles/tdset-2.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubblock.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubcount.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubstart.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubstride.err + ${PROJECT_SOURCE_DIR}/errfiles/textlink.err + ${PROJECT_SOURCE_DIR}/errfiles/textlinkfar.err + ${PROJECT_SOURCE_DIR}/errfiles/textlinksrc.err + ${PROJECT_SOURCE_DIR}/errfiles/torderlinks1.err + ${PROJECT_SOURCE_DIR}/errfiles/torderlinks2.err + ${PROJECT_SOURCE_DIR}/errfiles/tgroup-2.err + ${PROJECT_SOURCE_DIR}/errfiles/tperror.err + ${PROJECT_SOURCE_DIR}/errfiles/tslink-D.err ) - FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) - SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Copying ${ddl_file}") + # make test dir + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + + # + # copy test files from source dir to test dir + # + FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${tst_h5_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_file} ${ddldest} + ARGS -E copy_if_different ${tst_h5_file} ${dest} ) - ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + ENDFOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (xml_file ${HDF5_XML_REFERENCE_FILES}) - SET (xmldest "${PROJECT_BINARY_DIR}/${xml_file}") - #MESSAGE (STATUS " Copying ${xml_file}") + FOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_other_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${tst_other_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${xml_file} ${xmldest} + ARGS -E copy_if_different ${tst_other_file} ${dest} ) - ENDFOREACH (xml_file ${HDF5_XML_REFERENCE_FILES}) + ENDFOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") + FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${tst_error_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} + ARGS -E copy_if_different ${tst_error_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + ENDFOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) - FOREACH (h5_xml_file ${HDF5_XML_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_xml_file}") - #MESSAGE (STATUS " Copying ${h5_xml_file}") + # + # copy XML test files from source dir to test dir + # + SET (HDF5_XML_REFERENCE_TEST_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbitfields.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tenum.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmany.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-amp.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-apos.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-gt.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-lt.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-quot.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-sp.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes-at.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring-at.h5 + ) + SET (HDF5_XML_REFERENCE_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbitfields.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound_complex.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd-2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd-uri.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons-2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons-uri.h5.xml + ${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/textlink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmany.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-amp.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-apos.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-gt.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-lt.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-quot.h5.xml + ${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/tobjref.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr3.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr4.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes-at.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring-at.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5.xml + ) + + FOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_xml_h5_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${tst_xml_h5_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_xml_file} ${dest} + ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} ) - ENDFOREACH (h5_xml_file ${HDF5_XML_REFERENCE_TEST_FILES}) + ENDFOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${tst_xml_other_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${tst_xml_other_file} ${dest} + ) + ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + # -------------------------------------------------------------------- # Special file handling # -------------------------------------------------------------------- @@ -406,18 +464,18 @@ IF (BUILD_TESTING) TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/tbin1LE.ddl + ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/tbin1LE.ddl ) IF (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) - FILE (WRITE ${PROJECT_BINARY_DIR}/tbinregR.exp "${TEST_STREAM}") + FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/tbinregR.exp "${TEST_STREAM}") ELSE (WIN32 AND NOT CYGWIN) ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/tbinregR.exp + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/tbinregR.exp ) ENDIF (WIN32 AND NOT CYGWIN) @@ -426,71 +484,99 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory SET (HDF5_REFERENCE_PBITS - tnofilename-with-packed-bits.ddl - tpbitsArray.ddl - tpbitsCompound.ddl - tpbitsIncomplete.ddl - tpbitsLengthExceeded.ddl - tpbitsCharLengthExceeded.ddl - tpbitsIntLengthExceeded.ddl - tpbitsLongLengthExceeded.ddl - tpbitsLengthPositive.ddl - tpbitsMax.ddl - tpbitsMaxExceeded.ddl - tpbitsOffsetExceeded.ddl - tpbitsCharOffsetExceeded.ddl - tpbitsIntOffsetExceeded.ddl - tpbitsLongOffsetExceeded.ddl - tpbitsOffsetNegative.ddl - tpbitsOverlapped.ddl - tpbitsSigned.ddl - tpbitsUnsigned.ddl - tpbitsSignedInt.ddl - tpbitsUnsignedInt.ddl - tpbitsSignedLong.ddl - tpbitsUnsignedLong.ddl - tpbitsSignedLongLong.ddl - tpbitsUnsignedLongLong.ddl - tpbitsSignedWhole.ddl - tpbitsUnsignedWhole.ddl - tpbitsSignedIntWhole.ddl - tpbitsUnsignedIntWhole.ddl - tpbitsSignedLongWhole.ddl - tpbitsUnsignedLongWhole.ddl - tpbitsSignedLongLongWhole.ddl - tpbitsUnsignedLongLongWhole.ddl - tpbitsSignedLongLongWhole1.ddl - tpbitsUnsignedLongLongWhole1.ddl - tpbitsSignedLongLongWhole63.ddl - tpbitsUnsignedLongLongWhole63.ddl - tpbitsSigned4.ddl - tpbitsUnsigned4.ddl - tpbitsSignedInt8.ddl - tpbitsUnsignedInt8.ddl - tpbitsSignedLong16.ddl - tpbitsUnsignedLong16.ddl - tpbitsSignedLongLong32.ddl - tpbitsUnsignedLongLong32.ddl - tpbitsSigned2.ddl - tpbitsUnsigned2.ddl - tpbitsSignedInt4.ddl - tpbitsUnsignedInt4.ddl - tpbitsSignedLong8.ddl - tpbitsUnsignedLong8.ddl - tpbitsSignedLongLong16.ddl - tpbitsUnsignedLongLong16.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIncomplete.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthPositive.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMax.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMaxExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetNegative.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOverlapped.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedIntWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedIntWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole63.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole63.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong16.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong16.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong32.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong32.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl + ) + SET (HDF5_ERROR_REFERENCE_PBITS + ${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIncomplete.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntLengthExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntOffsetExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthPositive.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongLengthExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongOffsetExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsMaxExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err ) FOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) - SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_pbits}") - #MESSAGE (STATUS " Translating ${ddl_pbits}") + GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) + SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${ddl_pbits}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_pbits} ${ddldest} + ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + + FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) + SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${ddl_pbits}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${ddl_pbits} ${ddldest} + ) + ENDFOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) ############################################################################## ############################################################################## @@ -502,6 +588,7 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -512,12 +599,13 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove h5dump-${testname}.out h5dump-${testname}.out.err ) + SET_TESTS_PROPERTIES (H5DUMP-clear-h5dump-${testname}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") ADD_TEST ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=h5dump-${testname}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=h5dump-${testname}.txt" @@ -544,6 +632,7 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") @@ -557,12 +646,13 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) + SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.ddl" @@ -575,8 +665,9 @@ IF (BUILD_TESTING) MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) ADD_TEST ( NAME H5DUMP-output-${resultfile} - COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${targetfile} + COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile}.txt ${PROJECT_BINARY_DIR}/testfiles/${targetfile} ) + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -585,7 +676,7 @@ IF (BUILD_TESTING) ADD_TEST ( NAME H5DUMP-output-cmp-${resultfile} COMMAND ${CMAKE_COMMAND} - -E compare_files ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${resultfile}.exp + -E compare_files ${PROJECT_BINARY_DIR}/testfiles/${resultfile}.txt ${PROJECT_BINARY_DIR}/testfiles/${resultfile}.exp ) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS ${last_test}) @@ -601,12 +692,13 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) + SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.ddl" @@ -617,6 +709,31 @@ IF (BUILD_TESTING) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) + MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5ERR_MASK_TEST file) + MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) IF (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -633,6 +750,7 @@ IF (BUILD_TESTING) MACRO (ADD_XML_H5_TEST resultfile resultcode) IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN}) + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") @@ -646,12 +764,13 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) + SET_TESTS_PROPERTIES (H5DUMP-XML-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") ADD_TEST ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" -D "TEST_ARGS:STRING=--xml;${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.xml" @@ -673,7 +792,7 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### ############################################################################## ############################################################################## @@ -736,6 +855,10 @@ IF (BUILD_TESTING) tattr-3.out.err tattr-4_be.out tattr-4_be.out.err + tattrcontents1.out + tattrcontents1.out.err + tattrcontents2.out + tattrcontents2.out.err tattrintsize.out tattrintsize.out.err tattrreg.out @@ -860,6 +983,8 @@ IF (BUILD_TESTING) tnamed_dtype_attr.out.err tnestcomp-1.out tnestcomp-1.out.err + tnestedcmpddt.out + tnestedcmpddt.out.err tnbit.out tnbit.out.err tno-subset.out @@ -886,6 +1011,14 @@ IF (BUILD_TESTING) torderattr3.out.err torderattr4.out torderattr4.out.err + tordercontents1.out + tordercontents1.out.err + tordercontents2.out + tordercontents2.out.err + torderlinks1.out + torderlinks1.out.err + torderlinks2.out + torderlinks2.out.err tperror.out tperror.out.err treference.out @@ -936,7 +1069,10 @@ IF (BUILD_TESTING) tvlstr.out.err tvms.out tvms.out.err + twidedisplay.out + twidedisplay.out.err ) + SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -945,6 +1081,9 @@ IF (BUILD_TESTING) ADD_HELP_TEST(help 0 -h) + # test for maximum display datasets + ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5) + # test for signed/unsigned datasets ADD_H5_TEST (packedbits 0 --enable-error-stack packedbits.h5) # test for compound signed/unsigned datasets @@ -956,21 +1095,19 @@ IF (BUILD_TESTING) # test for displaying groups ADD_H5_TEST (tgroup-1 0 --enable-error-stack tgroup.h5) # test for displaying the selected groups - # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5) - # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group names are similar to version numbers - ADD_H5_TEST (tgroup-2 1 --group=/g2 --group / -g /y tgroup.h5) + ADD_H5ERR_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5) # test for displaying simple space datasets ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5) # test for displaying selected datasets - ADD_H5_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) + ADD_H5ERR_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) # test for displaying attributes ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) # test for displaying the selected attributes of string type and scalar space ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) # test for header and error messages - ADD_H5_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) + ADD_H5ERR_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) # test for displaying attributes in shared datatype (also in group and dataset) ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5) # test for displaying at least 9 attributes on root from a be machine @@ -983,7 +1120,7 @@ IF (BUILD_TESTING) ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5) ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5) # test for displaying dangling soft links - ADD_H5_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5) + ADD_H5ERR_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5) # tests for hard links ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5) @@ -997,18 +1134,16 @@ IF (BUILD_TESTING) # test for named data types ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) # test for unamed type - # JIRA HDFFV-7936 ADD_H5_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5") - ADD_H5_TEST (tcomp-3 0 "-t;/#6632;-g;/group2;tcompound.h5") + ADD_H5ERR_MASK_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5") # test complicated compound datatype ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) #test for the nested compound type ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5) + ADD_H5_TEST (tnestedcmpddt 0 --enable-error-stack tnestedcmpddt.h5) # test for options - # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-1 0 --enable-error-stack tall.h5) - # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers - ADD_H5_TEST (tall-1 0 tall.h5) + ADD_H5ERR_MASK_TEST (tall-1 0 --enable-error-stack tall.h5) ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5) ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) @@ -1035,8 +1170,7 @@ IF (BUILD_TESTING) # test for files with array data ADD_H5_TEST (tarray1 0 --enable-error-stack tarray1.h5) # # added for bug# 2092 - tarray1_big.h5 - # JIRA HDFFV-7936 ADD_H5_TEST (tarray1_big 0 --enable-error-stack -R tarray1_big.h5) - ADD_H5_TEST (tarray1_big 0 -R tarray1_big.h5) + ADD_H5ERR_MASK_TEST (tarray1_big 0 --enable-error-stack -R tarray1_big.h5) ADD_H5_TEST (tarray2 0 --enable-error-stack tarray2.h5) ADD_H5_TEST (tarray3 0 --enable-error-stack tarray3.h5) ADD_H5_TEST (tarray4 0 --enable-error-stack tarray4.h5) @@ -1065,13 +1199,10 @@ IF (BUILD_TESTING) ADD_H5_TEST (tlarge_objname 0 --enable-error-stack -w157 tlarge_objname.h5) # test '-A' to suppress data but print attr's - # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) - # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers - ADD_H5_TEST (tall-2A 0 -A tall.h5) + ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) # test '-r' to print attributes in ASCII instead of decimal - # JIRA HDFFV-7936 ADD_H5_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) - ADD_H5_TEST (tall-2B 0 -A -r tall.h5) + ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) # test Subsetting ADD_H5_TEST (tall-4s 0 --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5) @@ -1092,10 +1223,14 @@ IF (BUILD_TESTING) ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5) # test -p with a non existing dataset - ADD_H5_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5) + ADD_H5ERR_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5) # test for file contents ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5) + ADD_H5_TEST (tordercontents1 0 --enable-error-stack -n --sort_by=name --sort_order=ascending tfcontents1.h5) + ADD_H5_TEST (tordercontents2 0 --enable-error-stack -n --sort_by=name --sort_order=descending tfcontents1.h5) + ADD_H5_TEST (tattrcontents1 0 --enable-error-stack -n 1 --sort_order=ascending tall.h5) + ADD_H5_TEST (tattrcontents2 0 --enable-error-stack -n 1 --sort_order=descending tall.h5) # tests for storage layout # compact @@ -1221,20 +1356,32 @@ IF (BUILD_TESTING) # NATIVE default. the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST (tbin1 0 --enable-error-stack -d integer -o out1.bin -b tbinary.h5) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-tbin1") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-tbin1") + ADD_TEST (NAME H5DUMP-clear-out1D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out1D.h5) + SET_TESTS_PROPERTIES (H5DUMP-clear-out1D PROPERTIES DEPENDS H5DUMP-tbin1) + ADD_TEST (NAME H5DUMP-h5import-out1D COMMAND h5import out1.bin -c tbin1.out -o out1D.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES DEPENDS H5DUMP-clear-out1D) + ADD_TEST (NAME H5DUMP-h5diff-out1D COMMAND h5diff tbinary.h5 out1D.h5 /integer /integer) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES DEPENDS H5DUMP-h5import-out1D) + SET (last_test "H5DUMP-h5diff-out1D") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove out1.h5) + ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out1.h5) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES DEPENDS H5DUMP-clear-out1) ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1) SET (last_test "H5DUMP-h5diff-out1") @@ -1248,20 +1395,32 @@ IF (BUILD_TESTING) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST (tbin3 0 --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-tbin3") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-tbin3") + ADD_TEST (NAME H5DUMP-clear-out3D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out3D.h5) + SET_TESTS_PROPERTIES (H5DUMP-clear-out3D PROPERTIES DEPENDS H5DUMP-tbin3) + ADD_TEST (NAME H5DUMP-h5import-out3D COMMAND h5import out3.bin -c tbin3.out -o out3D.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES DEPENDS H5DUMP-clear-out3D) + ADD_TEST (NAME H5DUMP-h5diff-out3D COMMAND h5diff tbinary.h5 out3D.h5 /integer /integer -q) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES DEPENDS H5DUMP-h5import-out3D) + SET (last_test "H5DUMP-h5diff-out3D") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove out3.h5) + ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out3.h5) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-clear-out3 PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) + SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3) ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) + SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3) SET (last_test "H5DUMP-h5diff-out3") @@ -1287,19 +1446,17 @@ IF (BUILD_TESTING) out1.h5 out3.h5 ) + SET_TESTS_PROPERTIES (H5DUMP-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clear-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-clear-objects") ENDIF (NOT HDF5_NOCLEANUP) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clear-objects") # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) - # JIRA HDFFV-7936 ADD_H5_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) - ADD_H5_TEST (tdataregR 0 -R tdatareg.h5) - ADD_H5_TEST (tattrreg 0 --enable-error-stack tattrreg.h5) - # JIRA HDFFV-7936 ADD_H5_TEST (tattrregR 0 --enable-error-stack -R tattrreg.h5) - ADD_H5_TEST (tattrregR 0 -R tattrreg.h5) + ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) + ADD_H5ERR_MASK_TEST (tattrregR 0 -R --enable-error-stack tattrreg.h5) ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 --enable-error-stack -d /Dataset1 -s 0 -R -y -o) # tests for group creation order @@ -1316,20 +1473,22 @@ IF (BUILD_TESTING) ADD_H5_TEST (torderattr3 0 --enable-error-stack -H --sort_by=creation_order --sort_order=ascending torderattr.h5) ADD_H5_TEST (torderattr4 0 --enable-error-stack -H --sort_by=creation_order --sort_order=descending torderattr.h5) + # tests for link references and order + ADD_H5ERR_MASK_TEST (torderlinks1 0 --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5) + ADD_H5ERR_MASK_TEST (torderlinks2 0 --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5) + # tests for floating point user defined printf format ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5) # tests for traversal of external links - # JIRA HDFFV-7936 ADD_H5_TEST (textlinksrc 0 --enable-error-stack textlinksrc.h5) - ADD_H5_TEST (textlinksrc 0 textlinksrc.h5) - # JIRA HDFFV-7936 ADD_H5_TEST (textlinkfar 0 --enable-error-stack textlinkfar.h5) - ADD_H5_TEST (textlinkfar 0 textlinkfar.h5) + ADD_H5ERR_MASK_TEST (textlinksrc 0 --enable-error-stack textlinksrc.h5) + ADD_H5ERR_MASK_TEST (textlinkfar 0 --enable-error-stack textlinkfar.h5) # test for dangling external links - ADD_H5_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) + ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) # test for error stack display (BZ2048) - ADD_H5_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) + ADD_H5ERR_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) # test for -o -y for dataset with attributes ADD_H5_TEST (tall-6 0 --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5) @@ -1448,6 +1607,7 @@ IF (BUILD_TESTING) tpbitsUnsignedLongLong16.out tpbitsUnsignedLongLong16.out.err ) + SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -1668,6 +1828,7 @@ IF (BUILD_TESTING) tvlstr.h5.out tvlstr.h5.out.err ) + SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 38864f5..f80d12e 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -46,6 +46,6 @@ h5dump_SOURCES=h5dump.c h5dump_ddl.c h5dump_xml.c # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin -DISTCLEANFILES=testh5dump.sh +DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh include $(top_srcdir)/config/conclude.am diff --git a/tools/h5dump/errfiles/filter_fail.err b/tools/h5dump/errfiles/filter_fail.err new file mode 100644 index 0000000..8f0f990 --- /dev/null +++ b/tools/h5dump/errfiles/filter_fail.err @@ -0,0 +1,21 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dread(): can't read data + major: Dataset + minor: Read failed + #001: (file name) line (number) in H5D__read(): can't read data + major: Dataset + minor: Read failed + #002: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk + major: Low-level I/O + minor: Read failed + #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed + major: Data filters + minor: Filter operation failed + #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered + major: Data filters + minor: Read failed +h5dump error: unable to print data +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5tools_dump_simple_dset(): H5Dread failed + major: Failure in tools library + minor: error in function diff --git a/tools/h5dump/errfiles/tall-1.err b/tools/h5dump/errfiles/tall-1.err new file mode 100644 index 0000000..ba691d0 --- /dev/null +++ b/tools/h5dump/errfiles/tall-1.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/errfiles/tall-2A.err b/tools/h5dump/errfiles/tall-2A.err new file mode 100644 index 0000000..ba691d0 --- /dev/null +++ b/tools/h5dump/errfiles/tall-2A.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/errfiles/tall-2B.err b/tools/h5dump/errfiles/tall-2B.err new file mode 100644 index 0000000..ba691d0 --- /dev/null +++ b/tools/h5dump/errfiles/tall-2B.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/errfiles/tarray1_big.err b/tools/h5dump/errfiles/tarray1_big.err new file mode 100644 index 0000000..457afdd --- /dev/null +++ b/tools/h5dump/errfiles/tarray1_big.err @@ -0,0 +1,67 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Rdereference2(): unable to dereference object + major: References + minor: Unable to initialize object + #001: (file name) line (number) in H5R_dereference(): Unable to read dataset region information + major: References + minor: Read failed + #002: (file name) line (number) in H5HG_read(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #003: (file name) line (number) in H5HG_protect(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #004: (file name) line (number) in H5AC_protect(): H5C_protect() failed. + major: Object cache + minor: Unable to protect metadata + #005: (file name) line (number) in H5C_protect(): incorrect cache entry type + major: Object cache + minor: Inappropriate type +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Rdereference2(): unable to dereference object + major: References + minor: Unable to initialize object + #001: (file name) line (number) in H5R_dereference(): Unable to read dataset region information + major: References + minor: Read failed + #002: (file name) line (number) in H5HG_read(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #003: (file name) line (number) in H5HG_protect(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #004: (file name) line (number) in H5AC_protect(): H5C_protect() failed. + major: Object cache + minor: Unable to protect metadata + #005: (file name) line (number) in H5C_protect(): incorrect cache entry type + major: Object cache + minor: Inappropriate type +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Rdereference2(): unable to dereference object + major: References + minor: Unable to initialize object + #001: (file name) line (number) in H5R_dereference(): Unable to read dataset region information + major: References + minor: Read failed + #002: (file name) line (number) in H5HG_read(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #003: (file name) line (number) in H5HG_protect(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #004: (file name) line (number) in H5AC_protect(): H5C_protect() failed. + major: Object cache + minor: Unable to protect metadata + #005: (file name) line (number) in H5C_protect(): incorrect cache entry type + major: Object cache + minor: Inappropriate type +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed + major: Failure in tools library + minor: error in function + #001: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed + major: Failure in tools library + minor: error in function + #002: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed + major: Failure in tools library + minor: error in function diff --git a/tools/h5dump/errfiles/tattr-3.err b/tools/h5dump/errfiles/tattr-3.err new file mode 100644 index 0000000..ce8ddda --- /dev/null +++ b/tools/h5dump/errfiles/tattr-3.err @@ -0,0 +1,8 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Aopen(): unable to load attribute info from object header for attribute: 'attr' + major: Attribute + minor: Unable to initialize object + #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr' + major: Attribute + minor: Object not found +h5dump error: unable to open attribute "attr" diff --git a/tools/h5dump/errfiles/tattrregR.err b/tools/h5dump/errfiles/tattrregR.err new file mode 100644 index 0000000..7ab9afd --- /dev/null +++ b/tools/h5dump/errfiles/tattrregR.err @@ -0,0 +1,45 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Rdereference2(): unable to dereference object + major: References + minor: Unable to initialize object + #001: (file name) line (number) in H5R_dereference(): Unable to read dataset region information + major: References + minor: Read failed + #002: (file name) line (number) in H5HG_read(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #003: (file name) line (number) in H5HG_protect(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #004: (file name) line (number) in H5AC_protect(): H5C_protect() failed. + major: Object cache + minor: Unable to protect metadata + #005: (file name) line (number) in H5C_protect(): incorrect cache entry type + major: Object cache + minor: Inappropriate type +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Rdereference2(): unable to dereference object + major: References + minor: Unable to initialize object + #001: (file name) line (number) in H5R_dereference(): Unable to read dataset region information + major: References + minor: Read failed + #002: (file name) line (number) in H5HG_read(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #003: (file name) line (number) in H5HG_protect(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #004: (file name) line (number) in H5AC_protect(): H5C_protect() failed. + major: Object cache + minor: Unable to protect metadata + #005: (file name) line (number) in H5C_protect(): incorrect cache entry type + major: Object cache + minor: Inappropriate type +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed + major: Failure in tools library + minor: error in function + #001: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed + major: Failure in tools library + minor: error in function diff --git a/tools/h5dump/errfiles/tcomp-3.err b/tools/h5dump/errfiles/tcomp-3.err new file mode 100644 index 0000000..ee47ee5 --- /dev/null +++ b/tools/h5dump/errfiles/tcomp-3.err @@ -0,0 +1,16 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Topen2(): not found + major: Datatype + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object '#6632' doesn't exist + major: Symbol table + minor: Object not found diff --git a/tools/h5dump/errfiles/tdataregR.err b/tools/h5dump/errfiles/tdataregR.err new file mode 100644 index 0000000..7ab9afd --- /dev/null +++ b/tools/h5dump/errfiles/tdataregR.err @@ -0,0 +1,45 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Rdereference2(): unable to dereference object + major: References + minor: Unable to initialize object + #001: (file name) line (number) in H5R_dereference(): Unable to read dataset region information + major: References + minor: Read failed + #002: (file name) line (number) in H5HG_read(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #003: (file name) line (number) in H5HG_protect(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #004: (file name) line (number) in H5AC_protect(): H5C_protect() failed. + major: Object cache + minor: Unable to protect metadata + #005: (file name) line (number) in H5C_protect(): incorrect cache entry type + major: Object cache + minor: Inappropriate type +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Rdereference2(): unable to dereference object + major: References + minor: Unable to initialize object + #001: (file name) line (number) in H5R_dereference(): Unable to read dataset region information + major: References + minor: Read failed + #002: (file name) line (number) in H5HG_read(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #003: (file name) line (number) in H5HG_protect(): unable to protect global heap + major: Heap + minor: Unable to protect metadata + #004: (file name) line (number) in H5AC_protect(): H5C_protect() failed. + major: Object cache + minor: Unable to protect metadata + #005: (file name) line (number) in H5C_protect(): incorrect cache entry type + major: Object cache + minor: Inappropriate type +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed + major: Failure in tools library + minor: error in function + #001: (file name) line (number) in h5tools_dump_simple_data(): H5Rdereference failed + major: Failure in tools library + minor: error in function diff --git a/tools/h5dump/errfiles/tdset-2.err b/tools/h5dump/errfiles/tdset-2.err new file mode 100644 index 0000000..d9b92f3 --- /dev/null +++ b/tools/h5dump/errfiles/tdset-2.err @@ -0,0 +1,33 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "dset3" diff --git a/tools/h5dump/errfiles/texceedsubblock.err b/tools/h5dump/errfiles/texceedsubblock.err new file mode 100644 index 0000000..4c87ab9 --- /dev/null +++ b/tools/h5dump/errfiles/texceedsubblock.err @@ -0,0 +1 @@ +h5dump error: number of block dims (2) exceed dataset dims (1) diff --git a/tools/h5dump/errfiles/texceedsubcount.err b/tools/h5dump/errfiles/texceedsubcount.err new file mode 100644 index 0000000..de1c9d1 --- /dev/null +++ b/tools/h5dump/errfiles/texceedsubcount.err @@ -0,0 +1 @@ +h5dump error: number of count dims (2) exceed dataset dims (1) diff --git a/tools/h5dump/errfiles/texceedsubstart.err b/tools/h5dump/errfiles/texceedsubstart.err new file mode 100644 index 0000000..4555224 --- /dev/null +++ b/tools/h5dump/errfiles/texceedsubstart.err @@ -0,0 +1 @@ +h5dump error: number of start dims (2) exceed dataset dims (1) diff --git a/tools/h5dump/errfiles/texceedsubstride.err b/tools/h5dump/errfiles/texceedsubstride.err new file mode 100644 index 0000000..32d5725 --- /dev/null +++ b/tools/h5dump/errfiles/texceedsubstride.err @@ -0,0 +1 @@ +h5dump error: number of stride dims (2) exceed dataset dims (1) diff --git a/tools/h5dump/errfiles/textlink.err b/tools/h5dump/errfiles/textlink.err new file mode 100644 index 0000000..03c0550 --- /dev/null +++ b/tools/h5dump/errfiles/textlink.err @@ -0,0 +1,50 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' + major: Links + minor: Unable to open file +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/errfiles/textlinkfar.err b/tools/h5dump/errfiles/textlinkfar.err new file mode 100644 index 0000000..969e17c --- /dev/null +++ b/tools/h5dump/errfiles/textlinkfar.err @@ -0,0 +1,243 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #008: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #009: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #010: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #011: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + major: Links + minor: Link traversal failure + #013: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + major: Symbol table + minor: Object not found + #014: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #015: (file name) line (number) in H5G_traverse_slink_cb(): component not found + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #005: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #006: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #007: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #008: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #012: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #013: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #014: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #015: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #019: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #020: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #021: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #022: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #026: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #027: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #028: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #029: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #031: (file name) line (number) in H5G__traverse_special(): too many links + major: Links + minor: Too many soft links in path +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #005: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #006: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #007: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #008: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #012: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #013: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #014: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #015: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #019: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #020: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #021: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #022: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #026: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #027: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #028: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #029: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #031: (file name) line (number) in H5G__traverse_special(): too many links + major: Links + minor: Too many soft links in path diff --git a/tools/h5dump/errfiles/textlinksrc.err b/tools/h5dump/errfiles/textlinksrc.err new file mode 100644 index 0000000..969e17c --- /dev/null +++ b/tools/h5dump/errfiles/textlinksrc.err @@ -0,0 +1,243 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #008: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #009: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #010: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #011: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + major: Links + minor: Link traversal failure + #013: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + major: Symbol table + minor: Object not found + #014: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #015: (file name) line (number) in H5G_traverse_slink_cb(): component not found + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #005: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #006: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #007: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #008: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #012: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #013: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #014: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #015: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #019: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #020: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #021: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #022: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #026: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #027: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #028: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #029: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #031: (file name) line (number) in H5G__traverse_special(): too many links + major: Links + minor: Too many soft links in path +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #005: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #006: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #007: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #008: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #012: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #013: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #014: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #015: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #019: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #020: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #021: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #022: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #026: (file name) line (number) in H5L_extern_traverse(): unable to open object + major: Symbol table + minor: Can't open object + #027: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #028: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #029: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #031: (file name) line (number) in H5G__traverse_special(): too many links + major: Links + minor: Too many soft links in path diff --git a/tools/h5dump/errfiles/tgroup-2.err b/tools/h5dump/errfiles/tgroup-2.err new file mode 100644 index 0000000..3659b5c --- /dev/null +++ b/tools/h5dump/errfiles/tgroup-2.err @@ -0,0 +1,20 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Gopen2(): unable to open group + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5G__open_name(): group not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #005: (file name) line (number) in H5G_loc_find_cb(): object 'y' doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to open group "/y" diff --git a/tools/h5dump/errfiles/tnofilename-with-packed-bits.err b/tools/h5dump/errfiles/tnofilename-with-packed-bits.err new file mode 100644 index 0000000..84a7011 --- /dev/null +++ b/tools/h5dump/errfiles/tnofilename-with-packed-bits.err @@ -0,0 +1 @@ +h5dump error: missing file name diff --git a/tools/h5dump/errfiles/torderlinks1.err b/tools/h5dump/errfiles/torderlinks1.err new file mode 100644 index 0000000..780c7e6 --- /dev/null +++ b/tools/h5dump/errfiles/torderlinks1.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/errfiles/torderlinks2.err b/tools/h5dump/errfiles/torderlinks2.err new file mode 100644 index 0000000..780c7e6 --- /dev/null +++ b/tools/h5dump/errfiles/torderlinks2.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + major: Links + minor: Unable to open file diff --git a/tools/h5dump/errfiles/tpbitsCharLengthExceeded.err b/tools/h5dump/errfiles/tpbitsCharLengthExceeded.err new file mode 100644 index 0000000..e5854ea --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsCharLengthExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/h5dump/errfiles/tpbitsCharOffsetExceeded.err b/tools/h5dump/errfiles/tpbitsCharOffsetExceeded.err new file mode 100644 index 0000000..e5854ea --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsCharOffsetExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/h5dump/errfiles/tpbitsIncomplete.err b/tools/h5dump/errfiles/tpbitsIncomplete.err new file mode 100644 index 0000000..e0abee5 --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsIncomplete.err @@ -0,0 +1 @@ +h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/h5dump/errfiles/tpbitsIntLengthExceeded.err b/tools/h5dump/errfiles/tpbitsIntLengthExceeded.err new file mode 100644 index 0000000..7dd88ed --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsIntLengthExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/h5dump/errfiles/tpbitsIntOffsetExceeded.err b/tools/h5dump/errfiles/tpbitsIntOffsetExceeded.err new file mode 100644 index 0000000..7dd88ed --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsIntOffsetExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/h5dump/errfiles/tpbitsLengthExceeded.err b/tools/h5dump/errfiles/tpbitsLengthExceeded.err new file mode 100644 index 0000000..d4673f2 --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsLengthExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/h5dump/errfiles/tpbitsLengthPositive.err b/tools/h5dump/errfiles/tpbitsLengthPositive.err new file mode 100644 index 0000000..4928007 --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsLengthPositive.err @@ -0,0 +1 @@ +h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/h5dump/errfiles/tpbitsLongLengthExceeded.err b/tools/h5dump/errfiles/tpbitsLongLengthExceeded.err new file mode 100644 index 0000000..0318f79 --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsLongLengthExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/h5dump/errfiles/tpbitsLongOffsetExceeded.err b/tools/h5dump/errfiles/tpbitsLongOffsetExceeded.err new file mode 100644 index 0000000..0318f79 --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsLongOffsetExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/h5dump/errfiles/tpbitsMaxExceeded.err b/tools/h5dump/errfiles/tpbitsMaxExceeded.err new file mode 100644 index 0000000..a8d12fc --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsMaxExceeded.err @@ -0,0 +1 @@ +h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/h5dump/errfiles/tpbitsOffsetExceeded.err b/tools/h5dump/errfiles/tpbitsOffsetExceeded.err new file mode 100644 index 0000000..b7d6dad --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsOffsetExceeded.err @@ -0,0 +1 @@ +h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/h5dump/errfiles/tpbitsOffsetNegative.err b/tools/h5dump/errfiles/tpbitsOffsetNegative.err new file mode 100644 index 0000000..8a027c1 --- /dev/null +++ b/tools/h5dump/errfiles/tpbitsOffsetNegative.err @@ -0,0 +1 @@ +h5dump error: Bad mask list(-1,1) diff --git a/tools/h5dump/errfiles/tperror.err b/tools/h5dump/errfiles/tperror.err new file mode 100644 index 0000000..19a7a73 --- /dev/null +++ b/tools/h5dump/errfiles/tperror.err @@ -0,0 +1,33 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "bogus" diff --git a/tools/h5dump/errfiles/tqmarkfile.err b/tools/h5dump/errfiles/tqmarkfile.err new file mode 100644 index 0000000..06519fb --- /dev/null +++ b/tools/h5dump/errfiles/tqmarkfile.err @@ -0,0 +1,33 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "Dataset1" diff --git a/tools/h5dump/errfiles/tslink-D.err b/tools/h5dump/errfiles/tslink-D.err new file mode 100644 index 0000000..b98e324 --- /dev/null +++ b/tools/h5dump/errfiles/tslink-D.err @@ -0,0 +1,25 @@ +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #004: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + major: Symbol table + minor: Object not found + #006: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #007: (file name) line (number) in H5G_traverse_slink_cb(): component not found + major: Symbol table + minor: Object not found diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 2799d95..23fd1d9 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -71,11 +71,11 @@ struct handler_t { */ /* The following initialization makes use of C language cancatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char *s_opts = "hnpeyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RECM:"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RECM:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, - { "contents", no_arg, 'n' }, + { "contents", optional_arg, 'n' }, { "properties", no_arg, 'p' }, { "boot-block", no_arg, 'B' }, { "boot-bloc", no_arg, 'B' }, @@ -235,6 +235,7 @@ usage(const char *prog) HDfprintf(rawoutstream, " OPTIONS\n"); HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n"); HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n"); + HDfprintf(rawoutstream, " Optional value 1 also prints attributes.\n"); HDfprintf(rawoutstream, " -B, --superblock Print the content of the super block\n"); HDfprintf(rawoutstream, " -H, --header Print the header only; no data is displayed\n"); HDfprintf(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); @@ -296,10 +297,20 @@ usage(const char *prog) HDfprintf(rawoutstream, " number of dimensions in the dataspace being queried\n"); HDfprintf(rawoutstream, "\n"); HDfprintf(rawoutstream, " D - is the file driver to use in opening the file. Acceptable values\n"); - HDfprintf(rawoutstream, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); - HDfprintf(rawoutstream, " the file driver flag, the file will be opened with each driver in\n"); - HDfprintf(rawoutstream, " turn and in the order specified above until one driver succeeds\n"); - HDfprintf(rawoutstream, " in opening the file.\n"); + HDfprintf(rawoutstream, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); + HDfprintf(rawoutstream, " the file driver flag, the file will be opened with each driver in\n"); + HDfprintf(rawoutstream, " turn and in the order specified above until one driver succeeds\n"); + HDfprintf(rawoutstream, " in opening the file.\n"); + HDfprintf(rawoutstream, " These are the letters that are appended to the file name(without .h5) when opening\n"); + HDfprintf(rawoutstream, " names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are:\n"); + HDfprintf(rawoutstream, " m: All meta data when using the split driver.\n"); + HDfprintf(rawoutstream, " s: The userblock, superblock, and driver info block\n"); + HDfprintf(rawoutstream, " b: B-tree nodes\n"); + HDfprintf(rawoutstream, " r: Dataset raw data\n"); + HDfprintf(rawoutstream, " g: Global heap\n"); + HDfprintf(rawoutstream, " l: local heap (object names)\n"); + HDfprintf(rawoutstream, " o: object headers\n"); + HDfprintf(rawoutstream, "\n"); HDfprintf(rawoutstream, " F - is a filename.\n"); HDfprintf(rawoutstream, " P - is the full path from the root group to the object.\n"); HDfprintf(rawoutstream, " N - is an integer greater than 1.\n"); @@ -336,9 +347,13 @@ usage(const char *prog) HDfprintf(rawoutstream, "\n"); HDfprintf(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n"); HDfprintf(rawoutstream, "\n"); - HDfprintf(rawoutstream, " 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5\n"); + HDfprintf(rawoutstream, " 5) Dataset foo in files file1.h5 file2.h5 file3.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /foo file1.h5 file2.h5 file3.h5\n"); HDfprintf(rawoutstream, "\n"); - HDfprintf(rawoutstream, " h5dump -d /foo multi1.h5 multi2.h5 multi3.h5\n"); + HDfprintf(rawoutstream, " 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /foo -f split splitfile\n"); HDfprintf(rawoutstream, "\n"); } @@ -999,6 +1014,9 @@ parse_start: case 'n': display_fi = TRUE; last_was_dset = FALSE; + if ( opt_arg != NULL) { + h5trav_set_verbose(HDatoi(opt_arg)); + } break; case 'p': display_dcpl = TRUE; @@ -1035,6 +1053,9 @@ parse_start: break; case 'w': h5tools_nCols = HDatoi(opt_arg); + if (h5tools_nCols==0) { + h5tools_nCols = 65535; + } last_was_dset = FALSE; break; case 'a': @@ -1461,6 +1482,9 @@ main(int argc, const char *argv[]) h5tools_setstatus(EXIT_FAILURE); goto done; } + /* Initialize indexing options */ + h5trav_set_index(sort_by, sort_order); + while(opt_ind < argc) { fname = HDstrdup(argv[opt_ind++]); diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index b8deaf9..6f5fd3f 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -543,6 +543,56 @@ done: } /*------------------------------------------------------------------------- + * Function: attr_iteration + * + * Purpose: Iterate and display attributes within the specified group + * + * Return: void + * + *------------------------------------------------------------------------- + */ +void +attr_iteration(hid_t gid, unsigned attr_crt_order_flags) +{ + /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the group for attributes, then, sort by creation order, otherwise by name */ + + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ +} + +/*------------------------------------------------------------------------- + * Function: link_iteration + * + * Purpose: Iterate and display links within the specified group + * + * Return: void + * + *------------------------------------------------------------------------- + */ +void +link_iteration(hid_t gid, unsigned crt_order_flags) +{ + + /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the group, then, sort by creation order, otherwise by name */ + if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) + H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); + else + H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); +} + +/*------------------------------------------------------------------------- * Function: dump_named_datatype * * Purpose: Dump named datatype @@ -659,21 +709,7 @@ dump_named_datatype(hid_t tid, const char *name) /* print attributes */ dump_indent += COL; - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the datatype's create property list for attributes, then, sort by creation order, otherwise by name */ - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(tid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(tid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ + attr_iteration(tid, attr_crt_order_flags); dump_indent -= COL; @@ -829,53 +865,13 @@ dump_group(hid_t gid, const char *name) } else { found_obj->displayed = TRUE; - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group for attributes, then, sort by creation order, otherwise by name */ - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ - - /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group, then, sort by creation order, otherwise by name */ - if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); - else - H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); + attr_iteration(gid, attr_crt_order_flags); + link_iteration(gid, crt_order_flags); } } else { - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group for attributes, then, sort by creation order, otherwise by name */ - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ - - /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group, then, sort by creation order, otherwise by name */ - if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); - else - H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); + attr_iteration(gid, attr_crt_order_flags); + link_iteration(gid, crt_order_flags); } dump_indent -= COL; @@ -1050,20 +1046,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) H5Tclose(type); if (!bin_output) { - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group for attributes, then, sort by creation order, otherwise by name */ - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(did, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ + attr_iteration(did, attr_crt_order_flags); } ctx.indent_level--; dump_indent -= COL; @@ -1488,15 +1471,18 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if(sset) { unsigned int i; + unsigned int ndims; hid_t sid = H5Dget_space(dsetid); - int ndims = H5Sget_simple_extent_ndims(sid); + int ndims_res = H5Sget_simple_extent_ndims(sid); H5Sclose(sid); - if(ndims < 0) { + if(ndims_res < 0) { error_msg("H5Sget_simple_extent_ndims failed\n"); h5tools_setstatus(EXIT_FAILURE); return; } + else + ndims = ndims_res; if(!sset->start.data || !sset->stride.data || !sset->count.data || !sset->block.data) { /* they didn't specify a ``stride'' or ``block''. default to 1 in all diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 1b247f1..1a29659 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -1781,7 +1781,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU hsize_t nelmts = 1; int ndims; int i; - int depth; int status = -1; int stdindent = COL; /* should be 3 */ void *buf = NULL; diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index a37f908..b8ea020 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -97,11 +97,12 @@ #define FILE65 "file_space.h5" #define FILE66 "packedbits.h5" #define FILE67 "zerodim.h5" -#define FILE68a "tdset_idx.h5" #define FILE68 "charsets.h5" +#define FILE68a "tdset_idx.h5" #define FILE69 "tattrintsize.h5" #define FILE70 "tcmpdintsize.h5" #define FILE71 "tcmpdattrintsize.h5" +#define FILE72 "tnestedcmpddt.h5" /*------------------------------------------------------------------------- * prototypes @@ -113,16 +114,16 @@ static int make_dset(hid_t loc_id, const char *name, hid_t sid, hid_t tid, hid_t dcpl, void *buf); static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, - hid_t tid, void *buf); + hid_t tid, void *buf); static int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, - hid_t tid, void *buf ); + hid_t tid, void *buf ); /* a filter operation callback function */ static size_t myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf); + const unsigned int UNUSED *cd_values, size_t nbytes, + size_t UNUSED *buf_size, void UNUSED **buf); /* a "set local" callback */ static herr_t @@ -132,35 +133,35 @@ set_local_myfilter(hid_t dcpl_id, hid_t tid, hid_t UNUSED sid); /* This message derives from H5Z */ const H5Z_class2_t H5Z_MYFILTER[1] = {{ - H5Z_CLASS_T_VERS, - MYFILTER_ID, /* Filter id number */ - 1, 1, - "myfilter", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - set_local_myfilter, /* The "set local" callback */ - myfilter, /* The actual filter function */ + H5Z_CLASS_T_VERS, + MYFILTER_ID, /* Filter id number */ + 1, 1, + "myfilter", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + set_local_myfilter, /* The "set local" callback */ + myfilter, /* The actual filter function */ }}; /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(UNUSED const char * link_name, UNUSED hid_t cur_group, - UNUSED const void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id) + UNUSED const void * udata, UNUSED size_t udata_size, UNUSED hid_t lapl_id) { -return -1; + return -1; } #define MY_LINKCLASS 187 const H5L_class_t UD_link_class[1] = {{ - H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - (H5L_type_t)MY_LINKCLASS, /* Link type id number */ - "UD link class", /* name for debugging */ - NULL, /* Creation callback */ - NULL, /* Move/rename callback */ - NULL, /* Copy callback */ - UD_traverse, /* The actual traversal function */ - NULL, /* Deletion callback */ - NULL /* Query callback */ + H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ + (H5L_type_t)MY_LINKCLASS, /* Link type id number */ + "UD link class", /* name for debugging */ + NULL, /* Creation callback */ + NULL, /* Move/rename callback */ + NULL, /* Copy callback */ + UD_traverse, /* The actual traversal function */ + NULL, /* Deletion callback */ + NULL /* Query callback */ }}; @@ -189,18 +190,18 @@ const H5L_class_t UD_link_class[1] = {{ #define POINT1_NPOINTS 10 typedef enum{ - RED, - GREEN, - BLUE, - WHITE, - BLACK + RED, + GREEN, + BLUE, + WHITE, + BLACK } enumtype; /* Compound datatype */ typedef struct s1_t { - unsigned int a; - unsigned int b; - float c; + unsigned int a; + unsigned int b; + float c; } s1_t; @@ -262,7 +263,7 @@ typedef struct s1_t { #define STRATEGY H5F_FILE_SPACE_AGGR_VFD /* File space handling strategy */ #define THRESHOLD10 10 /* Free space section threshold */ -/* "FILE66" macros */ +/* "FILE66" macros and for FILE69 */ #define F66_XDIM 8 #define F66_DATASETU08 "DU08BITS" #define F66_DATASETS08 "DS08BITS" @@ -279,14 +280,14 @@ typedef struct s1_t { #define F66_DUMMYDBL "DummyDBL" /* Declarations for gent_dataset_idx() for "FILE68a" */ -#define DSET_FIXED "dset_fixed" -#define DSET_FIXED_FILTER "dset_filter" -#define DSET_BTREE "dset_btree" -#define DIM200 200 -#define DIM100 100 -#define DIM20 20 -#define DIM10 10 -#define CHUNK 5 +#define F68a_DSET_FIXED "dset_fixed" +#define F68a_DSET_FIXED_FILTER "dset_filter" +#define F68a_DSET_BTREE "dset_btree" +#define F68a_DIM200 200 +#define F68a_DIM100 100 +#define F68a_DIM20 20 +#define F68a_DIM10 10 +#define F68a_CHUNK 5 /* "FILE70" macros and for FILE71 */ /* Name of dataset to create in datafile */ @@ -374,8 +375,8 @@ gent_dataset(void) dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - for(j = 0; j < 20; j++) - dset1[i][j] = j + i; + for(j = 0; j < 20; j++) + dset1[i][j] = j + i; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); @@ -387,8 +388,8 @@ gent_dataset(void) dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 30; i++) - for(j = 0; j < 20; j++) - dset2[i][j] = 0.0001 * j + i; + for(j = 0; j < 20; j++) + dset2[i][j] = 0.0001 * j + i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -419,8 +420,8 @@ gent_dataset2(void) dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); for(i = 0; i < 10; i++) - for(j = 0; j < 20; j++) - dset1[i][j] = j; + for(j = 0; j < 20; j++) + dset1[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); @@ -433,8 +434,8 @@ gent_dataset2(void) dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); for(i = 0; i < 30; i++) - for(j = 0; j < 10; j++) - dset2[i][j] = j; + for(j = 0; j < 10; j++) + dset2[i][j] = j; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); @@ -547,9 +548,9 @@ static int gent_softlink2(void) int data2[NX][NY] = {{0,0},{0,1},{0,2},{3,3}}; herr_t status = SUCCEED; - /*----------------------------------------------------------------------- - * FILE - *------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * FILE + *------------------------------------------------------------------------*/ /* Create a new file */ fileid1 = H5Fcreate(FILE4_1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fileid1 < 0) @@ -559,9 +560,9 @@ static int gent_softlink2(void) goto out; } - /*----------------------------------------------------------------------- - * Groups - *------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Groups + *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fileid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { @@ -578,9 +579,9 @@ static int gent_softlink2(void) goto out; } - /*----------------------------------------------------------------------- - * Named datatype - *------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Named datatype + *------------------------------------------------------------------------*/ datatype = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fileid1, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) @@ -590,9 +591,9 @@ static int gent_softlink2(void) goto out; } - /*----------------------------------------------------------------------- - * Datasets - *------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Datasets + *------------------------------------------------------------------------*/ /* * Describe the size of the array and create the data space for fixed * size dataset. @@ -610,7 +611,7 @@ static int gent_softlink2(void) */ /* Create a new dataset as sample object */ dset1 = H5Dcreate2(fileid1, "/dset1", H5T_NATIVE_INT, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset1 < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); @@ -631,7 +632,7 @@ static int gent_softlink2(void) */ /* Create a new dataset as sample object */ dset2 = H5Dcreate2(fileid1, "/dset2", H5T_NATIVE_INT, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset2 < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); @@ -647,9 +648,9 @@ static int gent_softlink2(void) goto out; } - /*----------------------------------------------------------------------- - * Soft links - *------------------------------------------------------------------------*/ + /*----------------------------------------------------------------------- + * Soft links + *------------------------------------------------------------------------*/ /* * create various soft links under '/' root */ @@ -746,7 +747,7 @@ static int gent_softlink2(void) goto out; } -out: + out: /* * Close/release resources. */ @@ -793,7 +794,7 @@ out: dset2 g1.1 | dset3 -*/ + */ static void gent_hardlink(void) { @@ -824,7 +825,7 @@ static void gent_hardlink(void) H5Lcreate_hard(group, "/g2", H5L_SAME_LOC, "g1.1", H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group); - /* create a link to the root group */ + /* create a link to the root group */ H5Lcreate_hard(fid, "/", H5L_SAME_LOC, "g3", H5P_DEFAULT, H5P_DEFAULT); H5Fclose(fid); } @@ -865,38 +866,38 @@ static void gent_udlink(void) | dset2 -*/ + */ static void gent_compound_dt(void) { /* test compound data type */ hid_t fid, group, dataset, space, space3, type, type2; hid_t array_dt; typedef struct { - int a; - float b; - double c; + int a; + float b; + double c; } dset1_t; dset1_t dset1[5]; typedef struct { - int a; - float b; + int a; + float b; } dset2_t; dset2_t dset2[5]; typedef struct { - int a[4]; - float b[5][6]; + int a[4]; + float b[5][6]; } dset3_t; dset3_t dset3[3][6]; typedef struct { - int a; - float b; + int a; + float b; } dset4_t; dset4_t dset4[5]; typedef struct { - int a; - float b; + int a; + float b; } dset5_t; dset5_t dset5[5]; @@ -990,13 +991,13 @@ static void gent_compound_dt(void) { /* test compound data type */ space3 = H5Screate_simple(2, dset3_dim, NULL); dataset = H5Dcreate2(group, "dset3", type, space3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < (int)dset3_dim[0]; i++) - for(j = 0; j < (int)dset3_dim[1]; j++) { - for(k = 0; k < 4; k++) - dset3[i][j].a[k] = k + j + i; - for(k = 0; k < 5; k++) - for(l = 0; l < 6; l++) - dset3[i][j].b[k][l] = (float)((k + 1) + l + j + i); - } + for(j = 0; j < (int)dset3_dim[1]; j++) { + for(k = 0; k < 4; k++) + dset3[i][j].a[k] = k + j + i; + for(k = 0; k < 5; k++) + for(l = 0; l < 6; l++) + dset3[i][j].b[k][l] = (float)((k + 1) + l + j + i); + } H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3); H5Sclose(space3); H5Tclose(type); @@ -1051,38 +1052,38 @@ static void gent_compound_dt(void) { /* test compound data type */ | dset2 -*/ + */ static void gent_compound_dt2(void) { /* test compound data type */ hid_t fid, group, dataset, space, type, create_plist, type2; hid_t array_dt; typedef struct { - int a; - float b; - double c; + int a; + float b; + double c; } dset1_t; dset1_t dset1[10]; typedef struct { - int a; - float b; + int a; + float b; } dset2_t; dset2_t dset2[10]; typedef struct { - int a[4]; - float b[5][6]; + int a[4]; + float b[5][6]; } dset3_t; typedef struct { - int a; - float b; + int a; + float b; } dset4_t; dset4_t dset4[10]; typedef struct { - int a; - float b; + int a; + float b; } dset5_t; dset5_t dset5[10]; @@ -1237,7 +1238,7 @@ g1.2 : g1.2.1 extlink g1.2.1 : slink g2 : dset2.1 dset2.2 udlink -*/ + */ static void gent_all(void) { @@ -1379,7 +1380,7 @@ static void gent_all(void) o - group objects -*/ + */ static void gent_loop(void) { hid_t fid, group; @@ -1429,7 +1430,7 @@ static void gent_loop2(void) | | (g1) (dset2) (dset3) (elink) udlink dset1 link1 slink6 (dset1) (udlink) -*/ + */ static void gent_many(void) @@ -1446,9 +1447,9 @@ gent_many(void) hsize_t sdim, maxdim; typedef struct { /* compound type has members with rank > 1 */ - int a[2][2][2][2]; /* arrays are 2x2x2x2 */ - double b[2][2][2][2]; - double c[2][2][2][2]; + int a[2][2][2][2]; /* arrays are 2x2x2x2 */ + double b[2][2][2][2]; + double c[2][2][2][2]; } dset1_t; dset1_t dset1[6]; @@ -1628,13 +1629,13 @@ gent_many(void) } static hid_t mkstr(int size, H5T_str_t pad) { -hid_t type; + hid_t type; - if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; - if(H5Tset_size(type, (size_t)size) < 0) return -1; - if(H5Tset_strpad(type, pad) < 0) return -1; + if((type=H5Tcopy(H5T_C_S1)) < 0) return -1; + if(H5Tset_size(type, (size_t)size) < 0) return -1; + if(H5Tset_strpad(type, pad) < 0) return -1; - return type; + return type; } static void gent_str(void) { @@ -1643,131 +1644,131 @@ static void gent_str(void) { hsize_t dims1[] = { 3, 4}; char string1[12][3] = {"s1","s2","s3","s4","s5","s6","s7","s8","s9", - "s0","s1","s2"}; + "s0","s1","s2"}; hsize_t dims2[]={20}; char string2[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", - "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", - "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", - "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", - "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; + "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", + "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", + "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; hsize_t dims3[] = { 27}; char string3[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", - "abcd4", "abcd5", "abcd6", "abcd7", - "abcd8", "abcd9", "abcd0", "abcd1", - "abcd2", "abcd3", "abcd4", "abcd5", - "abcd6", "abcd7", "abcd8", "abcd9", - "abcd0", "abcd1", "abcd2", "abcd3", - "abcd4", "abcd5", "abcd6"}; + "abcd4", "abcd5", "abcd6", "abcd7", + "abcd8", "abcd9", "abcd0", "abcd1", + "abcd2", "abcd3", "abcd4", "abcd5", + "abcd6", "abcd7", "abcd8", "abcd9", + "abcd0", "abcd1", "abcd2", "abcd3", + "abcd4", "abcd5", "abcd6"}; int i, j, k, l; hsize_t dims4[] = { 3 }; char string4[3][21] = { "s1234567890123456789", "s1234567890123456789", - "s1234567890123456789"}; + "s1234567890123456789"}; hsize_t dims5[] = { 3, 6}; typedef struct { - int a[8][10]; - char s[12][33]; + int a[8][10]; + char s[12][33]; } compound_t; compound_t comp1[3][6]; hsize_t mdims[2]; - fid = H5Fcreate(FILE13, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - - /* string 1 : nullterm string */ - space = H5Screate_simple(2, dims1, NULL); - f_type = mkstr(5, H5T_STR_NULLTERM); - m_type = mkstr(3, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - - /* string 2 : space pad string */ - space = H5Screate_simple(1, dims2, NULL); - f_type = mkstr(11, H5T_STR_SPACEPAD); - m_type = mkstr(10, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - - /* string 3 : null pad string */ - space = H5Screate_simple(1, dims3, NULL); - f_type = mkstr(8, H5T_STR_NULLPAD); - m_type = mkstr(6, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - - /* string 4 : space pad long string */ - space = H5Screate_simple(1, dims4, NULL); - f_type = mkstr(168, H5T_STR_SPACEPAD); - m_type = mkstr(21, H5T_STR_NULLTERM); - dataset = H5Dcreate2(fid, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4); - H5Tclose(m_type); - H5Tclose(f_type); - H5Sclose(space); - H5Dclose(dataset); - - /* compound data */ - space = H5Screate_simple(2, dims5, NULL); - f_type = H5Tcreate (H5T_COMPOUND, sizeof(compound_t)); - f_type2 = H5Tcreate (H5T_COMPOUND, sizeof(compound_t)); - - mdims[0] = 8; mdims[1] = 10; - - array_dt = H5Tarray_create2(H5T_STD_I32BE, 2, mdims); - H5Tinsert(f_type, "int_array", HOFFSET(compound_t, a), array_dt); - H5Tclose(array_dt); - - array_dt = H5Tarray_create2(H5T_NATIVE_INT, 2, mdims); - H5Tinsert(f_type2, "int_array", HOFFSET(compound_t, a), array_dt); - H5Tclose(array_dt); - - mdims[0] = 3; mdims[1] = 4; - - str_type = mkstr(32, H5T_STR_SPACEPAD); - array_dt = H5Tarray_create2(str_type, 2, mdims); - H5Tinsert(f_type, "string", HOFFSET(compound_t, s), array_dt); - H5Tclose(array_dt); - H5Tclose(str_type); - - str_type = mkstr(33, H5T_STR_NULLTERM); - array_dt = H5Tarray_create2(str_type, 2, mdims); - H5Tinsert(f_type2, "string", HOFFSET(compound_t, s), array_dt); - H5Tclose(array_dt); - H5Tclose(str_type); - - for(i = 0; i < 3; i++) - for(j = 0; j < 6; j++) { - for(k = 0 ; k < 8; k++) + fid = H5Fcreate(FILE13, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* string 1 : nullterm string */ + space = H5Screate_simple(2, dims1, NULL); + f_type = mkstr(5, H5T_STR_NULLTERM); + m_type = mkstr(3, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 2 : space pad string */ + space = H5Screate_simple(1, dims2, NULL); + f_type = mkstr(11, H5T_STR_SPACEPAD); + m_type = mkstr(10, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 3 : null pad string */ + space = H5Screate_simple(1, dims3, NULL); + f_type = mkstr(8, H5T_STR_NULLPAD); + m_type = mkstr(6, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* string 4 : space pad long string */ + space = H5Screate_simple(1, dims4, NULL); + f_type = mkstr(168, H5T_STR_SPACEPAD); + m_type = mkstr(21, H5T_STR_NULLTERM); + dataset = H5Dcreate2(fid, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4); + H5Tclose(m_type); + H5Tclose(f_type); + H5Sclose(space); + H5Dclose(dataset); + + /* compound data */ + space = H5Screate_simple(2, dims5, NULL); + f_type = H5Tcreate (H5T_COMPOUND, sizeof(compound_t)); + f_type2 = H5Tcreate (H5T_COMPOUND, sizeof(compound_t)); + + mdims[0] = 8; mdims[1] = 10; + + array_dt = H5Tarray_create2(H5T_STD_I32BE, 2, mdims); + H5Tinsert(f_type, "int_array", HOFFSET(compound_t, a), array_dt); + H5Tclose(array_dt); + + array_dt = H5Tarray_create2(H5T_NATIVE_INT, 2, mdims); + H5Tinsert(f_type2, "int_array", HOFFSET(compound_t, a), array_dt); + H5Tclose(array_dt); + + mdims[0] = 3; mdims[1] = 4; + + str_type = mkstr(32, H5T_STR_SPACEPAD); + array_dt = H5Tarray_create2(str_type, 2, mdims); + H5Tinsert(f_type, "string", HOFFSET(compound_t, s), array_dt); + H5Tclose(array_dt); + H5Tclose(str_type); + + str_type = mkstr(33, H5T_STR_NULLTERM); + array_dt = H5Tarray_create2(str_type, 2, mdims); + H5Tinsert(f_type2, "string", HOFFSET(compound_t, s), array_dt); + H5Tclose(array_dt); + H5Tclose(str_type); + + for(i = 0; i < 3; i++) + for(j = 0; j < 6; j++) { + for(k = 0 ; k < 8; k++) for(l = 0; l < 10; l++) - comp1[i][j].a[k][l] = (l + j + k) * (l + j + k); - for(k = 0 ; k < 12; k++) - strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); - } + comp1[i][j].a[k][l] = (l + j + k) * (l + j + k); + for(k = 0 ; k < 12; k++) + strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); + } - dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1); + dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1); - H5Tclose(f_type); - H5Tclose(f_type2); - H5Sclose(space); - H5Dclose(dataset); + H5Tclose(f_type); + H5Tclose(f_type2); + H5Sclose(space); + H5Dclose(dataset); - H5Fclose(fid); + H5Fclose(fid); } /* @@ -1777,163 +1778,163 @@ static void gent_str(void) { | | | | \ \ string1 string3 string5 string2 string4 string6 -*/ + */ static void gent_str2(void) { -hid_t fid, group, attr, dataset, space, space2, mem_space, hyper_space; -hid_t fxdlenstr, fxdlenstr2, memtype; -hsize_t dims[1], size[1], stride[1], count[1], block[1]; -hsize_t start[1]; - - -int i; -char buf[LENSTR+10]; -char buf2[3*LENSTR2]; -hsize_t sdim; - - fid = H5Fcreate(FILE14, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - - fxdlenstr = H5Tcopy(H5T_C_S1); - H5Tset_size(fxdlenstr, LENSTR); - H5Tset_cset(fxdlenstr, H5T_CSET_ASCII); - H5Tset_strpad(fxdlenstr, H5T_STR_NULLTERM); - - memtype = H5Tcopy(H5T_C_S1); - H5Tset_size(memtype, LENSTR); - H5Tset_cset(memtype, H5T_CSET_ASCII); - H5Tset_strpad(memtype, H5T_STR_NULLTERM); - - sdim = 10; - size[0] = sdim; - space = H5Screate_simple(1, size, NULL); - size[0] = 1; - mem_space = H5Screate_simple(1,size,NULL); - hyper_space = H5Scopy(space); - - /* dset1 */ - - group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate2(group, "dset1", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - /* add attributes to dset1 */ - - fxdlenstr2 = H5Tcopy(H5T_C_S1); - H5Tset_size(fxdlenstr2, LENSTR2); - H5Tset_cset(fxdlenstr2, H5T_CSET_ASCII); - H5Tset_strpad(fxdlenstr2, H5T_STR_NULLTERM); - - dims[0] = 3; - space2 = H5Screate_simple(1, dims, NULL); - attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT); - sprintf(&(buf2[0*LENSTR2]), "0123456789"); - sprintf(&(buf2[1*LENSTR2]), "abcdefghij"); - sprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ"); - H5Awrite(attr, fxdlenstr2, buf2); - H5Sclose(space2); - H5Tclose(fxdlenstr2); - H5Aclose(attr); - - stride[0]=1; - count[0]=1; - block[0]=1; - - for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); - } - H5Dclose(dataset); - H5Gclose(group); - - group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate2(group, "dset2", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); - } - H5Dclose(dataset); - H5Gclose(group); - - - H5Tclose(fxdlenstr); - fxdlenstr = H5Tcopy(H5T_C_S1); - H5Tset_size(fxdlenstr, LENSTR); - H5Tset_cset(fxdlenstr, H5T_CSET_ASCII); - H5Tset_strpad(fxdlenstr, H5T_STR_NULLPAD); - - group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate2(group, "dset3", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - for(i = 0;(hsize_t) i < sdim; i++) { - start[0] = i; - sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); - } - H5Dclose(dataset); - H5Gclose(group); - - - group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate2(group, "dset4", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i); - H5Tset_size(memtype, HDstrlen(buf)+1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); - } - H5Dclose(dataset); - H5Gclose(group); - - H5Tclose(fxdlenstr); - fxdlenstr = H5Tcopy(H5T_C_S1); - H5Tset_size(fxdlenstr, LENSTR); - H5Tset_cset(fxdlenstr, H5T_CSET_ASCII); - H5Tset_strpad(fxdlenstr, H5T_STR_SPACEPAD); - - group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate2(group, "dset5", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); - } - H5Dclose(dataset); - H5Gclose(group); - - - group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - dataset = H5Dcreate2(group, "dset6", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - for(i = 0; (hsize_t)i < sdim; i++) { - start[0] = i; - sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i); - H5Tset_size(memtype, HDstrlen(buf) + 1); - H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); - H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); - } - - H5Dclose(dataset); - H5Gclose(group); - H5Tclose(fxdlenstr); - H5Tclose(memtype); - H5Sclose(mem_space); - H5Sclose(hyper_space); - H5Sclose(space); - H5Fclose(fid); + hid_t fid, group, attr, dataset, space, space2, mem_space, hyper_space; + hid_t fxdlenstr, fxdlenstr2, memtype; + hsize_t dims[1], size[1], stride[1], count[1], block[1]; + hsize_t start[1]; + + + int i; + char buf[LENSTR+10]; + char buf2[3*LENSTR2]; + hsize_t sdim; + + fid = H5Fcreate(FILE14, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + fxdlenstr = H5Tcopy(H5T_C_S1); + H5Tset_size(fxdlenstr, LENSTR); + H5Tset_cset(fxdlenstr, H5T_CSET_ASCII); + H5Tset_strpad(fxdlenstr, H5T_STR_NULLTERM); + + memtype = H5Tcopy(H5T_C_S1); + H5Tset_size(memtype, LENSTR); + H5Tset_cset(memtype, H5T_CSET_ASCII); + H5Tset_strpad(memtype, H5T_STR_NULLTERM); + + sdim = 10; + size[0] = sdim; + space = H5Screate_simple(1, size, NULL); + size[0] = 1; + mem_space = H5Screate_simple(1,size,NULL); + hyper_space = H5Scopy(space); + + /* dset1 */ + + group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset1", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* add attributes to dset1 */ + + fxdlenstr2 = H5Tcopy(H5T_C_S1); + H5Tset_size(fxdlenstr2, LENSTR2); + H5Tset_cset(fxdlenstr2, H5T_CSET_ASCII); + H5Tset_strpad(fxdlenstr2, H5T_STR_NULLTERM); + + dims[0] = 3; + space2 = H5Screate_simple(1, dims, NULL); + attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT); + sprintf(&(buf2[0*LENSTR2]), "0123456789"); + sprintf(&(buf2[1*LENSTR2]), "abcdefghij"); + sprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ"); + H5Awrite(attr, fxdlenstr2, buf2); + H5Sclose(space2); + H5Tclose(fxdlenstr2); + H5Aclose(attr); + + stride[0]=1; + count[0]=1; + block[0]=1; + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + } + H5Dclose(dataset); + H5Gclose(group); + + group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset2", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + } + H5Dclose(dataset); + H5Gclose(group); + + + H5Tclose(fxdlenstr); + fxdlenstr = H5Tcopy(H5T_C_S1); + H5Tset_size(fxdlenstr, LENSTR); + H5Tset_cset(fxdlenstr, H5T_CSET_ASCII); + H5Tset_strpad(fxdlenstr, H5T_STR_NULLPAD); + + group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset3", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0;(hsize_t) i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + } + H5Dclose(dataset); + H5Gclose(group); + + + group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset4", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i); + H5Tset_size(memtype, HDstrlen(buf)+1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + } + H5Dclose(dataset); + H5Gclose(group); + + H5Tclose(fxdlenstr); + fxdlenstr = H5Tcopy(H5T_C_S1); + H5Tset_size(fxdlenstr, LENSTR); + H5Tset_cset(fxdlenstr, H5T_CSET_ASCII); + H5Tset_strpad(fxdlenstr, H5T_STR_SPACEPAD); + + group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset5", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i); + H5Tset_size(memtype, HDstrlen(buf) + 1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + } + H5Dclose(dataset); + H5Gclose(group); + + + group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataset = H5Dcreate2(group, "dset6", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + for(i = 0; (hsize_t)i < sdim; i++) { + start[0] = i; + sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i); + H5Tset_size(memtype, HDstrlen(buf) + 1); + H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); + H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); + } + + H5Dclose(dataset); + H5Gclose(group); + H5Tclose(fxdlenstr); + H5Tclose(memtype); + H5Sclose(mem_space); + H5Sclose(hyper_space); + H5Sclose(space); + H5Fclose(fid); } static void gent_enum(void) @@ -1942,9 +1943,9 @@ static void gent_enum(void) hid_t file, type, space, dset; int val; enumtype data[] = {RED, GREEN, BLUE, GREEN, WHITE, - WHITE, BLACK, GREEN, BLUE, RED, - RED, BLUE, GREEN, BLACK, WHITE, - RED, WHITE, GREEN, GREEN, BLUE}; + WHITE, BLACK, GREEN, BLUE, RED, + RED, BLUE, GREEN, BLACK, WHITE, + RED, WHITE, GREEN, GREEN, BLUE}; hsize_t size[1] = {NELMTS(data)}; file = H5Fcreate(FILE15,H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1969,7 +1970,7 @@ static void gent_enum(void) static void gent_objref(void) { -/*some code is taken from enum.c in the test dir */ + /*some code is taken from enum.c in the test dir */ hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ @@ -1978,8 +1979,8 @@ static void gent_objref(void) hid_t tid1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; hobj_ref_t *wbuf, /* buffer to write to disk */ - *rbuf, /* buffer read from disk */ - *tbuf; /* temp. buffer read from disk */ + *rbuf, /* buffer read from disk */ + *tbuf; /* temp. buffer read from disk */ uint32_t *tu32; /* Temporary pointer to uint32 data */ int i; /* counting variables */ const char *write_comment = "Foo!"; /* Comments for group */ @@ -2077,20 +2078,20 @@ static void gent_datareg(void) hid_t fid1; /* HDF5 File IDs */ hid_t dset1, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ + dset2; /* Dereferenced dataset ID */ hid_t sid1, /* Dataspace ID #1 */ - sid2; /* Dataspace ID #2 */ + sid2; /* Dataspace ID #2 */ hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ hdset_reg_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ + *rbuf; /* buffer read from disk */ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ + *drbuf; /* Buffer for reading numeric data from disk */ uint8_t *tu8; /* Temporary pointer to uint8 data */ int i; /* counting variables */ @@ -2233,7 +2234,7 @@ static void gent_attrreg(void) */ sid1 = H5Screate (H5S_NULL); dset1 = H5Dcreate2 (fid1, "Dataset1", H5T_STD_I32LE, sid1, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT); H5Sclose (sid1); /* Create references */ @@ -2273,7 +2274,7 @@ static void gent_attrreg(void) /* Create the attribute and write the region references to it. */ attr1 = H5Acreate2 (dset1, "Attribute1", H5T_STD_REF_DSETREG, sid3, H5P_DEFAULT, - H5P_DEFAULT); + H5P_DEFAULT); H5Awrite (attr1, H5T_STD_REF_DSETREG, wbuf); /* Close attribute dataspace */ @@ -2301,18 +2302,18 @@ static void gent_attrreg(void) /*taken from Elena's compound test file*/ static void gent_nestcomp(void) { - /* Compound memeber of the compound datatype*/ + /* Compound memeber of the compound datatype*/ typedef struct cmp_t { - char a; - float b[2]; + char a; + float b[2]; } cmp_t; /* First structure and dataset*/ typedef struct s1_t { - int a; - float b; - double c; - cmp_t d; + int a; + float b; + double c; + cmp_t d; } s2_t; hid_t cmp_tid; /* Handle for the compound datatype */ hid_t char_id; /* Handle for the string datatype */ @@ -2388,7 +2389,7 @@ static void gent_nestcomp(void) */ status = H5Dwrite(dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1); if(status < 0) - fprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); + fprintf(stderr, "gent_nestcomp H5Dwrite failed\n"); /* * Release resources @@ -2459,14 +2460,14 @@ static void gent_bitfields(void) /* bitfield_1 */ nelmts = sizeof(buf); if((type = H5Tcopy(H5T_STD_B8LE)) < 0 || - (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || - (dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || + (dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; for(i = 0; i < sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i; if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + goto error; if(H5Sclose(space) < 0) goto error; if(H5Tclose(type) < 0) goto error; if(H5Dclose(dset) < 0) goto error; @@ -2474,25 +2475,25 @@ static void gent_bitfields(void) /* bitfield_2 */ nelmts = sizeof(buf)/2; if((type = H5Tcopy(H5T_STD_B16LE)) < 0 || - (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || - (dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + (space = H5Screate_simple(1, &nelmts, NULL)) < 0 || + (dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; for(i = 0; i < sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i; if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + goto error; if(H5Sclose(space) < 0) goto error; if(H5Tclose(type) < 0) goto error; if(H5Dclose(dset) < 0) goto error; if(H5Gclose(grp) < 0) goto error; H5Fclose(file); - error: + error: H5E_BEGIN_TRY { - H5Gclose(grp); - H5Tclose(type); - H5Sclose(space); - H5Dclose(dset); + H5Gclose(grp); + H5Tclose(type); + H5Sclose(space); + H5Dclose(dset); } H5E_END_TRY; } @@ -2508,7 +2509,7 @@ static void gent_vldatatypes(void) /* Allocate and initialize VL dataset to write */ for(i = 0; i < SPACE1_DIM1; i++) { - int j; + int j; wdata[i].p = HDmalloc((i + 1) * sizeof(int)); wdata[i].len = i + 1; @@ -2535,7 +2536,7 @@ static void gent_vldatatypes(void) /* Allocate and initialize VL dataset to write */ for(i = 0; i < SPACE1_DIM1; i++) { - int j; + int j; wdata[i].p = HDmalloc((i + 1) * sizeof(float)); wdata[i].len = i + 1; @@ -2659,9 +2660,9 @@ gent_vldatatypes2(void) static void gent_vldatatypes3(void) { typedef struct { /* Struct that the VL sequences are composed of */ - int i; - float f; - hvl_t v; + int i; + float f; + hvl_t v; } s1; s1 wdata[SPACE1_DIM1]; /* Information to write */ hid_t fid1; /* HDF5 File IDs */ @@ -2729,8 +2730,8 @@ static void gent_vldatatypes3(void) static void gent_vldatatypes4(void) { typedef struct { /* Struct that the VL sequences are composed of */ - int i; - float f; + int i; + float f; } s1; hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hid_t fid1; /* HDF5 File IDs */ @@ -2748,7 +2749,7 @@ static void gent_vldatatypes4(void) for(j=0; j<(i+1); j++) { ((s1 *)wdata[i].p)[j].i=i*10+j; ((s1 *)wdata[i].p)[j].f=(float)((i*20+j)/3.0); - } /* end for */ + } /* end for */ } /* end for */ /* Create file */ @@ -2859,7 +2860,7 @@ static void gent_vldatatypes5(void) via region reference for testing refion reference output. Note: this was added originally prepared for bug2092. before the fix h5dump didn't display array indices every 262 x N (N > 0) based on 2000x1000 dims. -*/ + */ #define SPACE_ARRAY1BIG_DIM 2000 #define ARRAY1BIG_DIM 1000 @@ -2875,7 +2876,7 @@ static void gent_array1_big(void) int i,j; /* counting variables */ herr_t ret; /* Generic return value */ - + /* for region reference dataset */ hid_t dset2; hid_t sid2; @@ -3100,8 +3101,8 @@ static void gent_array3(void) static void gent_array4(void) { typedef struct { /* Typedef for compound datatype */ - int i; - float f; + int i; + float f; } s2_t; s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ hid_t fid1; /* HDF5 File IDs */ @@ -3166,8 +3167,8 @@ static void gent_array4(void) static void gent_array5(void) { typedef struct { /* Typedef for compound datatype */ - int i; - float f[ARRAY1_DIM1]; + int i; + float f[ARRAY1_DIM1]; } s2_t; s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ hid_t fid1; /* HDF5 File IDs */ @@ -3385,7 +3386,7 @@ static void gent_array8(void) * elements within the array datatype. */ for (i=0; i<F64_DIM1; i++) - wdata[i] = i; + wdata[i] = i; /* * Create a new file using the default properties. @@ -3424,9 +3425,9 @@ static void gent_array8(void) static void gent_empty(void) { typedef struct { - int a; - float b; - char c; + int a; + float b; + char c; } empty_struct; hid_t file, dset, space, type; hsize_t dims[] = { SPACE1_DIM1 }; @@ -3581,8 +3582,8 @@ void gent_split_file(void) dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - for(j = 0; j < 15; j++) - dset[i][j] = i + j; + for(j = 0; j < 15; j++) + dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); H5Sclose(space); @@ -3613,8 +3614,8 @@ void gent_family(void) dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - for(j = 0; j < 15; j++) - dset[i][j] = i + j; + for(j = 0; j < 15; j++) + dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); H5Sclose(space); @@ -3653,13 +3654,13 @@ void gent_multi(void) memb_map[mt] = mt; sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; -/*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ + /*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ memb_addr[mt] = MAX(mt - 1,0) * (HADDR_MAX / 10); } memb_map[H5FD_MEM_DEFAULT] = H5FD_MEM_SUPER; H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, - memb_addr, FALSE); + memb_addr, FALSE); fid = H5Fcreate(FILE36, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -3670,8 +3671,8 @@ void gent_multi(void) dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 10; i++) - for(j = 0; j < 15; j++) - dset[i][j] = i + j; + for(j = 0; j < 15; j++) + dset[i][j] = i + j; H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); @@ -3704,11 +3705,11 @@ static void gent_large_objname(void) static void gent_vlstr(void) { const char *wdata[SPACE1_DIM1]= { - "Four score and seven years ago our forefathers brought forth on this continent a new nation,", - "conceived in liberty and dedicated to the proposition that all men are created equal.", - "", - NULL - }; /* Information to write */ + "Four score and seven years ago our forefathers brought forth on this continent a new nation,", + "conceived in liberty and dedicated to the proposition that all men are created equal.", + "", + NULL + }; /* Information to write */ const char *string_att= "This is the string for the attribute"; hid_t fid1; /* HDF5 File IDs */ hid_t dataset, root; /* Dataset ID */ @@ -3753,12 +3754,12 @@ static void gent_vlstr(void) static void gent_char(void) { const char *wdata = - "Four score and seven years ago our forefathers brought " - "forth on this continent a new nation, conceived in " - "liberty and dedicated to the proposition that all " - "men are created equal. Now we are engaged in a great " - "civil war, testing whether that nation or any nation " - "so conceived and so dedicated can long endure."; + "Four score and seven years ago our forefathers brought " + "forth on this continent a new nation, conceived in " + "liberty and dedicated to the proposition that all " + "men are created equal. Now we are engaged in a great " + "civil war, testing whether that nation or any nation " + "so conceived and so dedicated can long endure."; hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1; /* Dataspace ID */ @@ -3799,427 +3800,427 @@ static void gent_char(void) */ static void write_attr_in(hid_t loc_id, - const char* dset_name, /* for saving reference to dataset*/ - hid_t fid) + const char* dset_name, /* for saving reference to dataset*/ + hid_t fid) { - /* Compound datatype */ - typedef struct s_t - { - char a; - double b; - } s_t; - - typedef enum - { - E_RED, - E_GREEN - } e_t; - - hid_t aid; - hid_t sid; - hid_t tid; - herr_t status; - int val, i, j, k, n; - float f; - - /* create 1D attributes with dimension [2], 2 elements */ - hsize_t dims[1]={2}; - char buf1[2][2]= {"ab","de"}; /* string */ - char buf2[2]= {1,2}; /* bitfield, opaque */ - s_t buf3[2]= {{1,2},{3,4}}; /* compound */ - hobj_ref_t buf4[2]; /* reference */ - hvl_t buf5[2]; /* vlen */ - hsize_t dimarray[1]={3}; /* array dimension */ - int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int buf7[2]= {1,2}; /* integer */ - float buf8[2]= {1,2}; /* float */ - - /* create 2D attributes with dimension [3][2], 6 elements */ - hsize_t dims2[2]={3,2}; - char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ - char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ - s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ - hobj_ref_t buf42[3][2]; /* reference */ - hvl_t buf52[3][2]; /* vlen */ - int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ - int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ - float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ - - /* create 3D attributes with dimension [4][3][2], 24 elements */ - hsize_t dims3[3]={4,3,2}; - char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", - "rs","tu","vw","xz","AB","CD","EF","GH", - "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ - char buf23[4][3][2]; /* bitfield, opaque */ - s_t buf33[4][3][2]; /* compound */ - hobj_ref_t buf43[4][3][2]; /* reference */ - hvl_t buf53[4][3][2]; /* vlen */ - int buf63[24][3]; /* array */ - int buf73[4][3][2]; /* integer */ - float buf83[4][3][2]; /* float */ + /* Compound datatype */ + typedef struct s_t + { + char a; + double b; + } s_t; + typedef enum + { + E_RED, + E_GREEN + } e_t; -/*------------------------------------------------------------------------- - * 1D attributes - *------------------------------------------------------------------------- - */ + hid_t aid; + hid_t sid; + hid_t tid; + herr_t status; + int val, i, j, k, n; + float f; + + /* create 1D attributes with dimension [2], 2 elements */ + hsize_t dims[1]={2}; + char buf1[2][2]= {"ab","de"}; /* string */ + char buf2[2]= {1,2}; /* bitfield, opaque */ + s_t buf3[2]= {{1,2},{3,4}}; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1]={3}; /* array dimension */ + int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ + int buf7[2]= {1,2}; /* integer */ + float buf8[2]= {1,2}; /* float */ + + /* create 2D attributes with dimension [3][2], 6 elements */ + hsize_t dims2[2]={3,2}; + char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ + char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ + s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ + int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ + float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ + + /* create 3D attributes with dimension [4][3][2], 24 elements */ + hsize_t dims3[3]={4,3,2}; + char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ -/*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, 2); - write_attr(loc_id,1,dims,"string",tid,buf1); - status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,1,dims,"bitfield",tid,buf2); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * 1D attributes + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_OPAQUE, 1); - status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,1,dims,"opaque",tid,buf2); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, 2); + write_attr(loc_id,1,dims,"string",tid,buf1); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,1,dims,"compound",tid,buf3); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id,1,dims,"bitfield",tid,buf2); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - /* Create references to dataset */ - if(dset_name) - { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); - write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); - } + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id,1,dims,"opaque",tid,buf2); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); - H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,1,dims,"enum",tid,0); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id,1,dims,"compound",tid,buf3); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if(dset_name) + { + status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); + write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + } - /* Allocate and initialize VL dataset to write */ - - buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); - ((int *)buf5[0].p)[0] = 1; - buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); - ((int *)buf5[1].p)[0] = 2; - ((int *)buf5[1].p)[1] = 3; - - sid = H5Screate_simple(1, dims, NULL); - tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); - status = H5Awrite(aid, tid, buf5); - HDassert(status >= 0); - status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); - status = H5Aclose(aid); - status = H5Tclose(tid); - status = H5Sclose(sid); + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id,1,dims,"enum",tid,0); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_attr(loc_id, 1, dims, "array", tid, buf6); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_INTEGER and H5T_FLOAT - *------------------------------------------------------------------------- - */ - write_attr(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); - write_attr(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); + /* Allocate and initialize VL dataset to write */ + buf5[0].len = 1; + buf5[0].p = HDmalloc(1 * sizeof(int)); + ((int *)buf5[0].p)[0] = 1; + buf5[1].len = 2; + buf5[1].p = HDmalloc(2 * sizeof(int)); + ((int *)buf5[1].p)[0] = 2; + ((int *)buf5[1].p)[1] = 3; + + sid = H5Screate_simple(1, dims, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf5); + HDassert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); + HDassert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); -/*------------------------------------------------------------------------- - * 2D attributes - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 1, dims, "array", tid, buf6); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, 2); - write_attr(loc_id,2,dims2,"string2D",tid,buf12); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + write_attr(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_attr(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); -/*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,2,dims2,"bitfield2D",tid,buf22); - status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_OPAQUE, 1); - status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,2,dims2,"opaque2D",tid,buf22); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * 2D attributes + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,2,dims2,"compound2D",tid,buf32); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, 2); + write_attr(loc_id,2,dims2,"string2D",tid,buf12); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - /* Create references to dataset */ - if(dset_name) - { - for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); - } - } - write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); - } + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id,2,dims2,"bitfield2D",tid,buf22); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); - H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,2,dims2,"enum2D",tid,0); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id,2,dims2,"opaque2D",tid,buf22); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id,2,dims2,"compound2D",tid,buf32); + status = H5Tclose(tid); - /* Allocate and initialize VL dataset to write */ - n=0; - for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) { - int l; - - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; - for(l = 0; l < i + 1; l++) - ((int *)buf52[i][j].p)[l] = n++; - } - } - - sid = H5Screate_simple(2, dims2, NULL); - tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); - status = H5Awrite(aid, tid, buf52); - HDassert(status >= 0); - status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); - HDassert(status >= 0); - status = H5Aclose(aid); - status = H5Tclose(tid); - status = H5Sclose(sid); + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if(dset_name) + { + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { + status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); + } + } + write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + } -/*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_attr(loc_id, 2, dims2, "array2D", tid, buf62); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id,2,dims2,"enum2D",tid,0); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_INTEGER and H5T_FLOAT - *------------------------------------------------------------------------- - */ - write_attr(loc_id, 2, dims2, "integer2D", H5T_NATIVE_INT, buf72); - write_attr(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + /* Allocate and initialize VL dataset to write */ + n=0; + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { + int l; + + buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].len = i + 1; + for(l = 0; l < i + 1; l++) + ((int *)buf52[i][j].p)[l] = n++; + } + } -/*------------------------------------------------------------------------- - * 3D attributes - *------------------------------------------------------------------------- - */ + sid = H5Screate_simple(2, dims2, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf52); + HDassert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); + HDassert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); -/*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, 2); - write_attr(loc_id,3,dims3,"string3D",tid,buf13); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 2, dims2, "array2D", tid, buf62); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + write_attr(loc_id, 2, dims2, "integer2D", H5T_NATIVE_INT, buf72); + write_attr(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); - n=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - buf23[i][j][k]=n++; - } - } - } - tid = H5Tcopy(H5T_STD_B8LE); - write_attr(loc_id,3,dims3,"bitfield3D",tid,buf23); - status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_OPAQUE, 1); - status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_attr(loc_id,3,dims3,"opaque3D",tid,buf23); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * 3D attributes + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, 2); + write_attr(loc_id,3,dims3,"string3D",tid,buf13); + status = H5Tclose(tid); - n=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - buf33[i][j][k].a=n++; - buf33[i][j][k].b=n++; - } - } - } - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_attr(loc_id,3,dims3,"compound3D",tid,buf33); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - /* Create references to dataset */ - if(dset_name) - { - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); - } - } - write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); - } + n=1; + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + buf23[i][j][k]=n++; + } + } + } + tid = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id,3,dims3,"bitfield3D",tid,buf23); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); - H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_attr(loc_id,3,dims3,"enum3D",tid,0); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_attr(loc_id,3,dims3,"opaque3D",tid,buf23); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ - /* Allocate and initialize VL dataset to write */ - n = 0; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - int l; - - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; - for(l = 0; l < i + 1; l++) - ((int *)buf53[i][j][k].p)[l] = n++; - } - } - } - - sid = H5Screate_simple(3, dims3, NULL); - tid = H5Tvlen_create(H5T_NATIVE_INT); - aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); - status = H5Awrite(aid, tid, buf53); - HDassert(status >= 0); - status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); - HDassert(status >= 0); - status = H5Aclose(aid); - status = H5Tclose(tid); - status = H5Sclose(sid); + n=1; + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + buf33[i][j][k].a=n++; + buf33[i][j][k].b=n++; + } + } + } + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id,3,dims3,"compound3D",tid,buf33); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - n = 1; - for(i = 0; i < 24; i++) - for(j = 0; j < (int)dimarray[0]; j++) - buf63[i][j] = n++; + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if(dset_name) + { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) + status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); + } + } + write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + } - tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_attr(loc_id, 3, dims3, "array3D", tid, buf63); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_attr(loc_id,3,dims3,"enum3D",tid,0); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_INTEGER and H5T_FLOAT - *------------------------------------------------------------------------- - */ - n=1; f=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - buf73[i][j][k]=n++; - buf83[i][j][k]=f++; - } - } - } - write_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - write_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n = 0; + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + int l; + + buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].len = i + 1; + for(l = 0; l < i + 1; l++) + ((int *)buf53[i][j][k].p)[l] = n++; + } + } + } + + sid = H5Screate_simple(3, dims3, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); + status = H5Awrite(aid, tid, buf53); + HDassert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); + HDassert(status >= 0); + status = H5Aclose(aid); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + n = 1; + for(i = 0; i < 24; i++) + for(j = 0; j < (int)dimarray[0]; j++) + buf63[i][j] = n++; + + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 3, dims3, "array3D", tid, buf63); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + n=1; f=1; + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + buf73[i][j][k]=n++; + buf83[i][j][k]=f++; + } + } + } + write_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); + write_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } @@ -4239,441 +4240,441 @@ static void write_attr_in(hid_t loc_id, */ static void write_dset_in(hid_t loc_id, - const char* dset_name, /* for saving reference to dataset*/ - hid_t fid) + const char* dset_name, /* for saving reference to dataset*/ + hid_t fid) { - /* Compound datatype */ - typedef struct s_t - { - char a; - double b; - } s_t; - - typedef enum - { - E_RED, - E_GREEN - } e_t; - - hid_t did; - hid_t sid; - hid_t tid; - hid_t plist_id; - herr_t status; - int val, i, j, k, n; - float f; - int fillvalue=2; - - /* create 1D attributes with dimension [2], 2 elements */ - hsize_t dims[1]={2}; - char buf1[2][2]= {"ab","de"}; /* string */ - char buf2[2]= {1,2}; /* bitfield, opaque */ - s_t buf3[2]= {{1,2},{3,4}}; /* compound */ - hobj_ref_t buf4[2]; /* reference */ - hvl_t buf5[2]; /* vlen */ - hsize_t dimarray[1]={3}; /* array dimension */ - int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int buf7[2]= {1,2}; /* integer */ - float buf8[2]= {1,2}; /* float */ - - /* create 2D attributes with dimension [3][2], 6 elements */ - hsize_t dims2[2]={3,2}; - char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ - char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ - s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ - hobj_ref_t buf42[3][2]; /* reference */ - hvl_t buf52[3][2]; /* vlen */ - int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ - int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ - float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ - - /* create 3D attributes with dimension [4][3][2], 24 elements */ - hsize_t dims3[3]={4,3,2}; - char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", - "rs","tu","vw","xz","AB","CD","EF","GH", - "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ - char buf23[4][3][2]; /* bitfield, opaque */ - s_t buf33[4][3][2]; /* compound */ - hobj_ref_t buf43[4][3][2]; /* reference */ - hvl_t buf53[4][3][2]; /* vlen */ - int buf63[24][3]; /* array */ - int buf73[4][3][2]; /* integer */ - float buf83[4][3][2]; /* float */ + /* Compound datatype */ + typedef struct s_t + { + char a; + double b; + } s_t; + typedef enum + { + E_RED, + E_GREEN + } e_t; -/*------------------------------------------------------------------------- - * 1D - *------------------------------------------------------------------------- - */ + hid_t did; + hid_t sid; + hid_t tid; + hid_t plist_id; + herr_t status; + int val, i, j, k, n; + float f; + int fillvalue=2; + + /* create 1D attributes with dimension [2], 2 elements */ + hsize_t dims[1]={2}; + char buf1[2][2]= {"ab","de"}; /* string */ + char buf2[2]= {1,2}; /* bitfield, opaque */ + s_t buf3[2]= {{1,2},{3,4}}; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1]={3}; /* array dimension */ + int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ + int buf7[2]= {1,2}; /* integer */ + float buf8[2]= {1,2}; /* float */ + + /* create 2D attributes with dimension [3][2], 6 elements */ + hsize_t dims2[2]={3,2}; + char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ + char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ + s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ + int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ + float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ + + /* create 3D attributes with dimension [4][3][2], 24 elements */ + hsize_t dims3[3]={4,3,2}; + char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ -/*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, 2); - write_dset(loc_id,1,dims,"string",tid,buf1); - status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,1,dims,"bitfield",tid,buf2); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * 1D + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_OPAQUE, 1); - status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,1,dims,"opaque",tid,buf2); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, 2); + write_dset(loc_id,1,dims,"string",tid,buf1); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,1,dims,"compound",tid,buf3); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_STD_B8LE); + write_dset(loc_id,1,dims,"bitfield",tid,buf2); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - /* Create references to dataset */ - if(dset_name) - { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); - write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); - } + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_dset(loc_id,1,dims,"opaque",tid,buf2); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); - H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,1,dims,"enum",tid,0); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_dset(loc_id,1,dims,"compound",tid,buf3); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if(dset_name) + { + status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); + write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + } - /* Allocate and initialize VL dataset to write */ - - buf5[0].len = 1; - buf5[0].p = HDmalloc( 1 * sizeof(int)); - ((int *)buf5[0].p)[0]=1; - buf5[1].len = 2; - buf5[1].p = HDmalloc( 2 * sizeof(int)); - ((int *)buf5[1].p)[0]=2; - ((int *)buf5[1].p)[1]=3; - - sid = H5Screate_simple(1, dims, NULL); - tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); - HDassert(status >= 0); - status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); - status = H5Dclose(did); - status = H5Tclose(tid); - status = H5Sclose(sid); + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_dset(loc_id,1,dims,"enum",tid,0); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_dset(loc_id, 1, dims, "array", tid, buf6); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_INTEGER and H5T_FLOAT - *------------------------------------------------------------------------- - */ - write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); + /* Allocate and initialize VL dataset to write */ + buf5[0].len = 1; + buf5[0].p = HDmalloc( 1 * sizeof(int)); + ((int *)buf5[0].p)[0]=1; + buf5[1].len = 2; + buf5[1].p = HDmalloc( 2 * sizeof(int)); + ((int *)buf5[1].p)[0]=2; + ((int *)buf5[1].p)[1]=3; + + sid = H5Screate_simple(1, dims, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); + HDassert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); + HDassert(status >= 0); + status = H5Dclose(did); + status = H5Tclose(tid); + status = H5Sclose(sid); -/*------------------------------------------------------------------------- - * 2D - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_dset(loc_id, 1, dims, "array", tid, buf6); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, 2); - write_dset(loc_id,2,dims2,"string2D",tid,buf12); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); + write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); -/*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,2,dims2,"bitfield2D",tid,buf22); - status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_OPAQUE, 1); - status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,2,dims2,"opaque2D",tid,buf22); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * 2D + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,2,dims2,"compound2D",tid,buf32); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, 2); + write_dset(loc_id,2,dims2,"string2D",tid,buf12); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - /* Create references to dataset */ - if(dset_name) - { - for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); - } - } - write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); - } + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_STD_B8LE); + write_dset(loc_id,2,dims2,"bitfield2D",tid,buf22); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); - H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,2,dims2,"enum2D",tid,0); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_dset(loc_id,2,dims2,"opaque2D",tid,buf22); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_dset(loc_id,2,dims2,"compound2D",tid,buf32); + status = H5Tclose(tid); - /* Allocate and initialize VL dataset to write */ - n=0; - for(i = 0; i < 3; i++) - for(j = 0; j < 2; j++) { - int l; - - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; - for(l = 0; l < i + 1; l++) - ((int *)buf52[i][j].p)[l] = n++; - } - - sid = H5Screate_simple(2, dims2, NULL); - tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); - HDassert(status >= 0); - status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); - HDassert(status >= 0); - status = H5Dclose(did); - status = H5Tclose(tid); - status = H5Sclose(sid); + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if(dset_name) + { + for(i = 0; i < 3; i++) { + for(j = 0; j < 2; j++) { + status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); + } + } + write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + } -/*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_dset(loc_id, 2, dims2, "array2D", tid, buf62); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_dset(loc_id,2,dims2,"enum2D",tid,0); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_INTEGER, write a fill value - *------------------------------------------------------------------------- - */ - plist_id = H5Pcreate(H5P_DATASET_CREATE); - status = H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue); - sid = H5Screate_simple(2, dims2, NULL); - did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT); - status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72); - status = H5Pclose(plist_id); - status = H5Dclose(did); - status = H5Sclose(sid); + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_FLOAT - *------------------------------------------------------------------------- - */ + /* Allocate and initialize VL dataset to write */ + n=0; + for(i = 0; i < 3; i++) + for(j = 0; j < 2; j++) { + int l; - write_dset(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); + buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].len = i + 1; + for(l = 0; l < i + 1; l++) + ((int *)buf52[i][j].p)[l] = n++; + } + sid = H5Screate_simple(2, dims2, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); + HDassert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); + HDassert(status >= 0); + status = H5Dclose(did); + status = H5Tclose(tid); + status = H5Sclose(sid); -/*------------------------------------------------------------------------- - * 3D - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_dset(loc_id, 2, dims2, "array2D", tid, buf62); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_C_S1); - status = H5Tset_size(tid, 2); - write_dset(loc_id,3,dims3,"string3D",tid,buf13); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_INTEGER, write a fill value + *------------------------------------------------------------------------- + */ + plist_id = H5Pcreate(H5P_DATASET_CREATE); + status = H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue); + sid = H5Screate_simple(2, dims2, NULL); + did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT); + status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72); + status = H5Pclose(plist_id); + status = H5Dclose(did); + status = H5Sclose(sid); -/*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_FLOAT + *------------------------------------------------------------------------- + */ - n=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - buf23[i][j][k]=n++; - } - } - } - tid = H5Tcopy(H5T_STD_B8LE); - write_dset(loc_id,3,dims3,"bitfield3D",tid,buf23); - status = H5Tclose(tid); + write_dset(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); -/*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_OPAQUE, 1); - status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ - write_dset(loc_id,3,dims3,"opaque3D",tid,buf23); - status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * 3D + *------------------------------------------------------------------------- + */ - n=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - buf33[i][j][k].a=n++; - buf33[i][j][k].b=n++; - } - } - } - tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); - H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); - write_dset(loc_id,3,dims3,"compound3D",tid,buf33); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_C_S1); + status = H5Tset_size(tid, 2); + write_dset(loc_id,3,dims3,"string3D",tid,buf13); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - /* Create references to dataset */ - if(dset_name) - { - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); - } - } - write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); - } + /*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(tid, "RED", (val = 0, &val)); - H5Tenum_insert(tid, "GREEN", (val = 1, &val)); - write_dset(loc_id,3,dims3,"enum3D",tid,0); - status = H5Tclose(tid); + n=1; + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + buf23[i][j][k]=n++; + } + } + } + tid = H5Tcopy(H5T_STD_B8LE); + write_dset(loc_id,3,dims3,"bitfield3D",tid,buf23); + status = H5Tclose(tid); -/*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(tid, "1-byte opaque type"); /* must set this */ + write_dset(loc_id,3,dims3,"opaque3D",tid,buf23); + status = H5Tclose(tid); - /* Allocate and initialize VL dataset to write */ - n = 0; - for(i = 0; i < 4; i++) - for(j = 0; j < 3; j++) - for(k = 0; k < 2; k++) { - int l; - - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; - for(l = 0; l < i + 1; l++) - ((int *)buf53[i][j][k].p)[l] = n++; - } - - sid = H5Screate_simple(3, dims3, NULL); - tid = H5Tvlen_create(H5T_NATIVE_INT); - did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); - HDassert(status >= 0); - status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); - HDassert(status >= 0); - status = H5Dclose(did); - status = H5Tclose(tid); - status = H5Sclose(sid); + /*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - n=1; - for(i = 0; i < 24; i++) { - for(j = 0; j < (int)dimarray[0]; j++) { - buf63[i][j]=n++; - } - } + n=1; + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + buf33[i][j][k].a=n++; + buf33[i][j][k].b=n++; + } + } + } + tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(tid, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_dset(loc_id,3,dims3,"compound3D",tid,buf33); + status = H5Tclose(tid); - tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_dset(loc_id, 3, dims3, "array3D", tid, buf63); - status = H5Tclose(tid); + /*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if(dset_name) + { + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) + status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); + } + } + write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + } -/*------------------------------------------------------------------------- - * H5T_INTEGER and H5T_FLOAT - *------------------------------------------------------------------------- - */ - n=1; f=1; - for(i = 0; i < 4; i++) { - for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) { - buf73[i][j][k]=n++; - buf83[i][j][k]=f++; - } - } - } - write_dset(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); - write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); + /*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + tid = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(tid, "RED", (val = 0, &val)); + H5Tenum_insert(tid, "GREEN", (val = 1, &val)); + write_dset(loc_id,3,dims3,"enum3D",tid,0); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n = 0; + for(i = 0; i < 4; i++) + for(j = 0; j < 3; j++) + for(k = 0; k < 2; k++) { + int l; + + buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].len = i + 1; + for(l = 0; l < i + 1; l++) + ((int *)buf53[i][j][k].p)[l] = n++; + } + + sid = H5Screate_simple(3, dims3, NULL); + tid = H5Tvlen_create(H5T_NATIVE_INT); + did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); + HDassert(status >= 0); + status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); + HDassert(status >= 0); + status = H5Dclose(did); + status = H5Tclose(tid); + status = H5Sclose(sid); + + /*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + n=1; + for(i = 0; i < 24; i++) { + for(j = 0; j < (int)dimarray[0]; j++) { + buf63[i][j]=n++; + } + } + + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_dset(loc_id, 3, dims3, "array3D", tid, buf63); + status = H5Tclose(tid); + + /*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + n=1; f=1; + for(i = 0; i < 4; i++) { + for(j = 0; j < 3; j++) { + for(k = 0; k < 2; k++) { + buf73[i][j][k]=n++; + buf83[i][j][k]=f++; + } + } + } + write_dset(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); + write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } @@ -4719,18 +4720,18 @@ static void gent_attr_all(void) root_id = H5Gopen2(fid, "/", H5P_DEFAULT); /*------------------------------------------------------------------------- - * write a series of attributes on the dataset, group - *------------------------------------------------------------------------- - */ + * write a series of attributes on the dataset, group + *------------------------------------------------------------------------- + */ write_attr_in(did,"dset",fid); write_attr_in(group_id,NULL,0); write_attr_in(root_id,NULL,0); /*------------------------------------------------------------------------- - * write a series of datasets on group 2 - *------------------------------------------------------------------------- - */ + * write a series of datasets on group 2 + *------------------------------------------------------------------------- + */ write_dset_in(group2_id,"/dset",fid); @@ -4764,27 +4765,27 @@ static void gent_attr_all(void) static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, - hid_t tid, void *buf) + hid_t tid, void *buf) { - hid_t aid; - hid_t sid; - herr_t status; + hid_t aid; + hid_t sid; + herr_t status; - /* Create a buf space */ - sid = H5Screate_simple(rank, dims, NULL); + /* Create a buf space */ + sid = H5Screate_simple(rank, dims, NULL); - /* Create the attribute */ - aid = H5Acreate2(loc_id, attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + /* Create the attribute */ + aid = H5Acreate2(loc_id, attr_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - /* Write the buf */ - if(buf) - status = H5Awrite(aid, tid, buf); + /* Write the buf */ + if(buf) + status = H5Awrite(aid, tid, buf); - /* Close */ - status = H5Aclose(aid); - status = H5Sclose(sid); + /* Close */ + status = H5Aclose(aid); + status = H5Sclose(sid); - return status; + return status; } /*------------------------------------------------------------------------- @@ -4803,7 +4804,7 @@ int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, static int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, - hid_t tid, void *buf ) + hid_t tid, void *buf ) { hid_t did; hid_t sid; @@ -4831,23 +4832,23 @@ static void gent_compound_complex(void) { /* Structure and array for compound types */ typedef struct Array1Struct { - int a; - const char *b[F41_DIMb]; - char c[F41_ARRAY_DIMc]; - short d[F41_ARRAY_DIMd1][F41_ARRAY_DIMd2]; - float e; - double f[F41_ARRAY_DIMf]; - char g; + int a; + const char *b[F41_DIMb]; + char c[F41_ARRAY_DIMc]; + short d[F41_ARRAY_DIMd1][F41_ARRAY_DIMd2]; + float e; + double f[F41_ARRAY_DIMf]; + char g; } Array1Struct; Array1Struct Array1[F41_LENGTH]; /* Define the value of the string array */ const char *quote [F41_DIMb] = { - "A fight is a contract that takes two people to honor.", - "A combative stance means that you've accepted the contract.", - "In which case, you deserve what you get.", - " -- Professor Cheng Man-ch'ing" - }; + "A fight is a contract that takes two people to honor.", + "A combative stance means that you've accepted the contract.", + "In which case, you deserve what you get.", + " -- Professor Cheng Man-ch'ing" + }; /* Define the value of the character array */ char chararray [F41_ARRAY_DIMc] = {'H', 'e', 'l', 'l', 'o', '!'}; @@ -4874,24 +4875,24 @@ static void gent_compound_complex(void) Array1[m].a = m; for(n = 0; n < F41_DIMb; n++) { - Array1[m].b[n] = quote[n]; - } + Array1[m].b[n] = quote[n]; + } - for(n = 0; n < F41_ARRAY_DIMc; n++) { + for(n = 0; n < F41_ARRAY_DIMc; n++) { Array1[m].c[n] = chararray[n]; - } + } - for(n = 0; n < F41_ARRAY_DIMd1; n++) { - for(o = 0; o < F41_ARRAY_DIMd2; o++){ - Array1[m].d[n][o] = m + n + o; + for(n = 0; n < F41_ARRAY_DIMd1; n++) { + for(o = 0; o < F41_ARRAY_DIMd2; o++){ + Array1[m].d[n][o] = m + n + o; } } Array1[m].e = (float)( m * .96 ); - for(n = 0; n < F41_ARRAY_DIMf; n++) { + for(n = 0; n < F41_ARRAY_DIMf; n++) { Array1[m].f[n] = ( m * 1024.9637 ); - } + } Array1[m].g = 'm'; } @@ -4902,7 +4903,7 @@ static void gent_compound_complex(void) /* Create the file */ datafile = H5Fcreate(FILE41, H5F_ACC_TRUNC, H5P_DEFAULT, - H5P_DEFAULT); + H5P_DEFAULT); HDassert(datafile >= 0); /* Copy the array data type for the string array */ @@ -4939,40 +4940,40 @@ static void gent_compound_complex(void) /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, "a_name", - HOFFSET(Array1Struct, a), H5T_NATIVE_INT); + HOFFSET(Array1Struct, a), H5T_NATIVE_INT); HDassert(status >= 0); status = H5Tinsert(Array1Structid, "b_name", - HOFFSET(Array1Struct, b), str_array_id); + HOFFSET(Array1Struct, b), str_array_id); HDassert(status >= 0); status = H5Tinsert(Array1Structid, "c_name", - HOFFSET(Array1Struct, c), array1_tid); + HOFFSET(Array1Struct, c), array1_tid); HDassert(status >= 0); status = H5Tinsert(Array1Structid, "d_name", - HOFFSET(Array1Struct, d), array2_tid); + HOFFSET(Array1Struct, d), array2_tid); HDassert(status >= 0); status = H5Tinsert(Array1Structid, "e_name", - HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT); + HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT); HDassert(status >= 0); status = H5Tinsert(Array1Structid, "f_name", - HOFFSET(Array1Struct, f), array4_tid); + HOFFSET(Array1Struct, f), array4_tid); HDassert(status >= 0); status = H5Tinsert(Array1Structid, "g_name", - HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR); + HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR); HDassert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(datafile, F41_DATASETNAME, Array1Structid, - dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, - H5P_DEFAULT, Array1); + H5P_DEFAULT, Array1); HDassert(status >= 0); /* Release resources */ @@ -5007,106 +5008,106 @@ static void gent_compound_complex(void) static void gent_named_dtype_attr(void) { - hid_t fid; - hid_t did; - hid_t sid; - hid_t tid; - hid_t aid; - hid_t gid; - int data=8; - herr_t ret; - - /* Create a file */ - fid=H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid>0); + hid_t fid; + hid_t did; + hid_t sid; + hid_t tid; + hid_t aid; + hid_t gid; + int data=8; + herr_t ret; -/*------------------------------------------------------------------------- - * datatype - *------------------------------------------------------------------------- - */ + /* Create a file */ + fid=H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + HDassert(fid>0); - /* Create a datatype to commit and use */ - tid=H5Tcopy(H5T_NATIVE_INT); - HDassert(tid>0); + /*------------------------------------------------------------------------- + * datatype + *------------------------------------------------------------------------- + */ - /* Commit datatype to file */ - ret = H5Tcommit2(fid, F42_TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + /* Create a datatype to commit and use */ + tid=H5Tcopy(H5T_NATIVE_INT); + HDassert(tid>0); - /* Create a hard link to the datatype */ - ret = H5Lcreate_hard(fid, F42_TYPENAME, fid, F42_LINKNAME, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + /* Commit datatype to file */ + ret = H5Tcommit2(fid, F42_TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + HDassert(ret >= 0); - /* Create a scalar dataspace used for all objects */ - sid = H5Screate(H5S_SCALAR); - HDassert(sid > 0); + /* Create a hard link to the datatype */ + ret = H5Lcreate_hard(fid, F42_TYPENAME, fid, F42_LINKNAME, H5P_DEFAULT, H5P_DEFAULT); + HDassert(ret >= 0); - /* Create attribute on commited datatype */ - aid = H5Acreate2(tid, F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + /* Create a scalar dataspace used for all objects */ + sid = H5Screate(H5S_SCALAR); + HDassert(sid > 0); - /* Write data into the attribute */ - ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + /* Create attribute on commited datatype */ + aid = H5Acreate2(tid, F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); + HDassert(aid > 0); -/*------------------------------------------------------------------------- - * dataset - *------------------------------------------------------------------------- - */ + /* Write data into the attribute */ + ret = H5Awrite(aid, H5T_NATIVE_INT, &data); + HDassert(ret >= 0); - /* Create dataset */ - did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(did > 0); + /*------------------------------------------------------------------------- + * dataset + *------------------------------------------------------------------------- + */ - /* Create attribute on dataset */ - aid = H5Acreate2(did, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + /* Create dataset */ + did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + HDassert(did > 0); - /* Write data into the attribute */ - ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + /* Create attribute on dataset */ + aid = H5Acreate2(did, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + HDassert(aid > 0); -/*------------------------------------------------------------------------- - * group - *------------------------------------------------------------------------- - */ + /* Write data into the attribute */ + ret = H5Awrite(aid, H5T_NATIVE_INT, &data); + HDassert(ret >= 0); - /* Create a group */ - gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid > 0); + /*------------------------------------------------------------------------- + * group + *------------------------------------------------------------------------- + */ - /* Create attribute on group */ - aid = H5Acreate2(gid, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + /* Create a group */ + gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + HDassert(gid > 0); - /* Write data into the attribute */ - ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + /* Create attribute on group */ + aid = H5Acreate2(gid, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); + HDassert(aid > 0); -/*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ + /* Write data into the attribute */ + ret = H5Awrite(aid, H5T_NATIVE_INT, &data); + HDassert(ret >= 0); - /* Close attribute */ - ret = H5Aclose(aid); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + + /* Close attribute */ + ret = H5Aclose(aid); + HDassert(ret >= 0); - /* Close dataset */ - ret = H5Dclose(did); - HDassert(ret >= 0); + /* Close dataset */ + ret = H5Dclose(did); + HDassert(ret >= 0); - /* Close dataspace */ - ret = H5Sclose(sid); - HDassert(ret >= 0); + /* Close dataspace */ + ret = H5Sclose(sid); + HDassert(ret >= 0); - /* Close datatype */ - ret = H5Tclose(tid); - HDassert(ret >= 0); + /* Close datatype */ + ret = H5Tclose(tid); + HDassert(ret >= 0); - /* Close file */ - ret = H5Fclose(fid); - HDassert(ret >= 0); + /* Close file */ + ret = H5Fclose(fid); + HDassert(ret >= 0); } @@ -5165,7 +5166,7 @@ static void gent_zero_dim_size(void) /* dataset */ dataset = H5Dcreate2(fid, "dset of 0 dimension size", H5T_STD_I32BE, space, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT); /* nothing should be written */ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); @@ -5189,11 +5190,11 @@ static void gent_zero_dim_size(void) */ static int make_dset(hid_t loc_id, - const char *name, - hid_t sid, - hid_t tid, - hid_t dcpl, - void *buf) + const char *name, + hid_t sid, + hid_t tid, + hid_t dcpl, + void *buf) { hid_t dsid; @@ -5211,7 +5212,7 @@ int make_dset(hid_t loc_id, return 0; -out: + out: H5E_BEGIN_TRY { H5Dclose(dsid); } H5E_END_TRY; @@ -5230,38 +5231,38 @@ out: static void make_external(hid_t fid) { - hid_t dcpl; /*dataset creation property list */ - hid_t sid; /*dataspace ID */ - hid_t dsid; /*dataset ID */ - hsize_t cur_size[1]; /*data space current size */ - hsize_t max_size[1]; /*data space maximum size */ - hsize_t size; /*bytes reserved for data in the external file*/ - int ret; + hid_t dcpl; /*dataset creation property list */ + hid_t sid; /*dataspace ID */ + hid_t dsid; /*dataset ID */ + hsize_t cur_size[1]; /*data space current size */ + hsize_t max_size[1]; /*data space maximum size */ + hsize_t size; /*bytes reserved for data in the external file*/ + int ret; - cur_size[0] = max_size[0] = 100; - size = (max_size[0]*sizeof(int)/2); + cur_size[0] = max_size[0] = 100; + size = (max_size[0]*sizeof(int)/2); - dcpl = H5Pcreate(H5P_DATASET_CREATE); - ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size); - HDassert(ret >= 0); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size); + HDassert(ret >= 0); - ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size); - HDassert(ret >= 0); + ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size); + HDassert(ret >= 0); - sid = H5Screate_simple(1, cur_size, max_size); - HDassert(ret >= 0); + sid = H5Screate_simple(1, cur_size, max_size); + HDassert(ret >= 0); - dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - HDassert(ret >= 0); + dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + HDassert(ret >= 0); - H5Dclose(dsid); - HDassert(ret >= 0); + H5Dclose(dsid); + HDassert(ret >= 0); - H5Sclose(sid); - HDassert(ret >= 0); + H5Sclose(sid); + HDassert(ret >= 0); - H5Pclose(dcpl); - HDassert(ret >= 0); + H5Pclose(dcpl); + HDassert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5273,312 +5274,312 @@ make_external(hid_t fid) */ static void gent_filters(void) { - hid_t fid; /* file id */ - hid_t dcpl; /* dataset creation property list */ - hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ + hid_t fid; /* file id */ + hid_t dcpl; /* dataset creation property list */ + hid_t sid; /* dataspace ID */ + hid_t tid; /* datatype ID */ #ifdef H5_HAVE_FILTER_SZIP - unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK; - unsigned szip_pixels_per_block=4; + unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK; + unsigned szip_pixels_per_block=4; #endif /* H5_HAVE_FILTER_SZIP */ - hsize_t dims1[RANK] = {DIM1,DIM2}; - hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; - int buf1[DIM1][DIM2]; - int i, j, n, ret; - - for(i=n=0; i<DIM1; i++){ - for(j=0; j<DIM2; j++){ - buf1[i][j]=n++; - } - } + hsize_t dims1[RANK] = {DIM1,DIM2}; + hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; + int buf1[DIM1][DIM2]; + int i, j, n, ret; + + for(i=n=0; i<DIM1; i++){ + for(j=0; j<DIM2; j++){ + buf1[i][j]=n++; + } + } - /* create a file */ - fid = H5Fcreate(FILE44, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid>=0); + /* create a file */ + fid = H5Fcreate(FILE44, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + HDassert(fid>=0); - /* create a space */ - sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); + /* create a space */ + sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); - /* create a dataset creation property list; the same DCPL is used for all dsets */ - dcpl = H5Pcreate(H5P_DATASET_CREATE); + /* create a dataset creation property list; the same DCPL is used for all dsets */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); -/*------------------------------------------------------------------------- - * create a compact and contiguous storage layout dataset - * add a comment to the datasets - *------------------------------------------------------------------------- - */ - ret = H5Pset_layout(dcpl, H5D_COMPACT); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * create a compact and contiguous storage layout dataset + * add a comment to the datasets + *------------------------------------------------------------------------- + */ + ret = H5Pset_layout(dcpl, H5D_COMPACT); + HDassert(ret >= 0); - ret=make_dset(fid,"compact",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"compact",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); - HDassert(ret >= 0); + ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); + HDassert(ret >= 0); - ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); - HDassert(ret >= 0); + ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); + HDassert(ret >= 0); - ret=make_dset(fid,"contiguous",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"contiguous",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); - HDassert(ret >= 0); + ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); + HDassert(ret >= 0); - ret = H5Pset_layout(dcpl, H5D_CHUNKED); - HDassert(ret >= 0); + ret = H5Pset_layout(dcpl, H5D_CHUNKED); + HDassert(ret >= 0); - ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + HDassert(ret >= 0); - ret=make_dset(fid,"chunked",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"chunked",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); - HDassert(ret >= 0); + ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * make several dataset with filters - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * make several dataset with filters + *------------------------------------------------------------------------- + */ - /* set up chunk */ - ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + /* set up chunk */ + ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * SZIP - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * SZIP + *------------------------------------------------------------------------- + */ #ifdef H5_HAVE_FILTER_SZIP - if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); - - /* set szip data */ - ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - HDassert(ret >= 0); - - ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); - } + if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); + + /* set szip data */ + ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); + HDassert(ret >= 0); + + ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); + } #endif /* H5_HAVE_FILTER_SZIP */ -/*------------------------------------------------------------------------- - * GZIP - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * GZIP + *------------------------------------------------------------------------- + */ #if defined (H5_HAVE_FILTER_DEFLATE) - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); - /* set deflate data */ - ret = H5Pset_deflate(dcpl, 9); - HDassert(ret >= 0); + /* set deflate data */ + ret = H5Pset_deflate(dcpl, 9); + HDassert(ret >= 0); - ret=make_dset(fid,"deflate",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"deflate",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); #endif -/*------------------------------------------------------------------------- - * shuffle - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * shuffle + *------------------------------------------------------------------------- + */ #if defined (H5_HAVE_FILTER_SHUFFLE) - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); - /* set the shuffle filter */ - ret = H5Pset_shuffle(dcpl); - HDassert(ret >= 0); + /* set the shuffle filter */ + ret = H5Pset_shuffle(dcpl); + HDassert(ret >= 0); - ret=make_dset(fid,"shuffle",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"shuffle",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); #endif -/*------------------------------------------------------------------------- - * checksum - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * checksum + *------------------------------------------------------------------------- + */ #if defined (H5_HAVE_FILTER_FLETCHER32) - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); - /* set the checksum filter */ - ret = H5Pset_fletcher32(dcpl); - HDassert(ret >= 0); + /* set the checksum filter */ + ret = H5Pset_fletcher32(dcpl); + HDassert(ret >= 0); - ret=make_dset(fid,"fletcher32",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"fletcher32",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); #endif -/*------------------------------------------------------------------------- - * nbit - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * nbit + *------------------------------------------------------------------------- + */ #if defined (H5_HAVE_FILTER_NBIT) - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); - - /* set the checksum filter */ - ret = H5Pset_nbit(dcpl); - HDassert(ret >= 0); - - tid=H5Tcopy(H5T_NATIVE_INT); - H5Tset_precision(tid,H5Tget_size(tid)-1); - ret=make_dset(fid,"nbit",sid,tid,dcpl,buf1); - HDassert(ret >= 0); + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); + + /* set the checksum filter */ + ret = H5Pset_nbit(dcpl); + HDassert(ret >= 0); + + tid=H5Tcopy(H5T_NATIVE_INT); + H5Tset_precision(tid,H5Tget_size(tid)-1); + ret=make_dset(fid,"nbit",sid,tid,dcpl,buf1); + HDassert(ret >= 0); #endif -/*------------------------------------------------------------------------- - * scaleoffset - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * scaleoffset + *------------------------------------------------------------------------- + */ #if defined (H5_HAVE_FILTER_SCALEOFFSET) - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); - /* set the scaleoffset filter */ - ret = H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT)); - HDassert(ret >= 0); + /* set the scaleoffset filter */ + ret = H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT)); + HDassert(ret >= 0); - ret=make_dset(fid,"scaleoffset",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"scaleoffset",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); #endif -/*------------------------------------------------------------------------- - * all filters - *------------------------------------------------------------------------- - */ - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * all filters + *------------------------------------------------------------------------- + */ + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); #if defined (H5_HAVE_FILTER_SHUFFLE) - /* set the shuffle filter */ - ret = H5Pset_shuffle(dcpl); - HDassert(ret >= 0); + /* set the shuffle filter */ + ret = H5Pset_shuffle(dcpl); + HDassert(ret >= 0); #endif #ifdef H5_HAVE_FILTER_SZIP - if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { - szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK; - /* set szip data */ - ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - HDassert(ret >= 0); - } + if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { + szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK; + /* set szip data */ + ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); + HDassert(ret >= 0); + } #endif /* H5_HAVE_FILTER_SZIP */ #if defined (H5_HAVE_FILTER_DEFLATE) - /* set deflate data */ - ret = H5Pset_deflate(dcpl, 5); - HDassert(ret >= 0); + /* set deflate data */ + ret = H5Pset_deflate(dcpl, 5); + HDassert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_FLETCHER32) - /* set the checksum filter */ - ret = H5Pset_fletcher32(dcpl); - HDassert(ret >= 0); + /* set the checksum filter */ + ret = H5Pset_fletcher32(dcpl); + HDassert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_NBIT) - /* set the nbit filter */ - ret = H5Pset_nbit(dcpl); - HDassert(ret >= 0); + /* set the nbit filter */ + ret = H5Pset_nbit(dcpl); + HDassert(ret >= 0); #endif - ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * user defined filter - *------------------------------------------------------------------------- - */ - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * user defined filter + *------------------------------------------------------------------------- + */ + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); - ret = H5Zregister (H5Z_MYFILTER); - HDassert(ret >= 0); + ret = H5Zregister (H5Z_MYFILTER); + HDassert(ret >= 0); - ret = H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); - HDassert(ret >= 0); + ret = H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); + HDassert(ret >= 0); - ret=make_dset(fid,"myfilter",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + ret=make_dset(fid,"myfilter",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); - /* remove the filters from the dcpl */ - ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - HDassert(ret >= 0); + /* remove the filters from the dcpl */ + ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * make an external dataset - *------------------------------------------------------------------------- - */ - make_external(fid); + /*------------------------------------------------------------------------- + * make an external dataset + *------------------------------------------------------------------------- + */ + make_external(fid); -/*------------------------------------------------------------------------- - * H5D_ALLOC_TIME_EARLY - *------------------------------------------------------------------------- - */ - ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); - HDassert(ret >= 0); - ret=make_dset(fid,"alloc_time_early",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * H5D_ALLOC_TIME_EARLY + *------------------------------------------------------------------------- + */ + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); + HDassert(ret >= 0); + ret=make_dset(fid,"alloc_time_early",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * H5D_ALLOC_TIME_INCR - *------------------------------------------------------------------------- - */ - ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); - HDassert(ret >= 0); - ret=make_dset(fid,"alloc_time_incr",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * H5D_ALLOC_TIME_INCR + *------------------------------------------------------------------------- + */ + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); + HDassert(ret >= 0); + ret=make_dset(fid,"alloc_time_incr",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * H5D_ALLOC_TIME_LATE - *------------------------------------------------------------------------- - */ - ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); - HDassert(ret >= 0); - ret=make_dset(fid,"alloc_time_late",sid,H5T_NATIVE_INT,dcpl,buf1); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * H5D_ALLOC_TIME_LATE + *------------------------------------------------------------------------- + */ + ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); + HDassert(ret >= 0); + ret=make_dset(fid,"alloc_time_late",sid,H5T_NATIVE_INT,dcpl,buf1); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * commit a H5G_TYPE type with a comment - *------------------------------------------------------------------------- - */ - tid = H5Tcopy(H5T_STD_B8LE); - ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * commit a H5G_TYPE type with a comment + *------------------------------------------------------------------------- + */ + tid = H5Tcopy(H5T_STD_B8LE); + ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + HDassert(ret >= 0); - ret = H5Oset_comment_by_name(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); - HDassert(ret >= 0); + ret = H5Oset_comment_by_name(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); + HDassert(ret >= 0); - ret = H5Tclose(tid); - HDassert(ret >= 0); + ret = H5Tclose(tid); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - ret = H5Sclose(sid); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + ret = H5Sclose(sid); + HDassert(ret >= 0); - ret = H5Pclose(dcpl); - HDassert(ret >= 0); + ret = H5Pclose(dcpl); + HDassert(ret >= 0); - ret = H5Fclose(fid); - HDassert(ret >= 0); + ret = H5Fclose(fid); + HDassert(ret >= 0); } @@ -5591,10 +5592,10 @@ static void gent_filters(void) */ static size_t myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, - const unsigned int UNUSED *cd_values, size_t nbytes, - size_t UNUSED *buf_size, void UNUSED **buf) + const unsigned int UNUSED *cd_values, size_t nbytes, + size_t UNUSED *buf_size, void UNUSED **buf) { - return nbytes; + return nbytes; } @@ -5609,21 +5610,21 @@ myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, static herr_t set_local_myfilter(hid_t dcpl_id, hid_t UNUSED tid, hid_t UNUSED sid) { - unsigned flags; /* Filter flags */ - size_t cd_nelmts = 0; /* Number of filter parameters */ - unsigned cd_values[2] = {5, 6}; /* Filter parameters */ + unsigned flags; /* Filter flags */ + size_t cd_nelmts = 0; /* Number of filter parameters */ + unsigned cd_values[2] = {5, 6}; /* Filter parameters */ - /* Get the filter's current parameters */ - if(H5Pget_filter_by_id2(dcpl_id, MYFILTER_ID, &flags, &cd_nelmts, cd_values, 0, NULL, NULL) < 0) - return(FAIL); + /* Get the filter's current parameters */ + if(H5Pget_filter_by_id2(dcpl_id, MYFILTER_ID, &flags, &cd_nelmts, cd_values, 0, NULL, NULL) < 0) + return(FAIL); - cd_nelmts = 2; + cd_nelmts = 2; - /* Modify the filter's parameters for this dataset */ - if(H5Pmodify_filter(dcpl_id, MYFILTER_ID, flags, cd_nelmts, cd_values) < 0) - return(FAIL); + /* Modify the filter's parameters for this dataset */ + if(H5Pmodify_filter(dcpl_id, MYFILTER_ID, flags, cd_nelmts, cd_values) < 0) + return(FAIL); - return(SUCCEED); + return(SUCCEED); } /*------------------------------------------------------------------------- @@ -5652,9 +5653,9 @@ static void gent_fcontents(void) /*------------------------------------------------------------------------- - * links - *------------------------------------------------------------------------- - */ + * links + *------------------------------------------------------------------------- + */ /* hard link to "dset" */ @@ -5703,9 +5704,9 @@ static void gent_fcontents(void) HDassert(ret >= 0); /*------------------------------------------------------------------------- - * datatypes - *------------------------------------------------------------------------- - */ + * datatypes + *------------------------------------------------------------------------- + */ tid = H5Tcopy(H5T_NATIVE_INT); ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); HDassert(ret >= 0); @@ -5725,9 +5726,9 @@ static void gent_fcontents(void) /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ + * close + *------------------------------------------------------------------------- + */ ret = H5Fclose(fid); @@ -5752,152 +5753,152 @@ static void gent_fcontents(void) */ static void gent_fvalues(void) { - /* compound datatype */ - typedef struct c_t - { - char a; - double b; - } c_t; - - - hid_t fid; /* file id */ - hid_t dcpl; /* dataset creation property list */ - hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ - hid_t did; /* datasetID */ - hsize_t dims[1]={2}; - int buf[2]={1,2}; /* integer */ - int fillval1=-99; /* integer fill value */ - c_t buf2[2]={{1,2},{3,4}}; /* compound */ - c_t fillval2[1]={{1,2}}; /* compound fill value */ - hvl_t buf3[2]; /* vlen */ - hvl_t fillval3; /* vlen fill value */ - hsize_t dimarray[1]={3}; /* array dimension */ - int buf4[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int ret; - - /* create a file */ - fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid>=0); - - /* create a space */ - sid = H5Screate_simple(1, dims, NULL); - - /* create a dataset creation property list */ - dcpl = H5Pcreate(H5P_DATASET_CREATE); + /* compound datatype */ + typedef struct c_t + { + char a; + double b; + } c_t; + + + hid_t fid; /* file id */ + hid_t dcpl; /* dataset creation property list */ + hid_t sid; /* dataspace ID */ + hid_t tid; /* datatype ID */ + hid_t did; /* datasetID */ + hsize_t dims[1]={2}; + int buf[2]={1,2}; /* integer */ + int fillval1=-99; /* integer fill value */ + c_t buf2[2]={{1,2},{3,4}}; /* compound */ + c_t fillval2[1]={{1,2}}; /* compound fill value */ + hvl_t buf3[2]; /* vlen */ + hvl_t fillval3; /* vlen fill value */ + hsize_t dimarray[1]={3}; /* array dimension */ + int buf4[2][3]= {{1,2,3},{4,5,6}}; /* array */ + int ret; -/*------------------------------------------------------------------------- - * make datasets with fill value combinations - * H5D_FILL_TIME_IFSET - *------------------------------------------------------------------------- - */ - ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); - HDassert(ret >= 0); + /* create a file */ + fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + HDassert(fid>=0); - ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + /* create a space */ + sid = H5Screate_simple(1, dims, NULL); - ret=make_dset(fid,"fill_time_ifset",sid,H5T_NATIVE_INT,dcpl,buf); - HDassert(ret >= 0); + /* create a dataset creation property list */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); -/*------------------------------------------------------------------------- - * H5D_FILL_TIME_NEVER - *------------------------------------------------------------------------- - */ - ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * make datasets with fill value combinations + * H5D_FILL_TIME_IFSET + *------------------------------------------------------------------------- + */ + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); + HDassert(ret >= 0); - ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + HDassert(ret >= 0); - ret=make_dset(fid,"fill_time_never",sid,H5T_NATIVE_INT,dcpl,buf); - HDassert(ret >= 0); + ret=make_dset(fid,"fill_time_ifset",sid,H5T_NATIVE_INT,dcpl,buf); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * H5D_FILL_TIME_ALLOC - *------------------------------------------------------------------------- - */ - ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * H5D_FILL_TIME_NEVER + *------------------------------------------------------------------------- + */ + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); + HDassert(ret >= 0); - ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + HDassert(ret >= 0); - ret=make_dset(fid,"fill_time_alloc",sid,H5T_NATIVE_INT,dcpl,buf); - HDassert(ret >= 0); + ret=make_dset(fid,"fill_time_never",sid,H5T_NATIVE_INT,dcpl,buf); + HDassert(ret >= 0); - ret = H5Pclose(dcpl); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * H5D_FILL_TIME_ALLOC + *------------------------------------------------------------------------- + */ + ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * dataset with no fill value - *------------------------------------------------------------------------- - */ - write_dset(fid,1,dims,"no_fill",H5T_NATIVE_INT,buf); + ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * dataset with a H5T_COMPOUND fill value - *------------------------------------------------------------------------- - */ - dcpl = H5Pcreate(H5P_DATASET_CREATE); - tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t)); - H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR); - H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE); - ret = H5Pset_fill_value(dcpl, tid, &fillval2); - HDassert(ret >= 0); - ret=make_dset(fid,"fill_compound",sid,tid,dcpl,buf2); - HDassert(ret >= 0); - ret = H5Tclose(tid); - HDassert(ret >= 0); - ret = H5Pclose(dcpl); - HDassert(ret >= 0); + ret=make_dset(fid,"fill_time_alloc",sid,H5T_NATIVE_INT,dcpl,buf); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * dataset with a H5T_VLEN fill value - *------------------------------------------------------------------------- - */ - buf3[0].len = 1; - buf3[0].p = HDmalloc( 1 * sizeof(int)); - ((int *)buf3[0].p)[0]=1; - buf3[1].len = 2; - buf3[1].p = HDmalloc(2 * sizeof(int)); - ((int *)buf3[1].p)[0] = 2; - ((int *)buf3[1].p)[1] = 3; - - tid = H5Tvlen_create(H5T_NATIVE_INT); - dcpl = H5Pcreate(H5P_DATASET_CREATE); - - fillval3.p=NULL; fillval3.len=0; - ret = H5Pset_fill_value(dcpl, tid, &fillval3); - HDassert(ret >= 0); - - did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); - HDassert(ret >= 0); - ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3); - HDassert(ret >= 0); - ret = H5Dclose(did); - ret = H5Tclose(tid); - ret = H5Pclose(dcpl); - HDassert(ret >= 0); + ret = H5Pclose(dcpl); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * dataset with a H5T_ARRAY fill value - *------------------------------------------------------------------------- - */ - tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); - write_dset(fid, 1, dims, "fill_array", tid, buf4); - ret = H5Tclose(tid); + /*------------------------------------------------------------------------- + * dataset with no fill value + *------------------------------------------------------------------------- + */ + write_dset(fid,1,dims,"no_fill",H5T_NATIVE_INT,buf); + /*------------------------------------------------------------------------- + * dataset with a H5T_COMPOUND fill value + *------------------------------------------------------------------------- + */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t)); + H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR); + H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE); + ret = H5Pset_fill_value(dcpl, tid, &fillval2); + HDassert(ret >= 0); + ret=make_dset(fid,"fill_compound",sid,tid,dcpl,buf2); + HDassert(ret >= 0); + ret = H5Tclose(tid); + HDassert(ret >= 0); + ret = H5Pclose(dcpl); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - ret = H5Sclose(sid); - HDassert(ret >= 0); - ret = H5Fclose(fid); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * dataset with a H5T_VLEN fill value + *------------------------------------------------------------------------- + */ + buf3[0].len = 1; + buf3[0].p = HDmalloc( 1 * sizeof(int)); + ((int *)buf3[0].p)[0]=1; + buf3[1].len = 2; + buf3[1].p = HDmalloc(2 * sizeof(int)); + ((int *)buf3[1].p)[0] = 2; + ((int *)buf3[1].p)[1] = 3; + + tid = H5Tvlen_create(H5T_NATIVE_INT); + dcpl = H5Pcreate(H5P_DATASET_CREATE); + + fillval3.p=NULL; fillval3.len=0; + ret = H5Pset_fill_value(dcpl, tid, &fillval3); + HDassert(ret >= 0); + + did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); + HDassert(ret >= 0); + ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3); + HDassert(ret >= 0); + ret = H5Dclose(did); + ret = H5Tclose(tid); + ret = H5Pclose(dcpl); + HDassert(ret >= 0); + + /*------------------------------------------------------------------------- + * dataset with a H5T_ARRAY fill value + *------------------------------------------------------------------------- + */ + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_dset(fid, 1, dims, "fill_array", tid, buf4); + ret = H5Tclose(tid); + + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + ret = H5Sclose(sid); + HDassert(ret >= 0); + ret = H5Fclose(fid); + HDassert(ret >= 0); } @@ -5910,103 +5911,103 @@ static void gent_fvalues(void) */ static void gent_string(void) { - /* compound datatype */ - typedef struct c_t - { - int a; - char str[255]; - } c_t; - - hid_t fid; /* file id */ - hid_t sid; /* dataspace ID */ - hid_t tid; /* datatype ID */ - hid_t str_tid; /* datatype ID */ - hid_t did; /* dataset ID */ - char buf1[]={"quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r"}; - const char *buf2[SPACE1_DIM1]= { - "Four score and seven\n years ago our forefathers brought forth on this continent a new nation,", - "conceived in liberty\n and dedicated to the proposition that all men are created equal.", - "Now we are engaged\n in a great civil war,", - "testing whether that\n nation or any nation so conceived and so dedicated can long endure." - }; - c_t buf3 = {24, "Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; - char buf4[] = {"Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; - hsize_t dims1[] = {1}; - hsize_t dims2[] = {SPACE1_DIM1}; - hsize_t dims4[1]; - int ret; - - dims4[0] = sizeof(buf4); - - /* create a file */ - fid = H5Fcreate(FILE49, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid>=0); + /* compound datatype */ + typedef struct c_t + { + int a; + char str[255]; + } c_t; + + hid_t fid; /* file id */ + hid_t sid; /* dataspace ID */ + hid_t tid; /* datatype ID */ + hid_t str_tid; /* datatype ID */ + hid_t did; /* dataset ID */ + char buf1[]={"quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r"}; + const char *buf2[SPACE1_DIM1]= { + "Four score and seven\n years ago our forefathers brought forth on this continent a new nation,", + "conceived in liberty\n and dedicated to the proposition that all men are created equal.", + "Now we are engaged\n in a great civil war,", + "testing whether that\n nation or any nation so conceived and so dedicated can long endure." + }; + c_t buf3 = {24, "Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; + char buf4[] = {"Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; + hsize_t dims1[] = {1}; + hsize_t dims2[] = {SPACE1_DIM1}; + hsize_t dims4[1]; + int ret; -/*------------------------------------------------------------------------- - * str1 - *------------------------------------------------------------------------- - */ + dims4[0] = sizeof(buf4); - tid=H5Tcopy(H5T_C_S1); - ret = H5Tset_size(tid, sizeof(buf1)); - HDassert(ret >= 0); - write_dset(fid,1,dims1,"str1",tid,buf1); - HDassert(ret >= 0); - ret = H5Tclose(tid); - HDassert(ret >= 0); + /* create a file */ + fid = H5Fcreate(FILE49, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + HDassert(fid>=0); -/*------------------------------------------------------------------------- - * str2 - *------------------------------------------------------------------------- - */ - sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); - tid = H5Tcopy(H5T_C_S1); - ret = H5Tset_size(tid, H5T_VARIABLE); - HDassert(ret >= 0); - did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); - HDassert(ret >= 0); - ret = H5Tclose(tid); - HDassert(ret >= 0); - ret = H5Dclose(did); - HDassert(ret >= 0); - ret = H5Sclose(sid); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * str1 + *------------------------------------------------------------------------- + */ -/*------------------------------------------------------------------------- - * str3 - *------------------------------------------------------------------------- - */ - sid = H5Screate_simple(SPACE1_RANK, dims1, NULL); - tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t)); - str_tid = H5Tcopy( H5T_C_S1 ); - H5Tset_size( str_tid, 255 ); - H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); - H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid ); - ret=make_dset(fid,"str3",sid,tid,H5P_DEFAULT,&buf3); - HDassert(ret >= 0); - ret = H5Tclose(tid); - HDassert(ret >= 0); - ret = H5Tclose(str_tid); - HDassert(ret >= 0); - ret = H5Sclose(sid); - HDassert(ret >= 0); + tid=H5Tcopy(H5T_C_S1); + ret = H5Tset_size(tid, sizeof(buf1)); + HDassert(ret >= 0); + write_dset(fid,1,dims1,"str1",tid,buf1); + HDassert(ret >= 0); + ret = H5Tclose(tid); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * str4 - *------------------------------------------------------------------------- - */ - sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); - ret=make_dset(fid,"str4",sid,H5T_NATIVE_CHAR,H5P_DEFAULT,buf4); - ret = H5Sclose(sid); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * str2 + *------------------------------------------------------------------------- + */ + sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); + tid = H5Tcopy(H5T_C_S1); + ret = H5Tset_size(tid, H5T_VARIABLE); + HDassert(ret >= 0); + did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); + HDassert(ret >= 0); + ret = H5Tclose(tid); + HDassert(ret >= 0); + ret = H5Dclose(did); + HDassert(ret >= 0); + ret = H5Sclose(sid); + HDassert(ret >= 0); -/*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ - ret = H5Fclose(fid); - HDassert(ret >= 0); + /*------------------------------------------------------------------------- + * str3 + *------------------------------------------------------------------------- + */ + sid = H5Screate_simple(SPACE1_RANK, dims1, NULL); + tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t)); + str_tid = H5Tcopy( H5T_C_S1 ); + H5Tset_size( str_tid, 255 ); + H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); + H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid ); + ret=make_dset(fid,"str3",sid,tid,H5P_DEFAULT,&buf3); + HDassert(ret >= 0); + ret = H5Tclose(tid); + HDassert(ret >= 0); + ret = H5Tclose(str_tid); + HDassert(ret >= 0); + ret = H5Sclose(sid); + HDassert(ret >= 0); + + /*------------------------------------------------------------------------- + * str4 + *------------------------------------------------------------------------- + */ + sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); + ret=make_dset(fid,"str4",sid,H5T_NATIVE_CHAR,H5P_DEFAULT,buf4); + ret = H5Sclose(sid); + HDassert(ret >= 0); + + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + ret = H5Fclose(fid); + HDassert(ret >= 0); } @@ -6052,18 +6053,18 @@ static void gent_aindices(void) HDassert(fid>=0); /*------------------------------------------------------------------------- - * root datasets - *------------------------------------------------------------------------- - */ + * root datasets + *------------------------------------------------------------------------- + */ write_dset(fid,1,dims1,"1d",H5T_NATIVE_INT,buf1); write_dset(fid,2,dims2,"2d",H5T_NATIVE_INT,buf2); write_dset(fid,3,dims3,"3d",H5T_NATIVE_INT,buf3); write_dset(fid,4,dims4,"4d",H5T_NATIVE_INT,buf4); /*------------------------------------------------------------------------- - * test with group indentation - *------------------------------------------------------------------------- - */ + * test with group indentation + *------------------------------------------------------------------------- + */ gid[0] = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); gid[1] = H5Gcreate2(fid, "g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); gid[2] = H5Gcreate2(fid, "g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -6078,9 +6079,9 @@ static void gent_aindices(void) H5Gclose(gid[i]); /*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ + * close + *------------------------------------------------------------------------- + */ ret = H5Fclose(fid); HDassert(ret >= 0); @@ -6146,45 +6147,45 @@ static void gent_longlinks(void) */ static int gent_ldouble(void) { - hid_t fid; - hid_t did; - hid_t tid; - hid_t sid; - hsize_t dims[1] = {3}; - long double buf[3] = {1,2,3}; + hid_t fid; + hid_t did; + hid_t tid; + hid_t sid; + hsize_t dims[1] = {3}; + long double buf[3] = {1,2,3}; - if((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + if((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; - if((sid = H5Screate_simple(1, dims, NULL)) < 0) - goto error; + if((sid = H5Screate_simple(1, dims, NULL)) < 0) + goto error; - if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) - goto error; + if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) + goto error; - if(H5Tget_size(tid) == 0) - goto error; + if(H5Tget_size(tid) == 0) + goto error; - if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto error; + if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; - if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) - goto error; + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; - if(H5Sclose(sid) < 0) - goto error; - if(H5Tclose(tid) < 0) - goto error; - if(H5Dclose(did) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Tclose(tid) < 0) + goto error; + if(H5Dclose(did) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; - return 0; + return 0; -error: - printf("error !\n"); - return -1; + error: + printf("error !\n"); + return -1; } @@ -6203,48 +6204,48 @@ error: static void gent_binary(void) { - hid_t fid, sid, did, aid; - hsize_t dims[1] = {6}; - int ibuf[6] = {1,2,3,4,5,6}; - float fbuf[6] = {1,2,3,4,5,6}; - double dbuf[6] = {1,2,3,4,5,6}; + hid_t fid, sid, did, aid; + hsize_t dims[1] = {6}; + int ibuf[6] = {1,2,3,4,5,6}; + float fbuf[6] = {1,2,3,4,5,6}; + double dbuf[6] = {1,2,3,4,5,6}; - fid = H5Fcreate(FILE55, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - sid = H5Screate_simple(1, dims, NULL); + fid = H5Fcreate(FILE55, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + sid = H5Screate_simple(1, dims, NULL); -/*------------------------------------------------------------------------- - * integer - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * integer + *------------------------------------------------------------------------- + */ - did = H5Dcreate2(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf); - H5Dclose(did); + did = H5Dcreate2(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf); + H5Dclose(did); -/*------------------------------------------------------------------------- - * float - *------------------------------------------------------------------------- - */ - did = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf); - H5Dclose(did); + /*------------------------------------------------------------------------- + * float + *------------------------------------------------------------------------- + */ + did = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf); + H5Dclose(did); -/*------------------------------------------------------------------------- - * double - *------------------------------------------------------------------------- - */ - did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); - /* create an attribute */ - aid = H5Acreate2(did, "attr", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); - H5Aclose(aid); - H5Dclose(did); + /*------------------------------------------------------------------------- + * double + *------------------------------------------------------------------------- + */ + did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); + /* create an attribute */ + aid = H5Acreate2(did, "attr", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT); + H5Aclose(aid); + H5Dclose(did); - /* close */ - H5Sclose(sid); - H5Fclose(fid); + /* close */ + H5Sclose(sid); + H5Fclose(fid); } /*------------------------------------------------------------------------- @@ -6345,7 +6346,7 @@ gent_bigdims(void) return; -out: + out: printf("Error.....\n"); H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -6421,10 +6422,10 @@ gent_group_creation_order(void) if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto out; -/*------------------------------------------------------------------------- - * create a group "2" - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a group "2" + *------------------------------------------------------------------------- + */ if((gid = H5Gcreate2(fid, "2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) @@ -6460,7 +6461,7 @@ gent_group_creation_order(void) goto out; gid = -1; - if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; @@ -6472,10 +6473,10 @@ gent_group_creation_order(void) gid = -1; -/*------------------------------------------------------------------------- - * create a group "1" with H5P_CRT_ORDER_TRACKED set - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a group "1" with H5P_CRT_ORDER_TRACKED set + *------------------------------------------------------------------------- + */ if(H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED) < 0) goto out; @@ -6513,7 +6514,7 @@ gent_group_creation_order(void) goto out; gid = -1; - if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Gclose(gid) < 0) goto out; @@ -6537,7 +6538,7 @@ gent_group_creation_order(void) return; -out: + out: printf("Error.....\n"); H5E_BEGIN_TRY { H5Gclose(gid); @@ -6604,10 +6605,10 @@ gent_attr_creation_order(void) if((sid = H5Screate(H5S_SCALAR)) < 0) goto out; -/*------------------------------------------------------------------------- - * create a dataset with creation order tracked for attributes and atributes in it - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a dataset with creation order tracked for attributes and atributes in it + *------------------------------------------------------------------------- + */ /* create a dataset */ if((did = H5Dcreate2(fid, "dt", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) @@ -6630,10 +6631,10 @@ gent_attr_creation_order(void) did = -1; -/*------------------------------------------------------------------------- - * create a dataset without creation order tracked for attributes and atributes in it - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a dataset without creation order tracked for attributes and atributes in it + *------------------------------------------------------------------------- + */ /* create a dataset */ if((did = H5Dcreate2(fid, "d", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -6657,10 +6658,10 @@ gent_attr_creation_order(void) -/*------------------------------------------------------------------------- - * create a group with creation order tracked for attributes and atributes in it - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a group with creation order tracked for attributes and atributes in it + *------------------------------------------------------------------------- + */ if((gid = H5Gcreate2(fid, "gt", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) goto out; @@ -6681,10 +6682,10 @@ gent_attr_creation_order(void) goto out; gid = -1; -/*------------------------------------------------------------------------- - * create a group without creation order tracked for attributes and atributes in it - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a group without creation order tracked for attributes and atributes in it + *------------------------------------------------------------------------- + */ if((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; @@ -6705,10 +6706,10 @@ gent_attr_creation_order(void) goto out; gid = -1; -/*------------------------------------------------------------------------- - * create a named datatype with creation order tracked for attributes and atributes in it - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a named datatype with creation order tracked for attributes and atributes in it + *------------------------------------------------------------------------- + */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) goto out; @@ -6732,10 +6733,10 @@ gent_attr_creation_order(void) goto out; tid = -1; -/*------------------------------------------------------------------------- - * create a named datatype without creation order tracked for attributes and atributes in it - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create a named datatype without creation order tracked for attributes and atributes in it + *------------------------------------------------------------------------- + */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) goto out; @@ -6759,10 +6760,10 @@ gent_attr_creation_order(void) goto out; tid = -1; -/*------------------------------------------------------------------------- - * add some attributes to the root group - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * add some attributes to the root group + *------------------------------------------------------------------------- + */ if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) goto out; @@ -6782,10 +6783,10 @@ gent_attr_creation_order(void) goto out; gid = -1; -/*------------------------------------------------------------------------- - * close - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ if(H5Sclose(sid) < 0) goto out; sid = -1; @@ -6806,7 +6807,7 @@ gent_attr_creation_order(void) return; -out: + out: printf("Error.....\n"); H5E_BEGIN_TRY { H5Gclose(gid); @@ -6835,35 +6836,35 @@ out: static void gent_fpformat(void) { - hid_t fid, sid, did; - hsize_t dims[1] = {6}; - double dbuf[6] = {-0.1234567, 0.1234567, 0, 0, 0, 0}; - float fbuf[6] = {-0.1234567f, 0.1234567f, 0, 0, 0, 0}; + hid_t fid, sid, did; + hsize_t dims[1] = {6}; + double dbuf[6] = {-0.1234567, 0.1234567, 0, 0, 0, 0}; + float fbuf[6] = {-0.1234567f, 0.1234567f, 0, 0, 0, 0}; - fid = H5Fcreate(FILE60, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - sid = H5Screate_simple(1, dims, NULL); + fid = H5Fcreate(FILE60, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + sid = H5Screate_simple(1, dims, NULL); -/*------------------------------------------------------------------------- - * double - *------------------------------------------------------------------------- - */ - did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); - H5Dclose(did); + /*------------------------------------------------------------------------- + * double + *------------------------------------------------------------------------- + */ + did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf); + H5Dclose(did); -/*------------------------------------------------------------------------- - * float - *------------------------------------------------------------------------- - */ - did = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf); - H5Dclose(did); + /*------------------------------------------------------------------------- + * float + *------------------------------------------------------------------------- + */ + did = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf); + H5Dclose(did); - /* close */ - H5Sclose(sid); - H5Fclose(fid); + /* close */ + H5Sclose(sid); + H5Fclose(fid); } /*------------------------------------------------------------------------- @@ -6878,75 +6879,75 @@ gent_fpformat(void) static void gent_extlinks(void) { - hid_t source_fid, target_fid, far_fid, sid, did, gid, gid2, tid; - hsize_t dims[1] = {6}; - int buf[6] = {1, 2, 3, 4, 5, 6}; + hid_t source_fid, target_fid, far_fid, sid, did, gid, gid2, tid; + hsize_t dims[1] = {6}; + int buf[6] = {1, 2, 3, 4, 5, 6}; - /* create two files, a source and a target */ - source_fid = H5Fcreate(FILE61, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - target_fid = H5Fcreate(FILE62, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - far_fid = H5Fcreate(FILE63, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + /* create two files, a source and a target */ + source_fid = H5Fcreate(FILE61, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + target_fid = H5Fcreate(FILE62, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + far_fid = H5Fcreate(FILE63, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); -/*------------------------------------------------------------------------- - * create Groups, a Dataset, a committed Datatype, external links, and a - * cycle in the target - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create Groups, a Dataset, a committed Datatype, external links, and a + * cycle in the target + *------------------------------------------------------------------------- + */ - gid = H5Gcreate2(target_fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(H5Gcreate2(target_fid, "empty_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)); - sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate2(gid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - H5Lcreate_external(FILE61, "/", gid, "elink_t1", H5P_DEFAULT, H5P_DEFAULT); - H5Lcreate_external(FILE61, "/ext_link4", gid, "elink_t2", H5P_DEFAULT, H5P_DEFAULT); + gid = H5Gcreate2(target_fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(H5Gcreate2(target_fid, "empty_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)); + sid = H5Screate_simple(1, dims, NULL); + did = H5Dcreate2(gid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + H5Lcreate_external(FILE61, "/", gid, "elink_t1", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_external(FILE61, "/ext_link4", gid, "elink_t2", H5P_DEFAULT, H5P_DEFAULT); - gid2 = H5Gcreate2(gid, "subgroup", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Lcreate_hard(target_fid, "/group", gid2, "link_to_group", H5P_DEFAULT, H5P_DEFAULT); + gid2 = H5Gcreate2(gid, "subgroup", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_hard(target_fid, "/group", gid2, "link_to_group", H5P_DEFAULT, H5P_DEFAULT); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); - sid = H5Screate_simple(1, dims, NULL); - did = H5Dcreate2(target_fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - H5Dclose(did); - H5Sclose(sid); + sid = H5Screate_simple(1, dims, NULL); + did = H5Dcreate2(target_fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + H5Dclose(did); + H5Sclose(sid); - tid = H5Tcopy(H5T_NATIVE_INT); - H5Tcommit2(target_fid, "type", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Tclose(tid); + tid = H5Tcopy(H5T_NATIVE_INT); + H5Tcommit2(target_fid, "type", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Tclose(tid); -/*------------------------------------------------------------------------- - * create external links in the source file pointing to the target objects - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * create external links in the source file pointing to the target objects + *------------------------------------------------------------------------- + */ - H5Lcreate_external(FILE62, "group", source_fid, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); - H5Lcreate_external(FILE62, "dset", source_fid, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); - H5Lcreate_external(FILE62, "type", source_fid, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); - H5Lcreate_external(FILE62, "group/elink_t2", source_fid, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); - H5Lcreate_external(FILE62, "empty_group", source_fid, "ext_link5", H5P_DEFAULT, H5P_DEFAULT); -/* external link to soft link which linked to a dataset */ - H5Lcreate_external(FILE4_1, "/soft_dset1", source_fid, "ext2soft_link1", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_external(FILE62, "group", source_fid, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_external(FILE62, "dset", source_fid, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_external(FILE62, "type", source_fid, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_external(FILE62, "group/elink_t2", source_fid, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_external(FILE62, "empty_group", source_fid, "ext_link5", H5P_DEFAULT, H5P_DEFAULT); + /* external link to soft link which linked to a dataset */ + H5Lcreate_external(FILE4_1, "/soft_dset1", source_fid, "ext2soft_link1", H5P_DEFAULT, H5P_DEFAULT); -/* external link to dangle soft link */ - H5Lcreate_external(FILE4_1, "/soft_dangle", source_fid, "ext2softdangle_link1", H5P_DEFAULT, H5P_DEFAULT); + /* external link to dangle soft link */ + H5Lcreate_external(FILE4_1, "/soft_dangle", source_fid, "ext2softdangle_link1", H5P_DEFAULT, H5P_DEFAULT); -/*------------------------------------------------------------------------- - * create external link in the "far" file pointing to the source file - *------------------------------------------------------------------------- - */ - H5Lcreate_external(FILE61, "/", far_fid, "src_file", H5P_DEFAULT, H5P_DEFAULT); + /*------------------------------------------------------------------------- + * create external link in the "far" file pointing to the source file + *------------------------------------------------------------------------- + */ + H5Lcreate_external(FILE61, "/", far_fid, "src_file", H5P_DEFAULT, H5P_DEFAULT); - /* close */ - H5Fclose(source_fid); - H5Fclose(target_fid); - H5Fclose(far_fid); + /* close */ + H5Fclose(source_fid); + H5Fclose(target_fid); + H5Fclose(far_fid); } /*------------------------------------------------------------------------- @@ -6959,21 +6960,21 @@ gent_extlinks(void) static void gent_fs_strategy_threshold(void) { - hid_t fid; /* File id */ - hid_t fcpl; /* File creation property */ + hid_t fid; /* File id */ + hid_t fcpl; /* File creation property */ - /* Create file-creation template */ - fcpl = H5Pcreate(H5P_FILE_CREATE); + /* Create file-creation template */ + fcpl = H5Pcreate(H5P_FILE_CREATE); - /* Set file space information */ - H5Pset_file_space(fcpl, STRATEGY, (hsize_t)THRESHOLD10); + /* Set file space information */ + H5Pset_file_space(fcpl, STRATEGY, (hsize_t)THRESHOLD10); - /* Create the file with the specified strategy and threshold */ - fid = H5Fcreate(FILE65, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT); + /* Create the file with the specified strategy and threshold */ + fid = H5Fcreate(FILE65, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT); - /* close */ - H5Fclose(fid); - H5Pclose(fcpl); + /* close */ + H5Fclose(fid); + H5Pclose(fcpl); } /* @@ -7009,32 +7010,32 @@ gent_dataset_idx(void) fid = H5Fcreate(FILE68a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); dcpl = H5Pcreate(H5P_DATASET_CREATE); - dims[0] = CHUNK; - dims[1] = CHUNK; + dims[0] = F68a_CHUNK; + dims[1] = F68a_CHUNK; /* set chunk */ ret = H5Pset_chunk(dcpl, RANK, dims); assert(ret >= 0); /* dataset with fixed dimensions */ - dims[0] = DIM20; - dims[1] = DIM10; + dims[0] = F68a_DIM20; + dims[1] = F68a_DIM10; space = H5Screate_simple(RANK, dims, NULL); - for(i = 0; i < DIM20; i++) - for(j = 0; j < DIM10; j++) + for(i = 0; i < F68a_DIM20; i++) + for(j = 0; j < F68a_DIM10; j++) buf[i][j] = j; - ret = make_dset(fid, DSET_FIXED, space, H5T_NATIVE_INT, dcpl, buf); + ret = make_dset(fid, F68a_DSET_FIXED, space, H5T_NATIVE_INT, dcpl, buf); assert(ret >= 0); H5Sclose(space); /* dataset with non-fixed dimensions */ - maxdims[0] = DIM200; - maxdims[1] = DIM100; + maxdims[0] = F68a_DIM200; + maxdims[1] = F68a_DIM100; space = H5Screate_simple(RANK, dims, maxdims); - ret = make_dset(fid, DSET_BTREE, space, H5T_NATIVE_INT, dcpl, buf); + ret = make_dset(fid, F68a_DSET_BTREE, space, H5T_NATIVE_INT, dcpl, buf); assert(ret >= 0); H5Sclose(space); @@ -7050,7 +7051,7 @@ gent_dataset_idx(void) assert(ret >= 0); space = H5Screate_simple(RANK, dims, NULL); - ret = make_dset(fid, DSET_FIXED_FILTER, space, H5T_NATIVE_INT, dcpl, buf); + ret = make_dset(fid, F68a_DSET_FIXED_FILTER, space, H5T_NATIVE_INT, dcpl, buf); assert(ret >= 0); H5Sclose(space); @@ -7097,11 +7098,10 @@ gent_packedbits(void) valu8bits = (uint8_t) ~0u; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dsetu8[i][0] = valu8bits; - for(j = 1; j < dims[1]; j++) { - dsetu8[i][j] = dsetu8[i][j-1] << 1; - } - valu8bits <<= 1; + dsetu8[i][0] = valu8bits; + for(j = 1; j < dims[1]; j++) + dsetu8[i][j] = dsetu8[i][j-1] << 1; + valu8bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); @@ -7115,11 +7115,10 @@ gent_packedbits(void) valu16bits = (uint16_t) ~0u; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dsetu16[i][0] = valu16bits; - for(j = 1; j < dims[1]; j++) { - dsetu16[i][j] = dsetu16[i][j-1] << 1; - } - valu16bits <<= 1; + dsetu16[i][0] = valu16bits; + for(j = 1; j < dims[1]; j++) + dsetu16[i][j] = dsetu16[i][j-1] << 1; + valu16bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); @@ -7133,11 +7132,10 @@ gent_packedbits(void) valu32bits = (uint32_t) ~0u; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dsetu32[i][0] = valu32bits; - for(j = 1; j < dims[1]; j++) { - dsetu32[i][j] = dsetu32[i][j-1] << 1; - } - valu32bits <<= 1; + dsetu32[i][0] = valu32bits; + for(j = 1; j < dims[1]; j++) + dsetu32[i][j] = dsetu32[i][j-1] << 1; + valu32bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32); @@ -7151,11 +7149,10 @@ gent_packedbits(void) valu64bits = (uint64_t) ~0Lu; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dsetu64[i][0] = valu64bits; - for(j = 1; j < dims[1]; j++) { - dsetu64[i][j] = dsetu64[i][j-1] << 1; - } - valu64bits <<= 1; + dsetu64[i][0] = valu64bits; + for(j = 1; j < dims[1]; j++) + dsetu64[i][j] = dsetu64[i][j-1] << 1; + valu64bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64); @@ -7169,11 +7166,10 @@ gent_packedbits(void) val8bits = (int8_t) ~0; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dset8[i][0] = val8bits; - for(j = 1; j < dims[1]; j++) { - dset8[i][j] = dset8[i][j-1] << 1; - } - val8bits <<= 1; + dset8[i][0] = val8bits; + for(j = 1; j < dims[1]; j++) + dset8[i][j] = dset8[i][j-1] << 1; + val8bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); @@ -7187,11 +7183,10 @@ gent_packedbits(void) val16bits = (int16_t) ~0; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dset16[i][0] = val16bits; - for(j = 1; j < dims[1]; j++) { - dset16[i][j] = dset16[i][j-1] << 1; - } - val16bits <<= 1; + dset16[i][0] = val16bits; + for(j = 1; j < dims[1]; j++) + dset16[i][j] = dset16[i][j-1] << 1; + val16bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); @@ -7205,11 +7200,10 @@ gent_packedbits(void) val32bits = (int32_t) ~0; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dset32[i][0] = val32bits; - for(j = 1; j < dims[1]; j++) { - dset32[i][j] = dset32[i][j-1] << 1; - } - val32bits <<= 1; + dset32[i][0] = val32bits; + for(j = 1; j < dims[1]; j++) + dset32[i][j] = dset32[i][j-1] << 1; + val32bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32); @@ -7223,11 +7217,10 @@ gent_packedbits(void) val64bits = (int64_t) ~0L; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dset64[i][0] = val64bits; - for(j = 1; j < dims[1]; j++) { - dset64[i][j] = dset64[i][j-1] << 1; - } - val64bits <<= 1; + dset64[i][0] = val64bits; + for(j = 1; j < dims[1]; j++) + dset64[i][j] = dset64[i][j-1] << 1; + val64bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64); @@ -7240,8 +7233,8 @@ gent_packedbits(void) dataset = H5Dcreate2(fid, F66_DUMMYDBL, H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < dims[0]; i++) - for(j = 0; j < dims[1]; j++) - dsetdbl[i][j] = 0.0001 * j + i; + for(j = 0; j < dims[1]; j++) + dsetdbl[i][j] = 0.0001 * j + i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl); @@ -7289,7 +7282,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dsetu8[i][0] = valu8bits; for(j = 1; j < dims[1]; j++) { - dsetu8[i][j] = dsetu8[i][j-1] << 1; + dsetu8[i][j] = dsetu8[i][j-1] << 1; } valu8bits <<= 1; } @@ -7307,7 +7300,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dsetu16[i][0] = valu16bits; for(j = 1; j < dims[1]; j++) { - dsetu16[i][j] = dsetu16[i][j-1] << 1; + dsetu16[i][j] = dsetu16[i][j-1] << 1; } valu16bits <<= 1; } @@ -7325,7 +7318,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dsetu32[i][0] = valu32bits; for(j = 1; j < dims[1]; j++) { - dsetu32[i][j] = dsetu32[i][j-1] << 1; + dsetu32[i][j] = dsetu32[i][j-1] << 1; } valu32bits <<= 1; } @@ -7343,7 +7336,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dsetu64[i][0] = valu64bits; for(j = 1; j < dims[1]; j++) { - dsetu64[i][j] = dsetu64[i][j-1] << 1; + dsetu64[i][j] = dsetu64[i][j-1] << 1; } valu64bits <<= 1; } @@ -7361,7 +7354,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dset8[i][0] = val8bits; for(j = 1; j < dims[1]; j++) { - dset8[i][j] = dset8[i][j-1] << 1; + dset8[i][j] = dset8[i][j-1] << 1; } val8bits <<= 1; } @@ -7379,7 +7372,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dset16[i][0] = val16bits; for(j = 1; j < dims[1]; j++) { - dset16[i][j] = dset16[i][j-1] << 1; + dset16[i][j] = dset16[i][j-1] << 1; } val16bits <<= 1; } @@ -7397,7 +7390,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dset32[i][0] = val32bits; for(j = 1; j < dims[1]; j++) { - dset32[i][j] = dset32[i][j-1] << 1; + dset32[i][j] = dset32[i][j-1] << 1; } val32bits <<= 1; } @@ -7415,7 +7408,7 @@ gent_attr_intsize(void) for(i = 0; i < dims[0]; i++){ dset64[i][0] = val64bits; for(j = 1; j < dims[1]; j++) { - dset64[i][j] = dset64[i][j-1] << 1; + dset64[i][j] = dset64[i][j-1] << 1; } val64bits <<= 1; } @@ -7430,8 +7423,8 @@ gent_attr_intsize(void) attr = H5Acreate2(root, F66_DUMMYDBL, H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < dims[0]; i++) - for(j = 0; j < dims[1]; j++) - dsetdbl[i][j] = 0.0001 * j + i; + for(j = 0; j < dims[1]; j++) + dsetdbl[i][j] = 0.0001 * j + i; H5Awrite(attr, H5T_NATIVE_DOUBLE, dsetdbl); @@ -7463,22 +7456,26 @@ gent_charsets(void) const char *utf8_p_; } CharSetInfo; + hid_t charset_dtid; + hid_t ascii_dtid; + hid_t utf8_dtid = H5Tcreate( H5T_STRING, H5T_VARIABLE ); + const char * writeData[] = { "ascii", "utf8", }; + sid = H5Screate_simple( 1, dim, NULL ); fid = H5Fcreate( FILE68, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); - hid_t charset_dtid = H5Tcreate( H5T_COMPOUND, sizeof( CharSetInfo ) ); + charset_dtid = H5Tcreate( H5T_COMPOUND, sizeof( CharSetInfo ) ); - hid_t ascii_dtid = H5Tcreate( H5T_STRING, H5T_VARIABLE ); + ascii_dtid = H5Tcreate( H5T_STRING, H5T_VARIABLE ); status = H5Tset_cset( ascii_dtid, H5T_CSET_ASCII ); H5Tinsert( charset_dtid, "ascii", HOFFSET(CharSetInfo, ascii_p_ ), ascii_dtid ); - hid_t utf8_dtid = H5Tcreate( H5T_STRING, H5T_VARIABLE ); + utf8_dtid = H5Tcreate( H5T_STRING, H5T_VARIABLE ); status = H5Tset_cset( utf8_dtid, H5T_CSET_UTF8 ); H5Tinsert( charset_dtid, "utf8", HOFFSET( CharSetInfo, utf8_p_ ), utf8_dtid ); did = H5Dcreate2( fid, "CharSets", charset_dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT ); - const char * writeData[] = { "ascii", "utf8", }; status = H5Dwrite( did, charset_dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, writeData ); H5Tclose( charset_dtid ); @@ -7636,8 +7633,8 @@ static void gent_compound_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM8; for(n = 0; n < dims[0]; n++) - for(o = 0; o < dims[1]; o++) - Array1[m].dsetdbl[n][o] = 0.0001 * o + n; + for(o = 0; o < dims[1]; o++) + Array1[m].dsetdbl[n][o] = 0.0001 * o + n; } /* Create the array data type for the 8 bits signed int array */ @@ -7911,8 +7908,8 @@ static void gent_compound_attr_intsizes(void) { dims[0] = F70_XDIM; dims[1] = F70_YDIM8; for(n = 0; n < dims[0]; n++) - for(o = 0; o < dims[1]; o++) - Array1[m].dsetdbl[n][o] = 0.0001 * o + n; + for(o = 0; o < dims[1]; o++) + Array1[m].dsetdbl[n][o] = 0.0001 * o + n; } /* Create the array data type for the 8 bits signed int array */ @@ -8041,6 +8038,155 @@ static void gent_compound_attr_intsizes(void) { HDassert(status >= 0); } +static void gent_nested_compound_dt(void) { /* test nested data type */ + hid_t fid, group, dataset, space, type, create_plist, type1, type2; + hid_t array_dt, enum_dt; + enumtype val; + + typedef struct { + int a; + float b; + } dset1_t; + dset1_t dset1[10]; + + typedef struct { + int a; + float b; + enumtype c; + } dset2_t; + dset2_t dset2[10]; + + typedef struct { + int a[5]; + float b[5][6]; + dset1_t c; + } dset3_t; + dset3_t dset3[10]; + + enumtype dset4[] = {RED, GREEN, BLUE, GREEN, WHITE, BLUE}; + dset1_t dset5[10]; + + int i, j, k; + unsigned ndims; + hsize_t dim[2]; + + hsize_t sdim, maxdim; + + sdim = 10; + for(i = 0; i < (int)sdim; i++) { + dset1[i].a = i; + dset1[i].b = (float)(i*i); + + dset2[i].a = i; + dset2[i].b = (float)(i+i*0.1); + dset2[i].c = GREEN; + + for(j = 0; j < 5; j++) { + dset3[i].a[j] = i*j; + for(k = 0; k < 6; k++) { + dset3[i].b[j][k] = (float)(i*j*k*1.0); + } + } + dset3[i].c.a = i; + dset3[i].c.b = (float)(i*1.0); + } + + fid = H5Fcreate(FILE72, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + create_plist = H5Pcreate(H5P_DATASET_CREATE); + + sdim = 2; + H5Pset_chunk(create_plist, 1, &sdim); + + + sdim = 6; + maxdim = H5S_UNLIMITED; + + space = H5Screate_simple(1, &sdim, &maxdim); + + type = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); + H5Tinsert(type, "a_name", HOFFSET(dset1_t, a), H5T_STD_I32LE); + H5Tinsert(type, "b_name", HOFFSET(dset1_t, b), H5T_IEEE_F32LE); + + dataset = H5Dcreate2(fid, "/dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); + + H5Dwrite(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); + + H5Tclose(type); + H5Dclose(dataset); + + /* Create the shared enumerated datatype. */ + enum_dt = H5Tenum_create (H5T_NATIVE_INT); + val = (enumtype) RED; + H5Tenum_insert (enum_dt, "Red", &val); + val = (enumtype) GREEN; + H5Tenum_insert (enum_dt, "Green", &val); + val = (enumtype) BLUE; + H5Tenum_insert (enum_dt, "Blue", &val); + val = (enumtype) WHITE; + H5Tenum_insert (enum_dt, "White", &val); + val = (enumtype) BLACK; + H5Tenum_insert (enum_dt, "Black", &val); + H5Tcommit2(fid, "enumtype", enum_dt, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset2[0])); + + H5Tinsert(type2, "a_name", HOFFSET(dset2_t, a), H5T_NATIVE_INT); + H5Tinsert(type2, "b_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT); + H5Tinsert(type2, "c_name", HOFFSET(dset2_t, c), enum_dt); + + dataset = H5Dcreate2(fid, "/dset2", type2, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); + + H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); + + H5Tclose(type2); + + dataset = H5Dcreate2(fid, "/dset4", enum_dt, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); + H5Dwrite(dataset, enum_dt, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset4); + + H5Tclose(enum_dt); + H5Dclose(dataset); + + /* shared data type 1 */ + type1 = H5Tcreate(H5T_COMPOUND, sizeof(dset1_t)); + H5Tinsert(type1, "int_name", HOFFSET(dset1_t, a), H5T_STD_I32LE); + H5Tinsert(type1, "float_name", HOFFSET(dset1_t, b), H5T_IEEE_F32LE); + H5Tcommit2(fid, "type1", type1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset3_t)); + + ndims = 1; dim[0] = 5; + array_dt = H5Tarray_create2(H5T_STD_I32LE, ndims, dim); + H5Tinsert(type2, "int_name", HOFFSET(dset3_t, a), array_dt); + H5Tclose(array_dt); + + ndims = 2; dim[0] = 5; dim[1] = 6; + array_dt = H5Tarray_create2(H5T_IEEE_F32LE, ndims, dim); + H5Tinsert(type2, "float_name", HOFFSET(dset3_t, b), array_dt); + H5Tclose(array_dt); + + H5Tinsert (type2, "cmpd_name", HOFFSET (dset3_t, c), type1); + + dataset = H5Dcreate2(group, "dset3", type2, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); + + H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3); + + dataset = H5Dcreate2(fid, "/dset5", type1, space, H5P_DEFAULT, create_plist, H5P_DEFAULT); + H5Dwrite(dataset, type1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); + + H5Tclose(type1); + H5Tclose(type2); + H5Sclose(space); + H5Dclose(dataset); + H5Gclose(group); + + H5Pclose(create_plist); + + H5Fclose(fid); + +} /*------------------------------------------------------------------------- * Function: main @@ -8124,6 +8270,8 @@ int main(void) gent_compound_intsizes(); gent_compound_attr_intsizes(); + gent_nested_compound_dt(); + return 0; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 3bd0dfd..fa71558 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -55,6 +55,7 @@ SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" # testfiles source dirs for tools SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_ERRORFILES="$srcdir/errfiles" SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" @@ -142,6 +143,7 @@ $SRC_H5DUMP_TESTFILES/tmulti-r.h5 $SRC_H5DUMP_TESTFILES/tmulti-s.h5 $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5 $SRC_H5DUMP_TESTFILES/tnestedcomp.h5 +$SRC_H5DUMP_TESTFILES/tnestedcmpddt.h5 $SRC_H5DUMP_TESTFILES/tno-subset.h5 $SRC_H5DUMP_TESTFILES/tnullspace.h5 $SRC_H5DUMP_TESTFILES/zerodim.h5 @@ -162,6 +164,7 @@ $SRC_H5DUMP_TESTFILES/tvldtypes4.h5 $SRC_H5DUMP_TESTFILES/tvldtypes5.h5 $SRC_H5DUMP_TESTFILES/tvlstr.h5 $SRC_H5DUMP_TESTFILES/tvms.h5 +$SRC_H5DUMP_TESTFILES/twidedisplay.ddl " LIST_OTHER_TEST_FILES=" @@ -191,6 +194,8 @@ $SRC_H5DUMP_TESTFILES/tattr-1.ddl $SRC_H5DUMP_TESTFILES/tattr-2.ddl $SRC_H5DUMP_TESTFILES/tattr-3.ddl $SRC_H5DUMP_TESTFILES/tattr-4_be.ddl +$SRC_H5DUMP_TESTFILES/tattrcontents1.ddl +$SRC_H5DUMP_TESTFILES/tattrcontents2.ddl $SRC_H5DUMP_TESTFILES/tattrintsize.ddl $SRC_H5DUMP_TESTFILES/tattrreg.ddl $SRC_H5DUMP_TESTFILES/tattrregR.ddl @@ -258,6 +263,7 @@ $SRC_H5DUMP_TESTFILES/tqmarkfile.ddl $SRC_H5DUMP_TESTFILES/tstarfile.ddl $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl $SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl +$SRC_H5DUMP_TESTFILES/tnestedcmpddt.ddl $SRC_H5DUMP_TESTFILES/tnbit.ddl $SRC_H5DUMP_TESTFILES/tno-subset.ddl $SRC_H5DUMP_TESTFILES/tnullspace.ddl @@ -271,6 +277,10 @@ $SRC_H5DUMP_TESTFILES/torderattr1.ddl $SRC_H5DUMP_TESTFILES/torderattr2.ddl $SRC_H5DUMP_TESTFILES/torderattr3.ddl $SRC_H5DUMP_TESTFILES/torderattr4.ddl +$SRC_H5DUMP_TESTFILES/tordercontents1.ddl +$SRC_H5DUMP_TESTFILES/tordercontents2.ddl +$SRC_H5DUMP_TESTFILES/torderlinks1.ddl +$SRC_H5DUMP_TESTFILES/torderlinks2.ddl $SRC_H5DUMP_TESTFILES/tperror.ddl $SRC_H5DUMP_TESTFILES/treference.ddl $SRC_H5DUMP_TESTFILES/tsaf.ddl @@ -301,10 +311,36 @@ $SRC_H5DUMP_TESTFILES/out3.h5import $SRC_H5DUMP_TESTFILES/tbinregR.exp " +LIST_ERROR_TEST_FILES=" +${SRC_H5DUMP_ERRORFILES}/filter_fail.err +${SRC_H5DUMP_ERRORFILES}/tall-1.err +${SRC_H5DUMP_ERRORFILES}/tall-2A.err +${SRC_H5DUMP_ERRORFILES}/tall-2B.err +${SRC_H5DUMP_ERRORFILES}/tarray1_big.err +${SRC_H5DUMP_ERRORFILES}/tattr-3.err +${SRC_H5DUMP_ERRORFILES}/tattrregR.err +${SRC_H5DUMP_ERRORFILES}/tcomp-3.err +${SRC_H5DUMP_ERRORFILES}/tdataregR.err +${SRC_H5DUMP_ERRORFILES}/tdset-2.err +${SRC_H5DUMP_ERRORFILES}/texceedsubblock.err +${SRC_H5DUMP_ERRORFILES}/texceedsubcount.err +${SRC_H5DUMP_ERRORFILES}/texceedsubstart.err +${SRC_H5DUMP_ERRORFILES}/texceedsubstride.err +${SRC_H5DUMP_ERRORFILES}/textlink.err +${SRC_H5DUMP_ERRORFILES}/textlinkfar.err +${SRC_H5DUMP_ERRORFILES}/textlinksrc.err +${SRC_H5DUMP_ERRORFILES}/tgroup-2.err +${SRC_H5DUMP_ERRORFILES}/torderlinks1.err +${SRC_H5DUMP_ERRORFILES}/torderlinks2.err +${SRC_H5DUMP_ERRORFILES}/tperror.err +${SRC_H5DUMP_ERRORFILES}/tqmarkfile.err +${SRC_H5DUMP_ERRORFILES}/tslink-D.err +" + # # copy test files and expected output files from source dirs to test dir # -COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML" +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_ERROR_TEST_FILES" COPY_TESTFILES_TO_TESTDIR() { @@ -495,6 +531,69 @@ TOOLTEST3() { } +# same as TOOLTEST3 but filters error stack output and compares to an error file +# Extract file name, line number, version and thread IDs because they may be different +TOOLTEST4() { + + expect="$TESTDIR/$1" + expect_err="$TESTDIR/`basename $1 .ddl`.err" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.oerr" + actual_ext="$TESTDIR/`basename $1 .ddl`.ext" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual_ext + #cat $actual_ext >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi + +} + # Print a "SKIP" message SKIP() { TESTING $DUMPER $@ @@ -572,6 +671,9 @@ COPY_TESTFILES_TO_TESTDIR #TOOLTEST h5dump-help.txt -h +# test for maximum display datasets +TOOLTEST twidedisplay.ddl --enable-error-stack -w0 packedbits.h5 + # test for signed/unsigned datasets TOOLTEST packedbits.ddl --enable-error-stack packedbits.h5 # test for compound signed/unsigned datasets @@ -583,19 +685,19 @@ TOOLTEST tcmpdattrintsize.ddl --enable-error-stack tcmpdattrintsize.h5 # test for displaying groups TOOLTEST tgroup-1.ddl --enable-error-stack tgroup.h5 # test for displaying the selected groups -TOOLTEST tgroup-2.ddl --group=/g2 --group / -g /y tgroup.h5 +TOOLTEST4 tgroup-2.ddl --enable-error-stack --group=/g2 --group / -g /y tgroup.h5 # test for displaying simple space datasets TOOLTEST tdset-1.ddl --enable-error-stack tdset.h5 # test for displaying selected datasets -TOOLTEST3 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 +TOOLTEST4 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 # test for displaying attributes TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5 # test for displaying the selected attributes of string type and scalar space TOOLTEST tattr-2.ddl --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5 # test for header and error messages -TOOLTEST3 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5 +TOOLTEST4 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5 # test for displaying at least 9 attributes on root from a BE machine TOOLTEST tattr-4_be.ddl --enable-error-stack tattr4_be.h5 # test for displaying attributes in shared datatype (also in group and dataset) @@ -608,7 +710,7 @@ TOOLTEST tudlink-1.ddl --enable-error-stack tudlink.h5 TOOLTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5 TOOLTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5 # test for displaying dangling soft links -TOOLTEST3 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5 +TOOLTEST4 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5 # tests for hard links TOOLTEST thlink-1.ddl --enable-error-stack thlink.h5 @@ -622,17 +724,16 @@ TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5 # test for named data types TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5 # test for unamed type -# JIRA HDFFV-7936 TOOLTEST tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 -TOOLTEST tcomp-3.ddl -t /#6632 -g /group2 tcompound.h5 +TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 #test for the nested compound type TOOLTEST tnestcomp-1.ddl --enable-error-stack tnestedcomp.h5 +TOOLTEST tnestedcmpddt.ddl --enable-error-stack tnestedcmpddt.h5 # test for options -# JIRA HDFFV-7936 TOOLTEST tall-1.ddl --enable-error-stack tall.h5 -TOOLTEST tall-1.ddl tall.h5 +TOOLTEST4 tall-1.ddl --enable-error-stack tall.h5 TOOLTEST tall-2.ddl --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5 TOOLTEST tall-3.ddl --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5 @@ -659,8 +760,7 @@ TOOLTEST tvlstr.ddl --enable-error-stack tvlstr.h5 # test for files with array data TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5 # # added for bug# 2092 - tarray1_big.h -# JIRA HDFFV-7936 TOOLTEST tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 -TOOLTEST tarray1_big.ddl -R tarray1_big.h5 +TOOLTEST4 tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5 TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5 TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5 @@ -671,7 +771,7 @@ TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5 # test for wildcards in filename (does not work with cmake) # inconsistent across platforms TOOLTEST3 tstarfile.ddl --enable-error-stack -H -d Dataset1 tarr*.h5 -TOOLTEST3 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5 +TOOLTEST4 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5 TOOLTEST tmultifile.ddl --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5 # test for files with empty data @@ -689,18 +789,16 @@ TOOLTEST tmulti.ddl --enable-error-stack --filedriver=multi tmulti TOOLTEST tlarge_objname.ddl --enable-error-stack -w157 tlarge_objname.h5 # test '-A' to suppress data but print attr's -# JIRA HDFFV-7936 TOOLTEST tall-2A.ddl --enable-error-stack -A tall.h5 -TOOLTEST tall-2A.ddl -A tall.h5 +TOOLTEST4 tall-2A.ddl --enable-error-stack -A tall.h5 # test '-r' to print attributes in ASCII instead of decimal -# JIRA HDFFV-7936 TOOLTEST tall-2B.ddl --enable-error-stack -A -r tall.h5 -TOOLTEST tall-2B.ddl -A -r tall.h5 +TOOLTEST4 tall-2B.ddl --enable-error-stack -A -r tall.h5 # test Subsetting TOOLTEST tall-4s.ddl --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5 TOOLTEST tall-5s.ddl --enable-error-stack -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5 TOOLTEST tdset-3s.ddl --enable-error-stack -d "/dset1[1,1;;;]" tdset.h5 -TOOLTEST tno-subset.ddl --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 +TOOLTEST tno-subset.ddl --enable-error-stack --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 # test printing characters in ASCII instead of decimal TOOLTEST tchar1.ddl --enable-error-stack -r tchar.h5 @@ -716,10 +814,14 @@ TOOLTEST tboot2.ddl --enable-error-stack -B tfcontents2.h5 TOOLTEST file_space.ddl --enable-error-stack -B file_space.h5 # test -p with a non existing dataset -TOOLTEST3 tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5 +TOOLTEST4 tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5 # test for file contents TOOLTEST tcontents.ddl --enable-error-stack -n tfcontents1.h5 +TOOLTEST tordercontents1.ddl --enable-error-stack -n --sort_by=name --sort_order=ascending tfcontents1.h5 +TOOLTEST tordercontents2.ddl --enable-error-stack -n --sort_by=name --sort_order=descending tfcontents1.h5 +TOOLTEST tattrcontents1.ddl --enable-error-stack -n 1 --sort_order=ascending tall.h5 +TOOLTEST tattrcontents2.ddl --enable-error-stack -n 1 --sort_order=descending tall.h5 # tests for storage layout # compact @@ -851,6 +953,9 @@ TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b LE tbinar TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b tbinary.h5 IMPORTTEST out1.bin -c out3.h5import -o out1.h5 DIFFTEST tbinary.h5 out1.h5 /integer /integer +# Same but use h5dump as input to h5import +IMPORTTEST out1.bin -c tbin1.ddl -o out1D.h5 +DIFFTEST tbinary.h5 out1D.h5 /integer /integer TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbinary.h5 @@ -858,6 +963,9 @@ TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbina TOOLTEST tbin3.ddl --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5 IMPORTTEST out3.bin -c out3.h5import -o out3.h5 DIFFTEST tbinary.h5 out3.h5 /integer /integer +# Same but use h5dump as input to h5import +IMPORTTEST out3.bin -c tbin3.ddl -o out3D.h5 +DIFFTEST tbinary.h5 out3D.h5 /integer /integer TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5 @@ -870,11 +978,9 @@ fi # test for dataset region references TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 -# JIRA HDFFV-7936 TOOLTEST tdataregR.ddl --enable-error-stack -R tdatareg.h5 -TOOLTEST tdataregR.ddl -R tdatareg.h5 +TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 -# JIRA HDFFV-7936 TOOLTEST tattrregR.ddl --enable-error-stack -R tattrreg.h5 -TOOLTEST tattrregR.ddl -R tattrreg.h5 +TOOLTEST4 tattrregR.ddl --enable-error-stack -R tattrreg.h5 TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 @@ -897,21 +1003,22 @@ TOOLTEST torderattr2.ddl --enable-error-stack -H --sort_by=name --sort_order=des TOOLTEST torderattr3.ddl --enable-error-stack -H --sort_by=creation_order --sort_order=ascending torderattr.h5 TOOLTEST torderattr4.ddl --enable-error-stack -H --sort_by=creation_order --sort_order=descending torderattr.h5 +# tests for link references and order +TOOLTEST4 torderlinks1.ddl --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5 +TOOLTEST4 torderlinks2.ddl --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5 + # tests for floating point user defined printf format TOOLTEST tfpformat.ddl --enable-error-stack -m %.7f tfpformat.h5 # tests for traversal of external links -# JIRA HDFFV-7936 TOOLTEST textlinksrc.ddl --enable-error-stack textlinksrc.h5 -TOOLTEST textlinksrc.ddl textlinksrc.h5 -# JIRA HDFFV-7936 TOOLTEST textlinkfar.ddl --enable-error-stack textlinkfar.h5 -TOOLTEST textlinkfar.ddl textlinkfar.h5 +TOOLTEST4 textlinksrc.ddl --enable-error-stack textlinksrc.h5 +TOOLTEST4 textlinkfar.ddl --enable-error-stack textlinkfar.h5 # test for dangling external links -# JIRA HDFFV-7936 TOOLTEST textlink.ddl --enable-error-stack textlink.h5 -TOOLTEST3 textlink.ddl --enable-error-stack textlink.h5 +TOOLTEST4 textlink.ddl --enable-error-stack textlink.h5 # test for error stack display (BZ2048) -TOOLTEST3 filter_fail.ddl --enable-error-stack filter_fail.h5 +TOOLTEST4 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes TOOLTEST tall-6.ddl --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5 diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in index 393fcc1..991fe7a 100644 --- a/tools/h5dump/testh5dumppbits.sh.in +++ b/tools/h5dump/testh5dumppbits.sh.in @@ -55,6 +55,7 @@ SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" # testfiles source dirs for tools SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_ERRORFILES="$srcdir/errfiles" SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" @@ -134,10 +135,26 @@ $SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong16.ddl $SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong16.ddl " +LIST_ERROR_TEST_FILES=" +${SRC_H5DUMP_ERRORFILES}/tnofilename-with-packed-bits.err +${SRC_H5DUMP_ERRORFILES}/tpbitsCharLengthExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsCharOffsetExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsIncomplete.err +${SRC_H5DUMP_ERRORFILES}/tpbitsIntLengthExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsIntOffsetExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsLengthExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsLengthPositive.err +${SRC_H5DUMP_ERRORFILES}/tpbitsLongLengthExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsLongOffsetExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsMaxExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsOffsetExceeded.err +${SRC_H5DUMP_ERRORFILES}/tpbitsOffsetNegative.err +" + # # copy test files and expected output files from source dirs to test dir # -COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML" +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_ERROR_TEST_FILES" COPY_TESTFILES_TO_TESTDIR() { @@ -328,6 +345,69 @@ TOOLTEST3() { } +# same as TOOLTEST3 but filters error stack output and compares to an error file +# Extract file name, line number, version and thread IDs because they may be different +TOOLTEST4() { + + expect="$TESTDIR/$1" + expect_err="$TESTDIR/`basename $1 .ddl`.err" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.oerr" + actual_ext="$TESTDIR/`basename $1 .ddl`.ext" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual_ext + #cat $actual_ext >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi + +} + # Print a "SKIP" message SKIP() { TESTING $DUMPER $@ diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index a96ebc4..5bbcf02 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -12,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +#SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5import) @@ -59,6 +60,14 @@ IF (BUILD_TESTING) txtin32.txt textpfe64.txt txtstr.txt + dbinfp64.h5.txt + dbinin8.h5.txt + dbinin8w.h5.txt + dbinin16.h5.txt + dbinin32.h5.txt + dbinuin16.h5.txt + dbinuin32.h5.txt + dtxtstr.h5.txt ) SET (HDF5_REFERENCE_TEST_FILES binfp64.h5 @@ -92,7 +101,7 @@ IF (BUILD_TESTING) ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${txt_file}") + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") #MESSAGE (STATUS " Copying ${txt_file}") ADD_CUSTOM_COMMAND ( TARGET h5import @@ -119,24 +128,22 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5IMPORT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile} - ${testfile}.new - ${testfile}.new.err - ${testfile}.out - ${testfile}.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-${testname}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${testfile} + ${testfile}.new + ${testfile}.new.err + ${testfile}.out + ${testfile}.out.err + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5IMPORT-${testname}-clear-objects") - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c testfiles/${conffile} -o ${testfile}) + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") @@ -172,7 +179,89 @@ IF (BUILD_TESTING) SET_TESTS_PROPERTIES (H5IMPORT-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5IMPORT-H5DMP-${testname}) SET (last_test "H5IMPORT-H5DMP_CMP-${testname}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST testname resultcode testfile vparam srcname dstname) + ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) + + MACRO (ADD_H5_DUMPTEST testname datasetname testfile) + # If using memchecker add tests without using scripts + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + d${testfile} + d${testfile}.bin + d${testfile}.imp + d${testfile}.imp.err + d${testfile}.dmp + d${testfile}.dmp.err + d${testfile}.dff + d${testfile}.dff.err + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + + IF ("${ARGN}" STREQUAL "BINARY") + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-H5DUMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;testfiles/${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ELSE ("${ARGN}" STREQUAL "BINARY") + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-H5DUMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF ("${ARGN}" STREQUAL "BINARY") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DUMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5import>" + -D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.imp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DUMP") + + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-H5DIFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" + -D "TEST_ARGS:STRING=-v;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.dff" + -D "TEST_EXPECT=0" + -D "TEST_FILTER=(^(Warning)[^\n]*)" + -D "TEST_REFERENCE=testfiles/d${testfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DIFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") + SET (last_test "H5IMPORT-DUMP-${testname}-H5DIFF") + ELSE (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) ############################################################################## ############################################################################## @@ -192,8 +281,6 @@ IF (BUILD_TESTING) binin32.bin binuin16.bin binuin32.bin - txtin16.txt - txtin32.txt ${HDF5_REFERENCE_TEST_FILES} ) SET (last_test "H5IMPORT-clear-objects") @@ -205,52 +292,60 @@ IF (BUILD_TESTING) SET (last_test "H5IMPORT-h5importtest") # ----- TESTING "ASCII I32 rank 3 - Output BE " ; - ADD_H5_TEST (ASCII_I32 txtin32.txt txtin32.conf txtin32.h5) + ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) # ----- TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" - ADD_H5_TEST (ASCII_I16 txtin16.txt txtin16.conf txtin16.h5) + ADD_H5_TEST (ASCII_I16 testfiles/txtin16.txt testfiles/txtin16.conf txtin16.h5) # ----- TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " - ADD_H5_TEST (ASCII_I8 txtin8.txt txtin8.conf txtin8.h5) - - # ----- TESTING "ASCII UI32 - rank 3 - Output BE" - ADD_H5_TEST (ASCII_UI32 txtuin32.txt txtuin32.conf txtuin32.h5) + ADD_H5_TEST (ASCII_I8 testfiles/txtin8.txt testfiles/txtin8.conf txtin8.h5) # ----- TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " - ADD_H5_TEST (ASCII_UI16 txtuin16.txt txtuin16.conf txtuin16.h5) + ADD_H5_TEST (ASCII_UI16 testfiles/txtuin16.txt testfiles/txtuin16.conf txtuin16.h5) + + # ----- TESTING "ASCII UI32 - rank 3 - Output BE" + ADD_H5_TEST (ASCII_UI32 testfiles/txtuin32.txt testfiles/txtuin32.conf txtuin32.h5) # ----- TESTING "ASCII F32 - rank 3 - Output LE " - ADD_H5_TEST (ASCII_F32 txtfp32.txt txtfp32.conf txtfp32.h5) + ADD_H5_TEST (ASCII_F32 testfiles/txtfp32.txt testfiles/txtfp32.conf txtfp32.h5) # ----- TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " - ADD_H5_TEST (ASCII_F64 txtfp64.txt txtfp64.conf txtfp64.h5) + 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 binfp64.conf binfp64.h5) - - # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " - ADD_H5_TEST (BINARY_I16 binin16.bin binin16.conf binin16.h5) + ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) + ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " - ADD_H5_TEST (BINARY_I8 binin8.bin binin8.conf binin8.h5) + ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) + ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) + + # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " + ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/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 binin32.conf binin32.h5) + ADD_H5_TEST (BINARY_I32 binin32.bin testfiles/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 binuin16.conf binuin16.h5) + ADD_H5_TEST (BINARY_UI16 binuin16.bin testfiles/binuin16.conf binuin16.h5) + ADD_H5_DUMPTEST (BINARY_UI16 "/int/buin/16-bit" binuin16.h5 BINARY) - # ----- TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " - ADD_H5_TEST (BINARY_UI32 binuin32.bin binuin32.conf binuin32.h5) + # ----- TESTING "BINARY UI32 - rank 3 - Output LE " + ADD_H5_TEST (BINARY_UI32 binuin32.bin testfiles/binuin32.conf binuin32.h5) + ADD_H5_DUMPTEST (BINARY_UI32 "/int/buin/32-bit" binuin32.h5 BINARY) # ----- TESTING "STR" - ADD_H5_TEST (STR txtstr.txt txtstr.conf txtstr.h5) + ADD_H5_TEST (STR testfiles/txtstr.txt testfiles/txtstr.conf txtstr.h5) + ADD_H5_DUMPTEST (STR "/mytext/data" txtstr.h5) # ----- TESTING "BINARY I8 CR LF EOF" - ADD_H5_TEST (BINARY_I8_EOF binin8w.bin binin8w.conf binin8w.h5) + ADD_H5_TEST (BINARY_I8_EOF binin8w.bin testfiles/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 textpfe64.txt textpfe.conf textpfe.h5) + ADD_H5_TEST (ASCII_F64_R1 testfiles/textpfe64.txt testfiles/textpfe.conf textpfe.h5) ENDIF (BUILD_TESTING) diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 56dc5ab..34870fb 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -371,11 +371,19 @@ static int processDataFile(char *infile, struct Input *in, hid_t file_id) break; case 5: /* STR */ - - if (processStrData(strm, in, file_id) == -1) { - (void) HDfprintf(stderr, err11, infile); - HDfclose(strm); - return (-1); + if (in->h5dumpInput) { + if (processStrHDFData(strm, in, file_id) == -1) { + (void) HDfprintf(stderr, err11, infile); + HDfclose(strm); + return (-1); + } + } + else { + if (processStrData(strm, in, file_id) == -1) { + (void) HDfprintf(stderr, err11, infile); + HDfclose(strm); + return (-1); + } } break; @@ -944,6 +952,179 @@ out: return (-1); } +/*------------------------------------------------------------------------- + * Function: processStrData + * + * Purpose: read an ASCII file with string data and generate an HDF5 dataset + * with a variable length type + * + * Return: 0, ok, -1 no + * + *------------------------------------------------------------------------- + */ +static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) +{ + hid_t group_id; + hid_t dset_id; + hid_t space_id; + hid_t mspace_id; + hid_t type_id; + hid_t handle; + char *str1 = NULL; + char *str2 = NULL; + char *str3 = NULL; + char str[1024] = ""; + char c; + int results; + int j; + int nlines = 0; + int line; + + /*------------------------------------------------------------------------- + * read file and generate an HDF5 dataset + *------------------------------------------------------------------------- + */ +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING\n"); +#endif + + if ((type_id = H5Tcopy(H5T_C_S1)) < 0) + goto out; + + if (H5Tset_size(type_id, H5T_VARIABLE) < 0) + goto out; + + /* disable error reporting */ + H5E_BEGIN_TRY + { + /* create parent groups */ + if (in->path.count > 1) { + j = 0; + handle = file_id; + while (j < in->path.count - 1) { + if ((group_id = H5Gopen2(handle, in->path.group[j], H5P_DEFAULT)) < 0) { + group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for (; j < in->path.count - 1; j++) + group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + handle = group_id; + break; + } + handle = group_id; + j++; + } + } + else { + handle = file_id; + j = 0; + } + + /*enable error reporting */ + } + H5E_END_TRY; +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING groups created\n"); +#endif + + if ((space_id = H5Screate_simple(in->rank, in->sizeOfDimension, NULL)) < 0) + goto out; + + if ((mspace_id = H5Screate(H5S_SCALAR)) < 0) + goto out; + + if ((dset_id = H5Dcreate2(handle, in->path.group[j], type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto out; + +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING ready to process strings\n"); +#endif + line = 0; + j = 0; + + while (HDfgets(str,sizeof(str),strm)) { + str1 = str; + str2 = NULL; + str3 = NULL; +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING[%d]={%s}\n", line, str1); +#endif + /* process string to remove the first and last quote char */ + str2 = strchr(str1, '"'); + if (str2 != NULL) { +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2); +#endif + str2++; +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2); +#endif + str3 = strrchr(str2, '"'); + if (str3 != NULL) { +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str3), str3); +#endif + *str3 = '\0'; + +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING len:%d for {%s}\n", strlen(str2), str2); +#endif + + if(strlen(str2) > 0) { + hid_t fspace_id; + hsize_t start[1]; + hsize_t count[1] = { 1 }; + +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING[%d] store %s\n", line, str2); +#endif + if ((fspace_id = H5Dget_space(dset_id)) < 0) + goto out; + + start[0] = line++; + + if (H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + goto out; + + if (H5Dwrite(dset_id, type_id, mspace_id, fspace_id, H5P_DEFAULT, &str2) < 0) + goto out; + + if (H5Sclose(fspace_id) < 0) + goto out; + } + } + } + str[0] = '\0'; + j++; + } +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING eof reached\n"); +#endif + + /* close */ + H5Dclose(dset_id); + H5Sclose(space_id); + H5Sclose(mspace_id); + H5Tclose(type_id); + + return (0); + +out: +#ifdef H5DEBUGIMPORT + printf("processStrHDFData DATATYPE STRING error exit\n"); +#endif +/* disable error reporting */ +H5E_BEGIN_TRY +{ + /* close */ + H5Dclose(dset_id); + H5Sclose(space_id); + H5Sclose(mspace_id); + H5Tclose(type_id); +} +H5E_END_TRY; + + return (-1); +} + static int allocateIntegerStorage(struct Input *in) { hsize_t len = 1; @@ -1075,6 +1256,7 @@ static int processConfigurationFile(char *infile, struct Input *in) int kindex; char temp[255]; int ival; + int scanret; const char *err1 = "Unable to open the configuration file: %s for reading.\n"; const char *err2 = "Unknown keyword in configuration file: %s\n"; @@ -1124,285 +1306,888 @@ static int processConfigurationFile(char *infile, struct Input *in) return (-1); } - while (fscanf(strm, "%s", key) == 1) { - if ((kindex = mapKeywordToIndex(key)) == -1) { - (void) HDfprintf(stderr, err2, infile); - HDfclose(strm); - return (-1); - } - switch (kindex) { - case 0: /* PATH */ - if (in->configOptionVector[PATH] == 1) { - (void) HDfprintf(stderr, err3a, infile); - HDfclose(strm); - return (-1); - } - if (fscanf(strm, "%s", temp) != 1) { - (void) HDfprintf(stderr, "%s", err18); - HDfclose(strm); - return (-1); - } - if (parsePathInfo(&in->path, temp) == -1) { - (void) HDfprintf(stderr, err3b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[PATH] = 1; - break; + scanret = fscanf(strm, "%s", key); + if((scanret == 1) && !HDstrcmp("HDF5", key)) { +#ifdef H5DEBUGIMPORT + int pndx; + printf("\nh5dump file\n"); +#endif + in->h5dumpInput = 1; + scanret = fscanf(strm, "%s", temp); /* filename */ + scanret = fscanf(strm, "%s", temp); /* start bracket */ + scanret = fscanf(strm, "%s", key); /* DATASET */ + while (scanret == 1) { + if(!HDstrcmp("DATASET", key)) { /* PATH */ +#ifdef H5DEBUGIMPORT + printf("h5dump DATASET key\n"); +#endif + if (in->configOptionVector[PATH] == 1) { + (void) HDfprintf(stderr, err3a, infile); + HDfclose(strm); + return (-1); + } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASET %s found\n", temp); +#endif + if (parsePathInfo(&in->path, temp) == -1) { + (void) HDfprintf(stderr, err3b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[PATH] = 1; + scanret = fscanf(strm, "%s", temp); /* start bracket */ +#ifdef H5DEBUGIMPORT + printf("h5dump DATASET %s found\n", temp); +#endif + } /* if(!HDstrcmp("DATASET", key)) PATH */ + else if(!HDstrcmp("DATATYPE", key)) { /* INPUT-CLASS */ +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE key\n"); +#endif + if (in->configOptionVector[INPUT_CLASS] == 1) { + (void) HDfprintf(stderr, err4a, infile); + HDfclose(strm); + return (-1); + } - case 1: /* INPUT-CLASS */ - if (in->configOptionVector[INPUT_CLASS] == 1) { - (void) HDfprintf(stderr, err4a, infile); - HDfclose(strm); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE %s found\n", temp); +#endif + if ((kindex = getInputClassType(in, temp)) == -1) { + (void) HDfprintf(stderr, err4b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE type %d inputClass\n", in->inputClass); +#endif - if (fscanf(strm, "%s", temp) != 1) { - (void) HDfprintf(stderr, "%s", err18); - HDfclose(strm); - return (-1); - } - if (getInputClass(in, temp) == -1) { - (void) HDfprintf(stderr, err4b, infile); - HDfclose(strm); - return (-1); - } + in->configOptionVector[INPUT_CLASS] = 1; + + /*set default value for output-class */ + if (in->configOptionVector[OUTPUT_CLASS] == 0) { + if (in->inputClass == 0 || in->inputClass == 4) + in->outputClass = 0; + if (in->inputClass == 1 || in->inputClass == 2 + || in->inputClass == 3) + in->outputClass = 1; + if (in->inputClass == 6 || in->inputClass == 7) + in->outputClass = 2; + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE type %d outputClass\n", in->outputClass); +#endif - in->configOptionVector[INPUT_CLASS] = 1; - - /*set default value for output-class */ - if (in->configOptionVector[OUTPUT_CLASS] == 0) { - if (in->inputClass == 0 || in->inputClass == 4) - in->outputClass = 0; - if (in->inputClass == 1 || in->inputClass == 2 - || in->inputClass == 3) - in->outputClass = 1; - if (in->inputClass == 6 || in->inputClass == 7) - in->outputClass = 2; - } - break; + if(in->inputClass == 5) { /* STRING */ + int get_next_prop = 1; + in->outputClass = -1; +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING found\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* start bracket */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* string properties */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } + while (get_next_prop) { + if(!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */ + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err19); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING STRSIZE %s found\n", temp); +#endif + if (HDstrcmp("H5T_VARIABLE;", temp)) { + char *more = temp; + ival = HDstrtol(more, &more, 10); + if (getInputSize(in, ival) == -1) { + (void) HDfprintf(stderr, err5b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING %d InputSize\n", in->inputSize); +#endif + } + } + else if(!HDstrcmp("STRPAD", temp)) { /* STRPAD */ + if (fscanf(strm, "%s", temp) != 1) { /* STRPAD type */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING STRPAD %s found\n", temp); +#endif + } + else if(!HDstrcmp("CSET", key)) { /* CSET */ + if (fscanf(strm, "%s", temp) != 1) { /* CSET type */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING CSET %s found\n", temp); +#endif - case 2: /* INPUT-SIZE */ - if (in->configOptionVector[INPUT_SIZE] == 1) { - (void) HDfprintf(stderr, err5a, infile); - HDfclose(strm); - return (-1); + } + else if(!HDstrcmp("CTYPE", temp)) { /* CTYPE */ + if (fscanf(strm, "%s", temp) != 1) { /* CTYPE type */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING CTYPE %s found\n", temp); +#endif + } /* if(!HDstrcmp("CSET", key)) */ + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATATYPE STRING %s found\n", temp); +#endif + if(!HDstrcmp("}", temp)) { /* end bracket */ + get_next_prop = 0; + } + } /* while (get_next_prop) */ + } /* if(kindex == 5) STRING */ + } /* else if(!HDstrcmp("DATATYPE", key)) INPUT-CLASS */ + else if(!HDstrcmp("DATASPACE", key)) { /* RANK and DIMENSIONS */ + hsize_t temp_dims[MAX_NUM_DIMENSION]; + +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE key\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } + if(!HDstrcmp("SCALAR", temp)) { /* SCALAR */ + in->rank = 0; + } /* if(!HDstrcmp("SCALAR", key)) */ + else if(!HDstrcmp("NULL", temp)) { /* NULL */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } /* else if(!HDstrcmp("NULL", key)) */ + else if(!HDstrcmp("SIMPLE", temp)) { /* SIMPLE */ + int icount = 0; +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE found\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* start bracket */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* start paren */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %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); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %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); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %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"); + HDfclose(strm); + return (-1); + } + } + } /* while (get_next_dim) */ + + if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { + (void) HDfprintf(stderr, "Unable to allocate dynamic memory.\n"); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %d 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); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %d", in->sizeOfDimension[pndx]); + } + printf("\n"); +#endif + in->configOptionVector[DIM] = 1; + } /* if(!HDstrcmp("(", key)) start paren */ + else { + (void) HDfprintf(stderr, err5b, infile); + HDfclose(strm); + return (-1); + } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %s found\n", temp); +#endif + if(!HDstrcmp("/", temp)) { /* / max dims */ + if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { + (void) HDfprintf(stderr, "Unable to allocate dynamic memory.\n"); + return (-1); + } + if (fscanf(strm, "%s", temp) != 1) { /* start paren */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %s found\n", temp); +#endif + if(!HDstrcmp("(", temp)) { /* start paren */ + int get_next_dim = 1; + int i = 0; + +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE process max dim values\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* max dim with optional comma */ + (void) HDfprintf(stderr, err16c, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %s found\n", temp); +#endif + while (get_next_dim) { +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE get max dim value\n"); +#endif + if(!HDstrcmp("H5S_UNLIMITED", temp) || !HDstrcmp("H5S_UNLIMITED,", temp)) { /* unlimited */ + in->maxsizeOfDimension[i] = H5S_UNLIMITED; + in->configOptionVector[EXTEND] = 1; + } + else { + char *more = temp; + in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10); + } + if (fscanf(strm, "%s", temp) != 1) { /* max dim or end paren */ + (void) HDfprintf(stderr, err16c, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %s found\n", temp); +#endif + if(!HDstrcmp(")", temp)) { /* end paren */ + get_next_dim = 0; + } + else { /* comma */ + i++; + if (i > MAX_NUM_DIMENSION) { + (void) HDfprintf(stderr, "Invalid value for rank.\n"); + HDfclose(strm); + return (-1); + } + } + } /* while (get_next_dim) */ +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE maxdims:", in->rank); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %d", in->maxsizeOfDimension[pndx]); + } + printf("\n"); + printf("h5dump DATASPACE SIMPLE get max dim finished\n"); +#endif + } /* if(!HDstrcmp("(", key)) start paren */ + else { + (void) HDfprintf(stderr, err16c, infile); + HDfclose(strm); + return (-1); + } + scanret = fscanf(strm, "%s", temp); /* end bracket */ +#ifdef H5DEBUGIMPORT + printf("h5dump DATASPACE SIMPLE %s found\n", temp); +#endif + } /* if(!HDstrcmp("/", key)) max dims separator */ + } /* else if(!HDstrcmp("SIMPLE", key)) */ + else { + (void) HDfprintf(stderr, err5b, infile); + HDfclose(strm); + return (-1); + } + } /* else if(!HDstrcmp("DATASPACE", key)) RANK and DIMENSIONS */ + else if(!HDstrcmp("STORAGE_LAYOUT", key)) { /* CHUNKED-DIMENSION-SIZES */ +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT key\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* start bracket */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* CHUNKED */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT %s found\n", temp); +#endif + if(!HDstrcmp("CHUNKED", temp)) { /* CHUNKED */ + if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { + (void) HDfprintf(stderr, "Unable to allocate dynamic memory.\n"); + return (-1); + } + if (fscanf(strm, "%s", temp) != 1) { /* start paren */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); +#endif + if(!HDstrcmp("(", temp)) { /* start paren */ + int get_next_dim = 1; + int icount = 0; + + if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */ + (void) HDfprintf(stderr, err16c, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); +#endif + while (get_next_dim) { + char *more = temp; + in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10); + if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); +#endif + if(!HDstrcmp(")", temp)) { /* end paren */ + in->configOptionVector[RANK] = 1; + get_next_dim = 0; + } + else { /* Dimension */ + icount++; + if (icount > MAX_NUM_DIMENSION) { + (void) HDfprintf(stderr, "Invalid value for rank.\n"); + HDfclose(strm); + return (-1); + } + } + } /* while (get_next_dim) */ +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT CHUNKED dims:", in->rank); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %d", in->sizeOfChunk[pndx]); + } + printf("\n"); +#endif + in->configOptionVector[DIM] = 1; + } /* if(!HDstrcmp("(", key)) start paren */ + else { + (void) HDfprintf(stderr, err5b, infile); + HDfclose(strm); + return (-1); + } + if (fscanf(strm, "%s", temp) != 1) { /* SIZE */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); +#endif + if(!HDstrcmp("SIZE", temp)) { /* SIZE */ + if (fscanf(strm, "%d", (&ival)) != 1) { + (void) HDfprintf(stderr, "%s", err19); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT CHUNKED SIZE %d found\n", ival); +#endif + } + while (HDstrcmp("}", temp)) { + if (fscanf(strm, "%s", temp) != 1) { /* end bracket */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); +#endif + } + in->configOptionVector[CHUNK] = 1; + } /* if(!HDstrcmp("CHUNKED", key)) CHUNKED */ + } /* else if(!HDstrcmp("STORAGE_LAYOUT", key)) CHUNKED-DIMENSION-SIZES */ + else if(!HDstrcmp("FILTERS", key)) { /* FILTERS */ +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS key\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* start bracket */ + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS %s found\n", temp); +#endif + if(!HDstrcmp("COMPRESSION", temp)) { /* COMPRESSION */ +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS COMPRESSION found\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* DEFLATE */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS COMPRESSION %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* bgin bracket */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS COMPRESSION %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* LEVEL */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS COMPRESSION %s found\n", temp); +#endif + if (fscanf(strm, "%d", (&ival)) != 1) { + (void) HDfprintf(stderr, "%s", err19); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival); +#endif + in->compressionParam = ival; + if (fscanf(strm, "%s", temp) != 1) { /* end bracket */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS COMPRESSION %s found\n", temp); +#endif + in->compressionType = 0; /* ONLY GZIP supported */ + in->configOptionVector[COMPRESS] = 1; + } + else if(!HDstrcmp("CONTIGUOUS", temp)) { /* CONTIGUOUS */ +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS CONTIGUOUS found\n"); +#endif + in->configOptionVector[COMPRESS] = 0; + } + else if(!HDstrcmp("NONE", temp)) { /* NONE */ +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS NONE found\n"); +#endif + in->configOptionVector[COMPRESS] = 0; + } + if (fscanf(strm, "%s", temp) != 1) { /* end bracket */ + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } +#ifdef H5DEBUGIMPORT + printf("h5dump FILTERS %s found\n", temp); +#endif } - if (fscanf(strm, "%d", (&ival)) != 1) { - (void) HDfprintf(stderr, "%s", err19); - HDfclose(strm); - return (-1); + else if(!HDstrcmp("DATA", key)) { /* FINSHED */ +#ifdef H5DEBUGIMPORT + printf("h5dump DATA key\n"); +#endif + scanret = 0; + break; } - if (getInputSize(in, ival) == -1) { - (void) HDfprintf(stderr, err5b, infile); + scanret = fscanf(strm, "%s", key); + } +#ifdef H5DEBUGIMPORT + printf("h5dump path"); + for (pndx = 0; pndx < in->path.count; pndx++) { + printf(" : %s", in->path.group[pndx]); + } + printf("\n"); + printf("h5dump inputClass=%d\n", in->inputClass); + printf("h5dump inputSize=%d\n", in->inputSize); + printf("h5dump rank=%d\n", in->rank); + printf("h5dump outputClass=%d\n", in->outputClass); + printf("h5dump outputSize=%d\n", in->outputSize); + printf("h5dump outputArchitecture=%d\n", in->outputArchitecture); + printf("h5dump outputByteOrder=%d\n", in->outputByteOrder); + 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]); + } +#endif + } + else { + while (scanret == 1) { + if ((kindex = mapKeywordToIndex(key)) == -1) { + (void) HDfprintf(stderr, err2, infile); HDfclose(strm); return (-1); } - in->configOptionVector[INPUT_SIZE] = 1; + switch (kindex) { + case 0: /* PATH */ + if (in->configOptionVector[PATH] == 1) { + (void) HDfprintf(stderr, err3a, infile); + HDfclose(strm); + return (-1); + } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } + if (parsePathInfo(&in->path, temp) == -1) { + (void) HDfprintf(stderr, err3b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[PATH] = 1; + break; - /*set default value for output-size */ - if (in->configOptionVector[OUTPUT_SIZE] == 0) - in->outputSize = in->inputSize; - break; + case 1: /* INPUT-CLASS */ + if (in->configOptionVector[INPUT_CLASS] == 1) { + (void) HDfprintf(stderr, err4a, infile); + HDfclose(strm); + return (-1); + } - case 3: /* RANK */ - if (in->configOptionVector[RANK] == 1) { - (void) HDfprintf(stderr, err6a, infile); - HDfclose(strm); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } + if (getInputClass(in, temp) == -1) { + (void) HDfprintf(stderr, err4b, infile); + HDfclose(strm); + return (-1); + } - if (getRank(in, strm) == -1) { - (void) HDfprintf(stderr, err6b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[RANK] = 1; - break; + in->configOptionVector[INPUT_CLASS] = 1; + + /*set default value for output-class */ + if (in->configOptionVector[OUTPUT_CLASS] == 0) { + if (in->inputClass == 0 || in->inputClass == 4) + in->outputClass = 0; + if (in->inputClass == 1 || in->inputClass == 2 + || in->inputClass == 3) + in->outputClass = 1; + if (in->inputClass == 6 || in->inputClass == 7) + in->outputClass = 2; + } + break; - case 4: /* DIMENSION-SIZES */ - if (in->configOptionVector[DIM] == 1) { - (void) HDfprintf(stderr, err7a, infile); - HDfclose(strm); - return (-1); - } + case 2: /* INPUT-SIZE */ + if (in->configOptionVector[INPUT_SIZE] == 1) { + (void) HDfprintf(stderr, err5a, infile); + HDfclose(strm); + return (-1); + } + if (fscanf(strm, "%d", (&ival)) != 1) { + (void) HDfprintf(stderr, "%s", err19); + HDfclose(strm); + return (-1); + } + if (getInputSize(in, ival) == -1) { + (void) HDfprintf(stderr, err5b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[INPUT_SIZE] = 1; - if (in->configOptionVector[RANK] == 0) { - (void) HDfprintf(stderr, err7b, infile); - HDfclose(strm); - return (-1); - } - if (getDimensionSizes(in, strm) == -1) { - (void) HDfprintf(stderr, err7c, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[DIM] = 1; - break; + /*set default value for output-size */ + if (in->configOptionVector[OUTPUT_SIZE] == 0) + in->outputSize = in->inputSize; + break; - case 5: /* OUTPUT-CLASS */ - if (in->configOptionVector[OUTPUT_CLASS] == 1) { - (void) HDfprintf(stderr, err8a, infile); - HDfclose(strm); - return (-1); - } + case 3: /* RANK */ + if (in->configOptionVector[RANK] == 1) { + (void) HDfprintf(stderr, err6a, infile); + HDfclose(strm); + return (-1); + } - if (getOutputClass(in, strm) == -1) { - (void) HDfprintf(stderr, err8b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[OUTPUT_CLASS] = 1; - break; + if (getRank(in, strm) == -1) { + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[RANK] = 1; + break; - case 6: /* OUTPUT-SIZE */ - if (in->configOptionVector[OUTPUT_SIZE] == 1) { - (void) HDfprintf(stderr, err9a, infile); - HDfclose(strm); - return (-1); - } + case 4: /* DIMENSION-SIZES */ + if (in->configOptionVector[DIM] == 1) { + (void) HDfprintf(stderr, err7a, infile); + HDfclose(strm); + return (-1); + } - if (getOutputSize(in, strm) == -1) { - (void) HDfprintf(stderr, err9b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[OUTPUT_SIZE] = 1; - break; + if (in->configOptionVector[RANK] == 0) { + (void) HDfprintf(stderr, err7b, infile); + HDfclose(strm); + return (-1); + } + if (getDimensionSizes(in, strm) == -1) { + (void) HDfprintf(stderr, err7c, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[DIM] = 1; + break; - case 7: /* OUTPUT-ARCHITECTURE */ - if (in->configOptionVector[OUTPUT_ARCH] == 1) { - (void) HDfprintf(stderr, err10a, infile); - HDfclose(strm); - return (-1); - } + case 5: /* OUTPUT-CLASS */ + if (in->configOptionVector[OUTPUT_CLASS] == 1) { + (void) HDfprintf(stderr, err8a, infile); + HDfclose(strm); + return (-1); + } - if (getOutputArchitecture(in, strm) == -1) { - (void) HDfprintf(stderr, err10b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[OUTPUT_ARCH] = 1; - break; + if (getOutputClass(in, strm) == -1) { + (void) HDfprintf(stderr, err8b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_CLASS] = 1; + break; - case 8: /* OUTPUT-BYTE-ORDER */ - if (in->configOptionVector[OUTPUT_B_ORDER] == 1) { - (void) HDfprintf(stderr, err11a, infile); - HDfclose(strm); - return (-1); - } + case 6: /* OUTPUT-SIZE */ + if (in->configOptionVector[OUTPUT_SIZE] == 1) { + (void) HDfprintf(stderr, err9a, infile); + HDfclose(strm); + return (-1); + } - if (getOutputByteOrder(in, strm) == -1) { - (void) HDfprintf(stderr, err11b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[OUTPUT_B_ORDER] = 1; - break; + if (getOutputSize(in, strm) == -1) { + (void) HDfprintf(stderr, err9b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_SIZE] = 1; + break; - case 9: /* CHUNKED-DIMENSION-SIZES */ - if (in->configOptionVector[CHUNK] == 1) { - (void) HDfprintf(stderr, err12a, infile); - HDfclose(strm); - return (-1); - } - /* cant appear before dimension sizes have been provided */ - if (in->configOptionVector[DIM] == 0) { - (void) HDfprintf(stderr, err12b, infile); - HDfclose(strm); - return (-1); - } + case 7: /* OUTPUT-ARCHITECTURE */ + if (in->configOptionVector[OUTPUT_ARCH] == 1) { + (void) HDfprintf(stderr, err10a, infile); + HDfclose(strm); + return (-1); + } - if (getChunkedDimensionSizes(in, strm) == -1) { - (void) HDfprintf(stderr, err12c, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[CHUNK] = 1; - break; + if (getOutputArchitecture(in, strm) == -1) { + (void) HDfprintf(stderr, err10b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_ARCH] = 1; + break; - case 10: /* COMPRESSION-TYPE */ - if (in->configOptionVector[COMPRESS] == 1) { - (void) HDfprintf(stderr, err13a, infile); - HDfclose(strm); - return (-1); - } + case 8: /* OUTPUT-BYTE-ORDER */ + if (in->configOptionVector[OUTPUT_B_ORDER] == 1) { + (void) HDfprintf(stderr, err11a, infile); + HDfclose(strm); + return (-1); + } - if (getCompressionType(in, strm) == -1) { - (void) HDfprintf(stderr, err13b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[COMPRESS] = 1; + if (getOutputByteOrder(in, strm) == -1) { + (void) HDfprintf(stderr, err11b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_B_ORDER] = 1; + break; - if (in->configOptionVector[COMPRESS_PARAM] == 0) { - if (in->compressionType == 0) - in->compressionParam = 6; /* default value if compressionType is GZIP */ - } - break; + case 9: /* CHUNKED-DIMENSION-SIZES */ + if (in->configOptionVector[CHUNK] == 1) { + (void) HDfprintf(stderr, err12a, infile); + HDfclose(strm); + return (-1); + } + /* cant appear before dimension sizes have been provided */ + if (in->configOptionVector[DIM] == 0) { + (void) HDfprintf(stderr, err12b, infile); + HDfclose(strm); + return (-1); + } - case 11: /* COMPRESSION-PARAM */ - if (in->configOptionVector[COMPRESS_PARAM] == 1) { - (void) HDfprintf(stderr, err14a, infile); - HDfclose(strm); - return (-1); - } + if (getChunkedDimensionSizes(in, strm) == -1) { + (void) HDfprintf(stderr, err12c, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[CHUNK] = 1; + break; - if (getCompressionParameter(in, strm) == -1) { - (void) HDfprintf(stderr, err14b, infile); - HDfclose(strm); - return (-1); - } + case 10: /* COMPRESSION-TYPE */ + if (in->configOptionVector[COMPRESS] == 1) { + (void) HDfprintf(stderr, err13a, infile); + HDfclose(strm); + return (-1); + } - in->configOptionVector[COMPRESS_PARAM] = 1; + if (getCompressionType(in, strm) == -1) { + (void) HDfprintf(stderr, err13b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[COMPRESS] = 1; - if (in->configOptionVector[COMPRESS] == 0) - in->compressionType = 0; + if (in->configOptionVector[COMPRESS_PARAM] == 0) { + if (in->compressionType == 0) + in->compressionParam = 6; /* default value if compressionType is GZIP */ + } + break; - break; + case 11: /* COMPRESSION-PARAM */ + if (in->configOptionVector[COMPRESS_PARAM] == 1) { + (void) HDfprintf(stderr, err14a, infile); + HDfclose(strm); + return (-1); + } - case 12: /* EXTERNAL-STORAGE */ - if (in->configOptionVector[EXTERNALSTORE] == 1) { - (void) HDfprintf(stderr, err15a, infile); - HDfclose(strm); - return (-1); - } + if (getCompressionParameter(in, strm) == -1) { + (void) HDfprintf(stderr, err14b, infile); + HDfclose(strm); + return (-1); + } - if (getExternalFilename(in, strm) == -1) { - (void) HDfprintf(stderr, err15b, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[EXTERNALSTORE] = 1; - break; + in->configOptionVector[COMPRESS_PARAM] = 1; - case 13: /* MAXIMUM-DIMENSIONS */ - if (in->configOptionVector[EXTEND] == 1) { - (void) HDfprintf(stderr, err16a, infile); - HDfclose(strm); - return (-1); - } - /* cant appear before dimension sizes have been provided */ - if (in->configOptionVector[DIM] == 0) { - (void) HDfprintf(stderr, err16b, infile); - HDfclose(strm); - return (-1); - } - if (getMaximumDimensionSizes(in, strm) == -1) { - (void) HDfprintf(stderr, err16c, infile); - HDfclose(strm); - return (-1); - } - in->configOptionVector[EXTEND] = 1; - break; + if (in->configOptionVector[COMPRESS] == 0) + in->compressionType = 0; - default: - break; + break; + + case 12: /* EXTERNAL-STORAGE */ + if (in->configOptionVector[EXTERNALSTORE] == 1) { + (void) HDfprintf(stderr, err15a, infile); + HDfclose(strm); + return (-1); + } + + if (getExternalFilename(in, strm) == -1) { + (void) HDfprintf(stderr, err15b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[EXTERNALSTORE] = 1; + break; + + case 13: /* MAXIMUM-DIMENSIONS */ + if (in->configOptionVector[EXTEND] == 1) { + (void) HDfprintf(stderr, err16a, infile); + HDfclose(strm); + return (-1); + } + /* cant appear before dimension sizes have been provided */ + if (in->configOptionVector[DIM] == 0) { + (void) HDfprintf(stderr, err16b, infile); + HDfclose(strm); + return (-1); + } + if (getMaximumDimensionSizes(in, strm) == -1) { + (void) HDfprintf(stderr, err16c, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[EXTEND] = 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) { @@ -1410,7 +2195,6 @@ static int processConfigurationFile(char *infile, struct Input *in) HDfclose(strm); return (-1); } - HDfclose(strm); return (0); } @@ -1491,7 +2275,7 @@ static int mapKeywordToIndex(char *key) static int parsePathInfo(struct path_info *path, char *temp) { - const char delimiter[] = "/"; + const char delimiter[] = "/\""; char *token; int i = 0; const char *err1 = "Path string larger than MAX_PATH_NAME_LENGTH.\n"; @@ -1624,6 +2408,720 @@ static int getInputClass(struct Input *in, char * temp) return (0); } +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"; + + if (!HDstrcmp(buffer, "H5T_STD_I8BE")) { + in->inputSize = 8; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_I8LE")) { + in->inputSize = 8; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_I16BE")) { + in->inputSize = 16; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_I16LE")) { + in->inputSize = 16; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_I32BE")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_I32LE")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_I64BE")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_I64LE")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_STD_U8BE")) { + in->inputSize = 8; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_STD_U8LE")) { + in->inputSize = 8; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_STD_U16BE")) { + in->inputSize = 16; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_STD_U16LE")) { + in->inputSize = 16; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_STD_U32BE")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_STD_U32LE")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_STD_U64BE")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_STD_U64LE")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_SCHAR")) { + in->inputSize = 8; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_UCHAR")) { + in->inputSize = 8; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_SHORT")) { + in->inputSize = 16; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_USHORT")) { + in->inputSize = 16; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_INT")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_UINT")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_LONG")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_ULONG")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_LLONG")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 4; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_ULLONG")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 7; + } + else if (!HDstrcmp(buffer, "H5T_IEEE_F32BE")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("IEEE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 3; + } + else if (!HDstrcmp(buffer, "H5T_IEEE_F32LE")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("IEEE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 3; + } + else if (!HDstrcmp(buffer, "H5T_IEEE_F64BE")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("IEEE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 3; + } + else if (!HDstrcmp(buffer, "H5T_IEEE_F64LE")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("IEEE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = 3; + } + else if (!HDstrcmp(buffer, "H5T_VAX_F32")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + kindex = 3; + } + else if (!HDstrcmp(buffer, "H5T_VAX_F64")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + kindex = 3; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_FLOAT")) { + in->inputSize = 32; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 3; + } + else if (!HDstrcmp(buffer, "H5T_NATIVE_DOUBLE")) { + in->inputSize = 64; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 3; + } +#if H5_SIZEOF_LONG_DOUBLE !=0 + else if (!HDstrcmp(buffer, "H5T_NATIVE_LDOUBLE")) { + in->inputSize = H5_SIZEOF_LONG_DOUBLE; + in->configOptionVector[INPUT_SIZE] = 1; + + if ((kindex = OutputArchStrToInt("NATIVE")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + kindex = 3; + } +#endif + else if(!HDstrcmp(buffer, "H5T_TIME: not yet implemented")) { + kindex = -1; + } + else if(!HDstrcmp(buffer, "H5T_STRING")) { + kindex = 5; + } + /* case H5T_BITFIELD: */ + else if (!HDstrcmp(buffer, "H5T_STD_B8BE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + else if (!HDstrcmp(buffer, "H5T_STD_B8LE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + else if (!HDstrcmp(buffer, "H5T_STD_B16BE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + else if (!HDstrcmp(buffer, "H5T_STD_B16LE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + else if (!HDstrcmp(buffer, "H5T_STD_B32BE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + else if (!HDstrcmp(buffer, "H5T_STD_B32LE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + else if (!HDstrcmp(buffer, "H5T_STD_B64BE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + else if (!HDstrcmp(buffer, "H5T_STD_B64LE")) { + + if ((kindex = OutputArchStrToInt("STD")) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->outputArchitecture = kindex; + + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + in->outputByteOrder = kindex; + + kindex = -1; + } + /* case H5T_OPAQUE: */ + else if(!HDstrcmp(buffer, "H5T_OPAQUE")) { + kindex = -1; + } + /* case H5T_COMPOUND: */ + else if(!HDstrcmp(buffer, "H5T_COMPOUND")) { + kindex = -1; + } + /* case H5T_REFERENCE: */ + else if(!HDstrcmp(buffer, "H5T_REFERENCE")) { + kindex = -1; + } + /* case H5T_ENUM: */ + else if(!HDstrcmp(buffer, "H5T_ENUM")) { + kindex = -1; + } + /* case H5T_VLEN: */ + else if(!HDstrcmp(buffer, "H5T_VLEN")) { + kindex = -1; + } + /* case H5T_ARRAY: */ + else if(!HDstrcmp(buffer, "H5T_ARRAY")) { + kindex = -1; + } + + if (kindex == -1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + + /*set default value for output-size */ + 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); +#endif + + in->inputClass = kindex; + return (0); +} + static int InputClassStrToInt(char *temp) { int i; @@ -1910,6 +3408,7 @@ void setDefaultValues(struct Input *in, int count) char temp[255]; char num[255]; + in->h5dumpInput = 0; in->inputClass = 3; /* FP */ in->inputSize = 32; in->outputClass = 1; /* FP */ @@ -2348,6 +3847,9 @@ static int process(struct Options *opt) /*create data type */ intype = createInputDataType(in); outtype = createOutputDataType(in); +#ifdef H5DEBUGIMPORT + printf("process intype %d outtype %d\n", intype, outtype); +#endif /* create property list */ proplist = H5Pcreate(H5P_DATASET_CREATE); @@ -2498,7 +4000,7 @@ void help(char *name) (void) HDfprintf(stdout, "\t The user can specify output type and storage properties in \n"); (void) HDfprintf(stdout, - "\t the configuration file. The user is requited to specify the \n"); + "\t the configuration file. The user is required to specify the \n"); (void) HDfprintf(stdout, "\t path of the dataset. If the groups in the path leading to \n"); (void) HDfprintf(stdout, @@ -2511,7 +4013,7 @@ void help(char *name) (void) HDfprintf(stdout, "\t provide the class and size of output data to be written to \n"); (void) HDfprintf(stdout, - "\t the dataset and may optionally specify the output-architecure,\n"); + "\t the dataset and may optionally specify the output-architecture,\n"); (void) HDfprintf(stdout, "\t and the output-byte-order. If output-architecture is not \n"); (void) HDfprintf(stdout, @@ -2596,7 +4098,11 @@ void help(char *name) (void) HDfprintf(stdout, "\t The configuration file is an ASCII text file and must be \n"); (void) HDfprintf(stdout, - "\t organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n"); + "\t the ddl formatted file (without data values) produced by h5dump \n"); + (void) HDfprintf(stdout, + "\t when used with the options '-o outfilename -b' of a single dataset (-d) \n"); + (void) HDfprintf(stdout, + "\t OR organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n"); (void) HDfprintf(stdout, "\t line.\n\n"); (void) HDfprintf(stdout, "\t The configuration file may have the following keywords each \n"); @@ -2612,7 +4118,7 @@ void help(char *name) (void) HDfprintf(stdout, "\t Optional KEYWORDS:\n"); (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE\n"); (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER\n"); - (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); (void) HDfprintf(stdout, "\t COMPRESSION-TYPE\n"); (void) HDfprintf(stdout, "\t COMPRESSION-PARAM\n"); (void) HDfprintf(stdout, "\t EXTERNAL-STORAGE\n"); @@ -2622,7 +4128,7 @@ void help(char *name) (void) HDfprintf(stdout, "\t Strings separated by spaces to represent\n"); (void) HDfprintf(stdout, "\t the path of the data-set. If the groups in\n"); (void) HDfprintf(stdout, - "\t the path do no exist, they will be created. \n"); + "\t the path do not exist, they will be created. \n"); (void) HDfprintf(stdout, "\t For example,\n"); (void) HDfprintf(stdout, "\t PATH grp1/grp2/dataset1\n"); (void) HDfprintf(stdout, "\t PATH: keyword\n"); diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h index dbc6844..c686624 100644 --- a/tools/h5import/h5import.h +++ b/tools/h5import/h5import.h @@ -44,20 +44,20 @@ #define MAX_NUM_DIMENSION 32 #define BASE_10 10 -#define CHUNK 0 -#define COMPRESS 1 -#define EXTEND 2 -#define EXTERNALSTORE 3 +#define PATH 0 +#define INPUT_CLASS 1 +#define INPUT_SIZE 2 +#define RANK 3 #define DIM 4 -#define RANK 5 -#define PATH 6 -#define INPUT_CLASS 7 -#define INPUT_SIZE 8 -#define OUTPUT_CLASS 9 -#define OUTPUT_SIZE 10 -#define OUTPUT_ARCH 11 -#define OUTPUT_B_ORDER 12 -#define COMPRESS_PARAM 13 +#define OUTPUT_CLASS 5 +#define OUTPUT_SIZE 6 +#define OUTPUT_ARCH 7 +#define OUTPUT_B_ORDER 8 +#define CHUNK 9 +#define COMPRESS 10 +#define COMPRESS_PARAM 11 +#define EXTERNALSTORE 12 +#define EXTEND 13 /* data types */ #define H5DT_INT8 signed char @@ -80,6 +80,7 @@ struct path_info struct Input { + int h5dumpInput; struct path_info path; int inputClass; int inputSize; @@ -198,6 +199,7 @@ static int parsePathInfo(struct path_info *path, char *strm); 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 InputClassStrToInt(char *temp); static int getRank(struct Input *in, FILE *strm); static int getDimensionSizes(struct Input *in, FILE *strm); @@ -225,6 +227,7 @@ static int readUIntegerData(FILE *strm, struct Input *in); 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); #endif /* H5IMPORT_H__ */ diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 434cba7..49f977c 100644 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -165,21 +165,38 @@ main(void) #ifndef UNICOS +#ifdef REBUILDTEXTFILES /*------------------------------------------------------------------------- - * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5 + * TOOLTEST txtin8.txt -c $srcdir/testfiles/txtin8.conf -o txtin8.h5 *------------------------------------------------------------------------- */ + sp = HDfopen("txtin8.txt", "w"); + for (k = 0; k < npln; k++) + { + for (i = 0; i < nrow; i++) + { + for (j = 0; j < ncol; j++) + (void) fprintf(sp, "%10u", b8i3[k][i][j]); + (void) fprintf(sp, "\n"); + } + } + (void) HDfclose(sp); + + /*------------------------------------------------------------------------- + * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5 + *------------------------------------------------------------------------- + */ sp = HDfopen("txtin16.txt", "w"); for (k = 0; k < npln; k++) { - for (i = 0; i < nrow; i++) - { - for (j = 0; j < ncol; j++) - (void) fprintf(sp, "%10u", b16i3[k][i][j]); - (void) fprintf(sp, "\n"); - } + for (i = 0; i < nrow; i++) + { + for (j = 0; j < ncol; j++) + (void) fprintf(sp, "%10u", b16i3[k][i][j]); + (void) fprintf(sp, "\n"); + } } (void) HDfclose(sp); @@ -199,6 +216,7 @@ main(void) } } (void) HDfclose(sp); +#endif /*------------------------------------------------------------------------- * TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5 diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh index 37613dd..5be3118 100755 --- a/tools/h5import/h5importtestutil.sh +++ b/tools/h5import/h5importtestutil.sh @@ -101,6 +101,14 @@ $SRC_H5IMPORT_TESTFILES/txtin16.txt $SRC_H5IMPORT_TESTFILES/txtin32.txt $SRC_H5IMPORT_TESTFILES/textpfe64.txt $SRC_H5IMPORT_TESTFILES/txtstr.txt +$SRC_H5IMPORT_TESTFILES/dbinfp64.h5.txt +$SRC_H5IMPORT_TESTFILES/dbinin8.h5.txt +$SRC_H5IMPORT_TESTFILES/dbinin8w.h5.txt +$SRC_H5IMPORT_TESTFILES/dbinin16.h5.txt +$SRC_H5IMPORT_TESTFILES/dbinin32.h5.txt +$SRC_H5IMPORT_TESTFILES/dbinuin16.h5.txt +$SRC_H5IMPORT_TESTFILES/dbinuin32.h5.txt +$SRC_H5IMPORT_TESTFILES/dtxtstr.h5.txt " # @@ -153,6 +161,69 @@ else fi } +# Use h5dump output as input to h5import for binary numbers +# Use h5diff to verify results +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 +$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt 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 +} + +# Same as TOOLTEST2 except for strings +# Use h5dump output as input to h5import for strings +# Use h5diff to verify results +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 +$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt 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 +} + +# Same as TOOLTEST3 except for h5diff uses report mode without warnings +# Use h5dump output as input to h5import for strings +# Use h5diff to verify results +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 +$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt 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" @@ -181,58 +252,73 @@ TOOLTEST $TESTDIR/txtin32.txt -c $TESTDIR/txtin32.conf -o txtin32.h5 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 " TOOLTEST $TESTDIR/txtin8.txt -c $TESTDIR/txtin8.conf -o txtin8.h5 -TESTING "ASCII UI32 - rank 3 - Output BE" -TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5 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" +TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5 + + 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 " 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 "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " -TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5 +TESTING "H5DUMP-BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " +TOOLTEST2 "/fp/bin/64-bit" binfp64.h5 TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " -TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5 +TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5 +TESTING "H5DUMP-BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " +TOOLTEST2 "/int/bin/8-bit" binin8.h5 +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 " +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 " +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 " +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 " +TOOLTEST2 "/int/buin/32-bit" binuin32.h5 TESTING "STR" TOOLTEST $TESTDIR/txtstr.txt -c $TESTDIR/txtstr.conf -o txtstr.h5 +TESTING "H5DUMP-STR" +TOOLTEST43 "/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" +TOOLTEST2 "/dataset0" binin8w.h5 TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5 - -rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.h5 +rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.dmp *.imp *.h5 rm -rf tmp_testfiles else echo "** h5import or h5importtest not available ***" diff --git a/tools/h5import/testfiles/dbinfp64.h5.txt b/tools/h5import/testfiles/dbinfp64.h5.txt new file mode 100644 index 0000000..fb88984 --- /dev/null +++ b/tools/h5import/testfiles/dbinfp64.h5.txt @@ -0,0 +1,2 @@ +dataset: </fp/bin/64-bit> and </fp/bin/64-bit> +0 differences found diff --git a/tools/h5import/testfiles/dbinin16.h5.txt b/tools/h5import/testfiles/dbinin16.h5.txt new file mode 100644 index 0000000..b94781e --- /dev/null +++ b/tools/h5import/testfiles/dbinin16.h5.txt @@ -0,0 +1,2 @@ +dataset: </int/bin/16-bit> and </int/bin/16-bit> +0 differences found diff --git a/tools/h5import/testfiles/dbinin32.h5.txt b/tools/h5import/testfiles/dbinin32.h5.txt new file mode 100644 index 0000000..a35cd79 --- /dev/null +++ b/tools/h5import/testfiles/dbinin32.h5.txt @@ -0,0 +1,2 @@ +dataset: </int/bin/32-bit> and </int/bin/32-bit> +0 differences found diff --git a/tools/h5import/testfiles/dbinin8.h5.txt b/tools/h5import/testfiles/dbinin8.h5.txt new file mode 100644 index 0000000..bbc6c67 --- /dev/null +++ b/tools/h5import/testfiles/dbinin8.h5.txt @@ -0,0 +1,2 @@ +dataset: </int/bin/8-bit> and </int/bin/8-bit> +0 differences found diff --git a/tools/h5import/testfiles/dbinin8w.h5.txt b/tools/h5import/testfiles/dbinin8w.h5.txt new file mode 100644 index 0000000..28d43d2 --- /dev/null +++ b/tools/h5import/testfiles/dbinin8w.h5.txt @@ -0,0 +1,2 @@ +dataset: </dataset0> and </dataset0> +0 differences found diff --git a/tools/h5import/testfiles/dbinuin16.h5.txt b/tools/h5import/testfiles/dbinuin16.h5.txt new file mode 100644 index 0000000..ecad7a0 --- /dev/null +++ b/tools/h5import/testfiles/dbinuin16.h5.txt @@ -0,0 +1,2 @@ +dataset: </int/buin/16-bit> and </int/buin/16-bit> +0 differences found diff --git a/tools/h5import/testfiles/dbinuin32.h5.txt b/tools/h5import/testfiles/dbinuin32.h5.txt new file mode 100644 index 0000000..cc1d9f3 --- /dev/null +++ b/tools/h5import/testfiles/dbinuin32.h5.txt @@ -0,0 +1,2 @@ +dataset: </int/buin/32-bit> and </int/buin/32-bit> +0 differences found diff --git a/tools/h5import/testfiles/dtxtstr.h5.txt b/tools/h5import/testfiles/dtxtstr.h5.txt new file mode 100644 index 0000000..2170300 --- /dev/null +++ b/tools/h5import/testfiles/dtxtstr.h5.txt @@ -0,0 +1,2 @@ +dataset: </mytext/data> and </mytext/data> +0 differences found diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index ef5279d..936559e 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -96,6 +96,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layouto.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout2.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout3.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_named_dtypes.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nbit.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_objs.h5 @@ -322,10 +323,12 @@ IF (BUILD_TESTING) -E remove ./testfiles/h5repack_filters.h5.out ./testfiles/h5repack_filters.h5.out.err - ./testfiles/h5repack_layout2.h5-v.out - ./testfiles/h5repack_layout2.h5-v.out.err ./testfiles/h5repack_layout.h5-v.out ./testfiles/h5repack_layout.h5-v.out.err + ./testfiles/h5repack_layout2.h5-v.out + ./testfiles/h5repack_layout2.h5-v.out.err + ./testfiles/h5repack_layout3.h5-v.out + ./testfiles/h5repack_layout3.h5-v.out.err ./testfiles/out.tfamily%05d.h5 ./testfiles/out.h5diff_attr1.h5 ./testfiles/out.h5repack_attr.h5 @@ -336,9 +339,10 @@ IF (BUILD_TESTING) ./testfiles/out.h5repack_filters.h5 ./testfiles/out.h5repack_fletcher.h5 ./testfiles/out.h5repack_hlink.h5 - ./testfiles/out.h5repack_layout2.h5 ./testfiles/out.h5repack_layout.h5 ./testfiles/out.h5repack_layouto.h5 + ./testfiles/out.h5repack_layout2.h5 + ./testfiles/out.h5repack_layout3.h5 ./testfiles/out.h5repack_named_dtypes.h5 ./testfiles/out.h5repack_nbit.h5 ./testfiles/out.h5repack_objs.h5 @@ -369,9 +373,10 @@ IF (BUILD_TESTING) h5repack_fletcher_out.h5 h5repack_hlink.h5 h5repack_hlink_out.h5 - h5repack_layout2.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 @@ -777,6 +782,24 @@ IF (BUILD_TESTING) ADD_H5_TEST (contig_small_fixed_compa "TEST" ${FILE18} -l chunked_small_fixed:COMPA) ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT) +#--------------------------------------------------------------------------- +# Test file contains chunked datasets (need multiple dsets) with +# unlimited max dims. (HDFFV-7933) +# Use first dset to test. +#--------------------------------------------------------------------------- +# chunk to chunk - specify chunk dim bigger than any current dim +ADD_H5_TEST (chunk2chunk "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300) +ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) + +# chunk to contiguous +ADD_H5_TEST (chunk2conti "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CONTI) +ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI) + +# chunk to compact - convert big dataset (should be > 64k) for this purpose, +# should remain as original layout (chunk) +ADD_H5_TEST (chunk2compa "TEST" h5repack_layout3.h5 -l chunk_unlimit1:COMPA) +ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index fb38bc6..42472b56 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -207,10 +207,12 @@ int h5repack_addlayout(const char* str, if (obj_list==NULL) return -1; - /* set global layout option */ + /* set layout option */ + options->layout_g = pack.layout; + + /* no individual dataset specified */ if (options->all_layout==1 ) { - options->layout_g=pack.layout; if (pack.layout==H5D_CHUNKED) { /* -2 means the NONE option, remove chunking @@ -229,6 +231,7 @@ int h5repack_addlayout(const char* str, } } + /* individual dataset specified */ if (options->all_layout==0) options_add_layout(obj_list, n_objs, @@ -505,7 +508,7 @@ int copy_attr(hid_t loc_in, if (type_class == H5T_COMPOUND) { int nmembers = H5Tget_nmembers(wtype_id) ; for (j=0; j<nmembers; j++) { - hid_t mtid = H5Tget_member_type( wtype_id, j ); + hid_t mtid = H5Tget_member_type( wtype_id, (unsigned) j ); H5T_class_t mtclass = H5Tget_class(mtid); H5Tclose(mtid); diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 2bbed0a..329be1f 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -28,6 +28,7 @@ #define MAX_VAR_DIMS 32 /* max per variable dimensions */ #define FORMAT_OBJ " %-27s %s\n" /* obj type, name */ #define FORMAT_OBJ_ATTR " %-27s %s\n" /* obj type, name */ +#define MAX_COMPACT_DSIZE 64512 /* max data size for compact layout. -1k for header size */ /*------------------------------------------------------------------------- * data structures for command line options diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 236c555..e05b03f 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -94,6 +94,7 @@ $SRC_H5REPACK_TESTFILES/h5repack_hlink.h5 $SRC_H5REPACK_TESTFILES/h5repack_layout.h5 $SRC_H5REPACK_TESTFILES/h5repack_layouto.h5 $SRC_H5REPACK_TESTFILES/h5repack_layout2.h5 +$SRC_H5REPACK_TESTFILES/h5repack_layout3.h5 $SRC_H5REPACK_TESTFILES/h5repack_named_dtypes.h5 $SRC_H5REPACK_TESTFILES/h5repack_nbit.h5 $SRC_H5REPACK_TESTFILES/h5repack_objs.h5 @@ -165,7 +166,7 @@ TESTING() { # beginning with the word "Verifying". # VERIFY() { - MESSAGE "Verifying h5diff output $*" + MESSAGE "Verifying $*" } # Print a message that a test has been skipped (because a required filter @@ -179,7 +180,7 @@ SKIP() { # DIFFTEST() { - VERIFY $@ + VERIFY h5diff output $@ $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $RET != 0 ] ; then @@ -235,7 +236,7 @@ VERIFY_LAYOUT_DSET() #--------------------------------- # check the layout from a dataset - VERIFY "Layout" + VERIFY "a dataset layout" $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile $GREP $expectlayout $layoutfile > /dev/null if [ $? -eq 0 ]; then @@ -260,7 +261,7 @@ VERIFY_LAYOUT_ALL() #--------------------------------- # check the layout from a dataset # check if the other layouts still exsit - VERIFY "Layout " + VERIFY "layouts" # if CONTIGUOUS if [ $expectlayout = "CONTIGUOUS" ]; then $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile @@ -360,7 +361,8 @@ TOOLTEST1() rm -f $outfile } -# Call h5repack and compare output to a text file for -v option +# This is same as TOOLTEST() with comparing display output +# from -v option # TOOLTESTV() { @@ -374,10 +376,20 @@ TOOLTESTV() outfile=$TESTDIR/out.$1 shift $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile >$actual 2>$actual_err - cp $actual $actual_sav + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi + + # display output compare STDOUT_FILTER $actual cat $actual_err >> $actual + VERIFY output from $H5REPACK $@ if cmp -s $expect $actual; then echo " PASSED" else @@ -387,7 +399,8 @@ TOOLTESTV() test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' fi - rm -f $actual $actual_err $actual_sav + rm -f $actual $actual_err + rm -f $outfile } # TOOLTEST_META: @@ -559,7 +572,8 @@ arg="h5repack_filters.h5 -v -f /dset_deflate:GZIP=9" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + # compare output + TOOLTESTV $arg fi ########################################################### @@ -778,6 +792,24 @@ VERIFY_LAYOUT_DSET h5repack_layout2.h5 contig_small COMPACT TOOLTEST_MAIN h5repack_layout2.h5 -l chunked_small_fixed:COMPA VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT +#--------------------------------------------------------------------------- +# Test file contains chunked datasets (need multiple dsets) with +# unlimited max dims. (HDFFV-7933) +# Use first dset to test. +#--------------------------------------------------------------------------- +# chunk to chunk - specify chunk dim bigger than any current dim +TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300 +VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK + +# chunk to contiguous +TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CONTI +VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CONTI + +# chunk to compact - convert big dataset (should be > 64k) for this purpose, +# should remain as original layout (chunk) +TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:COMPA +VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. @@ -856,8 +888,7 @@ TOOLTEST h5repack_attr_refs.h5 # Note: this test is experimental for sharing test file among tools TOOLTEST h5diff_attr1.h5 -# tests for metadata block size option ('-M') -TOOLTEST_META h5repack_layout.h5 -M 8192 +# tests for metadata block size option TOOLTEST_META h5repack_layout.h5 --metadata_block_size=8192 if test $nerrors -eq 0 ; then diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index d38a15c..957d3c8 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -778,6 +778,8 @@ int do_copy_objects(hid_t fidin, unsigned u; int is_ref=0; htri_t is_named; + hbool_t limit_maxdims; + hsize_t size_dset; /*------------------------------------------------------------------------- @@ -794,8 +796,10 @@ int do_copy_objects(hid_t fidin, for ( i = 0; i < travt->nobjs; i++) { - + /* init variables per obj */ buf = NULL; + limit_maxdims = FALSE; + switch ( travt->objs[i].type ) { @@ -970,6 +974,9 @@ int do_copy_objects(hid_t fidin, if((msize = H5Tget_size(wtype_id)) == 0) goto error; + /* size of current dset */ + size_dset = nelmts * msize; + /*------------------------------------------------------------------------- * check if the dataset creation property list has filters that * are not registered in the current configuration @@ -999,7 +1006,7 @@ int do_copy_objects(hid_t fidin, */ if (options->layout_g != H5D_COMPACT) { - if ( nelmts*msize < options->min_comp ) + if ( size_dset < options->min_comp ) apply_s=0; } @@ -1016,9 +1023,38 @@ int do_copy_objects(hid_t fidin, goto error; } - /* unset the unlimimted dimensions, which cannot be applied to layout other than chunked. */ - if (options->layout_g != H5D_CHUNKED) { - H5Sset_extent_simple( f_space_id, rank, dims, NULL ); + /*------------------------------------------------- + * Unset the unlimited max dims if convert to other + * than chunk layouts, because unlimited max dims + * only can be applied to chunk layout. + * Also perform only for targeted dataset + * Also check for size limit to convert to compact + *-------------------------------------------------*/ + if (options->layout_g != H5D_CHUNKED) + { + /* any dataset is specified */ + if (options->op_tbl->nelems > 0) + { + /* if current obj match specified obj */ + if (options_get_object (travt->objs[i].name, options->op_tbl)) + limit_maxdims = TRUE; + } + else /* no dataset is specified */ + { + limit_maxdims = TRUE; + } + + /* if convert to COMPACT */ + if (options->layout_g == H5D_COMPACT) + { + /* should be smaller than 64K */ + if ( size_dset > MAX_COMPACT_DSIZE ) + limit_maxdims = FALSE; + } + + /* unset unlimited max dims */ + if (limit_maxdims) + H5Sset_extent_simple( f_space_id, rank, dims, NULL ); } /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index b6b8bfa..bfa8e96 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -456,6 +456,8 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->fs_threshold = (hsize_t)HDatol( opt_arg ); break; + default: + break; } /* switch */ diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index d0fcff3..4ec7fcf 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -388,11 +388,22 @@ pack_info_t* options_get_object( const char *path, pack_opttbl_t *table ) { unsigned int i; + const char tbl_path[MAX_NC_NAME]; + 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(table->objs[i].path,path)==0) + if (HDstrcmp(tbl_path, path)==0) { return (&table->objs[i]); } diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 0caf72a..3926744 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -124,6 +124,7 @@ static int make_hlinks(hid_t loc_id); static int make_early(void); static int make_layout(hid_t loc_id); static int make_layout2(hid_t loc_id); +static int make_layout3(hid_t loc_id); #ifdef H5_HAVE_FILTER_SZIP static int make_szip(hid_t loc_id); #endif /* H5_HAVE_FILTER_SZIP */ @@ -1761,6 +1762,19 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- + * 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; + + if(make_layout3(fid) < 0) + goto out; + + if(H5Fclose(fid) < 0) + return -1; + + /*------------------------------------------------------------------------- * create a file for the H5D_ALLOC_TIME_EARLY test *------------------------------------------------------------------------- */ @@ -3124,6 +3138,94 @@ out: } /* make_layout2() */ /*------------------------------------------------------------------------- +* Function: make_layout3 +* +* Purpose: make chunked datasets with unlimited max dim and chunk dim is +* bigger than current dim. (HDFFV-7933) +* Test for converting chunk to chunk , chunk to conti and chunk +* to compact. +* - The chunk to chunk changes layout bigger than any current dim +* again. +* - The chunk to compact test dataset bigger than 64K, should +* remain original layout.* +* +*------------------------------------------------------------------------- +*/ +#define DIM1_L3 300 +#define DIM2_L3 200 +static +int make_layout3(hid_t loc_id) +{ + hid_t dcpl=-1; /* dataset creation property list */ + hid_t sid=-1; /* dataspace ID */ + hsize_t dims[RANK]={DIM1_L3,DIM2_L3}; + hsize_t maxdims[RANK]={H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t chunk_dims[RANK]={DIM1_L3*2,5}; + int buf[DIM1_L3][DIM2_L3]; + int i, j, n; + + for (i=n=0; i<DIM1_L3; i++) + { + for (j=0; j<DIM2_L3; j++) + { + buf[i][j]=n++; + } + } + + /*------------------------------------------------------------------------- + * make several dataset with several layout options + *------------------------------------------------------------------------- + */ + /* create a space */ + if((sid = H5Screate_simple(RANK, dims, maxdims)) < 0) + return -1; + /* create a dataset creation property list; the same DCPL is used for all dsets */ + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + { + goto out; + } + + + /*------------------------------------------------------------------------- + * H5D_CHUNKED + *------------------------------------------------------------------------- + */ + if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) + goto out; + if (make_dset(loc_id,"chunk_unlimit1",sid,dcpl,buf) < 0) + { + goto out; + } + + if(H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) + goto out; + + if (make_dset(loc_id,"chunk_unlimit2",sid,dcpl,buf) < 0) + { + goto out; + } + + /*------------------------------------------------------------------------- + * close space and dcpl + *------------------------------------------------------------------------- + */ + if(H5Sclose(sid) < 0) + goto out; + if(H5Pclose(dcpl) < 0) + goto out; + + return 0; + +out: + H5E_BEGIN_TRY + { + H5Pclose(dcpl); + H5Sclose(sid); + } H5E_END_TRY; + return -1; +} + +/*------------------------------------------------------------------------- * Function: make a file with an integer dataset with a fill value * * Purpose: test copy of fill values @@ -3494,7 +3596,6 @@ out: * *------------------------------------------------------------------------- */ - static int write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ @@ -3758,17 +3859,23 @@ int write_dset_in(hid_t loc_id, { + hsize_t TEST_BUFSIZE = (128 * 1024 * 1024); /* 128MB */ double *dbuf; /* information to write */ size_t size; hsize_t sdims[] = {1}; - hsize_t tdims[] = {H5TOOLS_MALLOCSIZE / sizeof(double) + 1}; + hsize_t tdims[] = {TEST_BUFSIZE / sizeof(double) + 1}; unsigned u; /* allocate and initialize array data to write */ - size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); + size = ( TEST_BUFSIZE / sizeof(double) + 1 ) * sizeof(double); dbuf = (double*)malloc( size ); + if (NULL == dbuf) + { + printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 ); + goto out; + } - for( u = 0; u < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; u++) + for( u = 0; u < TEST_BUFSIZE / sizeof(double) + 1; u++) dbuf[u] = u; if (make_diffs) @@ -3777,7 +3884,7 @@ int write_dset_in(hid_t loc_id, dbuf[6] = 0; } - /* create a type larger than H5TOOLS_MALLOCSIZE */ + /* create a type larger than TEST_BUFSIZE */ if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) goto out; size = H5Tget_size(tid); diff --git a/tools/h5repack/testfiles/h5repack_layout3.h5 b/tools/h5repack/testfiles/h5repack_layout3.h5 Binary files differnew file mode 100644 index 0000000..5319031 --- /dev/null +++ b/tools/h5repack/testfiles/h5repack_layout3.h5 diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 1f19ca0..e8d75e3 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -41,6 +41,7 @@ IF (BUILD_TESTING) SET (HDF5_REFERENCE_FILES h5stat_help1.ddl h5stat_help2.ddl + h5stat_notexist.ddl h5stat_filters.ddl h5stat_filters-file.ddl h5stat_filters-F.ddl @@ -136,6 +137,8 @@ IF (BUILD_TESTING) h5stat_help1.out.err h5stat_help2.out h5stat_help2.out.err + h5stat_notexist.out + h5stat_notexist.out.err h5stat_filters.out h5stat_filters.out.err h5stat_filters-file.out @@ -171,6 +174,9 @@ IF (BUILD_TESTING) ADD_H5_TEST (h5stat_help1 0 -h) ADD_H5_TEST (h5stat_help2 0 --help) +# Test when h5stat a file that does not exist + ADD_H5_TEST (h5stat_notexist 1 notexist.h5) + # Test file with groups, compressed datasets, user-applied fileters, etc. # h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 ADD_H5_TEST (h5stat_filters 0 h5stat_filters.h5) diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 99ea688..a68760d 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -937,36 +937,9 @@ error: /*------------------------------------------------------------------------- - * Function: init_iter + * Function: iter_free * - * Purpose: Initialize iter structure - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Programmer: Elena Pourmal - * Saturday, August 12, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -iter_init(iter_t *iter, hid_t fid) -{ - /* Clear everything to zeros */ - HDmemset(iter, 0, sizeof(*iter)); - - /* Set the file ID for later use in callbacks */ - iter->fid = fid; - - return 0; -} /* iter_init() */ - - -/*------------------------------------------------------------------------- - * Function: free_iter - * - * Purpose: Freee iter structure + * Purpose: Free iter structure * * Return: Success: 0 * @@ -1610,7 +1583,7 @@ main(int argc, const char *argv[]) { iter_t iter; const char *fname = NULL; - hid_t fid; + hid_t fid = -1; hid_t fcpl; struct handler_t *hand = NULL; H5F_info2_t finfo; @@ -1633,6 +1606,8 @@ main(int argc, const char *argv[]) printf("Filename: %s\n", fname); + HDmemset(&iter, 0, sizeof(iter)); + fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if(fid < 0) { error_msg("unable to open file \"%s\"\n", fname); @@ -1641,7 +1616,7 @@ main(int argc, const char *argv[]) } /* end if */ /* Initialize iter structure */ - iter_init(&iter, fid); + iter.fid = fid; if(H5Fget_filesize(fid, &iter.filesize) < 0) warn_msg("Unable to retrieve file size\n"); @@ -1708,7 +1683,7 @@ done: /* Free iter structure */ iter_free(&iter); - if(H5Fclose(fid) < 0) { + if(fid >= 0 && H5Fclose(fid) < 0) { error_msg("unable to close file \"%s\"\n", fname); h5tools_setstatus(EXIT_FAILURE); } diff --git a/tools/h5stat/testfiles/h5stat_notexist.ddl b/tools/h5stat/testfiles/h5stat_notexist.ddl new file mode 100644 index 0000000..ac0fce4 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_notexist.ddl @@ -0,0 +1,5 @@ +############################# +Expected output for 'h5stat notexist.h5' +############################# +Filename: notexist.h5 +h5stat error: unable to open file "notexist.h5" diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index 74155e9..c605295 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -78,6 +78,7 @@ $SRC_H5STAT_TESTFILES/h5stat_idx.h5 LIST_OTHER_TEST_FILES=" $SRC_H5STAT_TESTFILES/h5stat_help1.ddl $SRC_H5STAT_TESTFILES/h5stat_help2.ddl +$SRC_H5STAT_TESTFILES/h5stat_notexist.ddl $SRC_H5STAT_TESTFILES/h5stat_filters.ddl $SRC_H5STAT_TESTFILES/h5stat_filters-file.ddl $SRC_H5STAT_TESTFILES/h5stat_filters-F.ddl @@ -191,6 +192,8 @@ COPY_TESTFILES_TO_TESTDIR # Test for help flag TOOLTEST h5stat_help1.ddl -h TOOLTEST h5stat_help2.ddl --help +# Test when h5stat a file that does not exist +TOOLTEST h5stat_notexist.ddl notexist.h5 # Test file with groups, compressed datasets, user-applied fileters, etc. # h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index ae43722..8805793 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -262,7 +262,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_context_t *ctx/*in,out*/, unsigned flags, hsize_t nelmts, hid_t type, void *_mem) { - HERR_INIT(int, SUCCEED) + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ unsigned char *mem = (unsigned char*) _mem; hsize_t i; /*element counter */ size_t size; /*size of each datum */ @@ -391,7 +391,6 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_str_close(&buffer); }/* else bin */ -CATCH return ret_value; } @@ -782,7 +781,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, hsize_t curr_pos = 0; hsize_t total_size[H5S_MAX_RANK]; size_t jndx; - int indx; + unsigned indx; int type_size; int ret_value = SUCCEED; unsigned int region_flags; /* buffer extent flags */ @@ -2186,6 +2185,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ case H5T_CSET_RESERVED_14: case H5T_CSET_RESERVED_15: h5tools_str_append(buffer, "H5T_CSET_UNKNOWN;"); + break; case H5T_CSET_ERROR: h5tools_str_append(buffer, "H5T_CSET_ERROR;"); break; @@ -2341,7 +2341,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->indent_level++; for (i = 0; i < nmembers; i++) { mname = H5Tget_member_name(type, i); - if((mtype = H5Tget_member_type(type, i))>=0) { + if((mtype = H5Tget_member_type(type, i)) >= 0) { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, 0, 0); @@ -2378,7 +2378,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ case H5T_ENUM: if((super = H5Tget_super(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed"); h5tools_str_append(buffer, "H5T_ENUM %s", h5tools_dump_header_format->enumblockbegin); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); @@ -2410,7 +2410,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ case H5T_VLEN: if((super = H5Tget_super(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed"); h5tools_str_append(buffer, "H5T_VLEN %s ", h5tools_dump_header_format->vlenblockbegin); @@ -2898,7 +2898,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, hsize_t size; /* size of external file */ hsize_t storage_size; hsize_t curr_pos = 0; /* total data element position */ - haddr_t ioffset; h5tools_str_t buffer; /* string into which to render */ /* setup */ @@ -2908,7 +2907,6 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, storage_size = H5Dget_storage_size(obj_id); nfilters = H5Pget_nfilters(dcpl_id); - ioffset = H5Dget_offset(obj_id); HDstrcpy(f_name,"\0"); /*------------------------------------------------------------------------- @@ -3091,6 +3089,8 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); } else { + haddr_t ioffset; + ctx->indent_level++; ctx->need_prefix = TRUE; @@ -3111,6 +3111,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); + ioffset = H5Dget_offset(obj_id); h5tools_str_append(&buffer,"OFFSET "H5_PRINTF_HADDR_FMT, ioffset); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index ad8b9fe..0215c46 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -48,6 +48,9 @@ typedef struct { hid_t fid; /* File ID being traversed */ } trav_print_udata_t; +/* format for hsize_t */ +#define HSIZE_T_FORMAT "%"H5_PRINTF_LL_WIDTH"u" + /*------------------------------------------------------------------------- * local functions *------------------------------------------------------------------------- @@ -61,6 +64,46 @@ static void trav_table_addlink(trav_table_t *table, const char *path); /*------------------------------------------------------------------------- + * local variables + *------------------------------------------------------------------------- + */ +static H5_index_t trav_index_by = H5_INDEX_NAME; +static H5_iter_order_t trav_index_order = H5_ITER_INC; + +static int trav_verbosity = 0; + +/*------------------------------------------------------------------------- + * Function: h5trav_set_index + * + * Purpose: Set indexing properties for the objects & links in the file + * + * Return: none + * + *------------------------------------------------------------------------- + */ +void +h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order) +{ + trav_index_by = print_index_by; + trav_index_order = print_index_order; +} + +/*------------------------------------------------------------------------- + * Function: h5trav_set_verbose + * + * Purpose: Set verbosity of file contents 1=>attributes + * + * Return: none + * + *------------------------------------------------------------------------- + */ +void +h5trav_set_verbose(int print_verbose) +{ + trav_verbosity = print_verbose; +} + +/*------------------------------------------------------------------------- * "h5trav info" public functions. used in h5diff *------------------------------------------------------------------------- */ @@ -255,12 +298,12 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, /* Check for iteration of links vs. visiting all links recursively */ if(recurse) { /* Visit all links in group, recursively */ - if(H5Lvisit_by_name(file_id, grp_name, H5_INDEX_NAME, H5_ITER_INC, traverse_cb, &udata, H5P_DEFAULT) < 0) + if(H5Lvisit_by_name(file_id, grp_name, trav_index_by, trav_index_order, traverse_cb, &udata, H5P_DEFAULT) < 0) return -1; } /* end if */ else { /* Iterate over links in group */ - if(H5Literate_by_name(file_id, grp_name, H5_INDEX_NAME, H5_ITER_INC, NULL, traverse_cb, &udata, H5P_DEFAULT) < 0) + if(H5Literate_by_name(file_id, grp_name, trav_index_by, trav_index_order, NULL, traverse_cb, &udata, H5P_DEFAULT) < 0) return -1; } /* end else */ @@ -821,6 +864,72 @@ void trav_table_free( trav_table_t *table ) HDfree(table); } +static herr_t +trav_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *op_data) +{ + char *buf; + + buf = (char*)op_data; + if((strlen(buf)==1) && (*buf=='/')) + printf(" %-10s %s%s", "attribute", buf, attr_name); + else + printf(" %-10s %s/%s", "attribute", buf, attr_name); + +#ifdef H5TRAV_PRINT_SPACE + if(trav_verbosity < 2) { +#endif + printf("\n"); +#ifdef H5TRAV_PRINT_SPACE + } + else { + hid_t attr = -1; + hid_t space = -1; + hsize_t size[H5S_MAX_RANK]; + int ndims; + int i; + H5S_class_t space_type; + + if((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) { + space = H5Aget_space(attr); + + /* Data space */ + ndims = H5Sget_simple_extent_dims(space, size, NULL); + space_type = H5Sget_simple_extent_type(space); + switch(space_type) { + case H5S_SCALAR: + /* scalar dataspace */ + printf(" scalar\n"); + break; + + case H5S_SIMPLE: + /* simple dataspace */ + printf(" {"); + for (i=0; i<ndims; i++) { + printf("%s" HSIZE_T_FORMAT, i?", ":"", size[i]); + } + printf("}\n"); + break; + + case H5S_NULL: + /* null dataspace */ + printf(" null\n"); + break; + + default: + /* Unknown dataspace type */ + printf(" unknown\n"); + break; + } /* end switch */ + + H5Sclose(space); + H5Aclose(attr); + } + } +#endif + + return(0); +} + /*------------------------------------------------------------------------- * Function: trav_print_visit_obj @@ -837,8 +946,9 @@ void trav_table_free( trav_table_t *table ) */ static int trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, - const char *already_visited, void UNUSED *udata) + const char *already_visited, void *udata) { + trav_print_udata_t *print_udata = (trav_print_udata_t *)udata; /* Print the name of the object */ /* (no new-line, so that objects that we've encountered before can print * the name of the original object) @@ -862,9 +972,12 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, } /* end switch */ /* Check if we've already seen this object */ - if(NULL == already_visited) + if(NULL == already_visited) { /* Finish printing line about object */ printf("\n"); + if(trav_verbosity > 0) + H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, path, H5P_DEFAULT); + } else /* Print the link's original name */ printf(" -> %s\n", already_visited); diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index da8dc69..c416cf8 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -131,6 +131,7 @@ extern "C" { * "h5trav general" public functions *------------------------------------------------------------------------- */ +H5TOOLS_DLL void h5trav_set_index(H5_index_t print_index_by, H5_iter_order_t print_index_order); H5TOOLS_DLL int h5trav_visit(hid_t file_id, 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); @@ -159,6 +160,7 @@ H5TOOLS_DLL int h5trav_getindext(const char *obj, const trav_table_t *travt); *------------------------------------------------------------------------- */ H5TOOLS_DLL int h5trav_print(hid_t fid); +H5TOOLS_DLL void h5trav_set_verbose(int print_verbose); #ifdef __cplusplus } diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 1c6e909..0687323 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -31,6 +31,13 @@ SET (H5_DEP_EXECUTABLES h5mkgrp ) +#----------------------------------------------------------------------------- +# Generate the h5cc file containing settings needed to compile programs +#----------------------------------------------------------------------------- +#IF (NOT WIN32) +# CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) +#ENDIF (NOT WIN32) + ############################################################################## ############################################################################## ### T E S T I N G ### diff --git a/tools/testfiles/filter_fail.ddl b/tools/testfiles/filter_fail.ddl index 75534e2..3a456f5 100644 --- a/tools/testfiles/filter_fail.ddl +++ b/tools/testfiles/filter_fail.ddl @@ -8,24 +8,3 @@ GROUP "/" { } } } -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dread(): can't read data - major: Dataset - minor: Read failed - #001: (file name) line (number) in H5D_read(): can't read data - major: Dataset - minor: Read failed - #002: (file name) line (number) in H5D_chunk_read(): unable to read raw data chunk - major: Low-level I/O - minor: Read failed - #003: (file name) line (number) in H5D_chunk_lock(): data pipeline read failed - major: Data filters - minor: Filter operation failed - #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered - major: Data filters - minor: Read failed -h5dump error: unable to print data -H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): - #000: (file name) line (number) in h5tools_dump_simple_dset(): H5Dread failed - major: Failure in tools library - minor: error in function diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index d8551ca..5e0a8f1 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,7 +112,11 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile diff --git a/tools/testfiles/tattr-3.ddl b/tools/testfiles/tattr-3.ddl index a19f69a..943dc0d 100644 --- a/tools/testfiles/tattr-3.ddl +++ b/tools/testfiles/tattr-3.ddl @@ -6,11 +6,3 @@ ATTRIBUTE "attr2" { ATTRIBUTE "attr" { } } -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Aopen(): unable to load attribute info from object header for attribute: 'attr' - major: Attribute - minor: Unable to initialize object - #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr' - major: Attribute - minor: Object not found -h5dump error: unable to open attribute "attr" diff --git a/tools/testfiles/tattrcontents1.ddl b/tools/testfiles/tattrcontents1.ddl new file mode 100644 index 0000000..e118d89 --- /dev/null +++ b/tools/testfiles/tattrcontents1.ddl @@ -0,0 +1,21 @@ +HDF5 "tall.h5" { +FILE_CONTENTS { + group / + attribute /attr1 + attribute /attr2 + group /g1 + group /g1/g1.1 + dataset /g1/g1.1/dset1.1.1 + attribute /g1/g1.1/dset1.1.1/attr1 + attribute /g1/g1.1/dset1.1.1/attr2 + dataset /g1/g1.1/dset1.1.2 + group /g1/g1.2 + ext link /g1/g1.2/extlink -> somefile somepath + group /g1/g1.2/g1.2.1 + link /g1/g1.2/g1.2.1/slink -> somevalue + group /g2 + dataset /g2/dset2.1 + dataset /g2/dset2.2 + unknown type of UD link /g2/udlink -> ??? + } +} diff --git a/tools/testfiles/tattrcontents2.ddl b/tools/testfiles/tattrcontents2.ddl new file mode 100644 index 0000000..4076385 --- /dev/null +++ b/tools/testfiles/tattrcontents2.ddl @@ -0,0 +1,21 @@ +HDF5 "tall.h5" { +FILE_CONTENTS { + group / + attribute /attr2 + attribute /attr1 + group /g2 + unknown type of UD link /g2/udlink -> ??? + dataset /g2/dset2.2 + dataset /g2/dset2.1 + group /g1 + group /g1/g1.2 + group /g1/g1.2/g1.2.1 + link /g1/g1.2/g1.2.1/slink -> somevalue + ext link /g1/g1.2/extlink -> somefile somepath + group /g1/g1.1 + dataset /g1/g1.1/dset1.1.2 + dataset /g1/g1.1/dset1.1.1 + attribute /g1/g1.1/dset1.1.1/attr2 + attribute /g1/g1.1/dset1.1.1/attr1 + } +} diff --git a/tools/testfiles/tdset-2.ddl b/tools/testfiles/tdset-2.ddl index 2034a43..dfda95e 100644 --- a/tools/testfiles/tdset-2.ddl +++ b/tools/testfiles/tdset-2.ddl @@ -8,36 +8,3 @@ DATASET "/dset2" { DATASPACE SIMPLE { ( 30, 20 ) / ( 30, 20 ) } } } -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dopen2(): not found - major: Dataset - minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object - major: Symbol table - minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed - major: Symbol table - minor: Callback failed - #004: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist - major: Symbol table - minor: Object not found -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Lget_info(): unable to get link info - major: Symbol table - minor: Object not found - #001: (file name) line (number) in H5L_get_info(): name doesn't exist - major: Symbol table - minor: Object already exists - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed - major: Symbol table - minor: Callback failed - #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist - major: Symbol table - minor: Object not found -h5dump error: unable to get link info from "dset3" diff --git a/tools/testfiles/tdset_idx.ls b/tools/testfiles/tdset_idx.ls new file mode 100644 index 0000000..daa14b2 --- /dev/null +++ b/tools/testfiles/tdset_idx.ls @@ -0,0 +1,36 @@ +dset_btree Dataset {20/200, 10/100} + Data: + (0,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + (2,2) 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, + (4,4) 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, + (6,6) 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, + (8,8) 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + (11,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + (13,2) 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, + (15,4) 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, + (17,6) 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, + (19,8) 8, 9 +dset_filter Dataset {20, 10} + Data: + (0,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + (2,2) 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, + (4,4) 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, + (6,6) 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, + (8,8) 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + (11,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + (13,2) 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, + (15,4) 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, + (17,6) 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, + (19,8) 8, 9 +dset_fixed Dataset {20, 10} + Data: + (0,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + (2,2) 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, + (4,4) 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, + (6,6) 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, + (8,8) 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + (11,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + (13,2) 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, + (15,4) 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, + (17,6) 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, + (19,8) 8, 9 diff --git a/tools/testfiles/textlink.ddl b/tools/testfiles/textlink.ddl index 4718adb..5459b30 100644 --- a/tools/testfiles/textlink.ddl +++ b/tools/testfiles/textlink.ddl @@ -10,53 +10,3 @@ GROUP "/" { } } } -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table - minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table - minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed - major: Links - minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed - major: Links - minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID - major: Symbol table - minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' - major: Links - minor: Unable to open file -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Oopen(): unable to open object - major: Symbol table - minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found - major: Symbol table - minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed - major: Links - minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed - major: Links - minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID - major: Symbol table - minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' - major: Links - minor: Unable to open file diff --git a/tools/testfiles/tgroup-2.ddl b/tools/testfiles/tgroup-2.ddl index c4af7bb..2ac8ac6 100644 --- a/tools/testfiles/tgroup-2.ddl +++ b/tools/testfiles/tgroup-2.ddl @@ -40,4 +40,3 @@ GROUP "/" { GROUP "/y" { } } -h5dump error: unable to open group "/y" diff --git a/tools/testfiles/tnestedcmpddt.ddl b/tools/testfiles/tnestedcmpddt.ddl new file mode 100644 index 0000000..db949f0 --- /dev/null +++ b/tools/testfiles/tnestedcmpddt.ddl @@ -0,0 +1,220 @@ +HDF5 "tnestedcmpddt.h5" { +GROUP "/" { + DATASET "dset1" { + DATATYPE H5T_COMPOUND { + H5T_STD_I32LE "a_name"; + H5T_IEEE_F32LE "b_name"; + } + DATASPACE SIMPLE { ( 6 ) / ( H5S_UNLIMITED ) } + DATA { + (0): { + 0, + 0 + }, + (1): { + 1, + 1 + }, + (2): { + 2, + 4 + }, + (3): { + 3, + 9 + }, + (4): { + 4, + 16 + }, + (5): { + 5, + 25 + } + } + } + DATASET "dset2" { + DATATYPE H5T_COMPOUND { + H5T_STD_I32LE "a_name"; + H5T_IEEE_F32LE "b_name"; + H5T_ENUM { + H5T_STD_I32LE; + "Red" 0; + "Green" 1; + "Blue" 2; + "White" 3; + "Black" 4; + } "c_name"; + } + DATASPACE SIMPLE { ( 6 ) / ( H5S_UNLIMITED ) } + DATA { + (0): { + 0, + 0, + Green + }, + (1): { + 1, + 1.1, + Green + }, + (2): { + 2, + 2.2, + Green + }, + (3): { + 3, + 3.3, + Green + }, + (4): { + 4, + 4.4, + Green + }, + (5): { + 5, + 5.5, + Green + } + } + } + DATASET "dset4" { + DATATYPE "/enumtype" + DATASPACE SIMPLE { ( 6 ) / ( H5S_UNLIMITED ) } + DATA { + (0): Red, Green, Blue, Green, White, Blue + } + } + DATASET "dset5" { + DATATYPE "/type1" + DATASPACE SIMPLE { ( 6 ) / ( H5S_UNLIMITED ) } + DATA { + (0): { + 0, + 0 + }, + (1): { + 1, + 1 + }, + (2): { + 2, + 4 + }, + (3): { + 3, + 9 + }, + (4): { + 4, + 16 + }, + (5): { + 5, + 25 + } + } + } + DATATYPE "enumtype" H5T_ENUM { + H5T_STD_I32LE; + "Red" 0; + "Green" 1; + "Blue" 2; + "White" 3; + "Black" 4; + }; + GROUP "group1" { + DATASET "dset3" { + DATATYPE H5T_COMPOUND { + H5T_ARRAY { [5] H5T_STD_I32LE } "int_name"; + H5T_ARRAY { [5][6] H5T_IEEE_F32LE } "float_name"; + H5T_COMPOUND { + H5T_STD_I32LE "int_name"; + H5T_IEEE_F32LE "float_name"; + } "cmpd_name"; + } + DATASPACE SIMPLE { ( 6 ) / ( H5S_UNLIMITED ) } + DATA { + (0): { + [ 0, 0, 0, 0, 0 ], + [ 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 ], + { + 0, + 0 + } + }, + (1): { + [ 0, 1, 2, 3, 4 ], + [ 0, 0, 0, 0, 0, 0, + 0, 1, 2, 3, 4, 5, + 0, 2, 4, 6, 8, 10, + 0, 3, 6, 9, 12, 15, + 0, 4, 8, 12, 16, 20 ], + { + 1, + 1 + } + }, + (2): { + [ 0, 2, 4, 6, 8 ], + [ 0, 0, 0, 0, 0, 0, + 0, 2, 4, 6, 8, 10, + 0, 4, 8, 12, 16, 20, + 0, 6, 12, 18, 24, 30, + 0, 8, 16, 24, 32, 40 ], + { + 2, + 2 + } + }, + (3): { + [ 0, 3, 6, 9, 12 ], + [ 0, 0, 0, 0, 0, 0, + 0, 3, 6, 9, 12, 15, + 0, 6, 12, 18, 24, 30, + 0, 9, 18, 27, 36, 45, + 0, 12, 24, 36, 48, 60 ], + { + 3, + 3 + } + }, + (4): { + [ 0, 4, 8, 12, 16 ], + [ 0, 0, 0, 0, 0, 0, + 0, 4, 8, 12, 16, 20, + 0, 8, 16, 24, 32, 40, + 0, 12, 24, 36, 48, 60, + 0, 16, 32, 48, 64, 80 ], + { + 4, + 4 + } + }, + (5): { + [ 0, 5, 10, 15, 20 ], + [ 0, 0, 0, 0, 0, 0, + 0, 5, 10, 15, 20, 25, + 0, 10, 20, 30, 40, 50, + 0, 15, 30, 45, 60, 75, + 0, 20, 40, 60, 80, 100 ], + { + 5, + 5 + } + } + } + } + } + DATATYPE "type1" H5T_COMPOUND { + H5T_STD_I32LE "int_name"; + H5T_IEEE_F32LE "float_name"; + } +} +} diff --git a/tools/testfiles/tnestedcmpddt.h5 b/tools/testfiles/tnestedcmpddt.h5 Binary files differnew file mode 100644 index 0000000..f2af756 --- /dev/null +++ b/tools/testfiles/tnestedcmpddt.h5 diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index 050a3a3..a82c94e 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,8 +112,12 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile h5dump error: missing file name diff --git a/tools/testfiles/tordercontents1.ddl b/tools/testfiles/tordercontents1.ddl new file mode 100644 index 0000000..14e12d6 --- /dev/null +++ b/tools/testfiles/tordercontents1.ddl @@ -0,0 +1,20 @@ +HDF5 "tfcontents1.h5" { +FILE_CONTENTS { + datatype /#5616 + group / + dataset /dset + dataset /dset3 -> /dset + dataset /dset4 -> /dset + dataset /dsetmytype2 + ext link /extlink -> fname oname + group /g1 + dataset /g1/dset1 -> /dset + group /g1/g1.1 + dataset /g1/g1.1/dset2 -> /dset + group /g2 -> /g1/g1.1 + link /mylink -> mylink + datatype /mytype + link /softlink -> /dset + unknown type of UD link /udlink -> ??? + } +} diff --git a/tools/testfiles/tordercontents2.ddl b/tools/testfiles/tordercontents2.ddl new file mode 100644 index 0000000..6757338 --- /dev/null +++ b/tools/testfiles/tordercontents2.ddl @@ -0,0 +1,20 @@ +HDF5 "tfcontents1.h5" { +FILE_CONTENTS { + datatype /#5616 + group / + unknown type of UD link /udlink -> ??? + link /softlink -> /dset + datatype /mytype + link /mylink -> mylink + group /g2 + dataset /g2/dset2 + group /g1 + group /g1/g1.1 -> /g2 + dataset /g1/dset1 -> /g2/dset2 + ext link /extlink -> fname oname + dataset /dsetmytype2 + dataset /dset4 -> /g2/dset2 + dataset /dset3 -> /g2/dset2 + dataset /dset -> /g2/dset2 + } +} diff --git a/tools/testfiles/torderlinks1.ddl b/tools/testfiles/torderlinks1.ddl new file mode 100644 index 0000000..eaf6eea --- /dev/null +++ b/tools/testfiles/torderlinks1.ddl @@ -0,0 +1,52 @@ +HDF5 "tfcontents1.h5" { +GROUP "/" { + DATATYPE "#5616" H5T_STD_I32BE; + DATASET "dset" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + DATA { + (0): 1, 2, 3, 4 + } + } + DATASET "dset3" { + HARDLINK "/dset" + } + DATASET "dset4" { + HARDLINK "/dset" + } + DATASET "dsetmytype2" { + DATATYPE "/#5616" + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + DATA { + (0): 1, 2, 3, 4 + } + } + EXTERNAL_LINK "extlink" { + TARGETFILE "fname" + TARGETPATH "oname" + } + GROUP "g1" { + DATASET "dset1" { + HARDLINK "/dset" + } + GROUP "g1.1" { + DATASET "dset2" { + HARDLINK "/dset" + } + } + } + GROUP "g2" { + HARDLINK "/g1/g1.1" + } + SOFTLINK "mylink" { + LINKTARGET "mylink" + } + DATATYPE "mytype" H5T_STD_I32BE; + SOFTLINK "softlink" { + LINKTARGET "/dset" + } + USERDEFINED_LINK "udlink" { + LINKCLASS 187 + } +} +} diff --git a/tools/testfiles/torderlinks2.ddl b/tools/testfiles/torderlinks2.ddl new file mode 100644 index 0000000..dd68208 --- /dev/null +++ b/tools/testfiles/torderlinks2.ddl @@ -0,0 +1,52 @@ +HDF5 "tfcontents1.h5" { +GROUP "/" { + DATATYPE "#5616" H5T_STD_I32BE; + USERDEFINED_LINK "udlink" { + LINKCLASS 187 + } + SOFTLINK "softlink" { + LINKTARGET "/dset" + } + DATATYPE "mytype" H5T_STD_I32BE; + SOFTLINK "mylink" { + LINKTARGET "mylink" + } + GROUP "g2" { + DATASET "dset2" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + DATA { + (0): 1, 2, 3, 4 + } + } + } + GROUP "g1" { + GROUP "g1.1" { + HARDLINK "/g2" + } + DATASET "dset1" { + HARDLINK "/g2/dset2" + } + } + EXTERNAL_LINK "extlink" { + TARGETFILE "fname" + TARGETPATH "oname" + } + DATASET "dsetmytype2" { + DATATYPE "/#5616" + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + DATA { + (0): 1, 2, 3, 4 + } + } + DATASET "dset4" { + HARDLINK "/g2/dset2" + } + DATASET "dset3" { + HARDLINK "/g2/dset2" + } + DATASET "dset" { + HARDLINK "/g2/dset2" + } +} +} diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 5608d2b..72d54fc 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,8 +112,12 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index f89b65f..d8b627c 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,8 +112,12 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index ba32aa6..39cef23 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,8 +112,12 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index 16f953d..5f35825 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,8 +112,12 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index 446fe2d..92cc816 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,8 +112,12 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index 747cf99..c318834 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -2,6 +2,7 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit -n, --contents Print a list of the file contents and exit + Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed -A, --onlyattr Print the header and value of attributes @@ -61,10 +62,20 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + These are the letters that are appended to the file name(without .h5) when opening + names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: + m: All meta data when using the split driver. + s: The userblock, superblock, and driver info block + b: B-tree nodes + r: Dataset raw data + g: Global heap + l: local heap (object names) + o: object headers + F - is a filename. P - is the full path from the root group to the object. N - is an integer greater than 1. @@ -101,8 +112,12 @@ usage: h5dump [OPTIONS] files h5dump -d /dset -M 0,1,4,3 quux.h5 - 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + 5) Dataset foo in files file1.h5 file2.h5 file3.h5 + + h5dump -d /foo file1.h5 file2.h5 file3.h5 + + 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5 - h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + h5dump -d /foo -f split splitfile h5dump error: Bad mask list(-1,1) diff --git a/tools/testfiles/tperror.ddl b/tools/testfiles/tperror.ddl index 16a7d8e..0cb961c 100644 --- a/tools/testfiles/tperror.ddl +++ b/tools/testfiles/tperror.ddl @@ -1,35 +1,2 @@ HDF5 "tfcontents1.h5" { } -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dopen2(): not found - major: Dataset - minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object - major: Symbol table - minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed - major: Symbol table - minor: Callback failed - #004: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist - major: Symbol table - minor: Object not found -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Lget_info(): unable to get link info - major: Symbol table - minor: Object not found - #001: (file name) line (number) in H5L_get_info(): name doesn't exist - major: Symbol table - minor: Object already exists - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed - major: Symbol table - minor: Callback failed - #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist - major: Symbol table - minor: Object not found -h5dump error: unable to get link info from "bogus" diff --git a/tools/testfiles/tqmarkfile.ddl b/tools/testfiles/tqmarkfile.ddl index e7771cb..885be5f 100644 --- a/tools/testfiles/tqmarkfile.ddl +++ b/tools/testfiles/tqmarkfile.ddl @@ -48,36 +48,3 @@ DATASET "Dataset1" { } HDF5 "tarray8.h5" { } -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dopen2(): not found - major: Dataset - minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object - major: Symbol table - minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed - major: Symbol table - minor: Callback failed - #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist - major: Symbol table - minor: Object not found -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Lget_info(): unable to get link info - major: Symbol table - minor: Object not found - #001: (file name) line (number) in H5L_get_info(): name doesn't exist - major: Symbol table - minor: Object already exists - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed - major: Symbol table - minor: Callback failed - #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist - major: Symbol table - minor: Object not found -h5dump error: unable to get link info from "Dataset1" diff --git a/tools/testfiles/tslink-D.ddl b/tools/testfiles/tslink-D.ddl index a1d999a..9d90262 100644 --- a/tools/testfiles/tslink-D.ddl +++ b/tools/testfiles/tslink-D.ddl @@ -3,28 +3,3 @@ SOFTLINK "/slink1" { LINKTARGET "somevalue" } } -HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Dopen2(): not found - major: Dataset - minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object - major: Symbol table - minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed - major: Symbol table - minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): special link traversal failed - major: Links - minor: Link traversal failure - #004: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed - major: Links - minor: Link traversal failure - #005: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link - major: Symbol table - minor: Object not found - #006: (file name) line (number) in H5G_traverse_real(): traversal operator failed - major: Symbol table - minor: Callback failed - #007: (file name) line (number) in H5G_traverse_slink_cb(): component not found - major: Symbol table - minor: Object not found diff --git a/tools/testfiles/twidedisplay.ddl b/tools/testfiles/twidedisplay.ddl new file mode 100644 index 0000000..1e6ffee --- /dev/null +++ b/tools/testfiles/twidedisplay.ddl @@ -0,0 +1,130 @@ +HDF5 "packedbits.h5" { +GROUP "/" { + DATASET "DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, + (1,0): -2, -4, -8, -16, -32, -64, -128, 0, + (2,0): -4, -8, -16, -32, -64, -128, 0, 0, + (3,0): -8, -16, -32, -64, -128, 0, 0, 0, + (4,0): -16, -32, -64, -128, 0, 0, 0, 0, + (5,0): -32, -64, -128, 0, 0, 0, 0, 0, + (6,0): -64, -128, 0, 0, 0, 0, 0, 0, + (7,0): -128, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, -536870912, -1073741824, -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, -68719476736, -137438953472, -274877906944, -549755813888, -1099511627776, -2199023255552, -4398046511104, -8796093022208, -17592186044416, -35184372088832, -70368744177664, -140737488355328, -281474976710656, -562949953421312, -1125899906842624, -2251799813685248, -4503599627370496, -9007199254740992, -18014398509481984, -36028797018963968, -72057594037927936, -144115188075855872, -288230376151711744, -576460752303423488, -1152921504606846976, -2305843009213693952, -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + DATA { + (0,0): 18446744073709551615, 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, + (1,0): 18446744073709551614, 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0, + (2,0): 18446744073709551612, 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0, 0, + (3,0): 18446744073709551608, 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0, 0, 0, + (4,0): 18446744073709551600, 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, + (5,0): 18446744073709551584, 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, + (6,0): 18446744073709551552, 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, 0, + (7,0): 18446744073709551488, 18446744073709551360, 18446744073709551104, 18446744073709550592, 18446744073709549568, 18446744073709547520, 18446744073709543424, 18446744073709535232, 18446744073709518848, 18446744073709486080, 18446744073709420544, 18446744073709289472, 18446744073709027328, 18446744073708503040, 18446744073707454464, 18446744073705357312, 18446744073701163008, 18446744073692774400, 18446744073675997184, 18446744073642442752, 18446744073575333888, 18446744073441116160, 18446744073172680704, 18446744072635809792, 18446744071562067968, 18446744069414584320, 18446744065119617024, 18446744056529682432, 18446744039349813248, 18446744004990074880, 18446743936270598144, 18446743798831644672, 18446743523953737728, 18446742974197923840, 18446741874686296064, 18446739675663040512, 18446735277616529408, 18446726481523507200, 18446708889337462784, 18446673704965373952, 18446603336221196288, 18446462598732840960, 18446181123756130304, 18445618173802708992, 18444492273895866368, 18442240474082181120, 18437736874454810624, 18428729675200069632, 18410715276690587648, 18374686479671623680, 18302628885633695744, 18158513697557839872, 17870283321406128128, 17293822569102704640, 16140901064495857664, 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, 0, 0 + } + } + DATASET "DummyDBL" { + DATATYPE H5T_IEEE_F64BE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + DATA { + (0,0): 0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, + (1,0): 1, 1.0001, 1.0002, 1.0003, 1.0004, 1.0005, 1.0006, 1.0007, + (2,0): 2, 2.0001, 2.0002, 2.0003, 2.0004, 2.0005, 2.0006, 2.0007, + (3,0): 3, 3.0001, 3.0002, 3.0003, 3.0004, 3.0005, 3.0006, 3.0007, + (4,0): 4, 4.0001, 4.0002, 4.0003, 4.0004, 4.0005, 4.0006, 4.0007, + (5,0): 5, 5.0001, 5.0002, 5.0003, 5.0004, 5.0005, 5.0006, 5.0007, + (6,0): 6, 6.0001, 6.0002, 6.0003, 6.0004, 6.0005, 6.0006, 6.0007, + (7,0): 7, 7.0001, 7.0002, 7.0003, 7.0004, 7.0005, 7.0006, 7.0007 + } + } +} +} |