From 7707859279a60b32d2b6c915442a7c04d44445b4 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Fri, 21 Apr 2023 23:25:12 -0700 Subject: Merge with develop (#2790) --- .github/workflows/hdfeos5.yml | 47 + .github/workflows/main.yml | 79 +- CMakeLists.txt | 2 +- bin/checkposix | 4 +- bin/format_source | 2 +- bin/release | 26 +- c++/examples/CMakeTests.cmake | 4 +- c++/test/dsets.cpp | 8 - c++/test/tfile.cpp | 14 - c++/test/tfilter.cpp | 4 - c++/test/th5s.cpp | 45 - config/cmake/ConfigureChecks.cmake | 19 +- config/cmake/HDF5PluginMacros.cmake | 1 + config/cmake/HDF5UseFortran.cmake | 29 +- config/cmake/HDFCompilerFlags.cmake | 1 + config/cmake/HDFFortranCompilerFlags.cmake | 5 + config/cmake/HDFMacros.cmake | 2 + config/cmake/UserMacros/Windows_MT.cmake | 1 + config/cmake/scripts/HDF5config.cmake | 30 +- config/cmake/scripts/HDF5options.cmake | 2 +- config/gnu-fflags | 2 + config/gnu-warnings/gfort-4.8 | 1 - config/gnu-warnings/gfort-developer-4.8 | 3 + config/gnu-warnings/gfort-no-developer-4.8 | 3 + configure.ac | 6 +- doxygen/aliases | 6 +- doxygen/dox/Overview.dox | 4 - doxygen/examples/H5Pget_metadata_read_attempts.2.c | 4 +- doxygen/examples/H5Pget_metadata_read_attempts.3.c | 4 +- doxygen/examples/H5Pset_metadata_read_attempts.c | 4 +- fortran/src/CMakeLists.txt | 4 + fortran/src/H5Af.c | 492 ------ fortran/src/H5Aff.F90 | 1310 +++++++++++--- fortran/src/H5Df.c | 224 --- fortran/src/H5Dff.F90 | 789 +++++++-- fortran/src/H5ESff.F90 | 296 ++++ fortran/src/H5Eff.F90 | 4 +- fortran/src/H5Ff.c | 167 -- fortran/src/H5Fff.F90 | 421 ++++- fortran/src/H5Gf.c | 348 ---- fortran/src/H5Gff.F90 | 936 ++++++++-- fortran/src/H5If.c | 1 - fortran/src/H5Lf.c | 320 ---- fortran/src/H5Lff.F90 | 687 ++++++-- fortran/src/H5Of.c | 225 +-- fortran/src/H5Off.F90 | 513 +++++- fortran/src/H5Pf.c | 6 - fortran/src/H5Pff.F90 | 62 +- fortran/src/H5Rff.F90 | 25 +- fortran/src/H5Sff.F90 | 14 +- fortran/src/H5Tff.F90 | 12 +- fortran/src/H5VLff.F90 | 27 +- fortran/src/H5_buildiface.F90 | 36 +- fortran/src/H5_f.c | 19 +- fortran/src/H5_ff.F90 | 29 +- fortran/src/H5config_f.inc.cmake | 6 + fortran/src/H5config_f.inc.in | 3 + fortran/src/H5f90global.F90 | 31 +- fortran/src/H5f90proto.h | 16 +- fortran/src/HDF5.F90 | 1 + fortran/src/Makefile.am | 9 +- fortran/src/hdf5_fortrandll.def.in | 52 +- fortran/test/Makefile.am | 2 +- fortran/test/t.c | 4 - fortran/test/tH5A_1_8.F90 | 5 + fortran/test/tH5G_1_8.F90 | 172 +- fortran/test/tH5MISC_1_8.F90 | 2 - fortran/test/tH5P_F03.F90 | 2 - fortran/test/tH5T.F90 | 2 - fortran/test/tH5T_F03.F90 | 7 - fortran/test/tf.F90 | 86 +- fortran/test/vol_connector.F90 | 6 +- fortran/testpar/CMakeLists.txt | 40 + fortran/testpar/Makefile.am | 3 +- fortran/testpar/async.F90 | 1417 ++++++++++++++++ fortran/testpar/ptest.F90 | 5 + fortran/testpar/subfiling.F90 | 14 +- hl/fortran/src/H5IMcc.c | 12 - hl/fortran/src/H5IMfc.c | 36 - hl/fortran/src/H5LTfc.c | 39 - hl/fortran/src/H5LTff.F90 | 8 - hl/src/H5IM.c | 29 - hl/src/H5LT.c | 74 - hl/src/H5PT.c | 50 - hl/tools/gif2h5/writehdf.c | 3 - java/CMakeLists.txt | 2 +- java/src/Makefile.am | 1 - java/src/hdf/hdf5lib/H5.java | 6 +- java/src/jni/h5fImp.c | 4 +- m4/aclocal_fc.f90 | 20 +- release_docs/INSTALL | 4 +- release_docs/INSTALL_CMake.txt | 68 +- release_docs/INSTALL_Cygwin.txt | 10 +- release_docs/README_HDF5_CMake | 8 +- release_docs/README_HPC | 6 +- release_docs/RELEASE.txt | 134 +- release_docs/USING_CMake_Examples.txt | 2 +- release_docs/USING_HDF5_CMake.txt | 17 +- release_docs/USING_HDF5_VS.txt | 4 +- src/H5AC.c | 107 +- src/H5ACmodule.h | 9 +- src/H5ACmpio.c | 25 +- src/H5ACpkg.h | 17 +- src/H5ACpublic.h | 2 +- src/H5Amodule.h | 9 +- src/H5Apkg.h | 3 - src/H5Apublic.h | 30 +- src/H5B2module.h | 9 +- src/H5B2pkg.h | 9 +- src/H5Bmodule.h | 9 +- src/H5Bpkg.h | 9 +- src/H5C.c | 1783 +++++--------------- src/H5CXmodule.h | 9 +- src/H5Cdbg.c | 30 +- src/H5Cepoch.c | 3 +- src/H5Cimage.c | 159 +- src/H5Cmodule.h | 9 +- src/H5Cmpio.c | 128 +- src/H5Cpkg.h | 1437 +++++----------- src/H5Cprivate.h | 61 +- src/H5Dint.c | 4 +- src/H5Dlayout.c | 14 +- src/H5Dmodule.h | 9 +- src/H5Dmpio.c | 10 +- src/H5Doh.c | 2 +- src/H5Dpkg.h | 9 +- src/H5Dpublic.h | 36 +- src/H5EAmodule.h | 9 +- src/H5EApkg.h | 3 - src/H5ESmodule.h | 5 +- src/H5ESpkg.h | 9 +- src/H5Emodule.h | 9 +- src/H5Epkg.h | 9 +- src/H5Epublic.h | 10 +- src/H5FAmodule.h | 9 +- src/H5FApkg.h | 8 +- src/H5FD.c | 8 - src/H5FDcore.h | 3 - src/H5FDdirect.h | 3 - src/H5FDdrvr_module.h | 9 +- src/H5FDfamily.h | 3 - src/H5FDhdfs.c | 8 +- src/H5FDhdfs.h | 8 - src/H5FDint.c | 16 - src/H5FDlog.h | 3 - src/H5FDmodule.h | 9 +- src/H5FDmpi.c | 30 - src/H5FDmpi.h | 3 - src/H5FDmpio.h | 3 - src/H5FDmulti.h | 11 +- src/H5FDpkg.h | 9 +- src/H5FDprivate.h | 4 - src/H5FDpublic.h | 4 - src/H5FDros3.c | 8 +- src/H5FDros3.h | 3 - src/H5FDs3comms.h | 5 - src/H5FDsec2.h | 5 +- src/H5FDstdio.h | 5 +- src/H5FDsubfiling/H5FDioc_int.c | 2 - src/H5FDsubfiling/H5FDioc_threads.c | 27 - src/H5FDsubfiling/H5FDsubfile_int.c | 4 - src/H5FDsubfiling/H5FDsubfiling.c | 12 - src/H5FDsubfiling/H5subfiling_common.c | 13 - src/H5FDwindows.h | 6 +- src/H5FLmodule.h | 9 +- src/H5FLprivate.h | 3 - src/H5FOprivate.h | 4 - src/H5FSmodule.h | 9 +- src/H5FSpkg.h | 3 - src/H5Fmodule.h | 9 +- src/H5Fpkg.h | 9 +- src/H5Fpublic.h | 14 +- src/H5Fsuper_cache.c | 58 +- src/H5Gent.c | 19 +- src/H5Gmodule.h | 21 +- src/H5Goh.c | 2 +- src/H5Gpkg.h | 3 - src/H5Gprivate.h | 2 +- src/H5Gpublic.h | 16 +- src/H5HFcache.c | 2 +- src/H5HFmodule.h | 9 +- src/H5HFpkg.h | 9 +- src/H5HGmodule.h | 9 +- src/H5HGpkg.h | 3 - src/H5HGprivate.h | 4 - src/H5HLmodule.h | 9 +- src/H5HLpkg.h | 3 - src/H5Imodule.h | 3 - src/H5Ipkg.h | 9 +- src/H5Ipublic.h | 16 +- src/H5Ldevelop.h | 10 + src/H5Lmodule.h | 9 +- src/H5Lpkg.h | 9 - src/H5Lpublic.h | 28 +- src/H5MF.c | 2 +- src/H5MFmodule.h | 9 +- src/H5MFpkg.h | 3 - src/H5Mpublic.h | 2 +- src/H5Oainfo.c | 37 +- src/H5Oalloc.c | 2 +- src/H5Oattr.c | 114 +- src/H5Obtreek.c | 33 +- src/H5Ocache.c | 5 +- src/H5Ocont.c | 23 +- src/H5Oefl.c | 54 +- src/H5Oginfo.c | 17 +- src/H5Olinfo.c | 28 +- src/H5Omodule.h | 11 +- src/H5Omtime.c | 74 +- src/H5Oname.c | 34 +- src/H5Opublic.h | 44 +- src/H5Oshared.h | 119 +- src/H5PBmodule.h | 9 +- src/H5PLint.c | 8 +- src/H5PLpath.c | 3 +- src/H5PLpublic.h | 6 +- src/H5Pfapl.c | 4 +- src/H5Pmodule.h | 9 +- src/H5Ppkg.h | 9 +- src/H5Ppublic.h | 24 +- src/H5RSmodule.h | 7 +- src/H5RSprivate.h | 3 - src/H5Rpublic.h | 12 +- src/H5SLmodule.h | 9 +- src/H5SLprivate.h | 3 - src/H5SMmodule.h | 9 +- src/H5SMpkg.h | 3 - src/H5SMprivate.h | 7 +- src/H5Sall.c | 4 +- src/H5Shyper.c | 2 +- src/H5Smodule.h | 9 +- src/H5Spkg.h | 9 +- src/H5Spublic.h | 8 +- src/H5Sselect.c | 132 -- src/H5Tenum.c | 4 +- src/H5Tmodule.h | 9 +- src/H5Tpkg.h | 9 +- src/H5Tpublic.h | 22 +- src/H5UCprivate.h | 3 - src/H5VL.c | 2 +- src/H5VLint.c | 2 +- src/H5VLpassthru.c | 31 + src/H5VM.c | 75 - src/H5VMprivate.h | 91 +- src/H5Z.c | 12 +- src/H5Zdevelop.h | 28 +- src/H5Zmodule.h | 11 +- src/H5Zprivate.h | 4 - src/H5Zpublic.h | 10 +- src/H5Zszip.c | 14 +- src/H5detect.c | 2 +- src/H5make_libsettings.c | 2 +- src/H5private.h | 26 +- src/H5public.h | 18 +- test/Makefile.am | 15 +- test/accum.c | 1 - test/accum_swmr_reader.c | 1 - test/big.c | 25 - test/bittests.c | 16 - test/cache.c | 461 +---- test/cache_api.c | 42 - test/cache_common.c | 23 - test/cache_common.h | 2 - test/cmpd_dset.c | 21 - test/dangle.c | 12 - test/dsets.c | 8 +- test/dt_arith.c | 51 - test/dtypes.c | 63 +- test/efc.c | 1 - test/enum.c | 12 - test/file_image.c | 8 - test/fillval.c | 25 - test/filter_fail.c | 7 - test/gen_cross.c | 24 - test/gen_filters.c | 2 - test/gen_new_array.c | 2 - test/gen_new_mtime.c | 2 - test/gen_noencoder.c | 2 - test/gen_old_array.c | 2 - test/gen_old_layout.c | 2 - test/gen_old_mtime.c | 2 - test/gen_sizes_lheap.c | 2 - test/h5test.c | 24 +- test/hdfs.c | 12 - test/istore.c | 15 - test/links.c | 109 +- test/links_env.c | 2 - test/mount.c | 64 - test/mtime.c | 7 - test/ntypes.c | 37 - test/page_buffer.c | 53 - test/reserved.c | 8 - test/s3comms.c | 4 - test/space_overflow.c | 2 - test/stab.c | 3 - test/tarray.c | 6 +- test/tattr.c | 385 +++-- test/tcheck_version.c | 2 - test/tconfig.c | 8 - test/tcoords.c | 8 +- test/test_plugin.sh.in | 2 +- test/test_swmr.pwsh.in | 7 - test/test_swmr.sh.in | 7 - test/testframe.c | 3 - test/tfile.c | 162 +- test/tgenprop.c | 48 +- test/th5o.c | 24 + test/th5s.c | 30 +- test/titerate.c | 17 +- test/tmeta.c | 2 - test/tmisc.c | 96 +- test/trefer.c | 188 ++- test/trefer_deprec.c | 2 - test/tselect.c | 86 +- test/tsohm.c | 32 - test/ttime.c | 8 +- test/tunicode.c | 6 +- test/tvlstr.c | 14 +- test/tvltypes.c | 8 +- test/twriteorder.c | 25 +- test/unlink.c | 32 - test/vfd.c | 28 - test/vol.c | 254 ++- testpar/t_bigio.c | 13 +- testpar/t_cache.c | 54 - testpar/t_cache_image.c | 65 - testpar/t_coll_chunk.c | 36 +- testpar/t_dset.c | 3 - testpar/t_file.c | 16 +- testpar/t_filter_read.c | 2 - testpar/t_pread.c | 4 - testpar/t_shapesame.c | 3 +- testpar/t_vfd.c | 66 - tools/lib/h5diff.c | 4 - tools/lib/h5tools.c | 18 +- tools/lib/h5tools.h | 2 +- tools/lib/h5tools_dump.c | 17 - tools/lib/h5tools_ref.c | 10 - tools/lib/h5tools_str.c | 16 - tools/lib/io_timer.c | 6 - tools/libtest/h5tools_test_utils.c | 8 - tools/src/h5copy/h5copy.c | 8 - tools/src/h5diff/h5diff_main.c | 32 - tools/src/h5diff/ph5diff_main.c | 8 - tools/src/h5import/h5import.c | 3 - tools/src/h5perf/pio_engine.c | 32 +- tools/src/h5perf/pio_perf.c | 27 +- tools/src/h5perf/sio_engine.c | 9 - tools/src/h5perf/sio_perf.c | 15 - tools/src/h5stat/h5stat.c | 27 - tools/src/misc/h5repart.c | 4 - tools/test/h5diff/h5diff_plugin.sh.in | 2 +- tools/test/h5dump/binread.c | 2 - tools/test/h5dump/h5dump_plugin.sh.in | 2 +- tools/test/h5dump/h5dumpgentest.c | 4 - tools/test/h5ls/h5ls_plugin.sh.in | 2 +- tools/test/h5repack/h5repack_plugin.sh.in | 2 +- tools/test/h5repack/testh5repack_detect_szip.c | 4 - tools/test/h5stat/testh5stat.sh.in | 4 - tools/test/perform/chunk.c | 10 - tools/test/perform/overhead.c | 10 - tools/test/perform/perf_meta.c | 26 +- tools/test/perform/zip_perf.c | 28 - utils/tools/h5dwalk/h5dwalk.c | 2 - 364 files changed, 9537 insertions(+), 9308 deletions(-) create mode 100644 .github/workflows/hdfeos5.yml create mode 100644 config/gnu-warnings/gfort-developer-4.8 create mode 100644 config/gnu-warnings/gfort-no-developer-4.8 create mode 100644 fortran/src/H5ESff.F90 create mode 100644 fortran/testpar/async.F90 diff --git a/.github/workflows/hdfeos5.yml b/.github/workflows/hdfeos5.yml new file mode 100644 index 0000000..142bf7c --- /dev/null +++ b/.github/workflows/hdfeos5.yml @@ -0,0 +1,47 @@ +name: hdfeos5 + +on: + workflow_dispatch: + push: + pull_request: + branches: [ develop ] + paths-ignore: + - '.github/CODEOWNERS' + - '.github/FUNDING.yml' + - 'doc/**' + - 'release_docs/**' + - 'ACKNOWLEDGEMENTS' + - 'COPYING**' + - '**.md' + +# Using concurrency to cancel any in-progress job or run +concurrency: + group: hdfeos5-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build hdfeos5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Autotools Dependencies (Linux) + run: | + sudo apt update + sudo apt install automake autoconf libtool libtool-bin + - name: Install HDF5 + run: | + ./autogen.sh + ./configure --prefix=/usr/local --with-default-api-version=v16 + make + sudo make install + - name: Install HDF-EOS5 + run: | + wget -O HDF-EOS5.2.0.tar.gz "https://git.earthdata.nasa.gov/projects/DAS/repos/hdfeos5/raw/hdf-eos5-2.0-src.tar.gz?at=refs%2Fheads%2FHDFEOS5_2.0" + tar zxvf HDF-EOS5.2.0.tar.gz + cd hdf-eos5-2.0 + ./configure CC=/usr/local/bin/h5cc --prefix=/usr/local/ --enable-install-include + make + make check + sudo make install diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5534ec..277262c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ on: # Using concurrency to cancel any in-progress job or run concurrency: - group: ${{ github.ref }} + group: ${{ github.workflow }}-${{ github.sha || github.event.pull_request.number }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or @@ -118,6 +118,7 @@ jobs: direct_vfd: enable deprec_sym: enable default_api: v114 + szip: yes toolchain: "" generator: "autogen" flags: "" @@ -138,6 +139,7 @@ jobs: direct_vfd: disable deprec_sym: enable default_api: v114 + szip: yes toolchain: "" generator: "autogen" flags: "CC=mpicc" @@ -180,6 +182,7 @@ jobs: direct_vfd: enable deprec_sym: enable default_api: v16 + szip: yes toolchain: "" generator: "autogen" flags: "" @@ -202,6 +205,7 @@ jobs: direct_vfd: enable deprec_sym: enable default_api: v18 + szip: yes toolchain: "" generator: "autogen" flags: "" @@ -224,6 +228,7 @@ jobs: direct_vfd: enable deprec_sym: enable default_api: v110 + szip: yes toolchain: "" generator: "autogen" flags: "" @@ -246,6 +251,7 @@ jobs: direct_vfd: enable deprec_sym: enable default_api: v112 + szip: yes toolchain: "" generator: "autogen" flags: "" @@ -267,7 +273,8 @@ jobs: mirror_vfd: enable direct_vfd: enable deprec_sym: disable - default_api: v114 + default_api: default + szip: yes toolchain: "" generator: "autogen" flags: "" @@ -290,6 +297,7 @@ jobs: direct_vfd: enable deprec_sym: enable default_api: v114 + szip: yes toolchain: "" generator: "autogen" flags: "CFLAGS=-Werror" @@ -312,6 +320,53 @@ jobs: direct_vfd: enable deprec_sym: enable default_api: v114 + szip: yes + toolchain: "" + generator: "autogen" + flags: "CFLAGS=-Werror" + run_tests: false + thread_safety: + enabled: false + text: "" + build_mode: + text: " REL" + cmake: "Release" + autotools: "production" + + # Parallel Debug -Werror + - name: "Ubuntu gcc Autotools parallel -Werror (build only)" + os: ubuntu-latest + cpp: disable + fortran: disable + java: disable + parallel: enable + mirror_vfd: disable + direct_vfd: enable + deprec_sym: enable + default_api: v114 + toolchain: "" + generator: "autogen" + flags: "CFLAGS=-Werror" + run_tests: false + thread_safety: + enabled: false + text: "" + build_mode: + text: " DBG" + cmake: "Debug" + autotools: "debug" + + # Parallel production/release -Werror + - name: "Ubuntu gcc Autotools parallel -Werror (build only)" + os: ubuntu-latest + cpp: disable + fortran: disable + java: disable + parallel: enable + mirror_vfd: disable + direct_vfd: enable + deprec_sym: enable + default_api: v114 toolchain: "" generator: "autogen" flags: "CFLAGS=-Werror" @@ -356,6 +411,7 @@ jobs: echo "CC=gcc-11" >> $GITHUB_ENV echo "CXX=g++-11" >> $GITHUB_ENV echo "FC=gfortran-11" >> $GITHUB_ENV + sudo apt install libaec0 libaec-dev if: (matrix.generator == 'autogen') && (matrix.parallel != 'enable') - name: Install Autotools Dependencies (Linux, parallel) @@ -365,6 +421,7 @@ jobs: sudo apt install openmpi-bin openmpi-common mpi-default-dev echo "CC=mpicc" >> $GITHUB_ENV echo "FC=mpif90" >> $GITHUB_ENV + sudo apt install libaec0 libaec-dev if: (matrix.generator == 'autogen') && (matrix.parallel == 'enable') - name: Install Dependencies (Windows) @@ -395,7 +452,7 @@ jobs: sh ./autogen.sh mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - ${{ matrix.flags }} $GITHUB_WORKSPACE/configure --enable-build-mode=${{ matrix.build_mode.autotools }} --${{ matrix.deprec_sym }}-deprecated-symbols --with-default-api-version=${{ matrix.default_api }} --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --${{ matrix.java }}-java --${{ matrix.mirror_vfd }}-mirror-vfd --${{ matrix.direct_vfd }}-direct-vfd + ${{ matrix.flags }} $GITHUB_WORKSPACE/configure --enable-build-mode=${{ matrix.build_mode.autotools }} --${{ matrix.deprec_sym }}-deprecated-symbols --with-default-api-version=${{ matrix.default_api }} --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --${{ matrix.java }}-java --${{ matrix.mirror_vfd }}-mirror-vfd --${{ matrix.direct_vfd }}-direct-vfd --with-szlib=${{ matrix.szip }} shell: bash if: (matrix.generator == 'autogen') && (! matrix.thread_safe.enabled) @@ -404,7 +461,7 @@ jobs: sh ./autogen.sh mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - ${{ matrix.flags }} $GITHUB_WORKSPACE/configure --enable-build-mode=${{ matrix.build_mode.autotools }} --enable-shared --enable-threadsafe --disable-hl --${{ matrix.parallel }}-parallel --${{ matrix.mirror_vfd }}-mirror-vfd --${{ matrix.direct_vfd }}-direct-vfd + ${{ matrix.flags }} $GITHUB_WORKSPACE/configure --enable-build-mode=${{ matrix.build_mode.autotools }} --enable-shared --enable-threadsafe --disable-hl --${{ matrix.parallel }}-parallel --${{ matrix.mirror_vfd }}-mirror-vfd --${{ matrix.direct_vfd }}-direct-vfd --with-szlib=${{ matrix.szip }} shell: bash if: (matrix.generator == 'autogen') && (matrix.thread_safe.enabled) @@ -457,3 +514,17 @@ jobs: working-directory: ${{ runner.workspace }}/build # Skip Debug MSVC while we investigate H5L Java test timeouts if: (matrix.generator != 'autogen') && (matrix.run_tests) && ! ((matrix.name == 'Windows MSVC CMake') && (matrix.build_mode.cmake == 'Debug')) + + # + # INSTALL (note that this runs even when we don't run the tests) + # + + - name: Autotools Install + run: make install + working-directory: ${{ runner.workspace }}/build + if: (matrix.generator == 'autogen') + + - name: Autotools Verify Install + run: make check-install + working-directory: ${{ runner.workspace }}/build + if: (matrix.generator == 'autogen') diff --git a/CMakeLists.txt b/CMakeLists.txt index 69f891d..9da39fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -646,7 +646,7 @@ else () endif () include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) -set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) +set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) #----------------------------------------------------------------------------- # Option to Enable HDFS diff --git a/bin/checkposix b/bin/checkposix index ee12d44..bb6b81b 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -103,7 +103,7 @@ foreach $arg (@ARGV) { # Now find all function calls on this line which don't start with 'H' while (($name)=/\b([a-z_A-GI-Z]\w*)\s*\(/) { $_ = $'; - + # Ignore C statements that look sort of like function # calls. next if $name =~ /^(if|for|offsetof|return|sizeof|switch|while|void)$/; @@ -186,7 +186,7 @@ foreach $arg (@ARGV) { } # TESTING (not comprehensive - just noise reduction) - + # Test macros and functions (testhdf5.h) next if $name =~ /^(AddTest|TestErrPrintf|TestSummary|TestCleanup|TestShutdown)$/; next if $name =~ /^(CHECK|CHECK_PTR|CHECK_PTR_NULL|CHECK_PTR_EQ|CHECK_I)$/; diff --git a/bin/format_source b/bin/format_source index 227d22a..1d9e88a 100755 --- a/bin/format_source +++ b/bin/format_source @@ -21,6 +21,6 @@ find . \( -type d -path ./config -prune -and -not -path ./config \) \ -or -name H5overflow.h \ \) \) \ -and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp -or -iname *.java \) \) \ - | xargs clang-format -style=file -i -fallback-style=none + | xargs -P0 -n1 clang-format -style=file -i -fallback-style=none exit 0 diff --git a/bin/release b/bin/release index 5bf002a..ad4b7b5 100755 --- a/bin/release +++ b/bin/release @@ -52,7 +52,7 @@ for compressing the resulting tar archive (if none are given then information is available in the README_HPC file. doc -- produce the latest doc tree in addition to the archive. -An sha256 checksum is produced for each archive created and stored in the sha256 file. +A sha256 checksum is produced for each archive created and stored in the sha256 file. Examples: @@ -193,19 +193,19 @@ tar2cmakezip() fi # step 2: add batch file for building CMake on window - (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2013 -C Release -V -O hdf5.log" > build-VS2013-32.bat; chmod 755 build-VS2013-32.bat) - (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201364 -C Release -V -O hdf5.log" > build-VS2013-64.bat; chmod 755 build-VS2013-64.bat) (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2015 -C Release -V -O hdf5.log" > build-VS2015-32.bat; chmod 755 build-VS2015-32.bat) (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201564 -C Release -V -O hdf5.log" > build-VS2015-64.bat; chmod 755 build-VS2015-64.bat) (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2017 -C Release -V -O hdf5.log" > build-VS2017-32.bat; chmod 755 build-VS2017-32.bat) (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -V -O hdf5.log" > build-VS2017-64.bat; chmod 755 build-VS2017-64.bat) (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2019 -C Release -V -O hdf5.log" > build-VS2019-32.bat; chmod 755 build-VS2019-32.bat) (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201964 -C Release -V -O hdf5.log" > build-VS2019-64.bat; chmod 755 build-VS2019-64.bat) + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2022 -C Release -V -O hdf5.log" > build-VS2022-32.bat; chmod 755 build-VS2022-32.bat) + (cd $cmziptmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=VS202264 -C Release -V -O hdf5.log" > build-VS2022-64.bat; chmod 755 build-VS2022-64.bat) # step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmziptmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpsubdir - cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.2-Source.zip $cmziptmpsubdir + cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.3-Source.zip $cmziptmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_0.zip $cmziptmpsubdir cp $cmziptmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpsubdir cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpsubdir @@ -297,7 +297,7 @@ tar2cmaketgz() # step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir - cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.2-Source.tar.gz $cmgztmpsubdir + cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.3-Source.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_0.tar.gz $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir @@ -376,7 +376,7 @@ tar2hpccmaketgz() # step 3: add LIBAEC.tar.gz, ZLib.tar.gz and cmake files cp /mnt/scr1/pre-release/hdf5/CMake/LIBAEC.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir - cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.2-Source.tar.gz $cmgztmpsubdir + cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-2.0.3-Source.tar.gz $cmgztmpsubdir cp /mnt/scr1/pre-release/hdf5/CMake/hdf5_plugins-1_14_0.tar.gz $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir @@ -537,37 +537,37 @@ for comp in $methods; do case $comp in tar) cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar - (cd $DEST; sha256 $HDF5_VERS.tar >> $SHA256) + (cd $DEST; sha256sum $HDF5_VERS.tar >> $SHA256) ;; gzip) test "$verbose" && echo " Running gzip..." 1>&2 gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz - (cd $DEST; sha256 $HDF5_VERS.tar.gz >> $SHA256) + (cd $DEST; sha256sum $HDF5_VERS.tar.gz >> $SHA256) ;; cmake-tgz) test "$verbose" && echo " Creating CMake tar.gz file..." 1>&2 tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; sha256 CMake-$HDF5_VERS.tar.gz >> $SHA256) + (cd $DEST; sha256sum CMake-$HDF5_VERS.tar.gz >> $SHA256) ;; hpc-cmake-tgz) test "$verbose" && echo " Creating HPC-CMake tar.gz file..." 1>&2 tar2hpccmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/HPC-CMake-$HDF5_VERS.tar.gz 1>&2 - (cd $DEST; sha256 HPC-CMake-$HDF5_VERS.tar.gz >> $SHA256) + (cd $DEST; sha256sum HPC-CMake-$HDF5_VERS.tar.gz >> $SHA256) ;; bzip2) test "$verbose" && echo " Running bzip2..." 1>&2 bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 - (cd $DEST; sha256 $HDF5_VERS.tar.bz2 >> $SHA256) + (cd $DEST; sha256sum $HDF5_VERS.tar.bz2 >> $SHA256) ;; zip) test "$verbose" && echo " Creating zip ball..." 1>&2 tar2zip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.zip 1>&2 - (cd $DEST; sha256 $HDF5_VERS.zip >> $SHA256) + (cd $DEST; sha256sum $HDF5_VERS.zip >> $SHA256) ;; cmake-zip) test "$verbose" && echo " Creating CMake-zip ball..." 1>&2 tar2cmakezip $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.zip 1>&2 - (cd $DEST; sha256 CMake-$HDF5_VERS.zip >> $SHA256) + (cd $DEST; sha256sum CMake-$HDF5_VERS.zip >> $SHA256) ;; doc) if [ "${DOCVERSION}" = "" ]; then diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index f5b2a88..f710204 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -104,8 +104,8 @@ foreach (example ${tutr_examples}) -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=tutr_cpp_ex_${example}.txt" - #-D "TEST_REFERENCE=cpp_ex_tutr_${example}.out" + -D "TEST_OUTPUT=cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_${example}.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 5c3ce81..1a23f5e 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -1375,14 +1375,6 @@ test_operator(H5File &file) * * Failure: -1 * - * Modifications: - * Nov 12, 01: - * - moved h5_cleanup to outside of try block because - * dataset.h5 cannot be removed until "file" is out of - * scope and dataset.h5 is closed. - * Feb 20, 05: - * - cleanup_dsets took care of the cleanup now. - * *------------------------------------------------------------------------- */ extern "C" void diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 5677449..d683797 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -65,13 +65,6 @@ const H5std_string FILE4("tfile4.h5"); * Programmer Binh-Minh Ribler (use C version) * January, 2001 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. *------------------------------------------------------------------------- */ static void @@ -274,13 +267,6 @@ test_file_create() * Programmer Binh-Minh Ribler (use C version) * January, 2001 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hsize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. *------------------------------------------------------------------------- */ static void diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 2d7dbb8..34078a7 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -96,8 +96,6 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values * Programmer Binh-Minh Ribler (use C version, from dsets.c/test_filters) * January, 2007 * - * Modifications: - * Note: H5Z interface is not implemented yet. *------------------------------------------------------------------------- */ const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; @@ -145,8 +143,6 @@ test_null_filter() * Programmer Binh-Minh Ribler (partly from dsets.c/test_filters) * January, 2007 * - * Modifications: - * Note: H5Z interface is not implemented yet. *------------------------------------------------------------------------- */ const H5std_string DSET_SZIP_NAME("szipped dataset"); diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index 3651aa3..b9a84e1 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -87,16 +87,6 @@ int space5_data = 7; * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. - * April 12, 2011: Raymond Lu - * Starting from the 1.8.7 release, we allow dimension - * size to be zero. So I took out the test against it. *------------------------------------------------------------------------- */ static void @@ -223,13 +213,6 @@ test_h5s_basic() * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. *------------------------------------------------------------------------- */ static void @@ -287,13 +270,6 @@ test_h5s_scalar_write() * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. *------------------------------------------------------------------------- */ static void @@ -348,13 +324,6 @@ test_h5s_scalar_read() * Programmer Raymond Lu (using C version) * May 18, 2004 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. *------------------------------------------------------------------------- */ static void @@ -402,13 +371,6 @@ test_h5s_null() * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. *------------------------------------------------------------------------- */ static void @@ -470,13 +432,6 @@ test_h5s_compound_scalar_write() * Programmer Binh-Minh Ribler (using C version) * Mar 2001 * - * Modifications: - * January, 2005: C tests' macro VERIFY casts values to 'long' for all - * cases. Since there are no operator<< for 'long long' - * or int64 in VS C++ ostream, I casted the hssize_t values - * passed to verify_val to 'long' as well. If problems - * arises later, this will have to be specifically handled - * with a special routine. *------------------------------------------------------------------------- */ static void diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 14ad0cf..b768928 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -131,6 +131,8 @@ CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H) CHECK_INCLUDE_FILE_CONCAT ("arpa/inet.h" ${HDF_PREFIX}_HAVE_ARPA_INET_H) if (WINDOWS) CHECK_INCLUDE_FILE_CONCAT ("shlwapi.h" ${HDF_PREFIX}_HAVE_SHLWAPI_H) + # Checking for StrStrIA in the library is not reliable for mingw32 to stdcall + set (LINK_LIBS ${LINK_LIBS} "shlwapi") endif () ## Check for non-standard extension quadmath.h @@ -156,10 +158,6 @@ if (MINGW OR NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${HDF_PREFIX}_HAVE_LIBWSOCK32) endif () -if (WINDOWS) - CHECK_LIBRARY_EXISTS_CONCAT ("shlwapi" StrStrIA ${HDF_PREFIX}_HAVE_SHLWAPI) -endif () - # UCB (BSD) compatibility library CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB) @@ -242,6 +240,7 @@ if (MINGW OR NOT WINDOWS) set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + mark_as_advanced (HDF_ENABLE_LARGE_FILE) if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) set (msg "Performing TEST_LFS_WORKS") try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE @@ -570,6 +569,7 @@ endif () # Option for --enable-strict-format-checks #----------------------------------------------------------------------------- option (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) +mark_as_advanced (HDF5_STRICT_FORMAT_CHECKS) if (HDF5_STRICT_FORMAT_CHECKS) set (${HDF_PREFIX}_STRICT_FORMAT_CHECKS 1) endif () @@ -582,6 +582,7 @@ MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) # support denormalized floating values) to maximize speed. #----------------------------------------------------------------------------- option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) +mark_as_advanced (HDF5_WANT_DATA_ACCURACY) if (HDF5_WANT_DATA_ACCURACY) set (${HDF_PREFIX}_WANT_DATA_ACCURACY 1) endif () @@ -594,6 +595,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # actually benefit little. #----------------------------------------------------------------------------- option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) +mark_as_advanced (HDF5_WANT_DCONV_EXCEPTION) if (HDF5_WANT_DCONV_EXCEPTION) set (${HDF_PREFIX}_WANT_DCONV_EXCEPTION 1) endif () @@ -603,6 +605,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) # Check if they would like the function stack support compiled in #----------------------------------------------------------------------------- option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) +mark_as_advanced (HDF5_ENABLE_CODESTACK) if (HDF5_ENABLE_CODESTACK) set (${HDF_PREFIX}_HAVE_CODESTACK 1) endif () @@ -782,12 +785,17 @@ if (HDF5_BUILD_FORTRAN) ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c ${SOURCE_CODE} ) + if (CMAKE_VERSION VERSION_LESS 3.25) + set (_RUN_OUTPUT_VARIABLE "RUN_OUTPUT_VARIABLE") + else () + set (_RUN_OUTPUT_VARIABLE "RUN_OUTPUT_STDOUT_VARIABLE") + endif() TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c COMPILE_DEFINITIONS "-D_SIZEOF___FLOAT128=${H5_SIZEOF___FLOAT128};-D_HAVE_QUADMATH_H=${H5_HAVE_QUADMATH_H}" COMPILE_OUTPUT_VARIABLE COMPILEOUT - RUN_OUTPUT_VARIABLE OUTPUT_VAR + ${_RUN_OUTPUT_VARIABLE} OUTPUT_VAR ) set (${RETURN_OUTPUT_VAR} ${OUTPUT_VAR}) @@ -818,7 +826,6 @@ if (HDF5_BUILD_FORTRAN) message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed") endif () endmacro () - set (PROG_SRC " #include \n\ diff --git a/config/cmake/HDF5PluginMacros.cmake b/config/cmake/HDF5PluginMacros.cmake index a180d5d..da0eab5 100644 --- a/config/cmake/HDF5PluginMacros.cmake +++ b/config/cmake/HDF5PluginMacros.cmake @@ -84,6 +84,7 @@ macro (FILTER_OPTION plname) option (ENABLE_${plname} "Enable Library Building for ${plname} plugin" ON) if (ENABLE_${plname}) option (HDF_${plname}_USE_EXTERNAL "Use External Library Building for ${PLUGIN_NAME} plugin" 0) + mark_as_advanced (HDF_${plname}_USE_EXTERNAL) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") set (HDF_${plname}_USE_EXTERNAL 1 CACHE BOOL "Use External Library Building for ${PLUGIN_NAME} plugin" FORCE) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 79084cb..aae7078 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -39,11 +39,16 @@ macro (FORTRAN_RUN FUNCTION_NAME SOURCE_CODE RUN_RESULT_VAR1 COMPILE_RESULT_VAR1 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 "${SOURCE_CODE}" ) + if (CMAKE_VERSION VERSION_LESS 3.25) + set (_RUN_OUTPUT_VARIABLE "RUN_OUTPUT_VARIABLE") + else () + set (_RUN_OUTPUT_VARIABLE "RUN_OUTPUT_STDOUT_VARIABLE") + endif() TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler1.f90 LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}" - RUN_OUTPUT_VARIABLE OUTPUT_VAR + ${_RUN_OUTPUT_VARIABLE} OUTPUT_VAR ) set (${RETURN_OUTPUT_VAR} ${OUTPUT_VAR}) @@ -169,10 +174,10 @@ foreach (KIND ${VAR}) " PROGRAM main USE ISO_C_BINDING - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT IMPLICIT NONE INTEGER (KIND=${KIND}) a - WRITE(stderr,'(I0)') ${FC_SIZEOF_A} + WRITE(stdout,'(I0)') ${FC_SIZEOF_A} END " ) @@ -210,10 +215,10 @@ foreach (KIND ${VAR} ) " PROGRAM main USE ISO_C_BINDING - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT IMPLICIT NONE REAL (KIND=${KIND}) a - WRITE(stderr,'(I0)') ${FC_SIZEOF_A} + WRITE(stdout,'(I0)') ${FC_SIZEOF_A} END " ) @@ -252,17 +257,17 @@ set (PROG_SRC3 " PROGRAM main USE ISO_C_BINDING - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT IMPLICIT NONE INTEGER a REAL b DOUBLE PRECISION c - WRITE(stderr,*) ${FC_SIZEOF_A} - WRITE(stderr,*) kind(a) - WRITE(stderr,*) ${FC_SIZEOF_B} - WRITE(stderr,*) kind(b) - WRITE(stderr,*) ${FC_SIZEOF_C} - WRITE(stderr,*) kind(c) + WRITE(stdout,*) ${FC_SIZEOF_A} + WRITE(stdout,*) kind(a) + WRITE(stdout,*) ${FC_SIZEOF_B} + WRITE(stdout,*) kind(b) + WRITE(stdout,*) ${FC_SIZEOF_C} + WRITE(stdout,*) kind(c) END " ) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 7a9a62e..1bbf57c 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -64,6 +64,7 @@ if (CMAKE_COMPILER_IS_GNUCC) # This should NOT be on by default as it can cause process issues. #----------------------------------------------------------------------------- option (HDF5_ENABLE_BUILD_DIAGS "Enable color and URL extended diagnostic messages" OFF) + mark_as_advanced (HDF5_ENABLE_BUILD_DIAGS) if (HDF5_ENABLE_BUILD_DIAGS) message (STATUS "... default color and URL extended diagnostic messages enabled") else () diff --git a/config/cmake/HDFFortranCompilerFlags.cmake b/config/cmake/HDFFortranCompilerFlags.cmake index 108a4e9..86d0431 100644 --- a/config/cmake/HDFFortranCompilerFlags.cmake +++ b/config/cmake/HDFFortranCompilerFlags.cmake @@ -79,6 +79,11 @@ if (NOT MSVC AND NOT MINGW) # Append more extra warning flags that only gcc 4.8+ knows about if (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.8) ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-4.8") + if (HDF5_ENABLE_DEV_WARNINGS) + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-developer-4.8") + else () + ADD_H5_FLAGS (HDF5_CMAKE_Fortran_FLAGS "${HDF5_SOURCE_DIR}/config/gnu-warnings/gfort-no-developer-4.8") + endif () endif () # Append more extra warning flags that only gcc 4.9+ knows about diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 1157283..5ac7316 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -73,6 +73,8 @@ endmacro () #------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) + option (DISABLE_PDB_FILES "Do not install PDB files" OFF) + mark_as_advanced (DISABLE_PDB_FILES) if (WIN32 AND MSVC AND NOT DISABLE_PDB_FILES) get_target_property (target_type ${libtarget} TYPE) if (${target_type} MATCHES "SHARED") diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 15cffba..c8edbe4 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -47,6 +47,7 @@ endmacro () #----------------------------------------------------------------------------- option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +mark_as_advanced (BUILD_STATIC_CRT_LIBS) if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () endif () diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 6087730..708e45f 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -11,7 +11,7 @@ # ############################################################################################# ### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564] ### +### BUILD_GENERATOR required [Unix, VS2022, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564] ### ### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log ### ############################################################################################# @@ -23,14 +23,14 @@ cmake_minimum_required (VERSION 3.18) # BUILD_GENERATOR - The cmake build generator: # MinGW * MinGW Makefiles # Unix * Unix Makefiles +# VS2022 * Visual Studio 17 2022 +# VS202264 * Visual Studio 17 2022 # VS2019 * Visual Studio 16 2019 # VS201964 * Visual Studio 16 2019 # VS2017 * Visual Studio 15 2017 # VS201764 * Visual Studio 15 2017 Win64 # VS2015 * Visual Studio 14 2015 # VS201564 * Visual Studio 14 2015 Win64 -# VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 # # INSTALLDIR - root folder where hdf5 is installed # CTEST_CONFIGURATION_TYPE - Release, Debug, etc @@ -43,9 +43,9 @@ set (CTEST_SOURCE_VERSEXT "-1") ############################################################################## # handle input parameters to script. #BUILD_GENERATOR - which CMake generator to use, required -#INSTALLDIR - HDF5-1.13.x root folder +#INSTALLDIR - HDF5-1.14.x root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5-1.13.x +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.14.x #MODEL - CDash group name #HPC - run alternate configurations for HPC machines; sbatch, bsub, raybsub, qsub #MPI - enable MPI @@ -68,7 +68,7 @@ endif () # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564") + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2022, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564") endif () ################################################################### @@ -105,12 +105,24 @@ endif () ######### Following describes compiler ############ if (NOT DEFINED HPC) if (NOT DEFINED BUILD_GENERATOR) - message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564") + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2022, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564") endif () if (WIN32 AND NOT MINGW) set (SITE_OS_NAME "Windows") set (SITE_OS_VERSION "WIN10") - if (BUILD_GENERATOR STREQUAL "VS201964") + if (BUILD_GENERATOR STREQUAL "VS202264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 17 2022") + set (CMAKE_GENERATOR_ARCHITECTURE "x64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2022") + set (SITE_COMPILER_VERSION "17") + elseif (BUILD_GENERATOR STREQUAL "VS2022") + set (CTEST_CMAKE_GENERATOR "Visual Studio 17 2022") + set (CMAKE_GENERATOR_ARCHITECTURE "Win32") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2022") + set (SITE_COMPILER_VERSION "17") + elseif (BUILD_GENERATOR STREQUAL "VS201964") set (CTEST_CMAKE_GENERATOR "Visual Studio 16 2019") set (CMAKE_GENERATOR_ARCHITECTURE "x64") set (SITE_OS_BITS "64") @@ -163,7 +175,7 @@ if (NOT DEFINED HPC) set (SITE_COMPILER_NAME "vs2012") set (SITE_COMPILER_VERSION "11") else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564") + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2022, VS2019, VS201964, VS2017, VS201764, VS2015, VS201564") endif () ## Set the following to unique id your computer ## set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index 7a5d327..92bfd37 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -74,7 +74,7 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### package examples #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-2.0.1-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-2.0.3-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") ############################################################################################# ### enable parallel builds diff --git a/config/gnu-fflags b/config/gnu-fflags index c43f416..b3385ec 100644 --- a/config/gnu-fflags +++ b/config/gnu-fflags @@ -159,6 +159,8 @@ if test "X-gfortran" = "X-$f9x_vendor"; then # gfortran >= 4.8 if test $f9x_vers_major -ge 5 -o $f9x_vers_major -eq 4 -a $f9x_vers_minor -ge 8; then H5_FCFLAGS="$H5_FCFLAGS $(load_gnu_arguments gfort-4.8)" + DEVELOPER_WARNING_FCFLAGS="$DEVELOPER_WARNING_FCFLAGS $(load_gnu_arguments gfort-developer-4.8)" + NO_DEVELOPER_WARNING_FCFLAGS="$NO_DEVELOPER_WARNING_FCFLAGS $(load_gnu_arguments gfort-no-developer-4.8)" fi # gfortran 4.9 (nothing new) diff --git a/config/gnu-warnings/gfort-4.8 b/config/gnu-warnings/gfort-4.8 index 9d880de..f986072 100644 --- a/config/gnu-warnings/gfort-4.8 +++ b/config/gnu-warnings/gfort-4.8 @@ -1,5 +1,4 @@ # warning flags added for gfortran >= 4.4 --Warray-temporaries -Wintrinsics-std # warning flag added for gfortran >= 4.5 diff --git a/config/gnu-warnings/gfort-developer-4.8 b/config/gnu-warnings/gfort-developer-4.8 new file mode 100644 index 0000000..20effdc --- /dev/null +++ b/config/gnu-warnings/gfort-developer-4.8 @@ -0,0 +1,3 @@ +# warning flags added for gfortran >= 4.4 +-Warray-temporaries + diff --git a/config/gnu-warnings/gfort-no-developer-4.8 b/config/gnu-warnings/gfort-no-developer-4.8 new file mode 100644 index 0000000..82274ef --- /dev/null +++ b/config/gnu-warnings/gfort-no-developer-4.8 @@ -0,0 +1,3 @@ +# warning flags added for gfortran >= 4.4 +-Wno-array-temporaries + diff --git a/configure.ac b/configure.ac index 7b1d10c..1cc487a 100644 --- a/configure.ac +++ b/configure.ac @@ -3747,11 +3747,13 @@ esac AC_SUBST([DEFAULT_API_VERSION]) AC_MSG_CHECKING([which version of public symbols to use by default]) AC_ARG_WITH([default-api-version], - [AS_HELP_STRING([--with-default-api-version=(v16|v18|v110|v112|v114)], + [AS_HELP_STRING([--with-default-api-version=(default|v16|v18|v110|v112|v114)], [Specify default release version of public symbols [default=v114]])],, [withval=v114]) +## Allowing "default" allows the GitHub CI to check that we didn't forget +## to change the defaults when creating a new major version if test "X$withval" = "Xv16"; then AC_MSG_RESULT([v16]) DEFAULT_API_VERSION=v16 @@ -3772,7 +3774,7 @@ elif test "X$withval" = "Xv112"; then DEFAULT_API_VERSION=v112 AC_DEFINE([USE_112_API_DEFAULT], [1], [Define using v1.12 public API symbols by default]) -elif test "X$withval" = "Xv114"; then +elif test "X$withval" = "Xv114" -o "X$withval" = "Xdefault"; then AC_MSG_RESULT([v114]) DEFAULT_API_VERSION=v114 AC_DEFINE([USE_114_API_DEFAULT], [1], diff --git a/doxygen/aliases b/doxygen/aliases index 3fc7e10..27090e6 100644 --- a/doxygen/aliases +++ b/doxygen/aliases @@ -15,7 +15,7 @@ ALIASES += Code{1}="\1" ALIASES += success{1}="\Bold{Success:} \1" ALIASES += failure{1}="\Bold{Failure:} \1" -ALIASES += herr_t="Returns a non-negative value if successful; otherwise returns a negative value." +ALIASES += herr_t="Returns a non-negative value if successful; otherwise, returns a negative value." ALIASES += herr_t_iter="\li Zero causes the iterator to continue, returning zero when the iteration is complete. \li A positive value causes the iterator to immediately return that positive value, indicating short-circuit success. \li A negative value causes the iterator to immediately return that value, indicating failure." ALIASES += hid_t{1}="Returns a \1 identifier if successful; otherwise returns #H5I_INVALID_HID. " ALIASES += hid_ti{1}="Returns an \1 identifier if successful; otherwise returns #H5I_INVALID_HID. " @@ -380,3 +380,7 @@ ALIASES += obj_info_fields="
FlagPurpose
download it as a tgz archive for offline reading. -\par History - A snapshot (~April 2017) of the pre-Doxygen HDF5 documentation can be found - here. - \par ToDo List There is plenty of unfinished business. diff --git a/doxygen/examples/H5Pget_metadata_read_attempts.2.c b/doxygen/examples/H5Pget_metadata_read_attempts.2.c index 2cd12db..44b26e9 100644 --- a/doxygen/examples/H5Pget_metadata_read_attempts.2.c +++ b/doxygen/examples/H5Pget_metadata_read_attempts.2.c @@ -1,7 +1,7 @@ /* Open the file with SWMR access and default file access property list */ fid = H5Fopen(FILE, (H5F_ACC_RDONLY | H5F_ACC_SWMR_READ), H5P_DEFAULT); -/* Get the file's file access roperty list */ +/* Get the file's file access property list */ file_fapl = H5Fget_access_plist(fid); /* Retrieve the # of read attempts from the file's file access property list */ @@ -26,7 +26,7 @@ H5Pset_metadata_read_attempts(fapl, 20); /* Open the file with SWMR access and the non-default file access property list */ fid = H5Fopen(FILE, (H5F_ACC_RDONLY | H5F_ACC_SWMR_READ), fapl); -/* Get the file's file access roperty list */ +/* Get the file's file access property list */ file_fapl = H5Fget_access_plist(fid); /* Retrieve the # of read attempts from the file's file access property list */ diff --git a/doxygen/examples/H5Pget_metadata_read_attempts.3.c b/doxygen/examples/H5Pget_metadata_read_attempts.3.c index 4b5ea3a..8edda9f 100644 --- a/doxygen/examples/H5Pget_metadata_read_attempts.3.c +++ b/doxygen/examples/H5Pget_metadata_read_attempts.3.c @@ -1,7 +1,7 @@ /* Open the file with non-SWMR access and default file access property list */ fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT); -/* Get the file's file access roperty list */ +/* Get the file's file access property list */ file_fapl = H5Fget_access_plist(fid); /* Retrieve the # of read attempts from the file's file access property list */ @@ -26,7 +26,7 @@ H5Pset_metadata_read_attempts(fapl, 20); /* Open the file with non-SWMR access and the non-default file access property list */ fid = H5Fopen(FILE, H5F_ACC_RDONLY, fapl); -/* Get the file's file access roperty list */ +/* Get the file's file access property list */ file_fapl = H5Fget_access_plist(fid); /* Retrieve the # of read attempts from the file's file access property list */ diff --git a/doxygen/examples/H5Pset_metadata_read_attempts.c b/doxygen/examples/H5Pset_metadata_read_attempts.c index 7c2f65d..db3573b 100644 --- a/doxygen/examples/H5Pset_metadata_read_attempts.c +++ b/doxygen/examples/H5Pset_metadata_read_attempts.c @@ -8,7 +8,7 @@ H5Pset_metadata_read_attempts(fapl, 20); /* Open the file with SWMR access and the non-default file access property list */ fid = H5Fopen(FILE, (H5F_ACC_RDONLY | H5F_ACC_SWMR_READ), fapl); -/* Get the file's file access roperty list */ +/* Get the file's file access property list */ file_fapl = H5Fget_access_plist(fid); /* Retrieve the # of read attempts from the file's file access property list */ @@ -38,7 +38,7 @@ H5Pset_metadata_read_attempts(fapl, 20); /* Open the file with SWMR access and the non-default file access property list */ fid = H5Fopen(FILE, H5F_ACC_RDONLY, fapl); -/* Get the file's file access roperty list */ +/* Get the file's file access property list */ file_fapl = H5Fget_access_plist(fid); /* Retrieve the # of read attempts from the file's file access property list */ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c93e943..5cfdead 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -13,6 +13,9 @@ if (WIN32) if (NOT H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE) set (H5_DBL_NOT_UNIQUE_EXP ";") endif () + if (NOT H5_NO_DEPRECATED_SYMBOLS) + set (H5_NO_DEPRECATED_SYMBOLS ";") + endif () configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) endif () endif () @@ -274,6 +277,7 @@ set (f90_F_BASE_SOURCES ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff.F90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5ESff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Gff.F90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Iff.F90 diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 6e14d0f..ba3b62d 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -21,56 +21,6 @@ #include "H5f90.h" #include "H5Eprivate.h" -/****if* H5Af/h5acreate_c - * NAME - * h5acreate_c - * PURPOSE - * Call H5Acreate2 to create an attribute - * INPUTS - * obj_id - object identifier - * name - name of the attribute - * namelen - name length - * type_id - datatype identifier - * space_id - dataspace identifier - * crt_pr - identifier of creation property list - * OUTPUTS - * attr_id - attribute identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 12, 1999 - * HISTORY - * - * SOURCE - */ -int_f -h5acreate_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, - hid_t_f *crt_prp, hid_t_f *aapl, hid_t_f *attr_id) -/*******/ -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if (NULL == (c_name = HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL); - - /* - * Call H5Acreate2 function. - */ - if ((*attr_id = (hid_t_f)H5Acreate2((hid_t)*obj_id, c_name, (hid_t)*type_id, (hid_t)*space_id, - (hid_t)*crt_prp, (hid_t)*aapl)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_name) - HDfree(c_name); - return ret_value; -} - /****if* H5Af/h5adelete_c * NAME * h5adelete_c @@ -205,111 +155,6 @@ done: return ret_value; } -/****if* H5Af/h5arename_by_name_c - * NAME - * h5arename_by_name_c - * PURPOSE - * Calls H5Arename_by_name - * INPUTS - * loc_id - Object identifier - * obj_name - Name of object, relative to location, - * whose attribute is to be renamed - * obj_name_len - Object name length - * old_attr_name - Prior attribute name - * old_attr_name_len - Prior attribute name length - * new_attr_name - New attribute name - * new_attr_name_len - New attribute name length - * lapl_id - Link access property list identifier - * OUTPUTS - * N/A - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * January, 2008 - * HISTORY - * N/A - * SOURCE - */ - -int_f -h5arename_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd old_attr_name, - size_t_f *old_attr_namelen, _fcd new_attr_name, size_t_f *new_attr_namelen, - hid_t_f *lapl_id) -/******/ -{ - char *c_obj_name = NULL; /* Buffer to hold C string */ - char *c_old_attr_name = NULL; /* Buffer to hold C string */ - char *c_new_attr_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - /* - * Convert FORTRAN name to C name - */ - if ((c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen)) == NULL) - HGOTO_DONE(FAIL); - if ((c_old_attr_name = HD5f2cstring(old_attr_name, (size_t)*old_attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - if ((c_new_attr_name = HD5f2cstring(new_attr_name, (size_t)*new_attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - - if (H5Arename_by_name((hid_t)*loc_id, c_obj_name, c_old_attr_name, c_new_attr_name, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_obj_name) - HDfree(c_obj_name); - if (c_old_attr_name) - HDfree(c_old_attr_name); - if (c_new_attr_name) - HDfree(c_new_attr_name); - return ret_value; -} - -/****if* H5Af/h5aopen_c - * NAME - * h5aopen_c - * PURPOSE - * Call H5Aopen to open an attribute - * INPUTS - * obj_id - Identifier for object to which attribute is attached - * attr_name - Attribute access property list - * attr_namelen - size of attr_name - * aapl_id - Link access property list - * OUTPUTS - * attr_id - dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * January, 2008 - * HISTORY - * - * SOURCE - */ -int_f -h5aopen_c(hid_t_f *obj_id, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *attr_id) -/******/ -{ - char *c_attr_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_attr_name = HD5f2cstring(attr_name, (size_t)*attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - /* - * Call H5Aopen function. - */ - - if ((*attr_id = (hid_t_f)H5Aopen((hid_t)*obj_id, c_attr_name, (hid_t)*aapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_attr_name) - HDfree(c_attr_name); - return ret_value; -} /****if* H5Af/h5adelete_by_name_c * NAME * h5adelete_by_name_c @@ -505,71 +350,6 @@ done: return ret_value; } -/****if* H5Af/h5aopen_by_idx_c - * NAME - * h5aopen_by_idx_c - * PURPOSE - * Call H5Aopen_by_idx - * INPUTS - * loc_id - Object identifier - * obj_name - Name of object to which attribute is attached - * obj_namelen - name length - * idx_type - Type of index; Possible values are: - * H5_INDEX_UNKNOWN - Unknown index type - * H5_INDEX_NAME - Index on names - * H5_INDEX_CRT_ORDER - Index on creation order - * H5_INDEX_N - Number of indices defined - * - * order - Order in which to iterate over index; Possible values are: - * H5_ITER_UNKNOWN - Unknown order - * H5_ITER_INC - Increasing order - * H5_ITER_DEC - Decreasing order - * H5_ITER_NATIVE - No particular order, whatever is fastest - * H5_ITER_N - Number of iteration orders - * - * n - Attribute’s position in index - * aapl_id - Attribute access property list - * lapl_id - Link access property list - * OUTPUTS - * attr_id - attribute identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * January, 2008 - * HISTORY - * N/A - * SOURCE - */ -int_f -h5aopen_by_idx_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, - hsize_t_f *n, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id) -/******/ -{ - char *c_obj_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if (NULL == (c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen))) - HGOTO_DONE(FAIL) - - /* - * Call H5Aopen_by_idx function. - */ - if ((*attr_id = (hid_t_f)H5Aopen_by_idx((hid_t)*loc_id, c_obj_name, (H5_index_t)*idx_type, - (H5_iter_order_t)*order, (hsize_t)*n, (hid_t)*aapl_id, - (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL) - -done: - if (c_obj_name) - HDfree(c_obj_name); - - return ret_value; -} - /****if* H5Af/h5aget_info_c * NAME * h5aget_info_c @@ -769,278 +549,6 @@ done: return ret_value; } -/****if* H5Af/h5acreate_by_name_c - * NAME - * h5acreate_by_name_c - * PURPOSE - * Call h5acreate_by_name - - * INPUTS - * - * loc_id - Object identifier - * obj_name - Name of object to which attribute is attached - * obj_namelen - name length - * attr_name - Attribute name - * attr_namelen - attribute name length - * type_id - Attribute datatype identifier - * space_id - Attribute dataspace identifier - * acpl_id - Attribute creation property list identifier (Currently not used.) - * aapl_id - Attribute access property list identifier (Currently not used.) - * lapl_id - Link access property list - * - * OUTPUTS - * - * attr - an attribute identifier - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February, 2008 - * HISTORY - * N/A - * SOURCE -*/ -int_f -h5acreate_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, - size_t_f *attr_namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *acpl_id, - hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id) -/******/ -{ - char *c_obj_name = NULL; /* Buffer to hold C string */ - char *c_attr_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen)) == NULL) - HGOTO_DONE(FAIL); - if ((c_attr_name = HD5f2cstring(attr_name, (size_t)*attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Acreate_by_name function. - */ - if ((*attr_id = (hid_t_f)H5Acreate_by_name((hid_t)*loc_id, c_obj_name, c_attr_name, (hid_t)*type_id, - (hid_t)*space_id, (hid_t)*acpl_id, (hid_t)*aapl_id, - (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_obj_name) - HDfree(c_obj_name); - if (c_attr_name) - HDfree(c_attr_name); - return ret_value; -} - -/****if* H5Af/h5aexists_c - * NAME - * h5aexists_c - * PURPOSE - * CAll h5aexists - * INPUTS - * - * obj_id - Object identifier - * attr_name - Attribute name - * OUTPUTS - * - * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February, 2008 - * HISTORY - * - * SOURCE - */ -int_f -h5aexists_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_exists) -/******/ -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Aexists function. - */ - if ((*attr_exists = (hid_t_f)H5Aexists((hid_t)*obj_id, c_name)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_name) - HDfree(c_name); - return ret_value; -} - -/****if* H5Af/h5aexists_by_name_c - * NAME - * h5aexists_by_name_c - * PURPOSE - * CAll H5Aexists_by_name - * INPUTS - * - * loc_id - Location identifier - * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) - * attr_name - Attribute name - * lapl_id - Link access property list identifier - * OUTPUTS - * - * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February, 2008 - * HISTORY - * - * SOURCE - */ -int_f -h5aexists_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, - size_t_f *attr_namelen, hid_t_f *lapl_id, int_f *attr_exists) -/******/ -{ - char *c_obj_name = NULL; /* Buffer to hold object name C string */ - char *c_attr_name = NULL; /* Buffer to hold attribute name C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen)) == NULL) - HGOTO_DONE(FAIL); - if ((c_attr_name = HD5f2cstring(attr_name, (size_t)*attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Aexists_by_name function. - */ - if ((*attr_exists = (int_f)H5Aexists_by_name((hid_t)*loc_id, c_obj_name, c_attr_name, (hid_t)*lapl_id)) < - 0) - HGOTO_DONE(FAIL); - -done: - if (c_obj_name) - HDfree(c_obj_name); - if (c_attr_name) - HDfree(c_attr_name); - return ret_value; -} - -/****if* H5Af/h5aopen_by_name_c - * NAME - * h5aopen_by_name_c - * PURPOSE - * Call H5Aopen_by_name - * INPUTS - * - * loc_id - Location identifier - * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) - * attr_name - Attribute name - * aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) - * lapl_id - Link access property list identifier - * OUTPUTS - * - * attr_id - attribute identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February, 2008 - * HISTORY - * - * SOURCE - */ -int_f -h5aopen_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, - size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id) -/******/ -{ - char *c_obj_name = NULL; /* Buffer to hold object name C string */ - char *c_attr_name = NULL; /* Buffer to hold attribute name C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen)) == NULL) - HGOTO_DONE(FAIL); - if ((c_attr_name = HD5f2cstring(attr_name, (size_t)*attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Aopen function. - */ - if ((*attr_id = (hid_t_f)H5Aopen_by_name((hid_t)*loc_id, c_obj_name, c_attr_name, (hid_t)*aapl_id, - (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_obj_name) - HDfree(c_obj_name); - if (c_attr_name) - HDfree(c_attr_name); - return ret_value; -} - -/****if* H5Af/h5arename_c - * NAME - * h5arename_c - * PURPOSE - * Calls H5Arename - * INPUTS - * loc_id - Object identifier - * old_attr_name - Prior attribute name - * old_attr_name_len - Prior attribute name length - * new_attr_name - New attribute name - * new_attr_name_len - New attribute name length - * OUTPUTS - * N/A - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * January, 2008 - * HISTORY - * N/A - * SOURCE - */ - -int_f -h5arename_c(hid_t_f *loc_id, _fcd old_attr_name, size_t_f *old_attr_namelen, _fcd new_attr_name, - size_t_f *new_attr_namelen) -/******/ -{ - char *c_old_attr_name = NULL; /* Buffer to hold C string */ - char *c_new_attr_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - /* - * Convert FORTRAN name to C name - */ - if ((c_old_attr_name = HD5f2cstring(old_attr_name, (size_t)*old_attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - if ((c_new_attr_name = HD5f2cstring(new_attr_name, (size_t)*new_attr_namelen)) == NULL) - HGOTO_DONE(FAIL); - - if (H5Arename((hid_t)*loc_id, c_old_attr_name, c_new_attr_name) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_old_attr_name) - HDfree(c_old_attr_name); - if (c_new_attr_name) - HDfree(c_new_attr_name); - return ret_value; -} /****if* H5Af/h5awrite_f_c * NAME * h5awrite_f_c diff --git a/fortran/src/H5Aff.F90 b/fortran/src/H5Aff.F90 index 75c92ab..2f1e6d0 100644 --- a/fortran/src/H5Aff.F90 +++ b/fortran/src/H5Aff.F90 @@ -77,6 +77,7 @@ MODULE H5A PRIVATE h5awrite_char_scalar, h5awrite_ptr PRIVATE h5aread_char_scalar, h5aread_ptr + #ifndef H5_DOXYGEN INTERFACE h5awrite_f MODULE PROCEDURE h5awrite_char_scalar @@ -117,6 +118,19 @@ MODULE H5A TYPE(C_PTR), VALUE :: buf END FUNCTION h5aread_f_c END INTERFACE + + INTERFACE + INTEGER(HID_T) FUNCTION H5Aopen(obj_id, attr_name, aapl_id_default) & + BIND(C,NAME='H5Aopen') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + INTEGER(HID_T), VALUE :: aapl_id_default + END FUNCTION H5Aopen + END INTERFACE + #endif CONTAINS @@ -124,7 +138,7 @@ CONTAINS !> !! \ingroup FH5A !! -!! \brief Creates a dataset as an attribute of a group, dataset, or named datatype +!! \brief Creates a dataset as an attribute of a group, dataset, or named datatype. !! !! \param loc_id Identifier of an object (group, dataset, or named datatype) attribute is attached to !! \param name Attribute name @@ -147,8 +161,8 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: attr_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: acpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: acpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id INTEGER(HID_T) :: acpl_id_default INTEGER(HID_T) :: aapl_id_default @@ -158,6 +172,7 @@ CONTAINS space_id, acpl_id_default, aapl_id_default) BIND(C,NAME='H5Acreate2') IMPORT :: C_CHAR IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: loc_id CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER(HID_T), INTENT(IN), VALUE :: type_id @@ -167,12 +182,13 @@ CONTAINS END FUNCTION H5Acreate2 END INTERFACE + c_name = TRIM(name)//C_NULL_CHAR + acpl_id_default = H5P_DEFAULT_F aapl_id_default = H5P_DEFAULT_F IF (PRESENT(acpl_id)) acpl_id_default = acpl_id IF (PRESENT(aapl_id)) aapl_id_default = aapl_id - c_name = TRIM(name)//C_NULL_CHAR attr_id = h5acreate2(loc_id, c_name, type_id, space_id, & acpl_id_default, aapl_id_default) @@ -184,10 +200,91 @@ CONTAINS !> !! \ingroup FH5A !! +!! \brief Asynchronously creates a dataset as an attribute of a group, dataset, or named datatype. +!! +!! \param loc_id Identifier of an object (group, dataset, or named datatype) attribute is attached to +!! \param name Attribute name +!! \param type_id Attribute datatype identifier +!! \param space_id Attribute dataspace identifier +!! \param attr_id Attribute identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param acpl_id Attribute creation property list identifier +!! \param aapl_id Attribute access property list identifier +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Acreate_async() +!! + SUBROUTINE h5acreate_async_f(loc_id, name, type_id, space_id, attr_id, es_id, & + hdferr, acpl_id, aapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT) :: attr_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: acpl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: aapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: acpl_id_default + INTEGER(HID_T) :: aapl_id_default + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + + INTERFACE + INTEGER(HID_T) FUNCTION H5Acreate_async(file, func, line, loc_id, name, type_id, & + space_id, acpl_id_default, aapl_id_default, es_id) BIND(C,NAME='H5Acreate_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: type_id + INTEGER(HID_T), VALUE :: space_id + INTEGER(HID_T), VALUE :: acpl_id_default + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Acreate_async + END INTERFACE + + acpl_id_default = H5P_DEFAULT_F + aapl_id_default = H5P_DEFAULT_F + IF (PRESENT(acpl_id)) acpl_id_default = acpl_id + IF (PRESENT(aapl_id)) aapl_id_default = aapl_id + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) + + c_name = TRIM(name)//C_NULL_CHAR + + attr_id = h5acreate_async(file_default, func_default, line_default, & + loc_id, c_name, type_id, space_id, & + acpl_id_default, aapl_id_default, es_id) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 + + END SUBROUTINE h5acreate_async_f + +!> +!! \ingroup FH5A +!! !! \brief Opens an attribute specified by name. !! -!! \param obj_id Identifier of a group, dataset, or named -!! datatype attribute to be attached to +!! \param obj_id Identifier of a group, dataset, or named datatype attribute to be attached to !! \param name Attribute name !! \param attr_id Attribute identifier !! \param hdferr \fortran_error @@ -203,17 +300,6 @@ CONTAINS CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name -! H5Aopen_name is deprecated - INTERFACE - INTEGER(HID_T) FUNCTION H5Aopen(obj_id, name, aapl_id) BIND(C,NAME='H5Aopen') - IMPORT :: C_CHAR - IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN), VALUE :: obj_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(HID_T), INTENT(IN), VALUE :: aapl_id - END FUNCTION H5Aopen - END INTERFACE - c_name = TRIM(name)//C_NULL_CHAR attr_id = H5Aopen(obj_id, c_name, H5P_DEFAULT_F) @@ -221,11 +307,15 @@ CONTAINS IF(attr_id.LT.0) hdferr = -1 END SUBROUTINE H5Aopen_name_f + +#ifndef H5_NO_DEPRECATED_SYMBOLS !> !! \ingroup FH5A !! !! \brief Opens the attribute specified by its index. !! +!! \deprecation_note{H5Aopen_by_idx_f()} +!! !! \param obj_id Identifier of a group, dataset, or named datatype an attribute to be attached to !! \param index Index of the attribute to open (zero-based) !! \param attr_id Attribute identifier @@ -233,27 +323,30 @@ CONTAINS !! !! See C API: @ref H5Aopen_idx() !! - SUBROUTINE H5Aopen_idx_f(obj_id, index, attr_id, hdferr) + SUBROUTINE h5aopen_idx_f(obj_id, index, attr_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(IN) :: index INTEGER(HID_T), INTENT(OUT) :: attr_id INTEGER, INTENT(OUT) :: hdferr INTERFACE - INTEGER(HID_T) FUNCTION H5Aopen_by_idx(obj_id, index) BIND(C,NAME='H5Aopen_by_idx') + INTEGER(HID_T) FUNCTION H5Aopen_idx(obj_id, index) BIND(C,NAME='H5Aopen_idx') IMPORT :: HID_T IMPORT :: C_INT - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER(C_INT), INTENT(IN) :: index - END FUNCTION H5Aopen_by_idx + IMPLICIT NONE + INTEGER(HID_T), VALUE :: obj_id + INTEGER(C_INT), VALUE :: index + END FUNCTION H5Aopen_idx END INTERFACE - attr_id = H5Aopen_by_idx(obj_id, INT(index, C_INT)) + attr_id = H5Aopen_idx(obj_id, INT(index, C_INT)) hdferr = 0 IF(attr_id.LT.0) hdferr = -1 - END SUBROUTINE H5Aopen_idx_f + END SUBROUTINE h5aopen_idx_f +#endif + !> !! \ingroup FH5A !! @@ -265,7 +358,7 @@ CONTAINS !! !! See C API: @ref H5Aget_space() !! - SUBROUTINE H5Aget_space_f(attr_id, space_id, hdferr) + SUBROUTINE h5aget_space_f(attr_id, space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(OUT) :: space_id @@ -283,7 +376,7 @@ CONTAINS hdferr = 0 IF(space_id.LT.0) hdferr = -1 - END SUBROUTINE H5Aget_space_f + END SUBROUTINE h5aget_space_f !> !! \ingroup FH5A !! @@ -295,7 +388,7 @@ CONTAINS !! !! See C API: @ref H5Aget_type() !! - SUBROUTINE H5Aget_type_f(attr_id, type_id, hdferr) + SUBROUTINE h5aget_type_f(attr_id, type_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(OUT) :: type_id @@ -313,7 +406,7 @@ CONTAINS hdferr = 0 IF(type_id.LT.0) hdferr = -1 - END SUBROUTINE H5Aget_type_f + END SUBROUTINE h5aget_type_f !> !! \ingroup FH5A !! @@ -337,6 +430,7 @@ CONTAINS BIND(C,NAME='h5aget_name_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(SIZE_T), INTENT(IN) :: size CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: buf @@ -379,16 +473,12 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER, INTENT(IN) :: idx_type - ! H5_INDEX_N_F - Number of indices defined - INTEGER, INTENT(IN) :: order - ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - ! H5_ITER_N_F - Number of iteration orders INTEGER(HSIZE_T), INTENT(IN) :: n CHARACTER(LEN=*), INTENT(OUT) :: name INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: size_default @@ -444,6 +534,7 @@ CONTAINS INTERFACE INTEGER FUNCTION h5aget_num_attrs_c(obj_id, attr_num) BIND(C,name='h5aget_num_attrs_c') IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id INTEGER, INTENT(OUT) :: attr_num END FUNCTION h5aget_num_attrs_c @@ -464,7 +555,7 @@ CONTAINS !! !! See C API: @ref H5Adelete() !! - SUBROUTINE H5Adelete_f(obj_id, name, hdferr) + SUBROUTINE h5adelete_f(obj_id, name, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(IN) :: name @@ -475,6 +566,7 @@ CONTAINS INTEGER FUNCTION H5Adelete_c(obj_id, name, namelen) BIND(C,NAME='h5adelete_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name INTEGER(SIZE_T) :: namelen @@ -483,7 +575,7 @@ CONTAINS namelen = LEN(name) hdferr = H5Adelete_c(obj_id, name, namelen) - END SUBROUTINE H5Adelete_f + END SUBROUTINE h5adelete_f !> !! \ingroup FH5A @@ -495,7 +587,7 @@ CONTAINS !! !! See C API: @ref H5Aclose() !! - SUBROUTINE H5Aclose_f(attr_id, hdferr) + SUBROUTINE h5aclose_f(attr_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER, INTENT(OUT) :: hdferr @@ -503,12 +595,61 @@ CONTAINS INTERFACE INTEGER FUNCTION H5Aclose(attr_id) BIND(C, NAME='H5Aclose') IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: attr_id END FUNCTION H5Aclose END INTERFACE hdferr = INT(H5Aclose(attr_id)) - END SUBROUTINE H5Aclose_f + END SUBROUTINE h5aclose_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously closes the specified attribute. +!! +!! \param attr_id Attribute identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Aclose_async() +!! + SUBROUTINE h5aclose_async_f(attr_id, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER FUNCTION H5Aclose_async(file, func, line, attr_id, es_id) BIND(C, NAME='H5Aclose_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: attr_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Aclose_async + END INTERFACE + + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = H5Aclose_async(file_default, func_default, line_default, attr_id, es_id) + + END SUBROUTINE h5aclose_async_f !> !! \ingroup FH5A @@ -521,7 +662,7 @@ CONTAINS !! !! See C API: @ref H5Aget_storage_size() !! - SUBROUTINE H5Aget_storage_size_f(attr_id, size, hdferr) + SUBROUTINE h5aget_storage_size_f(attr_id, size, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HSIZE_T), INTENT(OUT) :: size @@ -530,6 +671,7 @@ CONTAINS INTERFACE INTEGER(HSIZE_T) FUNCTION H5Aget_storage_size(attr_id) BIND(C,NAME='H5Aget_storage_size') IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: attr_id END FUNCTION H5Aget_storage_size END INTERFACE @@ -539,7 +681,7 @@ CONTAINS hdferr = 0 IF(size.LT.0) hdferr = -1 - END SUBROUTINE H5Aget_storage_size_f + END SUBROUTINE h5aget_storage_size_f !> !! \ingroup FH5A @@ -552,7 +694,7 @@ CONTAINS !! !! See C API: @ref H5Aget_create_plist() !! - SUBROUTINE H5Aget_create_plist_f(attr_id, creation_prop_id, hdferr) + SUBROUTINE h5aget_create_plist_f(attr_id, creation_prop_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(OUT) :: creation_prop_id @@ -560,6 +702,7 @@ CONTAINS INTERFACE INTEGER(HID_T) FUNCTION H5Aget_create_plist(attr_id) BIND(C,NAME='H5Aget_create_plist') IMPORT :: HID_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: attr_id END FUNCTION H5Aget_create_plist END INTERFACE @@ -569,68 +712,139 @@ CONTAINS hdferr = 0 IF(creation_prop_id.LT.0) hdferr = -1 - END SUBROUTINE H5Aget_create_plist_f + END SUBROUTINE h5aget_create_plist_f !> !! \ingroup FH5A !! !! \brief Renames an attribute !! -!! \param loc_id Location or object identifier; may be dataset or group +!! \param loc_id Location or object identifier; may be dataset or group or named datatype !! \param obj_name Name of object, relative to location, whose attribute is to be renamed !! \param old_attr_name Prior attribute name !! \param new_attr_name New attribute name -!! \param lapl_id Link access property list identifier !! \param hdferr \fortran_error +!! \param lapl_id Link access property list identifier !! !! See C API: @ref H5Arename_by_name() !! - SUBROUTINE H5Arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, & + SUBROUTINE h5arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, & hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name CHARACTER(LEN=*), INTENT(IN) :: old_attr_name CHARACTER(LEN=*), INTENT(IN) :: new_attr_name - INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: old_attr_namelen - INTEGER(SIZE_T) :: new_attr_namelen + CHARACTER(LEN=LEN_TRIM(obj_name) +1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(old_attr_name)+1,KIND=C_CHAR) :: c_old_attr_name + CHARACTER(LEN=LEN_TRIM(new_attr_name)+1,KIND=C_CHAR) :: c_new_attr_name INTERFACE - INTEGER FUNCTION H5Arename_by_name_c(loc_id, obj_name, obj_namelen, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & - lapl_id_default) BIND(C,NAME='h5arename_by_name_c') + INTEGER FUNCTION H5Arename_by_name(loc_id, obj_name, & + old_attr_name, new_attr_name, lapl_id_default) & + BIND(C,NAME='H5Arename_by_name') IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name - INTEGER(SIZE_T) :: obj_namelen - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: old_attr_name - INTEGER(SIZE_T) :: old_attr_namelen - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_attr_name - INTEGER(SIZE_T) :: new_attr_namelen - INTEGER(HID_T) :: lapl_id_default + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: old_attr_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: new_attr_name + INTEGER(HID_T), VALUE :: lapl_id_default - END FUNCTION H5Arename_by_name_c + END FUNCTION H5Arename_by_name END INTERFACE - obj_namelen = LEN(obj_name) - old_attr_namelen = LEN(old_attr_name) - new_attr_namelen = LEN(new_attr_name) + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_old_attr_name = TRIM(old_attr_name)//C_NULL_CHAR + c_new_attr_name = TRIM(new_attr_name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default=lapl_id + + hdferr = 0 + hdferr = H5Arename_by_name(loc_id, c_obj_name, c_old_attr_name, c_new_attr_name, lapl_id_default) + + END SUBROUTINE h5arename_by_name_f +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously renames an attribute +!! +!! \param loc_id Location or object identifier; may be dataset or group or named datatype +!! \param obj_name Name of object, relative to location, whose attribute is to be renamed +!! \param old_attr_name Prior attribute name +!! \param new_attr_name New attribute name +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list identifier +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Arename_by_name() +!! + SUBROUTINE h5arename_by_name_async_f(loc_id, obj_name, old_attr_name, new_attr_name, es_id, & + hdferr, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + CHARACTER(LEN=*), INTENT(IN) :: old_attr_name + CHARACTER(LEN=*), INTENT(IN) :: new_attr_name + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + CHARACTER(LEN=LEN_TRIM(obj_name) +1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(old_attr_name)+1,KIND=C_CHAR) :: c_old_attr_name + CHARACTER(LEN=LEN_TRIM(new_attr_name)+1,KIND=C_CHAR) :: c_new_attr_name + + INTERFACE + INTEGER FUNCTION H5Arename_by_name_async(file, func, line, loc_id, obj_name, & + old_attr_name, new_attr_name, lapl_id_default, es_id) & + BIND(C,NAME='H5Arename_by_name_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: old_attr_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: new_attr_name + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Arename_by_name_async + END INTERFACE + + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_old_attr_name = TRIM(old_attr_name)//C_NULL_CHAR + c_new_attr_name = TRIM(new_attr_name)//C_NULL_CHAR lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default=lapl_id - hdferr = H5Arename_by_name_c(loc_id, obj_name, obj_namelen, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & - lapl_id_default) + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = 0 + hdferr = H5Arename_by_name_async(file_default, func_default, line_default, & + loc_id, c_obj_name, c_old_attr_name, c_new_attr_name, lapl_id_default, es_id) - END SUBROUTINE H5Arename_by_name_f + END SUBROUTINE h5arename_by_name_async_f !> !! \ingroup FH5A @@ -646,45 +860,102 @@ CONTAINS !! !! See C API: @ref H5Aopen() !! - SUBROUTINE H5Aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id) + SUBROUTINE h5aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(IN) :: attr_name INTEGER(HID_T), INTENT(OUT) :: attr_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T) :: aapl_id_default + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name - INTEGER(SIZE_T) :: attr_namelen + c_attr_name = TRIM(attr_name)//C_NULL_CHAR + + aapl_id_default = H5P_DEFAULT_F + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + + attr_id = INT(H5Aopen(obj_id, c_attr_name, aapl_id_default), HID_T) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 + + END SUBROUTINE h5aopen_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously opens an attribute for an object specified by object identifier and attribute name. +!! +!! \param obj_id Identifier for object to which attribute is attached +!! \param attr_name Name of attribute to open +!! \param attr_id Attribute identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param aapl_id Attribute access property list +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Aopen_async() +!! + SUBROUTINE h5aopen_async_f(obj_id, attr_name, attr_id, es_id, hdferr, aapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(IN) :: attr_name + INTEGER(HID_T), INTENT(OUT) :: attr_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN) , OPTIONAL :: line + + INTEGER(HID_T) :: aapl_id_default + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name INTERFACE - INTEGER FUNCTION H5Aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) & - BIND(C,NAME='h5aopen_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name - INTEGER(HID_T) :: aapl_id_default - INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION H5Aopen_c + INTEGER(HID_T) FUNCTION H5Aopen_async(file, func, line, & + obj_id, attr_name, aapl_id_default, es_id) BIND(C,NAME='H5Aopen_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Aopen_async END INTERFACE - attr_namelen = LEN(attr_name) + c_attr_name = TRIM(attr_name)//C_NULL_CHAR aapl_id_default = H5P_DEFAULT_F IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) - hdferr = H5Aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) + attr_id = INT(H5Aopen_async(file_default, func_default, line_default, & + obj_id, c_attr_name, aapl_id_default, es_id), HID_T) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 - END SUBROUTINE H5Aopen_f + END SUBROUTINE h5aopen_async_f !> !! \ingroup FH5A !! !! \brief Deletes an attribute from an object according to index order !! -!! \param loc_id Location or object identifier; may be dataset or group +!! \param loc_id Location or object identifier; may be dataset or group or named datatype !! \param obj_name Name of object, relative to location, from which attribute is to be removed !! \param idx_type Type of index; Possible values are: !! \li H5_INDEX_UNKNOWN_F = -1 - Unknown index type @@ -705,7 +976,7 @@ CONTAINS !! !! See C API: @ref H5Adelete_by_idx() !! - SUBROUTINE H5Adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id) + SUBROUTINE h5adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name @@ -713,7 +984,7 @@ CONTAINS INTEGER, INTENT(IN) :: order INTEGER(HSIZE_T), INTENT(IN) :: n INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(SIZE_T) :: obj_namelen INTEGER(HID_T) :: lapl_id_default @@ -739,7 +1010,7 @@ CONTAINS obj_namelen = LEN(obj_name) hdferr = H5Adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) - END SUBROUTINE H5Adelete_by_idx_f + END SUBROUTINE h5adelete_by_idx_f !> !! \ingroup FH5A @@ -760,7 +1031,7 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: obj_name CHARACTER(LEN=*), INTENT(IN) :: attr_name INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(SIZE_T) :: attr_namelen INTEGER(SIZE_T) :: obj_namelen @@ -771,6 +1042,7 @@ CONTAINS BIND(C,NAME='h5adelete_by_name_c') IMPORT :: C_CHAR IMPORT :: HID_T, SIZE_T + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name @@ -788,7 +1060,7 @@ CONTAINS hdferr = H5Adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) - END SUBROUTINE H5Adelete_by_name_f + END SUBROUTINE h5adelete_by_name_f !> !! \ingroup FH5A @@ -817,7 +1089,7 @@ CONTAINS !! !! See C API: @ref H5Aopen_by_idx() !! - SUBROUTINE H5Aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id) + SUBROUTINE h5aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name @@ -828,40 +1100,134 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: attr_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id - INTEGER(SIZE_T) :: obj_namelen + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(HID_T) :: aapl_id_default INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name INTERFACE - INTEGER FUNCTION H5Aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & - aapl_id_default, lapl_id_default, attr_id) BIND(C,NAME='h5aopen_by_idx_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T, HSIZE_T - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name - INTEGER, INTENT(IN) :: idx_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION H5Aopen_by_idx_c + INTEGER(HID_T) FUNCTION H5Aopen_by_idx(loc_id, obj_name, idx_type, order, n, & + aapl_id_default, lapl_id_default) BIND(C,NAME='H5Aopen_by_idx') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + INTEGER(C_INT), VALUE :: idx_type + INTEGER(C_INT), VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Aopen_by_idx END INTERFACE - obj_namelen = LEN(obj_name) + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + + aapl_id_default = H5P_DEFAULT_F + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + attr_id = INT(H5Aopen_by_idx(loc_id, c_obj_name, INT(idx_type, C_INT), INT(order, C_INT), n, & + aapl_id_default, lapl_id_default), HID_T) + + END SUBROUTINE h5aopen_by_idx_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously opens an existing attribute that is attached to an object specified by location and name. +!! +!! \param loc_id Location of object to which attribute is attached. +!! \param obj_name Name of object to which attribute is attached, relative to location. +!! \param idx_type Type of index; Possible values are: +!! \li H5_INDEX_UNKNOWN_F = -1 - Unknown index type +!! \li H5_INDEX_NAME_F - Index on names +!! \li H5_INDEX_CRT_ORDER_F - Index on creation order +!! \li H5_INDEX_N_F - Number of indices defined +!! +!! \param order Order in which to iterate over index; Possible values are: +!! \li H5_ITER_UNKNOWN_F - Unknown order +!! \li H5_ITER_INC_F - Increasing order +!! \li H5_ITER_DEC_F - Decreasing order +!! \li H5_ITER_NATIVE_F - No particular order, whatever is fastest +!! \li H5_ITER_N_F - Number of iteration orders +!! \param n Attribute’s position in index. +!! \param attr_id Attribute identifier. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param aapl_id Attribute access property list. +!! \param lapl_id Link access property list. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Aopen_by_idx_async() +!! + SUBROUTINE h5aopen_by_idx_async_f(loc_id, obj_name, idx_type, order, n, attr_id, es_id, hdferr, & + aapl_id, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + INTEGER, INTENT(IN) :: idx_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T), INTENT(OUT) :: attr_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN) , OPTIONAL :: line + + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name + + INTERFACE + INTEGER(HID_T) FUNCTION H5Aopen_by_idx_async(file, func, line, & + loc_id, obj_name, idx_type, order, n, & + aapl_id_default, lapl_id_default, es_id) BIND(C,NAME='H5Aopen_by_idx_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + INTEGER(C_INT), VALUE :: idx_type + INTEGER(C_INT), VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Aopen_by_idx_async + END INTERFACE + + c_obj_name = TRIM(obj_name)//C_NULL_CHAR aapl_id_default = H5P_DEFAULT_F IF(PRESENT(aapl_id)) aapl_id_default = aapl_id lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) - hdferr = H5Aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & - aapl_id_default, lapl_id_default, attr_id) + attr_id = INT(H5Aopen_by_idx_async(file_default, func_default, line_default, & + loc_id, c_obj_name, INT(idx_type, C_INT), INT(order, C_INT), n, & + aapl_id_default, lapl_id_default, es_id), HID_T) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 - END SUBROUTINE H5Aopen_by_idx_f + END SUBROUTINE h5aopen_by_idx_async_f !> !! \ingroup FH5A @@ -878,7 +1244,7 @@ CONTAINS !! !! See C API: @ref H5Aget_info() !! - SUBROUTINE H5Aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr) + SUBROUTINE h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id LOGICAL, INTENT(OUT) :: f_corder_valid @@ -907,12 +1273,12 @@ CONTAINS IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - END SUBROUTINE H5Aget_info_f + END SUBROUTINE h5aget_info_f !> !! \ingroup FH5A !! -!! \brief Retrieves attribute information, by attribute index position +!! \brief Retrieves attribute information by attribute index position !! !! \param loc_id Location of object to which attribute is attached !! \param obj_name Name of object to which attribute is attached, relative to location @@ -928,7 +1294,7 @@ CONTAINS !! !! See C API: @ref H5Aget_info_by_idx() !! - SUBROUTINE H5Aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, & + SUBROUTINE h5aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, & f_corder_valid, corder, cset, data_size, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id @@ -946,7 +1312,7 @@ CONTAINS INTEGER, INTENT(OUT) :: cset INTEGER(HSIZE_T), INTENT(OUT) :: data_size INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER :: corder_valid INTEGER(SIZE_T) :: obj_namelen INTEGER(HID_T) :: lapl_id_default @@ -982,7 +1348,7 @@ CONTAINS f_corder_valid =.FALSE. IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - END SUBROUTINE H5Aget_info_by_idx_f + END SUBROUTINE h5aget_info_by_idx_f !> !! \ingroup FH5A @@ -1001,7 +1367,7 @@ CONTAINS !! !! See C API: @ref H5Aget_info_by_name() !! - SUBROUTINE H5Aget_info_by_name_f(loc_id, obj_name, attr_name, & + SUBROUTINE h5aget_info_by_name_f(loc_id, obj_name, attr_name, & f_corder_valid, corder, cset, data_size, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id @@ -1014,7 +1380,7 @@ CONTAINS INTEGER, INTENT(OUT) :: cset INTEGER(HSIZE_T), INTENT(OUT) :: data_size INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER :: corder_valid INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: attr_namelen @@ -1052,7 +1418,7 @@ CONTAINS f_corder_valid =.FALSE. IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - END SUBROUTINE H5Aget_info_by_name_f + END SUBROUTINE h5aget_info_by_name_f !> !! \ingroup FH5A @@ -1072,7 +1438,7 @@ CONTAINS !! !! See C API: @ref H5Acreate_by_name() !! - SUBROUTINE H5Acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, & + SUBROUTINE h5acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, & acpl_id, aapl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id @@ -1086,37 +1452,126 @@ CONTAINS INTEGER(HID_T), INTENT(IN), OPTIONAL :: acpl_id INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen INTEGER(HID_T) :: acpl_id_default INTEGER(HID_T) :: aapl_id_default INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name INTERFACE - INTEGER FUNCTION H5Acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) & - BIND(C,NAME='h5acreate_by_name_c') + INTEGER(HID_T) FUNCTION H5Acreate_by_name(loc_id, obj_name, attr_name, & + type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default) & + BIND(C,NAME='H5Acreate_by_name') IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T) :: acpl_id_default - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + INTEGER(HID_T), VALUE :: type_id + INTEGER(HID_T), VALUE :: space_id + INTEGER(HID_T), VALUE :: acpl_id_default + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Acreate_by_name + END INTERFACE + + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_attr_name = TRIM(attr_name)//C_NULL_CHAR + + acpl_id_default = H5P_DEFAULT_F + aapl_id_default = H5P_DEFAULT_F + lapl_id_default = H5P_DEFAULT_F + + IF(PRESENT(acpl_id)) acpl_id_default = acpl_id + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + attr = INT(H5Acreate_by_name(loc_id, c_obj_name, c_attr_name, type_id, space_id, & + acpl_id_default, aapl_id_default, lapl_id_default), HID_T) + + hdferr = 0 + IF(attr.LT.0) hdferr = -1 + + END SUBROUTINE h5acreate_by_name_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously creates an attribute attached to a specified object +!! +!! \param loc_id Location or object identifier; may be dataset or group +!! \param obj_name Name, relative to loc_id, of object that attribute is to be attached to +!! \param attr_name Attribute name +!! \param type_id Attribute datatype identifier +!! \param space_id Attribute dataspace identifier +!! \param attr An attribute identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param acpl_id Attribute creation property list identifier (Currently not used.) +!! \param aapl_id Attribute access property list identifier (Currently not used.) +!! \param lapl_id Link access property list +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Acreate_by_name_async() +!! + SUBROUTINE h5acreate_by_name_async_f(loc_id, obj_name, attr_name, type_id, space_id, attr, es_id, hdferr, & + acpl_id, aapl_id, lapl_id, file, func, line) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + CHARACTER(LEN=*), INTENT(IN) :: attr_name + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT) :: attr + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + + INTEGER(HID_T), INTENT(IN), OPTIONAL :: acpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line - END FUNCTION H5Acreate_by_name_c + INTEGER(HID_T) :: acpl_id_default + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Acreate_by_name_async(file, func, line, loc_id, obj_name, attr_name, & + type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, es_id) & + BIND(C,NAME='H5Acreate_by_name_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + INTEGER(HID_T), VALUE :: type_id + INTEGER(HID_T), VALUE :: space_id + INTEGER(HID_T), VALUE :: acpl_id_default + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Acreate_by_name_async END INTERFACE - obj_namelen = LEN(obj_name) - attr_namelen = LEN(attr_name) + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_attr_name = TRIM(attr_name)//C_NULL_CHAR acpl_id_default = H5P_DEFAULT_F aapl_id_default = H5P_DEFAULT_F @@ -1125,10 +1580,18 @@ CONTAINS IF(PRESENT(acpl_id)) acpl_id_default = acpl_id IF(PRESENT(aapl_id)) aapl_id_default = aapl_id IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + attr = H5Acreate_by_name_async(file_default, func_default, line_default, & + loc_id, c_obj_name, c_attr_name, & + type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, es_id) + + hdferr = 0 + IF(attr.LT.0) hdferr = -1 - hdferr = H5Acreate_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) - END SUBROUTINE H5Acreate_by_name_f + END SUBROUTINE h5acreate_by_name_async_f !> !! \ingroup FH5A @@ -1142,35 +1605,94 @@ CONTAINS !! !! See C API: @ref H5Aexists() !! - SUBROUTINE H5Aexists_f(obj_id, attr_name, attr_exists, hdferr) + SUBROUTINE h5aexists_f(obj_id, attr_name, attr_exists, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER(HID_T), INTENT(IN) :: obj_id CHARACTER(LEN=*), INTENT(IN) :: attr_name LOGICAL, INTENT(OUT) :: attr_exists INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T) :: attr_exists_c - INTEGER(SIZE_T) :: attr_namelen + + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name + INTEGER(C_INT) :: attr_exists_c INTERFACE - INTEGER FUNCTION H5Aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) BIND(C,NAME='h5aexists_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + INTEGER(C_INT) FUNCTION H5Aexists(obj_id, attr_name) BIND(C,NAME='H5Aexists') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name - INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T) :: attr_exists_c - END FUNCTION H5Aexists_c + INTEGER(HID_T), VALUE :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + END FUNCTION H5Aexists END INTERFACE - attr_namelen = LEN(attr_name) + c_attr_name = TRIM(attr_name)//C_NULL_CHAR - hdferr = H5Aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) + attr_exists_c = H5Aexists(obj_id, c_attr_name) attr_exists = .FALSE. IF(attr_exists_c.GT.0) attr_exists = .TRUE. - END SUBROUTINE H5Aexists_f + hdferr = 0 + IF(attr_exists_c.LT.0) hdferr = -1 + + END SUBROUTINE h5aexists_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously determines whether an attribute with a given name exists on an object +!! +!! \param obj_id Object identifier +!! \param attr_name Attribute name +!! \param attr_exists Pointer to attribute exists status, must be of type LOGICAL(C_BOOL) and initialize to .FALSE. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Aexists_async() +!! + SUBROUTINE h5aexists_async_f(obj_id, attr_name, attr_exists, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(IN) :: attr_name + TYPE(C_PTR) , INTENT(INOUT) :: attr_exists + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Aexists_async(file, func, line, & + obj_id, attr_name, exists, es_id) BIND(C,NAME='H5Aexists_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + TYPE(C_PTR) , VALUE :: exists + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Aexists_async + END INTERFACE + + c_attr_name = TRIM(attr_name)//C_NULL_CHAR + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Aexists_async(file_default, func_default, line_default, obj_id, c_attr_name, attr_exists, es_id)) + + END SUBROUTINE h5aexists_async_f !> !! \ingroup FH5A @@ -1186,48 +1708,120 @@ CONTAINS !! !! See C API: @ref H5Aexists_by_name() !! - SUBROUTINE H5Aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id) + SUBROUTINE h5aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name CHARACTER(LEN=*), INTENT(IN) :: attr_name LOGICAL, INTENT(OUT) :: attr_exists INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id - INTEGER :: attr_exists_c - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + INTEGER(C_INT) :: attr_exists_c INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name INTERFACE - INTEGER FUNCTION H5Aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - lapl_id_default, attr_exists_c) BIND(C,NAME='h5aexists_by_name_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + INTEGER(C_INT) FUNCTION H5Aexists_by_name(loc_id, obj_name, attr_name, lapl_id_default) & + BIND(C,NAME='H5Aexists_by_name') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T), INTENT(IN) :: lapl_id_default - INTEGER, INTENT(OUT) :: attr_exists_c - END FUNCTION H5Aexists_by_name_c + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Aexists_by_name END INTERFACE - attr_namelen = LEN(attr_name) - obj_namelen = LEN(obj_name) + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_attr_name = TRIM(attr_name)//C_NULL_CHAR lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = H5Aexists_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default, attr_exists_c) + attr_exists_c = H5Aexists_by_name(loc_id, c_obj_name, c_attr_name, lapl_id_default) attr_exists = .FALSE. IF(attr_exists_c.GT.0) attr_exists = .TRUE. - END SUBROUTINE H5Aexists_by_name_f + hdferr = 0 + IF(attr_exists_c.LT.0) hdferr = -1 + + END SUBROUTINE h5aexists_by_name_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously determines whether an attribute with a given name exists on an object +!! +!! \param loc_id Location identifier +!! \param obj_name Object name either relative to loc_id, absolute from the file’s root group, or '. '(a dot) +!! \param attr_name Attribute name +!! \param attr_exists Pointer to attribute exists status, must be of type LOGICAL(C_BOOL) and initialize to .FALSE. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list identifier +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Aexists_by_name_async() +!! + SUBROUTINE h5aexists_by_name_async_f(loc_id, obj_name, attr_name, attr_exists, es_id, hdferr, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER (HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + CHARACTER(LEN=*), INTENT(IN) :: attr_name + TYPE(C_PTR) , INTENT(INOUT) :: attr_exists + INTEGER (HID_T), INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER (HID_T), INTENT(IN) , OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN) , OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Aexists_by_name_async(file, func, line, & + loc_id, obj_name, attr_name, exists, lapl_id_default, es_id) & + BIND(C,NAME='H5Aexists_by_name_async') + IMPORT :: C_CHAR, C_PTR, C_INT + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + TYPE(C_PTR) , VALUE :: exists + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Aexists_by_name_async + END INTERFACE + + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_attr_name = TRIM(attr_name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Aexists_by_name_async(file_default, func_default, line_default, & + loc_id, c_obj_name, c_attr_name, attr_exists, lapl_id_default, es_id)) + + END SUBROUTINE h5aexists_by_name_async_f + !> !! \ingroup FH5A !! @@ -1243,50 +1837,129 @@ CONTAINS !! !! See C API: @ref H5Aopen_by_name() !! - SUBROUTINE H5Aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id) + SUBROUTINE h5aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name CHARACTER(LEN=*), INTENT(IN) :: attr_name INTEGER(HID_T), INTENT(OUT) :: attr_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + INTEGER(HID_T) :: aapl_id_default INTEGER(HID_T) :: lapl_id_default - - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: attr_namelen + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name INTERFACE - INTEGER FUNCTION H5Aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - aapl_id_default, lapl_id_default, attr_id) BIND(C,NAME='h5aopen_by_name_c') + INTEGER(HID_T) FUNCTION H5Aopen_by_name(loc_id, obj_name, attr_name, aapl_id_default, lapl_id_default) & + BIND(C,NAME='H5Aopen_by_name') IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name - INTEGER(SIZE_T), INTENT(IN) :: obj_namelen - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: attr_name - INTEGER(SIZE_T), INTENT(IN) :: attr_namelen - INTEGER(HID_T) :: aapl_id_default - INTEGER(HID_T) :: lapl_id_default - INTEGER(HID_T), INTENT(OUT) :: attr_id - END FUNCTION H5Aopen_by_name_c + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Aopen_by_name END INTERFACE - attr_namelen = LEN(attr_name) - obj_namelen = LEN(obj_name) + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_attr_name = TRIM(attr_name)//C_NULL_CHAR aapl_id_default = H5P_DEFAULT_F lapl_id_default = H5P_DEFAULT_F IF(PRESENT(aapl_id)) aapl_id_default = aapl_id IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = H5Aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & - aapl_id_default, lapl_id_default, attr_id) + attr_id = INT(H5Aopen_by_name(loc_id, c_obj_name, c_attr_name, aapl_id_default, lapl_id_default), HID_T) - END SUBROUTINE H5Aopen_by_name_f + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 + + END SUBROUTINE h5aopen_by_name_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously opens an attribute for an object by object name and attribute name. +!! +!! \param loc_id Location from which to find object to which attribute is attached +!! \param obj_name Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) +!! \param attr_name Attribute name +!! \param attr_id Attribute identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param aapl_id Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) +!! \param lapl_id Link access property list identifier +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Aopen_by_name_async() +!! + SUBROUTINE h5aopen_by_name_async_f(loc_id, obj_name, attr_name, attr_id, es_id, hdferr, & + aapl_id, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + CHARACTER(LEN=*), INTENT(IN) :: attr_name + INTEGER(HID_T), INTENT(OUT) :: attr_id + INTEGER(HID_T), INTENT(IN) :: es_id + + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: aapl_id_default + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + CHARACTER(LEN=LEN_TRIM(obj_name)+1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(attr_name)+1,KIND=C_CHAR) :: c_attr_name + + INTERFACE + INTEGER(HID_T) FUNCTION H5Aopen_by_name_async(file, func, line, loc_id, obj_name, attr_name, & + aapl_id_default, lapl_id_default, es_id) BIND(C,NAME='H5Aopen_by_name_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: attr_name + INTEGER(HID_T), VALUE :: aapl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Aopen_by_name_async + END INTERFACE + + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_attr_name = TRIM(attr_name)//C_NULL_CHAR + + aapl_id_default = H5P_DEFAULT_F + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(aapl_id)) aapl_id_default = aapl_id + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + attr_id = INT(H5Aopen_by_name_async(file_default, func_default, line_default, & + loc_id, c_obj_name, c_attr_name, aapl_id_default, lapl_id_default, es_id), HID_T) + + hdferr = 0 + IF(attr_id.LT.0) hdferr = -1 + + END SUBROUTINE h5aopen_by_name_async_f !> !! \ingroup FH5A @@ -1300,36 +1973,209 @@ CONTAINS !! !! See C API: @ref H5Arename() !! - SUBROUTINE H5Arename_f(loc_id, old_attr_name, new_attr_name, hdferr) + SUBROUTINE h5arename_f(loc_id, old_attr_name, new_attr_name, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: old_attr_name CHARACTER(LEN=*), INTENT(IN) :: new_attr_name INTEGER, INTENT(OUT) :: hdferr - INTEGER(SIZE_T) :: old_attr_namelen - INTEGER(SIZE_T) :: new_attr_namelen + + CHARACTER(LEN=LEN_TRIM(old_attr_name)+1,KIND=C_CHAR) :: c_old_attr_name + CHARACTER(LEN=LEN_TRIM(new_attr_name)+1,KIND=C_CHAR) :: c_new_attr_name INTERFACE - INTEGER FUNCTION H5Arename_c(loc_id, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) BIND(C,NAME='h5arename_c') + INTEGER FUNCTION H5Arename(loc_id, old_attr_name, new_attr_name) & + BIND(C,NAME='H5Arename') IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: old_attr_name + CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_attr_name + END FUNCTION H5Arename + END INTERFACE + + c_old_attr_name = TRIM(old_attr_name)//C_NULL_CHAR + c_new_attr_name = TRIM(new_attr_name)//C_NULL_CHAR + + hdferr = H5Arename(loc_id, c_old_attr_name, c_new_attr_name) + + END SUBROUTINE h5arename_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously renames an attribute +!! +!! \param loc_id Location or object identifier; may be dataset or group +!! \param old_attr_name Prior attribute name +!! \param new_attr_name New attribute name +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Arename_async() +!! + SUBROUTINE h5arename_async_f(loc_id, old_attr_name, new_attr_name, es_id, hdferr, & + file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: old_attr_name + CHARACTER(LEN=*), INTENT(IN) :: new_attr_name + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + CHARACTER(LEN=LEN_TRIM(old_attr_name)+1,KIND=C_CHAR) :: c_old_attr_name + CHARACTER(LEN=LEN_TRIM(new_attr_name)+1,KIND=C_CHAR) :: c_new_attr_name + + INTERFACE + INTEGER FUNCTION H5Arename_async(file, func, line, loc_id, old_attr_name, new_attr_name, es_id) & + BIND(C,NAME='H5Arename_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: old_attr_name - INTEGER(SIZE_T) :: old_attr_namelen CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: new_attr_name - INTEGER(SIZE_T) :: new_attr_namelen - END FUNCTION H5Arename_c + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Arename_async + END INTERFACE + + c_old_attr_name = TRIM(old_attr_name)//C_NULL_CHAR + c_new_attr_name = TRIM(new_attr_name)//C_NULL_CHAR + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = H5Arename_async(file_default, func_default, line_default, & + loc_id, c_old_attr_name, c_new_attr_name, es_id) + + END SUBROUTINE h5arename_async_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously reads an attribute. +!! +!! \param attr_id Identifier of an attribute to read. +!! \param memtype_id Identifier of the attribute datatype (in memory). +!! \param buf Buffer for data to be read. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Aread_async() +!! + + SUBROUTINE h5aread_async_f(attr_id, mem_type_id, buf, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR) , INTENT(OUT) :: buf + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER FUNCTION H5Aread_async(file, func, line, attr_id, mem_type_id, buf, es_id) & + BIND(C,NAME='H5Aread_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: attr_id + INTEGER(HID_T), VALUE :: mem_type_id + TYPE(C_PTR) , VALUE :: buf + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Aread_async + END INTERFACE + + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = H5Aread_async(file_default, func_default, line_default, attr_id, mem_type_id, buf, es_id) + + END SUBROUTINE h5aread_async_f + +!> +!! \ingroup FH5A +!! +!! \brief Asynchronously writes an attribute. +!! +!! \param attr_id Identifier of an attribute to read. +!! \param memtype_id Identifier of the attribute datatype (in memory). +!! \param buf Data to be written. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Awrite_async() +!! + + SUBROUTINE h5awrite_async_f(attr_id, mem_type_id, buf, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR) , INTENT(IN) :: buf + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER FUNCTION H5Awrite_async(file, func, line, attr_id, mem_type_id, buf, es_id) & + BIND(C,NAME='H5Awrite_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: attr_id + INTEGER(HID_T), VALUE :: mem_type_id + TYPE(C_PTR) , VALUE :: buf + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Awrite_async END INTERFACE - old_attr_namelen = LEN(old_attr_name) - new_attr_namelen = LEN(new_attr_name) + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) - hdferr = H5Arename_c(loc_id, & - old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) + hdferr = H5Awrite_async(file_default, func_default, line_default, attr_id, mem_type_id, buf, es_id) - END SUBROUTINE H5Arename_f + END SUBROUTINE h5awrite_async_f #ifdef H5_DOXYGEN @@ -1425,7 +2271,7 @@ CONTAINS #else - SUBROUTINE H5Awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + SUBROUTINE h5awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1435,9 +2281,9 @@ CONTAINS CALL H5Awrite_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), dims, hdferr) - END SUBROUTINE H5Awrite_char_scalar + END SUBROUTINE h5awrite_char_scalar - SUBROUTINE H5Awrite_char_scalar_fix(attr_id, memtype_id, buf, buf_len, dims, hdferr) + SUBROUTINE h5awrite_char_scalar_fix(attr_id, memtype_id, buf, buf_len, dims, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1451,9 +2297,9 @@ CONTAINS hdferr = H5Awrite_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE H5Awrite_char_scalar_fix + END SUBROUTINE h5awrite_char_scalar_fix - SUBROUTINE H5Awrite_ptr(attr_id, mem_type_id, buf, hdferr) + SUBROUTINE h5awrite_ptr(attr_id, mem_type_id, buf, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1462,9 +2308,9 @@ CONTAINS hdferr = H5Awrite_f_c(attr_id, mem_type_id, buf) - END SUBROUTINE H5Awrite_ptr + END SUBROUTINE h5awrite_ptr - SUBROUTINE H5Aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + SUBROUTINE h5aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: memtype_id @@ -1489,18 +2335,18 @@ CONTAINS hdferr = H5Aread_f_c(attr_id, memtype_id, f_ptr) - END SUBROUTINE H5Aread_char_scalar_fix + END SUBROUTINE h5aread_char_scalar_fix - SUBROUTINE H5Aread_ptr(attr_id, mem_type_id, buf, hdferr) + SUBROUTINE h5aread_ptr(attr_id, mem_type_id, buf, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id INTEGER(HID_T), INTENT(IN) :: mem_type_id - TYPE(C_PTR), INTENT(INOUT), TARGET :: buf + TYPE(C_PTR), INTENT(INOUT) :: buf INTEGER, INTENT(OUT) :: hdferr hdferr = H5Aread_f_c(attr_id, mem_type_id, buf) - END SUBROUTINE H5Aread_ptr + END SUBROUTINE h5aread_ptr #endif diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index e92e6a8..3df2fbf 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -20,111 +20,6 @@ #include "H5f90.h" -/****if* H5Df/h5dcreate_c - * NAME - * h5dcreate_c - * PURPOSE - * Call H5Dcreate2 to create a dataset - * INPUTS - * loc_id - file or group identifier - * name - name of the dataset - * namelen - name length - * type_id - datatype identifier - * space_id - dataspace identifier - * crt_pr - identifier of creation property list - * OUTPUTS - * dset_id - dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, August 4, 1999 - * HISTORY - * - Added optional parameters introduced in version 1.8 - * February, 2008 - * SOURCE - */ -int_f -h5dcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *lcpl_id, - hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id) -/******/ -{ - char *c_name = NULL; - hid_t c_dset_id; - int ret_value = -1; - - /* - * Convert FORTRAN name to C name - */ - if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - goto DONE; - - /* - * Call H5Dcreate2 function. - */ - if ((c_dset_id = H5Dcreate2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*space_id, (hid_t)*lcpl_id, - (hid_t)*dcpl_id, (hid_t)*dapl_id)) < 0) - goto DONE; - *dset_id = (hid_t_f)c_dset_id; - - ret_value = 0; - -DONE: - if (c_name) - HDfree(c_name); - return ret_value; -} - -/****if* H5Df/h5dopen_c - * NAME - * h5dopen_c - * PURPOSE - * Call H5Dopen2 to open a dataset - * INPUTS - * loc_id - file or group identifier - * name - name of the dataset - * namelen - name length - * dapl_id - Dataset access property list - * OUTPUTS - * dset_id - dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, August 4, 1999 - * HISTORY - * Added 1.8 parameter: dapl_id - * SOURCE - */ -int_f -h5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id) -/******/ -{ - char *c_name = NULL; - hid_t c_dset_id; - int ret_value = -1; - - /* - * Convert FORTRAN name to C name - */ - if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - goto DONE; - - /* - * Call H5Dopen2 function. - */ - if ((c_dset_id = H5Dopen2((hid_t)*loc_id, c_name, (hid_t)*dapl_id)) < 0) - goto DONE; - - *dset_id = (hid_t_f)c_dset_id; - ret_value = 0; - -DONE: - if (c_name) - HDfree(c_name); - return ret_value; -} - /****if* H5Df/h5dwrite_ref_reg_c * NAME * h5dwrite_ref_reg_c @@ -268,71 +163,6 @@ h5dread_ref_reg_c(hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, return ret_value; } -/****if* H5Df/h5dclose_c - * NAME - * h5dclose_c - * PURPOSE - * Call H5Dclose to close a dataset - * INPUTS - * dset_id - identifier of the dataset to be closed - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, August 4, 1999 - * HISTORY - * - * SOURCE - */ - -int_f -h5dclose_c(hid_t_f *dset_id) -/******/ -{ - int ret_value = 0; - hid_t c_dset_id; - c_dset_id = (hid_t)*dset_id; - if (H5Dclose(c_dset_id) < 0) - ret_value = -1; - return ret_value; -} - -/****if* H5Df/h5dget_space_c - * NAME - * h5dget_space_c - * PURPOSE - * Call H5Dget_space to obtain dataspace of a dataset - * INPUTS - * dset_id - identifier of the dataset - * OUTPUTS - * space_id - identifier of the dataset's dataspace - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 19, 1999 - * HISTORY - * - * SOURCE - */ - -int_f -h5dget_space_c(hid_t_f *dset_id, hid_t_f *space_id) -/******/ -{ - int ret_value = -1; - hid_t c_dset_id; - hid_t c_space_id; - - c_dset_id = (hid_t)*dset_id; - c_space_id = H5Dget_space(c_dset_id); - if (c_space_id < 0) - return ret_value; - ret_value = 0; - *space_id = (hid_t_f)c_space_id; - return ret_value; -} - /****if* H5Df/h5dget_type_c * NAME * h5dget_type_c @@ -410,60 +240,6 @@ h5dget_create_plist_c(hid_t_f *dset_id, hid_t_f *plist_id) return ret_value; } -/****if* H5Df/h5dset_extent_c - * NAME - * h5dset_extent_c - * PURPOSE - * Call H5Dset_extent to extend dataset with unlimited dimensions - * INPUTS - * dset_id - identifier of the dataset - * OUTPUTS - * dims - array with the dimension sizes - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Thursday, August 19, 1999 - * - * HISTORY - * Changed name from the now obsolete h5dextend - * to h5dset_extent in order to match new fortran interface. - * -MSB- March 14, 2008 - * SOURCE - */ - -int_f -h5dset_extent_c(hid_t_f *dset_id, hsize_t_f *dims) -/******/ -{ - hid_t c_space_id; - hsize_t c_dims[H5S_MAX_RANK]; - int rank; - int i; - int status; - int ret_value = -1; - - if ((c_space_id = H5Dget_space((hid_t)*dset_id)) < 0) - return ret_value; - - rank = H5Sget_simple_extent_ndims(c_space_id); - H5Sclose(c_space_id); - if (rank < 0) - return ret_value; - - /* - * Reverse dimensions due to C-FORTRAN storage order. - */ - for (i = 0; i < rank; i++) - c_dims[i] = (hsize_t)dims[rank - i - 1]; - - status = H5Dset_extent((hid_t)*dset_id, c_dims); - - if (status >= 0) - ret_value = 0; - return ret_value; -} - /****if* H5Df/h5dget_storage_size_c * NAME * h5dget_storage_size_c diff --git a/fortran/src/H5Dff.F90 b/fortran/src/H5Dff.F90 index bbfeb06..06034ac 100644 --- a/fortran/src/H5Dff.F90 +++ b/fortran/src/H5Dff.F90 @@ -88,6 +88,7 @@ MODULE H5D USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR USE H5GLOBAL USE H5LIB, ONLY : h5kind_to_type + USE H5S, ONLY : H5Sget_simple_extent_ndims_f, H5Sclose_f PRIVATE h5dread_vl_integer, h5dread_vl_real, h5dread_vl_string PRIVATE h5dwrite_vl_integer, h5dwrite_vl_real, h5dwrite_vl_string @@ -232,37 +233,119 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HID_T), INTENT(OUT) :: dset_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dapl_id INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: dcpl_id_default INTEGER(HID_T) :: dapl_id_default - - INTEGER :: namelen ! Name length + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5dcreate_c(loc_id, name, namelen, type_id, & - space_id, lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) & - BIND(C,NAME='h5dcreate_c') + INTEGER(HID_T) FUNCTION H5Dcreate2(loc_id, name, type_id, & + space_id, lcpl_id_default, dcpl_id_default, dapl_id_default) & + BIND(C,NAME='H5Dcreate2') IMPORT :: C_CHAR IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: type_id + INTEGER(HID_T), VALUE :: space_id + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: dcpl_id_default + INTEGER(HID_T), VALUE :: dapl_id_default + END FUNCTION H5Dcreate2 + END INTERFACE - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default + c_name = TRIM(name)//C_NULL_CHAR - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dcreate_c + lcpl_id_default = H5P_DEFAULT_F + dcpl_id_default = H5P_DEFAULT_F + dapl_id_default = H5P_DEFAULT_F + + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id + IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + + dset_id = INT(h5dcreate2(loc_id, c_name, type_id, space_id, & + lcpl_id_default, dcpl_id_default, dapl_id_default), HID_T) + + hdferr = 0 + IF(dset_id.LT.0) hdferr = -1 + + END SUBROUTINE h5dcreate_f + +!> +!! \ingroup FH5D +!! +!! \brief Asynchronously creates a dataset at the specified location. +!! +!! \param loc_id File or group identifier +!! \param name Dataset name +!! \param type_id Dataset datatype identifier +!! \param space_id Dataset dataspace identifier +!! \param dset_id Dataset identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param dcpl_id Dataset creation property list +!! \param lcpl_id Link creation property list +!! \param dapl_id Dataset access property list +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Dcreate_async() +!! + SUBROUTINE h5dcreate_async_f(loc_id, name, type_id, space_id, dset_id, es_id, & + hdferr, dcpl_id, lcpl_id, dapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT) :: dset_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: dcpl_id_default + INTEGER(HID_T) :: dapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Dcreate_async(file, func, line, loc_id, name, type_id, & + space_id, lcpl_id_default, dcpl_id_default, dapl_id_default, es_id) & + BIND(C,NAME='H5Dcreate_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: type_id + INTEGER(HID_T), VALUE :: space_id + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: dcpl_id_default + INTEGER(HID_T), VALUE :: dapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Dcreate_async END INTERFACE + c_name = TRIM(name)//C_NULL_CHAR + lcpl_id_default = H5P_DEFAULT_F dcpl_id_default = H5P_DEFAULT_F dapl_id_default = H5P_DEFAULT_F @@ -270,12 +353,18 @@ CONTAINS IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) - namelen = LEN(name) - hdferr = h5dcreate_c(loc_id, name, namelen, type_id, space_id, & - lcpl_id_default, dcpl_id_default, dapl_id_default, dset_id) + dset_id = h5dcreate_async(file_default, func_default, line_default, & + loc_id, c_name, type_id, space_id, & + lcpl_id_default, dcpl_id_default, dapl_id_default, es_id) - END SUBROUTINE h5dcreate_f + hdferr = 0 + IF(dset_id.LT.0) hdferr = -1 + + END SUBROUTINE h5dcreate_async_f !> !! \ingroup FH5D @@ -296,36 +385,105 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(OUT) :: dset_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id - INTEGER :: namelen ! Name length + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dapl_id INTEGER(HID_T) :: dapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) & - BIND(C,NAME='h5dopen_c') + INTEGER(HID_T) FUNCTION H5Dopen2(loc_id, name, dapl_id_default) & + BIND(C,NAME='H5Dopen2') IMPORT :: C_CHAR IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: dapl_id_default - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dopen_c + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T),VALUE :: dapl_id_default + END FUNCTION H5Dopen2 END INTERFACE + c_name = TRIM(name)//C_NULL_CHAR + dapl_id_default = H5P_DEFAULT_F IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - namelen = LEN(name) - hdferr = h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) + dset_id = INT(H5Dopen2(loc_id, c_name, dapl_id_default), HID_T) + + hdferr = 0 + IF(dset_id.LT.0) hdferr = -1 END SUBROUTINE h5dopen_f !> !! \ingroup FH5D !! +!! \brief Asynchronously opens an existing dataset. +!! +!! \param loc_id File or group identifier +!! \param name Dataset name +!! \param dset_id Dataset identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param dapl_id Dataset access property list +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Dopen_async() +!! + SUBROUTINE h5dopen_async_f(loc_id, name, dset_id, es_id, hdferr, dapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(OUT) :: dset_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: dapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Dopen_async(file, func, line, loc_id, name, dapl_id_default, es_id) & + BIND(C,NAME='H5Dopen_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: dapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Dopen_async + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + + dapl_id_default = H5P_DEFAULT_F + IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + dset_id = H5Dopen_async(file_default, func_default, line_default, & + loc_id, c_name, dapl_id_default, es_id) + + hdferr = 0 + IF(dset_id.LT.0) hdferr = -1 + + END SUBROUTINE h5dopen_async_f + +!> +!! \ingroup FH5D +!! !! \brief Closes a dataset. !! !! \param dset_id Dataset identifier @@ -337,22 +495,71 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER, INTENT(OUT) :: hdferr + INTERFACE - INTEGER FUNCTION h5dclose_c(dset_id) & - BIND(C,NAME='h5dclose_c') + INTEGER(C_INT) FUNCTION H5Dclose(dset_id) BIND(C,NAME='H5Dclose') + IMPORT :: C_INT IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id - END FUNCTION h5dclose_c + INTEGER(HID_T), VALUE :: dset_id + END FUNCTION h5dclose END INTERFACE - hdferr = h5dclose_c(dset_id) + hdferr = INT(H5Dclose(dset_id)) END SUBROUTINE h5dclose_f !> !! \ingroup FH5D !! +!! \brief Asynchronously closes a dataset. +!! +!! \param dset_id Dataset identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Dclose_async() +!! + SUBROUTINE h5dclose_async_f(dset_id, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Dclose_async(file, func, line, dset_id, es_id) BIND(C,NAME='H5Dclose_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: dset_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Dclose_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Dclose_async(file_default, func_default, line_default, dset_id, es_id)) + + END SUBROUTINE h5dclose_async_f + +!> +!! \ingroup FH5D +!! !! \brief Returns an identifier for a copy of the datatype for a !! dataset. !! @@ -386,29 +593,149 @@ CONTAINS !! \brief Extends a dataset with unlimited dimension. !! !! \param dataset_id Dataset identifier -!! \param size Array containing the new magnitude of each dimension +!! \param fsize Array containing the new magnitude of each dimension !! \param hdferr \fortran_error !! !! See C API: @ref H5Dset_extent() !! - SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr) + SUBROUTINE h5dset_extent_f(dataset_id, fsize, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: fsize INTEGER, INTENT(OUT) :: hdferr + + INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: csize + INTEGER(HID_T) :: space_id + INTEGER :: rank + INTEGER :: i + INTERFACE - INTEGER FUNCTION h5dset_extent_c(dataset_id, size) & - BIND(C,NAME='h5dset_extent_c') + INTEGER(C_INT) FUNCTION H5Dset_extent(dataset_id, size) & + BIND(C,NAME='H5Dset_extent') + IMPORT :: C_INT IMPORT :: HID_T, HSIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size - END FUNCTION h5dset_extent_c + INTEGER(HID_T), VALUE :: dataset_id + INTEGER(HSIZE_T), DIMENSION(*) :: size + END FUNCTION H5Dset_extent END INTERFACE - hdferr = H5Dset_extent_c(dataset_id, size) + CALL H5Dget_space_f(dataset_id, space_id, hdferr) + IF(hdferr.LT.0) RETURN + + CALL H5Sget_simple_extent_ndims_f(space_id, rank, hdferr) + IF( hdferr.LT.0 .OR. rank.LT.0 )THEN + CALL H5Sclose_f(space_id, hdferr) + hdferr = -1 + RETURN + ENDIF + CALL H5Sclose_f(space_id, hdferr) + IF(hdferr.LT.0) RETURN + + ALLOCATE(csize(rank), STAT=hdferr) + IF (hdferr .NE. 0 ) THEN + hdferr = -1 + RETURN + ENDIF + + ! + ! Reverse dimensions due to C-FORTRAN storage order. + ! + DO i = 1, rank + csize(i) = fsize(rank - i + 1) + ENDDO + + hdferr = INT(H5Dset_extent(dataset_id, csize)) + + DEALLOCATE(csize) + END SUBROUTINE h5dset_extent_f + +!> +!! \ingroup FH5D +!! +!! \brief Asynchronously extends a dataset with unlimited dimension. +!! +!! \param dataset_id Dataset identifier +!! \param fsize Array containing the new magnitude of each dimension +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Dset_extent_async() +!! + SUBROUTINE h5dset_extent_async_f(dataset_id, fsize, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: fsize + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: csize + INTEGER(HID_T) :: space_id + INTEGER :: rank + INTEGER :: i + + INTERFACE + INTEGER(C_INT) FUNCTION H5Dset_extent_async(file, func, line, dataset_id, size, es_id) & + BIND(C,NAME='H5Dset_extent_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: dataset_id + INTEGER(HSIZE_T), DIMENSION(*) :: size + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Dset_extent_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + CALL H5Dget_space_f(dataset_id, space_id, hdferr) + IF(hdferr.LT.0) RETURN + + CALL H5Sget_simple_extent_ndims_f(space_id, rank, hdferr) + IF( hdferr.LT.0 .OR. rank.LT.0 )THEN + CALL H5Sclose_f(space_id, hdferr) + hdferr = -1 + RETURN + ENDIF + CALL H5Sclose_f(space_id, hdferr) + IF(hdferr.LT.0) RETURN + + ALLOCATE(csize(rank), STAT=hdferr) + IF (hdferr .NE. 0 ) THEN + hdferr = -1 + RETURN + ENDIF + + ! + ! Reverse dimensions due to C-FORTRAN storage order. + ! + DO i = 1, rank + csize(i) = fsize(rank - i + 1) + ENDDO + + hdferr = INT(H5Dset_extent_async(file_default, func_default, line_default, & + dataset_id, csize, es_id)) + + DEALLOCATE(csize) + + END SUBROUTINE h5dset_extent_async_f + !> !! \ingroup FH5D !! @@ -551,8 +878,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: space_id INTEGER(HID_T), INTENT(OUT) :: dset_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: dapl_id INTEGER(HID_T) :: dcpl_id_default INTEGER(HID_T) :: dapl_id_default @@ -611,14 +938,14 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp END SUBROUTINE h5dread_vl_f !> !! \ingroup FH5D !! - !! \brief Writes variable-length data. F2003 API h5dwritef should be used instead. + !! \brief Writes variable-length data. F2003 API h5dwrite_f should be used instead. !! !! \param dset_id Dataset identifier. !! \param mem_type_id Memory datatype identifier. @@ -641,9 +968,9 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp END SUBROUTINE h5dwrite_vl_f #else @@ -657,9 +984,9 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2)), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default @@ -707,9 +1034,9 @@ CONTAINS INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default @@ -761,9 +1088,9 @@ CONTAINS REAL, INTENT(IN), & DIMENSION(dims(1),dims(2)) :: buf ! Data buffer INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -815,9 +1142,9 @@ CONTAINS REAL, INTENT(INOUT), & DIMENSION(dims(1),dims(2)) :: buf ! Data buffer INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -871,9 +1198,9 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(2)) :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -925,9 +1252,9 @@ CONTAINS CHARACTER(LEN=*), INTENT(OUT), & DIMENSION(dims(2)) :: buf ! Data buffer INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -1001,8 +1328,7 @@ CONTAINS !> !! \ingroup FH5D !! -!! \brief Returns an identifier for a copy of the dataspace for a -!! dataset. +!! \brief Returns an identifier for a copy of the dataspace for a dataset. !! !! \param dataset_id Dataset identifier. !! \param dataspace_id Dataspace identifier. @@ -1016,20 +1342,78 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: dataspace_id INTEGER, INTENT(OUT) :: hdferr INTERFACE - INTEGER FUNCTION h5dget_space_c(dataset_id, dataspace_id) BIND(C,NAME='h5dget_space_c') + INTEGER(HID_T) FUNCTION H5Dget_space(dataset_id) BIND(C,NAME='H5Dget_space') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(OUT) :: dataspace_id - END FUNCTION h5dget_space_c + INTEGER(HID_T), VALUE :: dataset_id + END FUNCTION H5Dget_space END INTERFACE - hdferr = h5dget_space_c(dataset_id, dataspace_id) + dataspace_id = h5dget_space(dataset_id) + + hdferr = 0 + IF(dataspace_id.LT.0) hdferr = -1 + END SUBROUTINE h5dget_space_f !> !! \ingroup FH5D !! +!! \brief Asynchronously returns an identifier for a copy of the dataspace for a dataset. +!! +!! \param dataset_id Dataset identifier. +!! \param dataspace_id Dataspace identifier. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Dget_space_async() +!! + SUBROUTINE h5dget_space_async_f(dataset_id, dataspace_id, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(OUT) :: dataspace_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Dget_space_async(file, func, line, dataset_id, es_id) & + BIND(C,NAME='H5Dget_space_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: dataset_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Dget_space_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + dataspace_id = H5Dget_space_async(file_default, func_default, line_default, & + dataset_id, es_id) + + hdferr = 0 + IF(dataspace_id.LT.0) hdferr = -1 + + END SUBROUTINE h5dget_space_async_f + +!> +!! \ingroup FH5D +!! !! \brief Returns a copy of the dataset creation property list. !! !! \param dset_id Dataset identifier. @@ -1091,7 +1475,141 @@ CONTAINS hdferr = H5Dvlen_reclaim_c(type_id, space_id, plist_id, buf) - END SUBROUTINE H5Dvlen_reclaim_f + END SUBROUTINE h5dvlen_reclaim_f + +!> +!! \ingroup FH5D +!! +!! \brief Asynchronously reads raw data from a dataset into a buffer. +!! +!! \param dset_id Identifier of the dataset read from. +!! \param mem_type_id Identifier of the memory datatype. +!! \param buf Buffer to receive data read from file. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param mem_space_id Identifier of the memory dataspace. +!! \param file_space_id Identifier of dataset's dataspace in the file. (Default: H5S_ALL_F) +!! \param xfer_prp Identifier of a transfer property list for this I/O operation. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Dread_async() +!! + SUBROUTINE h5dread_async_f(dset_id, mem_type_id, buf, es_id, hdferr, & + mem_space_id, file_space_id, xfer_prp, file, func, line) + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR), INTENT(INOUT) :: buf + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Dread_async(file, func, line, dset_id, mem_type_id, & + mem_space_id, file_space_id, xfer_prp, buf, es_id) BIND(C,NAME='H5Dread_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: dset_id + INTEGER(HID_T), VALUE :: mem_type_id + INTEGER(HID_T), VALUE :: mem_space_id + INTEGER(HID_T), VALUE :: file_space_id + INTEGER(HID_T), VALUE :: xfer_prp + TYPE(C_PTR) , VALUE :: buf + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Dread_async + END INTERFACE + + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = H5Dread_async(file_default, func_default, line_default, & + dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, es_id ) + + END SUBROUTINE h5dread_async_f + +!> +!! \ingroup FH5D +!! +!! \brief Asynchronously writes raw data from a buffer to a dataset. +!! +!! \param dset_id Identifier of the dataset to write to. +!! \param mem_type_id Identifier of the memory datatype. +!! \param buf Buffer with data to be written to the file. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param mem_space_id Identifier of the memory dataspace. +!! \param file_space_id Identifier of the dataset's dataspace in the file. +!! \param xfer_prp Identifier of a transfer property list for this I/O operation. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Dwrite_async() +!! + SUBROUTINE h5dwrite_async_f(dset_id, mem_type_id, buf, es_id, hdferr, & + mem_space_id, file_space_id, xfer_prp, file, func, line) + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR), INTENT(IN) :: buf + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Dwrite_async(file, func, line, dset_id, mem_type_id, & + mem_space_id, file_space_id, xfer_prp, buf, es_id) BIND(C,NAME='H5Dwrite_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: dset_id + INTEGER(HID_T), VALUE :: mem_type_id + INTEGER(HID_T), VALUE :: mem_space_id + INTEGER(HID_T), VALUE :: file_space_id + INTEGER(HID_T), VALUE :: xfer_prp + TYPE(C_PTR) , VALUE :: buf + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Dwrite_async + END INTERFACE + + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = H5Dwrite_async(file_default, func_default, line_default, & + dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, es_id) + + END SUBROUTINE h5dwrite_async_f #ifdef H5_DOXYGEN !> @@ -1118,9 +1636,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: mem_type_id TYPE(C_PTR), INTENT(IN) :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp END SUBROUTINE h5dwrite !> !! \ingroup FH5D @@ -1146,9 +1664,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: mem_type_id TYPE(C_PTR), INTENT(INOUT) :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp END SUBROUTINE h5dread_f !> @@ -1177,9 +1695,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: mem_type_id TYPE(TYPE), INTENT(IN) :: buf DIMENSION(*), INTEGER(HSIZE_T), INTENT(IN) :: dims - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp END SUBROUTINE h5dwrite_f___F90_VERSION !> @@ -1209,9 +1727,9 @@ CONTAINS INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims TYPE(TYPE), INTENT(INOUT) :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp END SUBROUTINE h5dread_f___F90_VERSION !> @@ -1273,9 +1791,9 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims TYPE(hobj_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -1305,9 +1823,9 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims TYPE(hdset_reg_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -1315,7 +1833,6 @@ CONTAINS INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf INTEGER :: i INTEGER(HSIZE_T) :: j - TYPE(C_PTR) :: f_ptr INTERFACE INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& mem_space_id_default, & @@ -1339,7 +1856,6 @@ CONTAINS IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1)) ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) IF (hdferr .NE. 0 ) THEN @@ -1360,16 +1876,15 @@ CONTAINS SUBROUTINE h5dwrite_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims CHARACTER(*), INTENT(IN), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp CALL h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), dims, hdferr, & mem_space_id, file_space_id, xfer_prp) @@ -1378,7 +1893,6 @@ CONTAINS SUBROUTINE h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, dims, hdferr, & mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1386,9 +1900,9 @@ CONTAINS INTEGER, INTENT(IN) :: buf_len CHARACTER(LEN=buf_len), INTENT(IN), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default @@ -1411,7 +1925,6 @@ CONTAINS SUBROUTINE h5dread_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1419,9 +1932,9 @@ CONTAINS TYPE(hobj_ref_t_f), INTENT(INOUT) , & DIMENSION(dims(1)), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -1451,9 +1964,9 @@ CONTAINS TYPE(hdset_reg_ref_t_f), INTENT(INOUT), & DIMENSION(dims(1)), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default @@ -1506,7 +2019,6 @@ CONTAINS SUBROUTINE h5dread_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id @@ -1514,9 +2026,9 @@ CONTAINS CHARACTER(LEN=*), INTENT(INOUT) :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -1537,16 +2049,15 @@ CONTAINS SUBROUTINE h5dread_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, hdferr, & mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id INTEGER, INTENT(IN) :: buf_len CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp TYPE(C_PTR) :: f_ptr @@ -1559,15 +2070,14 @@ CONTAINS SUBROUTINE h5dwrite_ptr(dset_id, mem_type_id, buf, hdferr, & mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id TYPE(C_PTR), INTENT(IN) :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -1588,15 +2098,14 @@ CONTAINS SUBROUTINE h5dread_ptr(dset_id, mem_type_id, buf, hdferr, & mem_space_id, file_space_id, xfer_prp) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id INTEGER(HID_T), INTENT(IN) :: mem_type_id TYPE(C_PTR), INTENT(INOUT) :: buf INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default @@ -1616,7 +2125,6 @@ CONTAINS END SUBROUTINE h5dread_ptr SUBROUTINE h5dfill_ptr(fill_value, fill_type_id, buf, buf_type_id, space_id, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE TYPE(C_PTR) :: fill_value INTEGER(HID_T), INTENT(IN) :: fill_type_id @@ -1643,7 +2151,6 @@ CONTAINS END SUBROUTINE h5dfill_ptr SUBROUTINE h5dfill_integer(fill_value, space_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER, INTENT(IN), TARGET :: fill_value ! Fill value INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier @@ -1667,7 +2174,6 @@ CONTAINS END SUBROUTINE h5dfill_integer SUBROUTINE h5dfill_c_float(fill_value, space_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE REAL(KIND=C_FLOAT), INTENT(IN), TARGET :: fill_value INTEGER(HID_T), INTENT(IN) :: space_id @@ -1739,7 +2245,6 @@ CONTAINS #endif SUBROUTINE h5dfill_char(fill_value, space_id, buf, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE CHARACTER, INTENT(IN), TARGET :: fill_value INTEGER(HID_T), INTENT(IN) :: space_id @@ -1775,7 +2280,7 @@ CONTAINS !! \param hdferr \fortran_error !! \param xfer_prp Identifier of a transfer property list for this I/O operation. !! - SUBROUTINE H5Dread_multi_f(count, dset_id, mem_type_id, mem_space_id, file_space_id, buf, hdferr, xfer_prp) + SUBROUTINE h5dread_multi_f(count, dset_id, mem_type_id, mem_space_id, file_space_id, buf, hdferr, xfer_prp) IMPLICIT NONE INTEGER(SIZE_T), INTENT(IN) :: count @@ -1811,7 +2316,7 @@ CONTAINS hdferr = H5Dread_multi(count, dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp_default, buf) - END SUBROUTINE H5Dread_multi_f + END SUBROUTINE h5dread_multi_f !> !! \ingroup FH5D !! @@ -1826,7 +2331,7 @@ CONTAINS !! \param hdferr \fortran_error !! \param xfer_prp Identifier of a transfer property list for this I/O operation. !! - SUBROUTINE H5Dwrite_multi_f(count, dset_id, mem_type_id, mem_space_id, file_space_id, buf, hdferr, xfer_prp) + SUBROUTINE h5dwrite_multi_f(count, dset_id, mem_type_id, mem_space_id, file_space_id, buf, hdferr, xfer_prp) IMPLICIT NONE INTEGER(SIZE_T), INTENT(IN) :: count @@ -1862,7 +2367,7 @@ CONTAINS hdferr = H5Dwrite_multi(count, dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp_default, buf) - END SUBROUTINE H5Dwrite_multi_f + END SUBROUTINE h5dwrite_multi_f #endif diff --git a/fortran/src/H5ESff.F90 b/fortran/src/H5ESff.F90 new file mode 100644 index 0000000..5b19a51 --- /dev/null +++ b/fortran/src/H5ESff.F90 @@ -0,0 +1,296 @@ +!> @defgroup FH5ES Fortran Event Set (H5ES) Interface +!! +!! @see H5ES, C-API +!! +!! @see @ref H5ES_UG, User Guide +!! +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! All rights reserved. * +! * +! This file is part of HDF5. The full HDF5 copyright notice, including * +! terms governing use, modification, and redistribution, is contained in * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://www.hdfgroup.org/licenses. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! + +MODULE H5ES + + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_INT64_T, C_BOOL + USE H5GLOBAL + IMPLICIT NONE + +CONTAINS + +!> +!! \ingroup FH5ES +!! +!! \brief Creates an event set. +!! +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5EScreate() +!! + SUBROUTINE h5escreate_f(es_id, hdferr) + IMPLICIT NONE + + INTEGER(HID_T), INTENT(OUT) :: es_id + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(HID_T) FUNCTION H5EScreate() BIND(C,NAME='H5EScreate') + IMPORT :: HID_T + END FUNCTION H5EScreate + END INTERFACE + + es_id = H5EScreate() + + hdferr = 0 + IF(es_id.LT.0) hdferr = -1 + + END SUBROUTINE h5escreate_f +!> +!! \ingroup FH5ES +!! +!! \brief Retrieves number of events in an event set. +!! +!! \param es_id \es_id +!! \param count The number of events in the event set +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5ESget_count() +!! + SUBROUTINE h5esget_count_f(es_id, count, hdferr) + IMPLICIT NONE + + INTEGER(hid_t), INTENT(IN) :: es_id + INTEGER(size_t), INTENT(OUT) :: count + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5ESget_count(es_id, count) BIND(C,NAME='H5ESget_count') + IMPORT :: C_INT + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T), VALUE :: es_id + INTEGER(SIZE_T) :: count + END FUNCTION H5ESget_count + END INTERFACE + + hdferr = INT(H5ESget_count(es_id, count)) + + END SUBROUTINE h5esget_count_f +!> +!! \ingroup FH5ES +!! +!! \brief Retrieves the next operation counter to be assigned in an event set. +!! +!! \param es_id \es_id +!! \param counter The number of events in the event set +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5ESget_op_counter() +!! + SUBROUTINE h5esget_op_counter_f(es_id, counter, hdferr) + + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER(C_INT64_T), INTENT(OUT) :: counter + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5ESget_op_counter(es_id, counter) BIND(C,NAME='H5ESget_op_counter') + IMPORT :: C_INT + IMPORT :: HID_T, C_INT64_T + INTEGER(HID_T) , VALUE :: es_id + INTEGER(C_INT64_T) :: counter + END FUNCTION H5ESget_op_counter + END INTERFACE + + hdferr = INT(H5ESget_op_counter(es_id, counter)) + + END SUBROUTINE h5esget_op_counter_f +!> +!! \ingroup FH5ES +!! +!! \brief Waits for operations in event set to complete. +!! +!! \param es_id \es_id +!! \param timeout The number of events in the event set +!! \param num_in_progress The number of operations still in progress +!! \param err_occurred Flag if an operation in the event set failed +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5ESwait() +!! + SUBROUTINE h5eswait_f(es_id, timeout, num_in_progress, err_occurred, hdferr) + + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER(C_INT64_T), INTENT(IN) :: timeout + INTEGER(SIZE_T) , INTENT(OUT) :: num_in_progress + LOGICAL , INTENT(OUT) :: err_occurred + INTEGER , INTENT(OUT) :: hdferr + + LOGICAL(C_BOOL) :: err_occurred_c = .FALSE. + + INTERFACE + INTEGER(C_INT) FUNCTION H5ESwait(es_id, timeout, num_in_progress, err_occurred) BIND(C,NAME='H5ESwait') + IMPORT :: C_INT + IMPORT :: HID_T, C_INT64_T, SIZE_T, C_BOOL + INTEGER(HID_T) , VALUE :: es_id + INTEGER(C_INT64_T), VALUE :: timeout + INTEGER(SIZE_T) :: num_in_progress + LOGICAL(C_BOOL) :: err_occurred + END FUNCTION H5ESwait + END INTERFACE + + hdferr = INT(H5ESwait(es_id, timeout, num_in_progress, err_occurred_c)) + + ! Transfer value of C c_bool type to Fortran LOGICAL + err_occurred = err_occurred_c + + END SUBROUTINE h5eswait_f +!> +!! \ingroup FH5ES +!! +!! \brief Attempt to cancel operations in an event set. +!! +!! \param es_id \es_id +!! \param num_not_canceled The number of events not canceled +!! \param err_occurred Status indicating if error is present in the event set +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5EScancel() +!! + SUBROUTINE h5escancel_f(es_id, num_not_canceled, err_occurred, hdferr) + + IMPLICIT NONE + + INTEGER(hid_t) , INTENT(IN) :: es_id + INTEGER(size_t), INTENT(OUT) :: num_not_canceled + LOGICAL , INTENT(OUT) :: err_occurred + INTEGER , INTENT(OUT) :: hdferr + + LOGICAL(C_BOOL) :: err_occurred_c = .FALSE. + + INTERFACE + INTEGER(C_INT) FUNCTION H5EScancel(es_id, num_not_canceled, err_occurred) BIND(C,NAME='H5EScancel') + IMPORT :: C_INT + IMPORT :: HID_T, SIZE_T, C_BOOL + INTEGER(HID_T) , VALUE :: es_id + INTEGER(SIZE_T) :: num_not_canceled + LOGICAL(C_BOOL) :: err_occurred + END FUNCTION H5EScancel + END INTERFACE + + hdferr = INT(H5EScancel(es_id, num_not_canceled, err_occurred_c)) + + ! Transfer value of C c_bool type to Fortran LOGICAL + err_occurred = err_occurred_c + + END SUBROUTINE h5escancel_f +!> +!! \ingroup FH5ES +!! +!! \brief Checks for failed operations. +!! +!! \param es_id \es_id +!! \param err_occurred Status indicating if error is present in the event set +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5ESget_err_status() +!! + SUBROUTINE h5esget_err_status_f(es_id, err_occurred, hdferr) + + IMPLICIT NONE + + INTEGER(hid_t), INTENT(IN) :: es_id + LOGICAL , INTENT(OUT) :: err_occurred + INTEGER , INTENT(OUT) :: hdferr + + LOGICAL(C_BOOL) :: err_occurred_c = .FALSE. + + INTERFACE + INTEGER(C_INT) FUNCTION H5ESget_err_status(es_id, err_occurred) BIND(C,NAME='H5ESget_err_status') + IMPORT :: C_INT + IMPORT :: HID_T, C_BOOL + INTEGER(HID_T) , VALUE :: es_id + LOGICAL(C_BOOL) :: err_occurred + END FUNCTION H5ESget_err_status + END INTERFACE + + hdferr = INT(H5ESget_err_status(es_id, err_occurred_c)) + + ! Transfer value of C c_bool type to Fortran LOGICAL + err_occurred = err_occurred_c + + END SUBROUTINE h5esget_err_status_f +!> +!! \ingroup FH5ES +!! +!! \brief Retrieves the number of failed operations. +!! +!! \param es_id \es_id +!! \param num_errs Number of errors +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5ESget_err_count() +!! + SUBROUTINE h5esget_err_count_f(es_id, num_errs, hdferr) + + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER(SIZE_T), INTENT(OUT) :: num_errs + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5ESget_err_count(es_id, num_errs) BIND(C,NAME='H5ESget_err_count') + IMPORT :: C_INT + IMPORT :: HID_T, SIZE_T + INTEGER(HID_T) , VALUE :: es_id + INTEGER(SIZE_T) :: num_errs + END FUNCTION H5ESget_err_count + END INTERFACE + + hdferr = INT(H5ESget_err_count(es_id, num_errs)) + + END SUBROUTINE h5esget_err_count_f + +!> +!! \ingroup FH5ES +!! +!! \brief Terminates access to an event set. +!! +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5ESclose() +!! + SUBROUTINE h5esclose_f(es_id, hdferr) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5ESclose(es_id) BIND(C,NAME='H5ESclose') + IMPORT :: C_INT + IMPORT :: HID_T + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5ESclose + END INTERFACE + + hdferr = INT(H5ESclose(es_id)) + + END SUBROUTINE h5esclose_f + +END MODULE H5ES diff --git a/fortran/src/H5Eff.F90 b/fortran/src/H5Eff.F90 index 26b2c77..a4c9e8c 100644 --- a/fortran/src/H5Eff.F90 +++ b/fortran/src/H5Eff.F90 @@ -58,7 +58,7 @@ CONTAINS SUBROUTINE h5eclear_f(hdferr, estack_id) IMPLICIT NONE INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: estack_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: estack_id INTEGER(HID_T) :: estack_id_default INTERFACE @@ -86,7 +86,7 @@ CONTAINS !! See C API: @ref H5Eprint2() !! SUBROUTINE h5eprint_f(hdferr, name) - CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: name + CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: name INTEGER, INTENT(OUT) :: hdferr INTEGER :: namelen diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 7402e18..b2f09ef 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -91,47 +91,6 @@ h5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *crt_prp, hi return ret_value; } -/****if* H5Ff/h5fflush_c - * NAME - * h5fflush_c - * PURPOSE - * Call H5Fflush to flush the object - * INPUTS - * object_id - identifier of either a file, a dataset, - * a group, an attribute or a named data type - * scope - integer to specify the flushing action, either - * H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Xiangyang Su - * Friday, November 5, 1999 - * SOURCE - */ -int_f -h5fflush_c(hid_t_f *object_id, int_f *scope) -/******/ -{ - int ret_value = -1; - hid_t c_file_id; - H5F_scope_t c_scope; - htri_t status; - c_scope = (H5F_scope_t)*scope; - - /* - * Call H5Fflush function. - */ - - c_file_id = *object_id; - - status = H5Fflush(c_file_id, c_scope); - - if (status >= 0) - ret_value = 0; - - return ret_value; -} - /****if* H5Ff/h5fmount_c * NAME * h5fmount_c @@ -240,103 +199,6 @@ h5funmount_c(hid_t_f *loc_id, _fcd dsetname, int_f *namelen) return ret_value; } -/****if* H5Ff/h5fopen_c - * NAME - * h5fopen_c - * PURPOSE - * Call H5Fopen to open the file - * INPUTS - * name - name of the file - * namelen - name length - * access_flags - file access flags - * acc_prp - identifier of access property list - * OUTPUTS - * file_id - file identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, August 3, 1999 - * SOURCE - */ -int_f -h5fopen_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id) -/******/ -{ - int ret_value = -1; - char *c_name; - int_f c_namelen; - hid_t c_file_id; - unsigned c_access_flags; - hid_t c_acc_prp; - c_acc_prp = (hid_t)*acc_prp; - - /* - * Define access flags - */ - c_access_flags = (unsigned)*access_flags; - - /* - * Define access property - */ - c_acc_prp = *acc_prp; - - /* - * Convert FORTRAN name to C name - */ - c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, (size_t)c_namelen); - if (c_name == NULL) - return ret_value; - - /* - * Call H5Fopen function. - */ - c_file_id = H5Fopen(c_name, c_access_flags, c_acc_prp); - - if (c_file_id >= 0) { - ret_value = 0; - *file_id = (hid_t_f)c_file_id; - } /* end if */ - - HDfree(c_name); - return ret_value; -} - -/****if* H5Ff/h5freopen_c - * NAME - * h5freopen_c - * PURPOSE - * Call H5Freopen to open the file - * INPUTS - * file_id1 - file identifier - * OUTPUTS - * file_id2 - file identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Xiangyang Su - * Wednesday, November 3, 1999 - * SOURCE - */ -int_f -h5freopen_c(hid_t_f *file_id1, hid_t_f *file_id2) -/******/ -{ - int ret_value = -1; - hid_t c_file_id1, c_file_id2; - - c_file_id1 = *file_id1; - c_file_id2 = H5Freopen(c_file_id1); - - if (c_file_id2 < 0) - return ret_value; - *file_id2 = (hid_t_f)c_file_id2; - - ret_value = 0; - return ret_value; -} - /****if* H5Ff/h5fget_create_plist_c * NAME * h5fget_create_plist_c @@ -407,35 +269,6 @@ h5fget_access_plist_c(hid_t_f *file_id, hid_t_f *access_id) return ret_value; } -/****if* H5Ff/h5fclose_c - * NAME - * h5fclose_c - * PURPOSE - * Call H5Fclose to close the file - * INPUTS - * file_id - identifier of the file to be closed - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Monday, July 26, 1999 - * HISTORY - * - * SOURCE - */ - -int_f -h5fclose_c(hid_t_f *file_id) -/******/ -{ - int ret_value = 0; - hid_t c_file_id; - - c_file_id = (hid_t)*file_id; - if (H5Fclose(c_file_id) < 0) - ret_value = -1; - return ret_value; -} /****if* H5Ff/h5fget_obj_count_c * NAME * h5fget_obj_count_c diff --git a/fortran/src/H5Fff.F90 b/fortran/src/H5Fff.F90 index 551db7d..f1a0d2a 100644 --- a/fortran/src/H5Fff.F90 +++ b/fortran/src/H5Fff.F90 @@ -43,6 +43,7 @@ MODULE H5F ! Number of objects opened in H5open_f INTEGER(SIZE_T) :: H5OPEN_NUM_OBJ + #ifndef H5_DOXYGEN INTERFACE INTEGER(C_INT) FUNCTION h5fis_accessible(name, & @@ -81,46 +82,127 @@ CONTAINS INTEGER, INTENT(IN) :: access_flags INTEGER(HID_T), INTENT(OUT) :: file_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: creation_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: access_prp + INTEGER(HID_T) :: creation_prp_default INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5fcreate_c(name, namelen, access_flags, & - creation_prp_default, access_prp_default, file_id) BIND(C,NAME='h5fcreate_c') + INTEGER(HID_T) FUNCTION H5Fcreate(name, access_flags, & + creation_prp_default, access_prp_default) BIND(C,NAME='H5Fcreate') IMPORT :: C_CHAR IMPORT :: HID_T - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: access_flags - INTEGER(HID_T), INTENT(OUT) :: file_id - INTEGER(HID_T), INTENT(IN) :: creation_prp_default - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER :: namelen - END FUNCTION h5fcreate_c + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER, VALUE :: access_flags + INTEGER(HID_T), VALUE :: creation_prp_default + INTEGER(HID_T), VALUE :: access_prp_default + END FUNCTION H5Fcreate END INTERFACE + c_name = TRIM(name)//C_NULL_CHAR + creation_prp_default = H5P_DEFAULT_F access_prp_default = H5P_DEFAULT_F IF (PRESENT(creation_prp)) creation_prp_default = creation_prp IF (PRESENT(access_prp)) access_prp_default = access_prp - namelen = LEN_TRIM(name) - hdferr = h5fcreate_c(name, namelen, access_flags, & - creation_prp_default, access_prp_default, file_id) + + file_id = h5fcreate(c_name, access_flags, & + creation_prp_default, access_prp_default) + + hdferr = 0 + IF(file_id.LT.0) hdferr = -1 END SUBROUTINE h5fcreate_f + !> !! \ingroup FH5F !! -!! \brief Flushes all buffers associated with a file to disk +!! \brief Asynchronously creates HDF5 files. !! -!! \param object_id Identifier of object used to identify the file. -!! \param scope Specifies the scope of the flushing action. Possible values are: -!! \li H5F_SCOPE_GLOBAL_F -!! \li H5F_SCOPE_LOCAL_F +!! \param name Name of the file to create +!! \param access_flags File access flags. Allowable values are: +!! \li H5F_ACC_TRUNC_F +!! \li H5F_ACC_EXCL_F +!! \param file_id File identifier +!! \param es_id \es_id !! \param hdferr \fortran_error +!! \param creation_prp File creation property list identifier +!! \param access_prp File access property list identifier +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Fcreate_async() +!! + SUBROUTINE h5fcreate_async_f(name, access_flags, file_id, es_id, hdferr, & + creation_prp, access_prp, file, func, line) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: access_flags + INTEGER(HID_T), INTENT(OUT) :: file_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: creation_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: access_prp + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: creation_prp_default + INTEGER(HID_T) :: access_prp_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Fcreate_async(file, func, line, name, access_flags, & + creation_prp_default, access_prp_default, es_id) BIND(C,NAME='H5Fcreate_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER, VALUE :: access_flags + INTEGER(HID_T), VALUE :: creation_prp_default + INTEGER(HID_T), VALUE :: access_prp_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Fcreate_async + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + + creation_prp_default = H5P_DEFAULT_F + access_prp_default = H5P_DEFAULT_F + + IF(PRESENT(creation_prp)) creation_prp_default = creation_prp + IF(PRESENT(access_prp)) access_prp_default = access_prp + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + file_id = H5Fcreate_async(file_default, func_default, line_default, & + c_name, access_flags, creation_prp_default, access_prp_default, es_id) + + hdferr = 0 + IF(file_id.LT.0) hdferr = -1 + + END SUBROUTINE h5fcreate_async_f +!> +!! \ingroup FH5F +!! +!! \brief Flushes all buffers associated with a file to disk. +!! +!! \param object_id Identifier of object used to identify the file. +!! \param scope Specifies the scope of the flushing action. Possible values are: +!! \li H5F_SCOPE_GLOBAL_F +!! \li H5F_SCOPE_LOCAL_F +!! \param hdferr \fortran_error !! !! See C API: @ref H5Fflush() !! @@ -131,20 +213,75 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr INTERFACE - INTEGER FUNCTION h5fflush_c(object_id, scope) BIND(C,NAME='h5fflush_c') + INTEGER FUNCTION H5Fflush(object_id, scope) BIND(C,NAME='H5Fflush') + IMPORT :: C_INT IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER, INTENT(IN) :: scope - END FUNCTION h5fflush_c + INTEGER(HID_T), VALUE :: object_id + INTEGER(C_INT), VALUE :: scope + END FUNCTION H5Fflush END INTERFACE - hdferr = h5fflush_c(object_id, scope) + hdferr = H5Fflush(object_id, INT(scope, C_INT)) END SUBROUTINE h5fflush_f !> !! \ingroup FH5F !! +!! \brief Asynchronously flushes all buffers associated with a file to disk. +!! +!! \param object_id Identifier of object used to identify the file. +!! \param scope Specifies the scope of the flushing action. Possible values are: +!! \li H5F_SCOPE_GLOBAL_F +!! \li H5F_SCOPE_LOCAL_F +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Fflush_async() +!! + SUBROUTINE h5fflush_async_f(object_id, scope, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(IN) :: scope + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER FUNCTION H5Fflush_async(file, func, line, object_id, scope, es_id) & + BIND(C,NAME='H5Fflush_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: object_id + INTEGER(C_INT), VALUE :: scope + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Fflush_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = H5Fflush_async(file_default, func_default, line_default, & + object_id, INT(scope, C_INT), es_id) + + END SUBROUTINE h5fflush_async_f +!> +!! \ingroup FH5F +!! !! \brief Mounts a file. !! !! \param loc_id The identifier for of file or group in which name is defined. @@ -161,7 +298,7 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(IN) :: child_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: access_prp INTEGER(HID_T) :: access_prp_default INTEGER :: namelen ! Length of the name character string @@ -219,6 +356,7 @@ CONTAINS hdferr = h5funmount_c(loc_id, name, namelen) END SUBROUTINE h5funmount_f + !> !! \ingroup FH5F !! @@ -240,30 +378,106 @@ CONTAINS INTEGER, INTENT(IN) :: access_flags INTEGER(HID_T), INTENT(OUT) :: file_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: access_prp + INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5fopen_c(name, namelen, access_flags, & - access_prp_default, file_id) BIND(C,NAME='h5fopen_c') - IMPORT :: C_CHAR + INTEGER(HID_T) FUNCTION H5Fopen(name, access_flags, access_prp_default) & + BIND(C,NAME='H5Fopen') + IMPORT :: C_CHAR, C_INT, C_PTR IMPORT :: HID_T IMPLICIT NONE - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(IN) :: access_flags - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER(HID_T), INTENT(OUT) :: file_id - END FUNCTION h5fopen_c + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(C_INT), VALUE :: access_flags + INTEGER(HID_T), VALUE :: access_prp_default + END FUNCTION H5Fopen END INTERFACE + c_name = TRIM(name)//C_NULL_CHAR + access_prp_default = H5P_DEFAULT_F - IF (PRESENT(access_prp)) access_prp_default = access_prp - namelen = LEN_TRIM(name) - hdferr = h5fopen_c(name, namelen, access_flags, & - access_prp_default, file_id) + + IF(PRESENT(access_prp)) access_prp_default = access_prp + + file_id = H5Fopen(c_name, INT(access_flags, C_INT), access_prp_default) + + hdferr = 0 + IF(file_id.LT.0) hdferr = -1 + END SUBROUTINE h5fopen_f + +!> +!! \ingroup FH5F +!! +!! \brief Asynchronously opens HDF5 file. +!! +!! \param name Name of the file to acecss. +!! \param access_flags File access flags. Allowable values are: +!! \li H5F_ACC_RDWR_F +!! \li H5F_ACC_RDONLY_F +!! \param file_id File identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param access_prp File access property list identifier +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Fopen_async() +!! + SUBROUTINE h5fopen_async_f(name, access_flags, file_id, es_id, hdferr, & + access_prp, file, func, line) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: access_flags + INTEGER(HID_T), INTENT(OUT) :: file_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: access_prp + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: access_prp_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Fopen_async(file, func, line, name, access_flags, access_prp_default, es_id) & + BIND(C,NAME='H5Fopen_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(C_INT), VALUE :: access_flags + INTEGER(HID_T), VALUE :: access_prp_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Fopen_async + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + + access_prp_default = H5P_DEFAULT_F + + IF(PRESENT(access_prp)) access_prp_default = access_prp + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + file_id = H5Fopen_async(file_default, func_default, line_default, & + c_name, INT(access_flags, C_INT), access_prp_default, es_id) + + hdferr = 0 + IF(file_id.LT.0) hdferr = -1 + + END SUBROUTINE h5fopen_async_f !> !! \ingroup FH5F !! @@ -281,20 +495,75 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: ret_file_id INTEGER, INTENT(OUT) :: hdferr INTERFACE - INTEGER FUNCTION h5freopen_c(file_id, ret_file_id) BIND(C,NAME='h5freopen_c') + INTEGER(HID_T) FUNCTION H5Freopen(file_id) BIND(C,NAME='H5Freopen') IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HID_T), INTENT(OUT) :: ret_file_id - END FUNCTION h5freopen_c + INTEGER(HID_T), VALUE :: file_id + END FUNCTION H5Freopen END INTERFACE - hdferr = h5freopen_c(file_id, ret_file_id) + ret_file_id = h5freopen(file_id) + + hdferr = 0 + IF(ret_file_id.LT.0) hdferr = -1 END SUBROUTINE h5freopen_f !> !! \ingroup FH5F !! +!! \brief Asynchronously reopens HDF5 file. +!! +!! \param file_id Identifier of a file for which an additional identifier is required. +!! \param ret_file_id New file identifier. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Freopen_async() +!! + SUBROUTINE h5freopen_async_f(file_id, ret_file_id, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HID_T), INTENT(OUT) :: ret_file_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Freopen_async(file, func, line, file_id, es_id) & + BIND(C,NAME='H5Freopen_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: file_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Freopen_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + ret_file_id = h5freopen_async(file_default, func_default, line_default, file_id, es_id) + + hdferr = 0 + IF(ret_file_id.LT.0) hdferr = -1 + + END SUBROUTINE h5freopen_async_f +!> +!! \ingroup FH5F +!! !! \brief Returns a file creation property list identifier. !! !! \param file_id Identifier of a file to creation property list of. @@ -366,7 +635,7 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name LOGICAL, INTENT(OUT) :: status INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + INTEGER(HID_T), INTENT(IN), OPTIONAL :: access_prp INTEGER(HID_T) :: access_prp_default CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name @@ -437,20 +706,70 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: file_id INTEGER, INTENT(OUT) :: hdferr INTERFACE - INTEGER FUNCTION h5fclose_c(file_id) BIND(C,NAME='h5fclose_c') + INTEGER(C_INT) FUNCTION H5Fclose(file_id) BIND(C,NAME='H5Fclose') + IMPORT :: C_INT IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id - END FUNCTION h5fclose_c + INTEGER(HID_T), VALUE :: file_id + END FUNCTION H5Fclose END INTERFACE - hdferr = h5fclose_c(file_id) + hdferr = INT(H5Fclose(file_id)) END SUBROUTINE h5fclose_f !> !! \ingroup FH5F !! +!! \brief Asynchronously closes HDF5 file. +!! +!! \param file_id File identifier +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Fclose_async() +!! + SUBROUTINE h5fclose_async_f(file_id, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Fclose_async(file, func, line, file_id, es_id) & + BIND(C,NAME='H5Fclose_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: file_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Fclose_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Fclose_async(file_default, func_default, line_default, file_id, es_id)) + + END SUBROUTINE h5fclose_async_f + +!> +!! \ingroup FH5F +!! !! \brief Gets number of the objects open within a file !! !! \param file_id File identifier. diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 9513a58..445fcea 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -21,128 +21,6 @@ #include "H5f90.h" #include "H5Eprivate.h" -/****if* H5Gf/h5gcreate_c - * NAME - * h5gcreate_c - * PURPOSE - * Call H5Gcreate to create a group - * INPUTS - * loc_id - file or group identifier - * name - name of the group - * namelen - name length - * size_hint - length of names in the group - * OUTPUTS - * grp_id - group identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, August 5, 1999 - * HISTORY - * Changed to call H5Gcreate2 because H5Gcreate flip-flops and - * H5Gcreate1 can be compiled out of the library - * QAK - 2007/08/23 - * SOURCE - */ -int_f -h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id, - hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id) -/******/ -{ - hid_t c_gcpl_id = -1; /* Group creation property list */ - char *c_name = NULL; - hid_t c_grp_id; - int_f ret_value = -1; - - /* - * Convert FORTRAN name to C name - */ - if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - goto DONE; - - /* - * Call H5Gcreate function. - */ - if (*size_hint == (size_t_f)OBJECT_NAMELEN_DEFAULT_F) { - c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, (hid_t)*lcpl_id, (hid_t)*gcpl_id, (hid_t)*gapl_id); - } - else { - /* Create the group creation property list */ - if ((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto DONE; - - /* Set the local heap size hint */ - if (H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0) - goto DONE; - - /* Create the group */ - c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT); - } - if (c_grp_id < 0) - goto DONE; - - /* Everything OK, set values to return */ - *grp_id = (hid_t_f)c_grp_id; - ret_value = 0; - -DONE: - if (c_gcpl_id > 0) - H5Pclose(c_gcpl_id); - if (c_name) - HDfree(c_name); - return ret_value; -} - -/****if* H5Gf/h5gopen_c - * NAME - * h5gopen_c - * PURPOSE - * Call H5Gopen to open a dataset - * INPUTS - * loc_id - file or group identifier - * name - name of the group - * namelen - name length - * gapl_id - Group access property list identifier - * OUTPUTS - * grp_id - group identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, August 5, 1999 - * - * SOURCE - */ -int_f -h5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id) -/******/ -{ - char *c_name = NULL; - hid_t c_grp_id; - int ret_value = -1; - - /* - * Convert FORTRAN name to C name - */ - if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - goto DONE; - - /* - * Call H5Gopen function. - */ - if ((c_grp_id = H5Gopen2((hid_t)*loc_id, c_name, (hid_t)*gapl_id)) < 0) - goto DONE; - - /* Everything OK, set values to return */ - *grp_id = (hid_t_f)c_grp_id; - ret_value = 0; - -DONE: - if (c_name) - HDfree(c_name); - return ret_value; -} - /****if* H5Gf/h5gget_obj_info_idx_c * NAME * h5gget_obj_info_idx_c @@ -273,32 +151,6 @@ DONE: return ret_value; } -/****if* H5Gf/h5gclose_c - * NAME - * h5gclose_c - * PURPOSE - * Call H5Gclose to close the group - * INPUTS - * grp_id - identifier of the group to be closed - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Wednesday, August 5, 1999 - * SOURCE - */ - -int_f -h5gclose_c(hid_t_f *grp_id) -/******/ -{ - int ret_value = 0; - - if (H5Gclose((hid_t)*grp_id) < 0) - ret_value = -1; - return ret_value; -} - /****if* H5Gf/h5glink_c * NAME * h5glink_c @@ -852,203 +704,3 @@ h5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id) done: return ret_value; } - -/****if* H5Gf/h5gget_info_c - * NAME - * h5gget_info_c - * PURPOSE - * Call H5Gget_info - * INPUTS - * group_id - Group identifier - * OUTPUTS - * - * storage_type - Type of storage for links in group: - * H5G_STORAGE_TYPE_COMPACT: Compact storage - * H5G_STORAGE_TYPE_DENSE: Indexed storage - * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure - * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * mounted - Whether group has a file mounted on it (0 = false, 1 = true) - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February 15, 2008 - * HISTORY - * - * - Added 'mounted' parameter - * M. Scot Breitenfeld - * July 16, 2008 - * SOURCE - */ -int_f -h5gget_info_c(hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) -/******/ -{ - - int_f ret_value = 0; /* Return value */ - H5G_info_t ginfo; - - /* - * Call H5Gget_info function. - */ - if (H5Gget_info((hid_t)*group_id, &ginfo) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *storage_type = (int_f)ginfo.storage_type; - *nlinks = (int_f)ginfo.nlinks; - *max_corder = (int_f)ginfo.max_corder; - *mounted = 0; - if (ginfo.mounted) - *mounted = 1; - -done: - return ret_value; -} - -/****if* H5Gf/h5gget_info_by_idx_c - * NAME - * h5gget_info_by_idx_c - * PURPOSE - * Call H5Gget_info_by_idx - * INPUTS - * - * loc_id - File or group identifier - * group_name - Name of group containing group for which information is to be retrieved - * group_namelen - name length - * index_type - Index type - * order - Order of the count in the index - * n - Position in the index of the group for which information is retrieved - * lapl_id - Link access property list - * OUTPUTS - * - * storage_type - Type of storage for links in group: - * H5G_STORAGE_TYPE_COMPACT: Compact storage - * H5G_STORAGE_TYPE_DENSE: Indexed storage - * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure - * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * mounted - Whether group has a file mounted on it (0 = false, 1 = true) - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February 18, 2008 - * HISTORY - * - * - Added 'mounted' parameter - * M. Scot Breitenfeld - * July 16, 2008 - * SOURCE - */ -int_f -h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, - int_f *order, hsize_t_f *n, hid_t_f *lapl_id, int_f *storage_type, int_f *nlinks, - int_f *max_corder, int_f *mounted) -/******/ -{ - char *c_group_name = NULL; /* Buffer to hold group name C string */ - int_f ret_value = 0; /* Return value */ - H5G_info_t ginfo; - /* - * Convert FORTRAN name to C name - */ - if ((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Gget_info_by_idx function. - */ - if (H5Gget_info_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_type, (H5_iter_order_t)*order, - (hsize_t)*n, &ginfo, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *storage_type = (int_f)ginfo.storage_type; - *nlinks = (int_f)ginfo.nlinks; - *max_corder = (int_f)ginfo.max_corder; - *mounted = 0; - if (ginfo.mounted) - *mounted = 1; - -done: - if (c_group_name) - HDfree(c_group_name); - return ret_value; -} - -/****if* H5Gf/h5gget_info_by_name_c - * NAME - * h5gget_info_by_name_c - * PURPOSE - * Call H5Gget_info_by_name - * INPUTS - * - * loc_id - File or group identifier - * group_name - Name of group containing group for which information is to be retrieved - * group_namelen - name length - * lapl_id - Link access property list - * OUTPUTS - * - * storage_type - Type of storage for links in group: - * H5G_STORAGE_TYPE_COMPACT: Compact storage - * H5G_STORAGE_TYPE_DENSE: Indexed storage - * H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure - * - * nlinks - Number of links in group - * max_corder - Current maximum creation order value for group - * mounted - Whether group has a file mounted on it (0 = false, 1 = true) - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February 18, 2008 - * HISTORY - * - * - Added 'mounted' parameter - * M. Scot Breitenfeld - * July 16, 2008 - * SOURCE - */ -int_f -h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) -/******/ -{ - char *c_group_name = NULL; /* Buffer to hold group name C string */ - int_f ret_value = 0; /* Return value */ - H5G_info_t ginfo; - /* - * Convert FORTRAN name to C name - */ - if ((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Gget_info_by_name function. - */ - if (H5Gget_info_by_name((hid_t)*loc_id, c_group_name, &ginfo, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - - /* Unpack the structure */ - - *storage_type = (int_f)ginfo.storage_type; - *nlinks = (int_f)ginfo.nlinks; - *max_corder = (int_f)ginfo.max_corder; - *mounted = 0; - if (ginfo.mounted) - *mounted = 1; - -done: - if (c_group_name) - HDfree(c_group_name); - return ret_value; -} diff --git a/fortran/src/H5Gff.F90 b/fortran/src/H5Gff.F90 index 436eece..655c226 100644 --- a/fortran/src/H5Gff.F90 +++ b/fortran/src/H5Gff.F90 @@ -36,8 +36,127 @@ ! MODULE H5G - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_CHAR + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_CHAR, C_INT USE H5GLOBAL + USE H5P, ONLY : H5Pcreate_f, H5Pset_local_heap_size_hint_f, H5Pclose_f + + +! +! @brief Fortran2003 Derived Type for @ref H5G_info_t +! + TYPE, BIND(C) :: H5G_info_t + INTEGER(C_INT ) :: storage_type !< Type of storage for links in group: + !< \li H5G_STORAGE_TYPE_COMPACT_F: Compact storage + !< \li H5G_STORAGE_TYPE_DENSE_F: Indexed storage + !< \li H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure + INTEGER(HSIZE_T) :: nlinks !< Number of links in group + INTEGER(C_INT64_T) :: max_corder !< Current maximum creation order value for group + LOGICAL(C_BOOL) :: mounted !< Whether group has a file mounted on it + END TYPE H5G_info_t + +#ifndef H5_DOXYGEN + INTERFACE H5Gget_info_f + MODULE PROCEDURE h5Gget_info_f90 + MODULE PROCEDURE h5Gget_info_f03 + END INTERFACE + + INTERFACE H5Gget_info_by_idx_f + MODULE PROCEDURE H5Gget_info_by_idx_f90 + MODULE PROCEDURE H5Gget_info_by_idx_f03 + END INTERFACE + + INTERFACE H5Gget_info_by_name_f + MODULE PROCEDURE H5Gget_info_by_name_f90 + MODULE PROCEDURE H5Gget_info_by_name_f03 + END INTERFACE + + INTERFACE + INTEGER(C_INT) FUNCTION H5Gget_info(loc_id, ginfo) BIND(C,NAME='H5Gget_info') + IMPORT :: C_INT, C_PTR + IMPORT :: HID_T + INTEGER(HID_T), VALUE :: loc_id + TYPE(C_PTR), VALUE :: ginfo + END FUNCTION H5Gget_info + END INTERFACE + + INTERFACE + INTEGER(C_INT) FUNCTION H5Gget_info_async(file, func, line, loc_id, ginfo, es_id) & + BIND(C,NAME='H5Gget_info_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + TYPE(C_PTR) , VALUE :: ginfo + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Gget_info_async + END INTERFACE + + INTERFACE + INTEGER(C_INT) FUNCTION H5Gget_info_by_idx(loc_id, group_name, idx_type, order, n, ginfo, lapl_id) & + BIND(C,NAME='H5Gget_info_by_idx') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: group_name + INTEGER(C_INT) , VALUE :: idx_type + INTEGER(C_INT) , VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + TYPE(C_PTR) , VALUE :: ginfo + INTEGER(HID_T) , VALUE :: lapl_id + END FUNCTION H5Gget_info_by_idx + END INTERFACE + + INTERFACE + INTEGER(C_INT) FUNCTION H5Gget_info_by_idx_async(file, func, line, loc_id, & + group_name, idx_type, order, n, ginfo, lapl_id, es_id) & + BIND(C,NAME='H5Gget_info_by_idx_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: group_name + INTEGER(C_INT) , VALUE :: idx_type + INTEGER(C_INT) , VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + TYPE(C_PTR) , VALUE :: ginfo + INTEGER(HID_T) , VALUE :: lapl_id + INTEGER(HID_T) , VALUE :: es_id + END FUNCTION H5Gget_info_by_idx_async + END INTERFACE + + INTERFACE + INTEGER(C_INT) FUNCTION H5Gget_info_by_name(loc_id, name, ginfo, lapl_id) & + BIND(C,NAME='H5Gget_info_by_name') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + TYPE(C_PTR), VALUE :: ginfo + INTEGER(HID_T), VALUE :: lapl_id + END FUNCTION H5Gget_info_by_name + END INTERFACE + + INTERFACE + INTEGER(C_INT) FUNCTION H5Gget_info_by_name_async(file, func, line,loc_id, name, ginfo, lapl_id, es_id) & + BIND(C,NAME='H5Gget_info_by_name_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + TYPE(C_PTR), VALUE :: ginfo + INTEGER(HID_T), VALUE :: lapl_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Gget_info_by_name_async + END INTERFACE + +#endif CONTAINS @@ -52,7 +171,7 @@ CONTAINS !! \param hdferr \fortran_error !! \param size_hint A parameter indicating the number of bytes to reserve for the names that will appear in the group. !! Set to OBJECT_NAMELEN_DEFAULT_F if using any of the optional parameters lcpl_id, gcpl_id, -!! and/or gapl_id when not using keywords in specifying the optional parameters. +!! and/or gapl_id when not using keywords in specifying the optional parameters. See @ref H5Gcreate1(). !! \param lcpl_id Property list for link creation. !! \param gcpl_id Property list for group creation. !! \param gapl_id Property list for group access. @@ -65,50 +184,187 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(OUT) :: grp_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id + INTEGER(SIZE_T), INTENT(IN), OPTIONAL :: size_hint + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: gcpl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: gapl_id INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: gcpl_id_default INTEGER(HID_T) :: gapl_id_default - INTEGER :: namelen ! Length of the name character string INTEGER(SIZE_T) :: size_hint_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & - size_hint_default, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) & - BIND(C,NAME='h5gcreate_c') + INTEGER(HID_T) FUNCTION H5Gcreate2(loc_id, name, & + lcpl_id_default, gcpl_id_default, gapl_id_default) & + BIND(C,NAME='H5Gcreate2') IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(SIZE_T) :: size_hint_default - INTEGER(HID_T), INTENT(OUT) :: grp_id - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: gcpl_id_default - INTEGER(HID_T) :: gapl_id_default - END FUNCTION h5gcreate_c + IMPORT :: HID_T + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: gcpl_id_default + INTEGER(HID_T), VALUE :: gapl_id_default + END FUNCTION H5Gcreate2 END INTERFACE - size_hint_default = OBJECT_NAMELEN_DEFAULT_F - IF (PRESENT(size_hint)) size_hint_default = size_hint + hdferr = 0 + c_name = TRIM(name)//C_NULL_CHAR + lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id gcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id gapl_id_default = H5P_DEFAULT_F - IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + size_hint_default = OBJECT_NAMELEN_DEFAULT_F - namelen = LEN(name) + IF(PRESENT(size_hint)) size_hint_default = size_hint + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id + IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + ! + ! size_hint was introduced as an overload option for H5Gcreate1, + ! it was removed in H5Gcreate2. + ! + IF(size_hint_default .EQ. OBJECT_NAMELEN_DEFAULT_F)THEN + grp_id = H5Gcreate2(loc_id, c_name, & + lcpl_id_default, gcpl_id_default, gapl_id_default) + ELSE + ! Create the group creation property list + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id_default, hdferr) + IF(hdferr.LT.0) RETURN + + ! Set the local heap size hint + CALL H5Pset_local_heap_size_hint_f(gcpl_id_default, size_hint, hdferr) + IF(hdferr.LT.0)THEN + CALL H5Pclose_f(gcpl_id_default, hdferr) + hdferr = -1 + RETURN + END IF + + grp_id = H5Gcreate2(loc_id, c_name, & + H5P_DEFAULT_F, gcpl_id_default, H5P_DEFAULT_F) + + CALL H5Pclose_f(gcpl_id_default, hdferr) + IF(hdferr.LT.0) RETURN + ENDIF - hdferr = h5gcreate_c(loc_id, name, namelen, size_hint_default, grp_id, & - lcpl_id_default, gcpl_id_default, gapl_id_default) + IF(grp_id.LT.0) hdferr = -1 END SUBROUTINE h5gcreate_f + +!> +!! \ingroup FH5G +!! +!! \brief Asynchronously creates a new group. +!! +!! \param loc_id Location identifier. +!! \param name Group name at the specified location. +!! \param grp_id Group identifier. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param size_hint A parameter indicating the number of bytes to reserve for the names that will appear in the group. +!! Set to OBJECT_NAMELEN_DEFAULT_F if using any of the optional parameters lcpl_id, gcpl_id, +!! and/or gapl_id when not using keywords in specifying the optional parameters. See @ref H5Gcreate1(). +!! \param lcpl_id Property list for link creation. +!! \param gcpl_id Property list for group creation. +!! \param gapl_id Property list for group access. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Gcreate_async() +!! + SUBROUTINE h5gcreate_async_f(loc_id, name, grp_id, es_id, hdferr, & + size_hint, lcpl_id, gcpl_id, gapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(OUT) :: grp_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(SIZE_T), INTENT(IN), OPTIONAL :: size_hint + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: gcpl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: gapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: gcpl_id_default + INTEGER(HID_T) :: gapl_id_default + INTEGER(SIZE_T) :: size_hint_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Gcreate_async(file, func, line, loc_id, name, & + lcpl_id_default, gcpl_id_default, gapl_id_default, es_id) & + BIND(C,NAME='H5Gcreate_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: gcpl_id_default + INTEGER(HID_T), VALUE :: gapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Gcreate_async + END INTERFACE + + hdferr = 0 + c_name = TRIM(name)//C_NULL_CHAR + + lcpl_id_default = H5P_DEFAULT_F + gcpl_id_default = H5P_DEFAULT_F + gapl_id_default = H5P_DEFAULT_F + size_hint_default = OBJECT_NAMELEN_DEFAULT_F + + IF(PRESENT(size_hint)) size_hint_default = size_hint + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF(PRESENT(gcpl_id)) gcpl_id_default = gcpl_id + IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + ! + ! size_hint was introduced as an overload option for H5Gcreate1, + ! it was removed in H5Gcreate2. + ! + IF(size_hint_default .EQ. OBJECT_NAMELEN_DEFAULT_F)THEN + grp_id = H5Gcreate_async(file_default, func_default, line_default, loc_id, c_name, & + lcpl_id_default, gcpl_id_default, gapl_id_default, es_id) + ELSE + ! Create the group creation property list + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id_default, hdferr) + IF(hdferr.LT.0) RETURN + + ! Set the local heap size hint + CALL H5Pset_local_heap_size_hint_f(gcpl_id_default, size_hint, hdferr) + IF(hdferr.LT.0)THEN + CALL H5Pclose_f(gcpl_id_default, hdferr) + hdferr = -1 + RETURN + END IF + + grp_id = H5Gcreate_async(file_default, func_default, line_default, loc_id, c_name, & + H5P_DEFAULT_F, gcpl_id_default, H5P_DEFAULT_F, es_id) + + CALL H5Pclose_f(gcpl_id_default, hdferr) + IF(hdferr.LT.0) RETURN + ENDIF + + IF(grp_id.LT.0) hdferr = -1 + + END SUBROUTINE h5gcreate_async_f + !> !! \ingroup FH5G !! @@ -128,30 +384,100 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(OUT) :: grp_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: gapl_id + + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTEGER(HID_T) :: gapl_id_default - INTEGER :: namelen ! Length of the name character string INTERFACE - INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) & - BIND(C,NAME='h5gopen_c') + INTEGER(HID_T) FUNCTION H5Gopen2(loc_id, name, gapl_id_default) & + BIND(C,NAME='H5Gopen2') IMPORT :: C_CHAR IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: gapl_id_default - INTEGER(HID_T), INTENT(OUT) :: grp_id - END FUNCTION h5gopen_c + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: gapl_id_default + END FUNCTION H5Gopen2 END INTERFACE + c_name = TRIM(name)//C_NULL_CHAR + gapl_id_default = H5P_DEFAULT_F IF(PRESENT(gapl_id)) gapl_id_default = gapl_id - namelen = LEN(name) - hdferr = h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) + grp_id = H5Gopen2(loc_id, c_name, gapl_id_default) + + hdferr = 0 + IF(grp_id.LT.0) hdferr = -1 END SUBROUTINE h5gopen_f + +!> +!! \ingroup FH5G +!! +!! \brief Asynchronously opens an existing group. +!! +!! \param loc_id Location identifier. +!! \param name Name of the group to open. +!! \param grp_id Group identifier. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param gapl_id Group access property list identifier. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Gopen_async() +!! + SUBROUTINE h5gopen_async_f(loc_id, name, grp_id, es_id, hdferr, & + gapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(OUT) :: grp_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: gapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: gapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Gopen_async(file, func, line, loc_id, name, gapl_id_default, es_id) & + BIND(C,NAME='H5Gopen_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: gapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Gopen_async + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + + gapl_id_default = H5P_DEFAULT_F + IF(PRESENT(gapl_id)) gapl_id_default = gapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + grp_id = H5Gopen_async(file_default, func_default, line_default, & + loc_id, c_name, gapl_id_default, es_id) + + hdferr = 0 + IF(grp_id.LT.0) hdferr = -1 + + END SUBROUTINE h5gopen_async_f !> !! \ingroup FH5G !! @@ -167,18 +493,66 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: grp_id INTEGER, INTENT(OUT) :: hdferr INTERFACE - INTEGER FUNCTION h5gclose_c(grp_id) BIND(C,NAME='h5gclose_c') + INTEGER(C_INT) FUNCTION H5Gclose(grp_id) BIND(C,NAME='H5Gclose') + IMPORT :: C_INT IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN) :: grp_id - END FUNCTION h5gclose_c + INTEGER(HID_T), VALUE :: grp_id + END FUNCTION H5Gclose END INTERFACE - hdferr = h5gclose_c(grp_id) + hdferr = INT(H5Gclose(grp_id)) END SUBROUTINE h5gclose_f !> !! \ingroup FH5G !! +!! \brief Asynchronously closes the specified group. +!! +!! \param grp_id Group identifier. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Gclose_async() +!! + SUBROUTINE h5gclose_async_f(grp_id, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: grp_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Gclose_async(file, func, line, grp_id, es_id) & + BIND(C,NAME='H5Gclose_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: grp_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Gclose_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Gclose_async(file_default, func_default, line_default, grp_id, es_id)) + + END SUBROUTINE h5gclose_async_f +!> +!! \ingroup FH5G +!! !! \brief Returns name and type of the group member identified by its index. !! !! \param loc_id Location identifier. @@ -604,8 +978,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER(HID_T), INTENT(OUT) :: grp_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: gcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: gapl_id INTEGER(HID_T) :: gcpl_id_default INTEGER(HID_T) :: gapl_id_default @@ -657,15 +1031,96 @@ CONTAINS END SUBROUTINE h5gget_create_plist_f +#ifdef H5_DOXYGEN !> !! \ingroup FH5G !! !! \brief Retrieves information about a group !! -!! \param group_id Group identifier. +!! \attention \fortran_approved +!! +!! \param loc_id Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. +!! \param ginfo Derived type in which group information is returned. +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Gget_info() +!! + SUBROUTINE h5gget_info_f(& +#else + SUBROUTINE h5gget_info_f03(& +#endif + loc_id, ginfo, hdferr) + + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: loc_id + TYPE(H5G_info_t), INTENT(OUT), TARGET :: ginfo + INTEGER , INTENT(OUT) :: hdferr + + TYPE(C_PTR) :: ptr + + ptr = C_LOC(ginfo) + + hdferr = INT(H5Gget_info(loc_id, ptr)) + +#ifdef H5_DOXYGEN + END SUBROUTINE h5gget_info_f +#else + END SUBROUTINE h5gget_info_f03 +#endif + +!> +!! \ingroup FH5G +!! +!! \brief Asynchronously retrieves information about a group +!! +!! \param loc_id Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. +!! \param ginfo Derived type in which group information is returned. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Gget_info_async() +!! + SUBROUTINE h5gget_info_async_f(loc_id, ginfo, es_id, hdferr, file, func, line) + + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: loc_id + TYPE(H5G_info_t), INTENT(OUT), TARGET :: ginfo + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: ptr + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + ptr = C_LOC(ginfo) + + hdferr = INT(H5Gget_info_async(file_default, func_default, line_default, loc_id, ptr, es_id)) + + END SUBROUTINE h5gget_info_async_f + +!> +!! \ingroup FH5G +!! +!! \brief Retrieves information about a group. +!! +!! \attention \fortran_obsolete. Both nlinks and max_corder can overflow. +!! +!! \param loc_id Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. !! \param storage_type Type of storage for links in group: !! \li H5G_STORAGE_TYPE_COMPACT_F: Compact storage -!! \li H5G_STORAGE_TYPE_DENS_FE: Indexed storage +!! \li H5G_STORAGE_TYPE_DENSE_F: Indexed storage !! \li H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure !! \param nlinks Number of links in group. !! \param max_corder Current maximum creation order value for group. @@ -674,48 +1129,169 @@ CONTAINS !! !! See C API: @ref H5Gget_info() !! - SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr, mounted) +#ifdef H5_DOXYGEN + SUBROUTINE h5gget_info_f(& +#else + SUBROUTINE h5gget_info_f90(& +#endif + loc_id, storage_type, nlinks, max_corder, hdferr, mounted) + IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: group_id + INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER, INTENT(OUT) :: storage_type INTEGER, INTENT(OUT) :: nlinks INTEGER, INTENT(OUT) :: max_corder INTEGER, INTENT(OUT) :: hdferr LOGICAL, INTENT(OUT), OPTIONAL :: mounted - INTEGER :: mounted_c - INTERFACE - INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) & - BIND(C,NAME='h5gget_info_c') - IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN) :: group_id - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - INTEGER :: mounted_c - END FUNCTION h5gget_info_c - END INTERFACE + TYPE(H5G_info_t), TARGET :: ginfo + TYPE(C_PTR) :: ptr + + ptr = C_LOC(ginfo) + hdferr = INT(H5Gget_info(loc_id, ptr)) - hdferr = h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) + storage_type = INT(ginfo%storage_type) + nlinks = INT(ginfo%nlinks) + max_corder = INT(ginfo%max_corder) IF(PRESENT(mounted))THEN - IF(mounted_c.EQ.0) THEN - mounted = .FALSE. - ELSE + IF(ginfo%mounted) THEN mounted = .TRUE. + ELSE + mounted = .FALSE. ENDIF ENDIF - +#ifdef H5_DOXYGEN END SUBROUTINE h5gget_info_f +#else + END SUBROUTINE h5gget_info_f90 +#endif + +!> +!! \ingroup FH5G +!! +!! \brief Retrieves information about a group, according to the group’s position within an index. +!! +!! \attention \fortran_approved +!! +!! \param loc_id Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. +!! \param group_name Name of group containing group for which information is to be retrieved. +!! \param idx_type Index type. +!! \param order Order of the count in the index. +!! \param n Position in the index of the group for which information is retrieved. +!! \param ginfo Derived type in which group information is returned. +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list. +!! +!! See C API: @ref H5Gget_info_by_idx() +!! +#ifdef H5_DOXYGEN + SUBROUTINE h5gget_info_by_idx_f(& +#else + SUBROUTINE h5gget_info_by_idx_f03(& +#endif + loc_id, group_name, idx_type, order, n, ginfo, hdferr, lapl_id) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER, INTENT(IN) :: idx_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + TYPE(H5G_info_t), INTENT(OUT), TARGET :: ginfo + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(group_name)+1,KIND=C_CHAR) :: c_group_name + TYPE(C_PTR) :: ptr + + c_group_name = TRIM(group_name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + ptr = C_LOC(ginfo) + + hdferr = H5Gget_info_by_idx(loc_id, c_group_name, & + INT(idx_type,C_INT), INT(order, C_INT), n, ptr, lapl_id_default ) + +#ifdef H5_DOXYGEN + END SUBROUTINE h5gget_info_by_idx_f +#else + END SUBROUTINE h5gget_info_by_idx_f03 +#endif + +!> +!! \ingroup FH5G +!! +!! \brief Asynchronously retrieves information about a group, according to the group’s position within an index. +!! +!! \param loc_id Location identifier. The identifier may be that of a file, group, dataset, named datatype, or attribute. +!! \param group_name Name of group containing group for which information is to be retrieved. +!! \param idx_type Index type. +!! \param order Order of the count in the index. +!! \param n Position in the index of the group for which information is retrieved. +!! \param ginfo Derived type in which group information is returned. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Gget_info_by_idx_async() +!! + SUBROUTINE h5gget_info_by_idx_async_f(loc_id, group_name, idx_type, order, n, ginfo, es_id, hdferr, & + lapl_id, file, func, line) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER, INTENT(IN) :: idx_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + TYPE(H5G_info_t), INTENT(OUT), TARGET :: ginfo + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(group_name)+1,KIND=C_CHAR) :: c_group_name + TYPE(C_PTR) :: ptr + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + c_group_name = TRIM(group_name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + ptr = C_LOC(ginfo) + + hdferr = H5Gget_info_by_idx_async(file_default, func_default, line_default, loc_id, c_group_name, & + INT(idx_type,C_INT), INT(order, C_INT), n, ptr, lapl_id_default, es_id ) + + END SUBROUTINE h5gget_info_by_idx_async_f + !> !! \ingroup FH5G !! !! \brief Retrieves information about a group, according to the group’s position within an index. !! +!! \attention \fortran_obsolete. Both nlinks and max_corder can overflow. +!! !! \param loc_id File or group identifier. !! \param group_name Name of group containing group for which information is to be retrieved. -!! \param index_type Index type. +!! \param idx_type Index type. !! \param order Order of the count in the index. !! \param n Position in the index of the group for which information is retrieved. !! \param storage_type Type of storage for links in group: @@ -730,71 +1306,164 @@ CONTAINS !! !! See C API: @ref H5Gget_info_by_idx() !! - SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, & +#ifdef H5_DOXYGEN + SUBROUTINE h5gget_info_by_idx_f(& +#else + SUBROUTINE h5gget_info_by_idx_f90(& +#endif + loc_id, group_name, idx_type, order, n, & storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: idx_type INTEGER, INTENT(IN) :: order INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER, INTENT(OUT) :: storage_type INTEGER, INTENT(OUT) :: nlinks INTEGER, INTENT(OUT) :: max_corder INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id LOGICAL, INTENT(OUT), OPTIONAL :: mounted - INTEGER :: mounted_c - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_name_len ! length of group name - INTERFACE - INTEGER FUNCTION h5gget_info_by_idx_c(loc_id, group_name, group_name_len, index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) BIND(C,NAME='h5gget_info_by_idx_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T, HSIZE_T - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name - INTEGER, INTENT(IN) :: index_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - - INTEGER(SIZE_T) :: group_name_len - INTEGER :: mounted_c - - END FUNCTION h5gget_info_by_idx_c - END INTERFACE + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(group_name)+1,KIND=C_CHAR) :: c_group_name + TYPE(H5G_info_t), TARGET :: ginfo + TYPE(C_PTR) :: ptr - group_name_len = LEN(group_name) + c_group_name = TRIM(group_name)//C_NULL_CHAR + ptr = C_LOC(ginfo) lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = h5gget_info_by_idx_c(loc_id, group_name, group_name_len, & - index_type, order, n, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) + + hdferr = H5Gget_info_by_idx(loc_id, c_group_name, & + INT(idx_type,C_INT), INT(order, C_INT), n, ptr, lapl_id_default ) + + storage_type = INT(ginfo%storage_type) + nlinks = INT(ginfo%nlinks) + max_corder = INT(ginfo%max_corder) IF(PRESENT(mounted))THEN - IF(mounted_c.EQ.0) THEN - mounted = .FALSE. - ELSE + IF(ginfo%mounted) THEN mounted = .TRUE. + ELSE + mounted = .FALSE. ENDIF ENDIF - +#ifdef H5_DOXYGEN END SUBROUTINE h5gget_info_by_idx_f +#else + END SUBROUTINE h5gget_info_by_idx_f90 +#endif !> !! \ingroup FH5G !! -!! \brief Retrieves information about a group. +!! \brief Retrieves information about a group by its name. +!! +!! \attention \fortran_approved +!! +!! \param loc_id File or group identifier. +!! \param name Name of group containing group for which information is to be retrieved. +!! \param ginfo Derived type in which group information is returned. +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list. +!! +!! See C API: @ref H5Gget_info_by_name() +!! +#ifdef H5_DOXYGEN + SUBROUTINE h5gget_info_by_name_f( & +#else + SUBROUTINE h5gget_info_by_name_f03( & +#endif + loc_id, name, ginfo, hdferr, lapl_id) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(H5G_info_t), INTENT(OUT), TARGET :: ginfo + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: ptr + + c_name = TRIM(name)//C_NULL_CHAR + ptr = C_LOC(ginfo) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = INT(h5gget_info_by_name(loc_id, c_name, ptr, lapl_id_default)) + +#ifdef H5_DOXYGEN + END SUBROUTINE h5gget_info_by_name_f +#else + END SUBROUTINE h5gget_info_by_name_f03 +#endif + +!> +!! \ingroup FH5G +!! +!! \brief Asynchronously retrieves information about a group by its name. +!! +!! \param loc_id File or group identifier. +!! \param name Name of group containing group for which information is to be retrieved. +!! \param ginfo Derived type in which group information is returned. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list. +!! +!! See C API: @ref H5Gget_info_by_name_async() +!! + SUBROUTINE h5gget_info_by_name_async_f(loc_id, name, ginfo, es_id, hdferr, & + lapl_id, file, func, line) + + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(H5G_info_t), INTENT(OUT), TARGET :: ginfo + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: ptr + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + c_name = TRIM(name)//C_NULL_CHAR + ptr = C_LOC(ginfo) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(h5gget_info_by_name_async(file_default, func_default, line_default, & + loc_id, c_name, ptr, lapl_id_default, es_id)) + + END SUBROUTINE h5gget_info_by_name_async_f + +!> +!! \ingroup FH5G +!! +!! \brief Retrieves information about a group by its name. +!! +!! \attention \fortran_obsolete. Both nlinks and max_corder can overflow. !! !! \param loc_id File or group identifier. -!! \param group_name Name of group containing group for which information is to be retrieved. +!! \param name Name of group containing group for which information is to be retrieved. !! \param storage_type Type of storage for links in group: !! \li H5G_STORAGE_TYPE_COMPACT_F: Compact storage !! \li H5G_STORAGE_TYPE_DENSE_F: Indexed storage @@ -807,56 +1476,53 @@ CONTAINS !! !! See C API: @ref H5Gget_info_by_name() !! - SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, & - storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) +#ifdef H5_DOXYGEN + SUBROUTINE h5gget_info_by_name_f( & +#else + SUBROUTINE h5gget_info_by_name_f90( & +#endif + loc_id, name, storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) + IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name + CHARACTER(LEN=*), INTENT(IN) :: name INTEGER, INTENT(OUT) :: storage_type INTEGER, INTENT(OUT) :: nlinks INTEGER, INTENT(OUT) :: max_corder INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id LOGICAL, INTENT(OUT), OPTIONAL :: mounted - INTEGER :: mounted_c - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_name_len ! length of group name - - INTERFACE - INTEGER FUNCTION h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) BIND(C,NAME='h5gget_info_by_name_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name - INTEGER(HID_T), INTENT(IN) :: lapl_id_default - INTEGER, INTENT(OUT) :: storage_type - INTEGER, INTENT(OUT) :: nlinks - INTEGER, INTENT(OUT) :: max_corder - - INTEGER(SIZE_T) :: group_name_len - INTEGER :: mounted_c - END FUNCTION h5gget_info_by_name_c - END INTERFACE + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(H5G_info_t), TARGET :: ginfo + TYPE(C_PTR) :: ptr - group_name_len = LEN(group_name) + c_name = TRIM(name)//C_NULL_CHAR + ptr = C_LOC(ginfo) lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & - storage_type, nlinks, max_corder, mounted_c) + hdferr = INT(H5Gget_info_by_name(loc_id, c_name, ptr, lapl_id_default)) + + storage_type = INT(ginfo%storage_type) + nlinks = INT(ginfo%nlinks) + max_corder = INT(ginfo%max_corder) IF(PRESENT(mounted))THEN - IF(mounted_c.EQ.0) THEN - mounted = .FALSE. - ELSE + IF(ginfo%mounted) THEN mounted = .TRUE. + ELSE + mounted = .FALSE. ENDIF ENDIF +#ifdef H5_DOXYGEN END SUBROUTINE h5gget_info_by_name_f +#else + END SUBROUTINE h5gget_info_by_name_f90 +#endif END MODULE H5G diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index ef0128a..ffc6e08 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -273,7 +273,6 @@ done: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, August 24, 2004 - * Modifications: *---------------------------------------------------------------------------*/ int_f h5iis_valid_c(hid_t_f *obj_id, int_f *c_valid) diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 6951fef..63bed99 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -144,277 +144,6 @@ done: return ret_value; } -/****if* H5Lf/h5ldelete_c - * NAME - * h5ldelete_c - * PURPOSE - * Call H5Ldelete - * INPUTS - * - * - * loc_id - Identifier of the file or group containing the object - * name - Name of the link to delete - * lapl_id - Link access property list identifier - * namelen - length of name - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * January, 2008 - * SOURCE - */ - -int_f -h5ldelete_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id) -/******/ -{ - char *c_name = NULL; - int_f ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Ldelete function. - */ - if (H5Ldelete((hid_t)*loc_id, c_name, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_name) - HDfree(c_name); - - return ret_value; -} - -/****if* H5Lf/h5lcreate_soft_c - * NAME - * h5lcreate_soft_c - * PURPOSE - * Call H5Lcreate_soft - * INPUTS - * - * - * target_path - Path to the target object, which is not required to exist. - * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February 20, 2008 - * SOURCE - */ - -int_f -h5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, hid_t_f *link_loc_id, _fcd link_name, - size_t_f *link_name_len, hid_t_f *lcpl_id, hid_t_f *lapl_id) -/******/ -{ - char *c_target_path = NULL; - char *c_link_name = NULL; - int_f ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if ((c_target_path = HD5f2cstring(target_path, (size_t)*target_path_len)) == NULL) - HGOTO_DONE(FAIL); - if ((c_link_name = HD5f2cstring(link_name, (size_t)*link_name_len)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Adelete function. - */ - if (H5Lcreate_soft(c_target_path, (hid_t)*link_loc_id, c_link_name, (hid_t)*lcpl_id, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_target_path) - HDfree(c_target_path); - if (c_link_name) - HDfree(c_link_name); - - return ret_value; -} - -/****if* H5Lf/h5lcreate_hard_c - * NAME - * h5lcreate_hard_c - * PURPOSE - * Call H5Lcreate_hard - * INPUTS - * - * obj_loc_id - The file or group identifier for the target object. - * obj_name - Name of the target object, which must already exist. - * obj_namelen - Name length - * link_loc_id - The file or group identifier for the new link. - * link_name - The name of the new link. - * link_namelen- Name length - * lcpl_id - Link creation property list identifier. - * lapl_id - Link access property list identifier. - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February 27, 2008 - * SOURCE - */ -int_f -h5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, hid_t_f *link_loc_id, - _fcd link_name, size_t_f *link_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) -/******/ -{ - char *c_obj_name = NULL; - char *c_link_name = NULL; - int_f ret_value = 0; - - /* - * Convert FORTRAN name to C name - */ - if ((c_obj_name = HD5f2cstring(obj_name, (size_t)*obj_namelen)) == NULL) - HGOTO_DONE(FAIL); - if ((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lcreate_hard function. - */ - if (H5Lcreate_hard((hid_t)*obj_loc_id, c_obj_name, (hid_t)*link_loc_id, c_link_name, (hid_t)*lcpl_id, - (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_obj_name) - HDfree(c_obj_name); - if (c_link_name) - HDfree(c_link_name); - - return ret_value; -} - -/****if* H5Lf/h5ldelete_by_idx_c - * NAME - * h5ldelete_by_idx_c - * PURPOSE - * Calls h5ldelete_by_idx - * INPUTS - * - * loc_id - File or group identifier specifying location of subject group - * group_name - Name of subject group - * group_namelen - Name length - * index_field - Type of index; Possible values are: - * H5_INDEX_UNKNOWN_F = -1 - Unknown index type - * H5_INDEX_NAME_F - Index on names - * H5_INDEX_CRT_ORDER_F - Index on creation order - * H5_INDEX_N_F - Number of indices defined - * order - Order within field or index; Possible values are: - * H5_ITER_UNKNOWN_F - Unknown order - * H5_ITER_INC_F - Increasing order - * H5_ITER_DEC_F - Decreasing order - * H5_ITER_NATIVE_F - No particular order, whatever is fastest - * H5_ITER_N_F - Number of iteration orders - * n - Link for which to retrieve information - * lapl_id - Link access property list - * - * OUTPUTS - * N/A - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February 29, 2008 - * HISTORY - * N/A - * SOURCE - */ -int_f -h5ldelete_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, - int_f *order, hsize_t_f *n, hid_t_f *lapl_id) -/******/ -{ - char *c_group_name = NULL; /* Buffer to hold C string */ - H5_index_t c_index_field; - H5_iter_order_t c_order; - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - c_index_field = (H5_index_t)*index_field; - c_order = (H5_iter_order_t)*order; - - /* - * Call H5Ldelete_by_name function. - */ - if (H5Ldelete_by_idx((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n, (hid_t)*lapl_id) < - 0) - HGOTO_DONE(FAIL); - -done: - if (c_group_name) - HDfree(c_group_name); - return ret_value; -} - -/****if* H5Lf/h5lexists_c - * NAME - * h5lexists_c - * PURPOSE - * Calls H5Lexists - * INPUTS - * - * loc_id - Identifier of the file or group to query. - * name - Link name to check - * lapl_id - Link access property list identifier. - * OUTPUTS - * - * link_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * February 29, 2008 - * HISTORY - * - * SOURCE - */ -int_f -h5lexists_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists) -/******/ -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Lexists function. - */ - if ((*link_exists = (int_f)H5Lexists((hid_t)*loc_id, c_name, (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_name) - HDfree(c_name); - return ret_value; -} - /****if* H5Lf/h5lget_info_c * NAME * h5lget_info_c @@ -953,55 +682,6 @@ done: return ret_value; } -/****if* H5Lf/h5literate_c - * NAME - * h5literate_c - * PURPOSE - * Calls H5Literate - * INPUTS - * - * group_id - Identifier specifying subject group - * index_type - Type of index which determines the order - * order - Order within index - * idx - Iteration position at which to start - * op - Callback function passing data regarding the link to the calling application - * op_data - User-defined pointer to data required by the application for its processing of the link - * - * OUTPUTS - * - * idx - Position at which an interrupted iteration may be restarted - * - * RETURNS - * >0 on success, 0< on failure - * AUTHOR - * M. Scot Breitenfeld - * July 8, 2008 - * SOURCE - */ -int_f -h5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate2_t op, - void *op_data) -/******/ -{ - int_f ret_value = -1; /* Return value */ - herr_t func_ret_value; /* H5Linterate return value */ - hsize_t idx_c = 0; - - idx_c = (hsize_t)*idx; - - /* - * Call H5Linterate - */ - - func_ret_value = - H5Literate2((hid_t)*group_id, (H5_index_t)*index_type, (H5_iter_order_t)*order, &idx_c, op, op_data); - - ret_value = (int_f)func_ret_value; - *idx = (hsize_t_f)idx_c; - - return ret_value; -} - /****if* H5Lf/h5literate_by_name_c * NAME * h5literate_by_name_c diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 index 8171c1b..9111144 100644 --- a/fortran/src/H5Lff.F90 +++ b/fortran/src/H5Lff.F90 @@ -42,13 +42,14 @@ MODULE H5L IMPLICIT NONE + TYPE, bind(c) :: union_t TYPE(H5O_TOKEN_T_F) :: token !< Type for object tokens INTEGER(size_t) :: val_size !< Size of a soft link or user-defined link value END TYPE union_t ! -! @brief Fortran2003 Derived Type for h5l_info_t +! @brief Fortran2003 Derived Type for @ref H5L_info_t ! TYPE, bind(c) :: h5l_info_t INTEGER(c_int) :: type !< Specifies the link class. Valid values include the following: @@ -90,8 +91,8 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: dest_name INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default @@ -147,34 +148,96 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: name INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5ldelete_c(loc_id, name, namelen, lapl_id_default) BIND(C,name='h5ldelete_c') - IMPORT :: c_char + INTEGER(C_INT) FUNCTION H5Ldelete(loc_id, name, lapl_id_default) BIND(C,name='H5Ldelete') + IMPORT :: C_CHAR, C_INT, C_PTR IMPORT :: HID_T, SIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - END FUNCTION h5ldelete_c + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION h5ldelete END INTERFACE - namelen = LEN(name) + c_name = TRIM(name)//C_NULL_CHAR lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = h5ldelete_c(loc_id, name, namelen, lapl_id_default) + hdferr = INT(H5Ldelete(loc_id, c_name, lapl_id_default)) END SUBROUTINE h5ldelete_f !> !! \ingroup FH5L !! +!! \brief Asynchronously removes a link from a group. +!! +!! \param loc_id Identifier of the file or group containing the object. +!! \param name Name of the link to delete. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list identifier. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Ldelete_async() +!! + SUBROUTINE h5ldelete_async_f(loc_id, name, es_id, hdferr, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Ldelete_async(file, func, line, loc_id, name, lapl_id_default, es_id) & + BIND(C,name='H5Ldelete_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Ldelete_async + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Ldelete_async(file_default, func_default, line_default, & + loc_id, c_name, lapl_id_default, es_id)) + + END SUBROUTINE h5ldelete_async_f + +!> +!! \ingroup FH5L +!! !! \brief Creates a soft link to an object. !! !! \param target_path Path to the target object, which is not required to exist. @@ -192,49 +255,118 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: link_loc_id CHARACTER(LEN=*), INTENT(IN) :: link_name INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: target_path_len - INTEGER(SIZE_T) :: link_name_len + CHARACTER(LEN=LEN_TRIM(target_path) +1,KIND=C_CHAR) :: c_target_path + CHARACTER(LEN=LEN_TRIM(link_name)+1,KIND=C_CHAR) :: c_link_name INTERFACE - INTEGER FUNCTION h5lcreate_soft_c(target_path, target_path_len, & - link_loc_id, & - link_name,link_name_len, & - lcpl_id_default, lapl_id_default ) BIND(C,NAME='h5lcreate_soft_c') - IMPORT :: c_char - IMPORT :: HID_T, SIZE_T + INTEGER(C_INT) FUNCTION H5Lcreate_soft(target_path, link_loc_id, link_name, & + lcpl_id_default, lapl_id_default ) BIND(C,NAME='H5Lcreate_soft') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T IMPLICIT NONE - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: target_path - INTEGER(SIZE_T) :: target_path_len - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: link_name_len - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_soft_c + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: target_path + INTEGER(HID_T), VALUE :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: link_name + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Lcreate_soft END INTERFACE - target_path_len = LEN(target_path) - link_name_len = LEN(link_name) + c_target_path = TRIM(target_path)//C_NULL_CHAR + c_link_name = TRIM(link_name)//C_NULL_CHAR lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = h5lcreate_soft_c(target_path, target_path_len,& - link_loc_id, & - link_name, link_name_len, & - lcpl_id_default, lapl_id_default ) + hdferr = INT(H5Lcreate_soft(c_target_path, link_loc_id, c_link_name, & + lcpl_id_default, lapl_id_default)) END SUBROUTINE h5lcreate_soft_f !> !! \ingroup FH5L !! +!! \brief Asynchronously creates a soft link to an object. +!! +!! \param target_path Path to the target object, which is not required to exist. +!! \param link_loc_id The file or group identifier for the new link. +!! \param link_name The name of the new link. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lcpl_id Link creation property list identifier. +!! \param lapl_id Link access property list identifier. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Lcreate_soft_async() +!! + SUBROUTINE h5lcreate_soft_async_f(target_path, link_loc_id, link_name, es_id, hdferr,& + lcpl_id, lapl_id, file, func, line) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: target_path + INTEGER(HID_T), INTENT(IN) :: link_loc_id + CHARACTER(LEN=*), INTENT(IN) :: link_name + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(target_path) +1,KIND=C_CHAR) :: c_target_path + CHARACTER(LEN=LEN_TRIM(link_name)+1,KIND=C_CHAR) :: c_link_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Lcreate_soft_async(file, func, line, target_path, link_loc_id, link_name, & + lcpl_id_default, lapl_id_default, es_id) BIND(C,NAME='H5Lcreate_soft_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: target_path + INTEGER(HID_T), VALUE :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: link_name + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Lcreate_soft_async + END INTERFACE + + c_target_path = TRIM(target_path)//C_NULL_CHAR + c_link_name = TRIM(link_name)//C_NULL_CHAR + + lcpl_id_default = H5P_DEFAULT_F + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Lcreate_soft_async(file_default, func_default, line_default,& + c_target_path, link_loc_id, c_link_name, lcpl_id_default, lapl_id_default, es_id)) + + END SUBROUTINE h5lcreate_soft_async_f +!> +!! \ingroup FH5L +!! !! \brief Creates a hard link to an object. !! !! \param obj_loc_id The file or group identifier for the target object. @@ -247,51 +379,124 @@ CONTAINS !! !! See C API: @ref H5Lcreate_hard() !! - SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) + SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, & + lcpl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER(HID_T), INTENT(IN) :: link_loc_id CHARACTER(LEN=*), INTENT(IN) :: link_name - INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(obj_name) +1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(link_name)+1,KIND=C_CHAR) :: c_link_name + INTERFACE + INTEGER(C_INT) FUNCTION H5Lcreate_hard(obj_loc_id, obj_name, & + link_loc_id, link_name, lcpl_id_default, lapl_id_default) BIND(C,NAME='H5Lcreate_hard') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: obj_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + INTEGER(HID_T), VALUE :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: link_name + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Lcreate_hard + END INTERFACE - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_link_name = TRIM(link_name)//C_NULL_CHAR + + lcpl_id_default = H5P_DEFAULT_F + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = INT(H5Lcreate_hard(obj_loc_id, c_obj_name, & + link_loc_id, c_link_name, lcpl_id_default, lapl_id_default)) + + END SUBROUTINE h5lcreate_hard_f +!> +!! \ingroup FH5L +!! +!! \brief Asynchronously creates a hard link to an object. +!! +!! \param obj_loc_id The file or group identifier for the target object. +!! \param obj_name Name of the target object, which must already exist. +!! \param link_loc_id The file or group identifier for the new link. +!! \param link_name The name of the new link. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lcpl_id Link creation property list identifier. +!! \param lapl_id Link access property list identifier. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Lcreate_hard_async() +!! + SUBROUTINE h5lcreate_hard_async_f(obj_loc_id, obj_name, link_loc_id, link_name, es_id, hdferr, & + lcpl_id, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + INTEGER(HID_T), INTENT(IN) :: link_loc_id + CHARACTER(LEN=*), INTENT(IN) :: link_name + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lcpl_id_default + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(obj_name) +1,KIND=C_CHAR) :: c_obj_name + CHARACTER(LEN=LEN_TRIM(link_name)+1,KIND=C_CHAR) :: c_link_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 INTERFACE - INTEGER FUNCTION h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) BIND(C,NAME='h5lcreate_hard_c') - IMPORT :: c_char - IMPORT :: HID_T, SIZE_T + INTEGER(C_INT) FUNCTION H5Lcreate_hard_async(file, func, line, obj_loc_id, obj_name, & + link_loc_id, link_name, lcpl_id_default, lapl_id_default, es_id) BIND(C,NAME='H5Lcreate_hard_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: obj_name - INTEGER(HID_T), INTENT(IN) :: link_loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name - INTEGER(SIZE_T) :: obj_namelen - INTEGER(SIZE_T) :: link_namelen - INTEGER(HID_T) :: lcpl_id_default - INTEGER(HID_T) :: lapl_id_default - END FUNCTION h5lcreate_hard_c + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: obj_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: obj_name + INTEGER(HID_T), VALUE :: link_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: link_name + INTEGER(HID_T), VALUE :: lcpl_id_default + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Lcreate_hard_async END INTERFACE - obj_namelen = LEN(obj_name) - link_namelen = LEN(link_name) + + c_obj_name = TRIM(obj_name)//C_NULL_CHAR + c_link_name = TRIM(link_name)//C_NULL_CHAR lcpl_id_default = H5P_DEFAULT_F - IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF (PRESENT(file)) file_default = file + IF (PRESENT(func)) func_default = func + IF (PRESENT(line)) line_default = INT(line, C_INT) - hdferr = h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & - link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) + hdferr = INT(H5Lcreate_hard_async(file_default, func_default, line_default, obj_loc_id, c_obj_name, & + link_loc_id, c_link_name, lcpl_id_default, lapl_id_default, es_id)) - END SUBROUTINE h5lcreate_hard_f + END SUBROUTINE h5lcreate_hard_async_f !> !! \ingroup FH5L @@ -318,8 +523,8 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default @@ -391,37 +596,119 @@ CONTAINS INTEGER, INTENT(IN) :: order INTEGER(HSIZE_T), INTENT(IN) :: n INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_namelen + CHARACTER(LEN=LEN_TRIM(group_name)+1,KIND=C_CHAR) :: c_group_name INTERFACE - INTEGER FUNCTION h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) & - BIND(C,NAME='h5ldelete_by_idx_c') - IMPORT :: c_char - IMPORT :: HID_T, SIZE_T, HSIZE_T + INTEGER(C_INT) FUNCTION H5Ldelete_by_idx(loc_id, group_name, index_field, order, n, lapl_id_default) & + BIND(C,NAME='H5Ldelete_by_idx') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name - INTEGER, INTENT(IN) :: index_field - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: group_namelen - END FUNCTION h5ldelete_by_idx_c + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: group_name + INTEGER(C_INT), VALUE :: index_field + INTEGER(C_INT), VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Ldelete_by_idx END INTERFACE + c_group_name = TRIM(group_name)//C_NULL_CHAR + lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - group_namelen = LEN(group_name) - hdferr = h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) + hdferr = INT(H5Ldelete_by_idx(loc_id, c_group_name, INT(index_field,C_INT), INT(order, C_INT), n, lapl_id_default)) END SUBROUTINE h5ldelete_by_idx_f !> !! \ingroup FH5L !! +!! \brief Asynchronously removes the nth link in a group. +!! +!! \param loc_id File or group identifier specifying location of subject group. +!! \param group_name Name of subject group. +!! \param index_field Type of index; Possible values are: +!! \li H5_INDEX_UNKNOWN_F = -1 - Unknown index type +!! \li H5_INDEX_NAME_F - Index on names +!! \li H5_INDEX_CRT_ORDER_F - Index on creation order +!! \li H5_INDEX_N_F - Number of indices defined +!! \param order Order within field or index; Possible values are: +!! \li H5_ITER_UNKNOWN_F - Unknown order +!! \li H5_ITER_INC_F - Increasing order +!! \li H5_ITER_DEC_F - Decreasing order +!! \li H5_ITER_NATIVE_F - No particular order, whatever is fastest +!! \li H5_ITER_N_F - Number of iteration orders +!! \param n Link for which to retrieve information. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Ldelete_by_idx_async() +!! + SUBROUTINE h5ldelete_by_idx_async_f(loc_id, group_name, index_field, order, n, es_id, hdferr, & + lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER, INTENT(IN) :: index_field + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(group_name)+1,KIND=C_CHAR) :: c_group_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Ldelete_by_idx_async(file, func, line, loc_id, group_name, index_field, order, n, & + lapl_id_default, es_id) BIND(C,NAME='H5Ldelete_by_idx_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: group_name + INTEGER(C_INT), VALUE :: index_field + INTEGER(C_INT), VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Ldelete_by_idx_async + END INTERFACE + + c_group_name = TRIM(group_name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Ldelete_by_idx_async(file_default, func_default, line_default, & + loc_id, c_group_name, INT(index_field,C_INT), INT(order, C_INT), n, lapl_id_default, es_id)) + + END SUBROUTINE h5ldelete_by_idx_async_f + +!> +!! \ingroup FH5L +!! !! \brief Check if a link with a particular name exists in a group. !! !! \param loc_id Identifier of the file or group to query. @@ -438,41 +725,107 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name LOGICAL, INTENT(OUT) :: link_exists INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id - INTEGER :: link_exists_c + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + + INTEGER(C_INT) :: link_exists_c INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) & - BIND(C,NAME='h5lexists_c') - IMPORT :: c_char - IMPORT :: HID_T, SIZE_T + INTEGER(C_INT) FUNCTION H5Lexists(loc_id, name, lapl_id_default) BIND(C,NAME='H5Lexists') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(SIZE_T), INTENT(IN) :: namelen - INTEGER, INTENT(OUT) :: link_exists_c - INTEGER(HID_T) :: lapl_id_default + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: lapl_id_default - END FUNCTION h5lexists_c + END FUNCTION H5Lexists END INTERFACE - namelen = LEN(name) + c_name = TRIM(name)//C_NULL_CHAR lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) + link_exists_c = H5Lexists(loc_id, c_name, lapl_id_default) link_exists = .FALSE. IF(link_exists_c.GT.0) link_exists = .TRUE. + hdferr = 0 + IF(link_exists_c.LT.0) hdferr = -1 + END SUBROUTINE h5lexists_f !> !! \ingroup FH5L !! +!! \brief Asynchronously checks if a link with a particular name exists in a group. +!! +!! \param loc_id Identifier of the file or group to query. +!! \param name Link name to check. +!! \param link_exists Pointer to Link exists status, must be of type LOGICAL(C_BOOL) and initialize to .FALSE. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list identifier. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Lexists_async() +!! + SUBROUTINE h5lexists_async_f(loc_id, name, link_exists, es_id, hdferr, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(C_PTR) , INTENT(INOUT) :: link_exists + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Lexists_async(file, func, line, & + loc_id, name, exists, lapl_id_default, es_id) BIND(C,NAME='H5Lexists_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + TYPE(C_PTR) , VALUE :: exists + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Lexists_async + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Lexists_async(file_default, func_default, line_default, loc_id, c_name, & + link_exists, lapl_id_default, es_id)) + + END SUBROUTINE h5lexists_async_f + +!> +!! \ingroup FH5L +!! !! \brief Returns information about a link. !! !! \param link_loc_id File or group identifier. @@ -509,7 +862,7 @@ CONTAINS TYPE(H5O_TOKEN_T_F), INTENT(OUT), TARGET :: token INTEGER(SIZE_T), INTENT(OUT) :: val_size INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(SIZE_T) :: link_namelen INTEGER(HID_T) :: lapl_id_default INTEGER :: corder_valid @@ -599,13 +952,11 @@ CONTAINS TYPE(H5O_TOKEN_T_F), INTENT(OUT), TARGET :: token INTEGER(SIZE_T), INTENT(OUT) :: val_size INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER :: corder_valid INTEGER(SIZE_T) :: group_namelen INTEGER(HID_T) :: lapl_id_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & link_type, corder_valid, corder, cset, token, val_size, lapl_id_default) & @@ -697,8 +1048,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: dest_loc_id CHARACTER(LEN=*), INTENT(IN) :: dest_name INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(SIZE_T) :: src_namelen INTEGER(SIZE_T) :: dest_namelen @@ -733,7 +1084,7 @@ CONTAINS src_namelen = LEN(src_name) dest_namelen = LEN(dest_name) - hdferr = H5Lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & + hdferr = h5lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & dest_name, dest_namelen, lcpl_id_default, lapl_id_default) END SUBROUTINE h5lmove_f @@ -775,9 +1126,9 @@ CONTAINS CHARACTER(LEN=*), INTENT(OUT) :: name INTEGER, INTENT(OUT) :: hdferr INTEGER(SIZE_T) :: group_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size INTEGER(SIZE_T) :: size_default INTERFACE @@ -940,54 +1291,54 @@ CONTAINS !! !! \brief Iterates through links in a group. !! -!! \param group_id Identifier specifying subject group. -!! \param index_type Type of index which determines the order: +!! \param group_id Identifier specifying subject group. +!! \param idx_type Type of index which determines the order: !! \li H5_INDEX_NAME_F - Alphanumeric index on name !! \li H5_INDEX_CRT_ORDER_F - Index on creation order -!! \param order Order within index: +!! \param order Order within index: !! \li H5_ITER_INC_F - Increasing order !! \li H5_ITER_DEC_F - Decreasing order !! \li H5_ITER_NATIVE_F - Fastest available order !! \param idx Iteration position at which to start, or
!! Position at which an interrupted iteration may be restarted -!! \param op Callback function passing data regarding the link to the calling application. -!! \param op_data User-defined pointer to data required by the application for its processing of the link. -!! \param return_value Return context: +!! \param op Callback function passing data regarding the link to the calling application. +!! \param op_data User-defined pointer to data required by the application for its processing of the link. +!! \param return_value Return context: !! \li Success: The return value of the first operator that !! returns non-zero, or zero if all members were processed with no operator returning non-zero. !! \li Failure: Negative if something goes wrong within the !! library, or the negative value returned by one of the operators. -!! \param hdferr \fortran_error +!! \param hdferr \fortran_error !! !! See C API: @ref H5Literate2() !! - SUBROUTINE h5literate_f(group_id, index_type, order, idx, op, op_data, return_value, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_FUNPTR + SUBROUTINE h5literate_f(group_id, idx_type, order, idx, op, op_data, return_value, hdferr) IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) :: group_id - INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: idx_type INTEGER , INTENT(IN) :: order INTEGER(HSIZE_T), INTENT(INOUT) :: idx TYPE(C_FUNPTR) , INTENT(IN) :: op TYPE(C_PTR) , INTENT(IN) :: op_data INTEGER , INTENT(OUT) :: return_value INTEGER , INTENT(OUT) :: hdferr + INTERFACE - INTEGER FUNCTION h5literate_c(group_id, index_type, order, idx, op, op_data) & - BIND(C, NAME='h5literate_c') - IMPORT :: c_ptr, c_funptr + INTEGER(C_INT) FUNCTION H5Literate2(group_id, idx_type, order, idx, op, op_data) & + BIND(C, NAME='H5Literate2') + IMPORT :: C_INT, C_PTR, C_FUNPTR IMPORT :: HID_T, HSIZE_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: group_id - INTEGER, INTENT(IN) :: index_type - INTEGER, INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(INOUT) :: idx - TYPE(C_FUNPTR), VALUE :: op - TYPE(C_PTR), VALUE :: op_data - END FUNCTION h5literate_c + INTEGER(HID_T) , VALUE :: group_id + INTEGER(C_INT) , VALUE :: idx_type + INTEGER(C_INT) , VALUE :: order + INTEGER(HSIZE_T) :: idx + TYPE(C_FUNPTR) , VALUE :: op + TYPE(C_PTR) , VALUE :: op_data + END FUNCTION H5Literate2 END INTERFACE - return_value = h5literate_c(group_id, index_type, order, idx, op, op_data) + return_value = INT(H5Literate2(group_id, INT(idx_type, C_INT), INT(order, C_INT), idx, op, op_data)) IF(return_value.GE.0)THEN hdferr = 0 @@ -1000,6 +1351,88 @@ CONTAINS !> !! \ingroup FH5L !! +!! \brief Asynchronously iterates through links in a group. +!! +!! \param group_id Identifier specifying subject group. +!! \param idx_type Type of index which determines the order: +!! \li H5_INDEX_NAME_F - Alphanumeric index on name +!! \li H5_INDEX_CRT_ORDER_F - Index on creation order +!! \param order Order within index: +!! \li H5_ITER_INC_F - Increasing order +!! \li H5_ITER_DEC_F - Decreasing order +!! \li H5_ITER_NATIVE_F - Fastest available order +!! \param idx Iteration position at which to start, or
+!! Position at which an interrupted iteration may be restarted +!! \param op Callback function passing data regarding the link to the calling application. +!! \param op_data User-defined pointer to data required by the application for its processing of the link. +!! \param return_value N/A +!! +!! \warning The returned value of the callback routine op will not be set +!! in \p return_value for H5Literate_async_f(), so \p return_value should +!! not be used for determining the return state of the callback routine. +!! +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Literate_async() +!! + SUBROUTINE h5literate_async_f(group_id, idx_type, order, idx, op, op_data, return_value, es_id, hdferr, & + file, func, line) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: group_id + INTEGER , INTENT(IN) :: idx_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR) , INTENT(IN) :: op + TYPE(C_PTR) , INTENT(IN) :: op_data + INTEGER , INTENT(OUT) :: return_value + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Literate_async(file, func, line, & + group_id, idx_type, order, idx, op, op_data, es_id) BIND(C, NAME='H5Literate_async') + IMPORT :: C_CHAR, C_INT, C_PTR, C_FUNPTR + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T) , VALUE :: group_id + INTEGER(C_INT) , VALUE :: idx_type + INTEGER(C_INT) , VALUE :: order + INTEGER(HSIZE_T) :: idx + TYPE(C_FUNPTR) , VALUE :: op + TYPE(C_PTR) , VALUE :: op_data + INTEGER(HID_T) , VALUE :: es_id + END FUNCTION H5Literate_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + return_value = INT(H5Literate_async(file_default, func_default, line_default, & + group_id, INT(idx_type, C_INT), INT(order, C_INT), idx, op, op_data, es_id)) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5literate_async_f + +!> +!! \ingroup FH5L +!! !! \brief Iterates through links in a group. !! !! \param loc_id File or group identifier specifying location of subject group. diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 019699e..186a9a2 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -132,76 +132,6 @@ done: return ret_value; } -/****if* H5Of/h5oopen_c - * NAME - * h5oopen_c - * PURPOSE - * Calls H5Oopen - * INPUTS - * loc_id - File or group identifier - * name - Attribute access property list - * namelen - Size of name - * lapl_id - Link access property list - * OUTPUTS - * obj_id - Dataset identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * April 18, 2008 - * SOURCE - */ -int_f -h5oopen_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id) -/******/ -{ - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Oopen function. - */ - if ((*obj_id = (hid_t_f)H5Oopen((hid_t)*loc_id, c_name, (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_name) - HDfree(c_name); - return ret_value; -} -/****if* H5Of/h5oclose_c - * NAME - * h5oclose_c - * PURPOSE - * Call H5Oclose - * INPUTS - * object_id - Object identifier - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * December 17, 2008 - * SOURCE - */ -int_f -h5oclose_c(hid_t_f *object_id) -/******/ -{ - int_f ret_value = 0; /* Return value */ - - if (H5Oclose((hid_t)*object_id) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - /****if* H5Of/h5ovisit_c * NAME * h5ovisit_c @@ -292,6 +222,11 @@ done: * namelen - Name length. * lapl_id - Link access property list. * fields - Flags specifying the fields to include in object_info. + * file - Filename the async subroutine is being called from + * func - Function name the async subroutine is being called in + * line - Line number the async subroutine is being called at + * es_id - Event set identifier + * * OUTPUTS * object_info - Buffer in which to return object information. * @@ -303,31 +238,30 @@ done: * SOURCE */ int_f -h5oget_info_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, - H5O_info_t_f *object_info, int_f *fields) +h5oget_info_by_name_c(hid_t_f *loc_id, char *name, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields, + hid_t_f *es_id, char *file, char *func, int_f *line) /******/ { - char *c_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; /* Return value */ + int_f ret_value = 0; /* Return value */ H5O_info2_t Oinfo; /* - * Convert FORTRAN name to C name - */ - if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) - HGOTO_DONE(FAIL); - - /* * Call H5Oinfo_by_name function. */ - if (H5Oget_info_by_name3((hid_t)*loc_id, c_name, &Oinfo, (unsigned)*fields, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL); + + if ((hid_t)*es_id != -1) { + if (H5Oget_info_by_name3((hid_t)*loc_id, name, &Oinfo, (unsigned)*fields, (hid_t)*lapl_id) < 0) + HGOTO_DONE(FAIL); + } + else { + if (H5Oget_info_by_name_async_wrap(file, func, (unsigned)*line, (hid_t)*loc_id, name, &Oinfo, + (unsigned)*fields, (hid_t)*lapl_id, (hid_t)*es_id) < 0) + HGOTO_DONE(FAIL); + } ret_value = fill_h5o_info_t_f(Oinfo, object_info); done: - if (c_name) - HDfree(c_name); return ret_value; } @@ -424,78 +358,22 @@ done: return ret_value; } -/* ***if* H5Of/H5Ocopy_c - * NAME - * H5Ocopy_c - * PURPOSE - * Calls H5Ocopy - * INPUTS - * src_loc_id - Object identifier indicating the location of the source object to be copied - * src_name - Name of the source object to be copied - * src_name_len - Length of src_name - * dst_loc_id - Location identifier specifying the destination - * dst_name - Name to be assigned to the new copy - * dst_name_len - Length of dst_name - * ocpypl_id - Object copy property list - * lcpl_id - Link creation property list for the new hard link - * - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * March 14, 2012 - * SOURCE - */ -int_f -h5ocopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, hid_t_f *dst_loc_id, _fcd dst_name, - size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id) -/******/ -{ - char *c_src_name = NULL; /* Buffer to hold C string */ - char *c_dst_name = NULL; /* Buffer to hold C string */ - - int_f ret_value = 0; /* Return value */ - - /* - * Convert FORTRAN name to C name - */ - if ((c_src_name = HD5f2cstring(src_name, (size_t)*src_name_len)) == NULL) - HGOTO_DONE(FAIL); - if ((c_dst_name = HD5f2cstring(dst_name, (size_t)*dst_name_len)) == NULL) - HGOTO_DONE(FAIL); - - /* - * Call H5Ocopy function. - */ - if (H5Ocopy((hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name, (hid_t)*ocpypl_id, - (hid_t)*lcpl_id) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_src_name) - HDfree(c_src_name); - if (c_dst_name) - HDfree(c_dst_name); - - return ret_value; -} - /****if* H5Of/h5ovisit_by_name_c * NAME * h5ovisit_by_name_c * PURPOSE * Calls H5Ovisit_by_name * INPUTS - * object_id - Identifier specifying subject group - * index_type - Type of index which determines the order - * order - Order within index - * idx - Iteration position at which to start - * op - Callback function passing data regarding the link to the calling application - * op_data - User-defined pointer to data required by the application for its processing of the link + * object_id - Identifier specifying subject group. + * index_type - Type of index which determines the order. + * order - Order within index. + * idx - Iteration position at which to start. + * op - Callback function passing data regarding the link to the calling application. + * op_data - User-defined pointer to data required by the application for its processing of the link. * fields - Flags specifying the fields to include in object_info. * * OUTPUTS - * idx - Position at which an interrupted iteration may be restarted + * idx - Position at which an interrupted iteration may be restarted. * * RETURNS * >0 on success, 0< on failure @@ -730,59 +608,6 @@ done: HDfree(c_comment); return ret_value; } -/****if* H5Of/h5oopen_by_idx_c - * NAME - * h5oopen_by_idx_c - * PURPOSE - * Calls H5Oopen_by_idx_c - * INPUTS - * loc_id - A file or group identifier. - * group_name - Name of group, relative to loc_id, in which object is located. - * group_namelen - Length of group_name - * index_type - Type of index by which objects are ordered. - * order - Order of iteration within index. - * n - Object to open. - * lapl_id - Link access property list. - * OUTPUTS - * obj_id - An object identifier for the opened object. - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * M. Scot Breitenfeld - * May 17, 2012 - * SOURCE - */ -int_f -h5oopen_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, - hsize_t_f *n, hid_t_f *obj_id, hid_t_f *lapl_id) -/******/ -{ - char *c_group_name = NULL; /* Buffer to hold C string */ - int_f ret_value = 0; - H5_index_t c_index_type; - H5_iter_order_t c_order; - - /* - * Convert FORTRAN string to C string - */ - if ((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) - HGOTO_DONE(FAIL); - - c_index_type = (H5_index_t)*index_type; - c_order = (H5_iter_order_t)*order; - - /* - * Call H5Oopen_by_idx function. - */ - if ((*obj_id = (hid_t_f)H5Oopen_by_idx((hid_t)*loc_id, c_group_name, c_index_type, c_order, (hsize_t)*n, - (hid_t)*lapl_id)) < 0) - HGOTO_DONE(FAIL); - -done: - if (c_group_name) - HDfree(c_group_name); - return ret_value; -} /****if* H5Of/h5oget_comment_c * NAME diff --git a/fortran/src/H5Off.F90 b/fortran/src/H5Off.F90 index 7bb3a0c..215f6e8 100644 --- a/fortran/src/H5Off.F90 +++ b/fortran/src/H5Off.F90 @@ -41,6 +41,7 @@ MODULE H5O USE H5GLOBAL IMPLICIT NONE + !> @brief h5o_info_t derived type. The time values are an integer array as specified in the Fortran intrinsic DATE_AND_TIME(VALUES). TYPE, BIND(C) :: h5o_info_t INTEGER(C_LONG) :: fileno !< File number that object is located in @@ -135,6 +136,24 @@ MODULE H5O TYPE(meta_size_t) :: meta_size END TYPE c_h5o_native_info_t + INTERFACE + INTEGER FUNCTION h5oget_info_by_name_c(loc_id, name, lapl_id_default, object_info, fields, & + es_id, file, func, line ) & + BIND(C, NAME='h5oget_info_by_name_c') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR), VALUE :: object_info + INTEGER :: fields + INTEGER(HID_T) :: es_id + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT) :: line + END FUNCTION h5oget_info_by_name_c + END INTERFACE CONTAINS @@ -212,30 +231,100 @@ CONTAINS INTEGER(HID_T) , INTENT(OUT) :: obj_id INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id + INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTERFACE - INTEGER FUNCTION h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) BIND(C,NAME='h5oopen_c') + INTEGER(HID_T) FUNCTION H5Oopen(loc_id, name, lapl_id_default) BIND(C,NAME='H5Oopen') IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5oopen_c + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: lapl_id_default + END FUNCTION H5Oopen END INTERFACE - namelen = LEN(name) + c_name = TRIM(name)//C_NULL_CHAR lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id - hdferr = h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) + obj_id = H5Oopen(loc_id, c_name, lapl_id_default) + + hdferr = 0 + IF(obj_id.LT.0) hdferr = -1 END SUBROUTINE h5oopen_f + +!> +!! \ingroup FH5O +!! +!! \brief Asynchronously opens an object in an HDF5 file by location identifier and path name. +!! +!! \param loc_id File or group identifier. +!! \param name Path to the object, relative to loc_id. +!! \param obj_id Object identifier for the opened object. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Access property list identifier for the link pointing to the object. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Oopen_async() +!! + SUBROUTINE h5oopen_async_f(loc_id, name, obj_id, es_id, hdferr, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Oopen_async(file, func, line, & + loc_id, name, lapl_id_default, es_id) BIND(C,NAME='H5Oopen_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Oopen_async + END INTERFACE + + c_name = TRIM(name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + obj_id = H5Oopen_async(file_default, func_default, line_default, & + loc_id, c_name, lapl_id_default, es_id) + + hdferr = 0 + IF(obj_id.LT.0) hdferr = -1 + + END SUBROUTINE h5oopen_async_f + !> !! \ingroup FH5O !! @@ -248,22 +337,69 @@ CONTAINS !! SUBROUTINE h5oclose_f(object_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER(HID_T), INTENT(IN) :: object_id INTEGER , INTENT(OUT) :: hdferr INTERFACE - INTEGER FUNCTION h5oclose_c(object_id) BIND(C,NAME='h5oclose_c') + INTEGER(C_INT) FUNCTION H5Oclose(object_id) BIND(C,NAME='H5Oclose') + IMPORT :: C_INT IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id - END FUNCTION h5oclose_c + INTEGER(HID_T), VALUE :: object_id + END FUNCTION H5Oclose END INTERFACE - hdferr = h5oclose_c(object_id) + hdferr = INT(H5Oclose(object_id)) + END SUBROUTINE h5oclose_f !> !! \ingroup FH5O !! +!! \brief Asynchronously closes an object in an HDF5 file. +!! +!! \param object_id Object identifier. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Oclose_async_f() +!! + SUBROUTINE h5oclose_async_f(object_id, es_id, hdferr, file, func, line) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER(HID_T), INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Oclose_async(file, func, line, object_id, es_id) BIND(C,NAME='H5Oclose_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: object_id + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Oclose_async + END INTERFACE + + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Oclose_async(file_default, func_default, line_default, object_id, es_id)) + + END SUBROUTINE h5oclose_async_f + +!> +!! \ingroup FH5O +!! !! \brief Opens an object using its token within an HDF5 file. !! !! \param loc_id File or group identifier. @@ -318,43 +454,118 @@ CONTAINS INTEGER(HID_T) , INTENT(IN), OPTIONAL :: ocpypl_id INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id - INTEGER(SIZE_T) :: src_name_len, dst_name_len INTEGER(HID_T) :: ocpypl_id_default, lcpl_id_default + CHARACTER(LEN=LEN_TRIM(src_name)+1,KIND=C_CHAR) :: c_src_name + CHARACTER(LEN=LEN_TRIM(dst_name)+1,KIND=C_CHAR) :: c_dst_name INTERFACE - INTEGER FUNCTION h5ocopy_c(src_loc_id, src_name, src_name_len, & - dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) & - BIND(C,NAME='h5ocopy_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T + INTEGER(C_INT) FUNCTION H5Ocopy(src_loc_id, src_name, dst_loc_id, dst_name, & + ocpypl_id_default, lcpl_id_default) BIND(C,NAME='H5Ocopy') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: src_loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: src_name - INTEGER(HID_T) , INTENT(IN) :: dst_loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: dst_name - INTEGER(HID_T) , INTENT(IN) :: ocpypl_id_default - INTEGER(HID_T) , INTENT(IN) :: lcpl_id_default - INTEGER(SIZE_T) :: src_name_len, dst_name_len - - END FUNCTION h5ocopy_c + INTEGER(HID_T) , VALUE :: src_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: src_name + INTEGER(HID_T) , VALUE :: dst_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: dst_name + INTEGER(HID_T) , VALUE :: ocpypl_id_default + INTEGER(HID_T) , VALUE :: lcpl_id_default + END FUNCTION H5Ocopy END INTERFACE - src_name_len = LEN(src_name) - dst_name_len = LEN(dst_name) + c_src_name = TRIM(src_name)//C_NULL_CHAR + c_dst_name = TRIM(dst_name)//C_NULL_CHAR ocpypl_id_default = H5P_DEFAULT_F + lcpl_id_default = H5P_DEFAULT_F IF(PRESENT(ocpypl_id)) ocpypl_id_default = ocpypl_id - lcpl_id_default = H5P_DEFAULT_F IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id - hdferr = h5ocopy_c(src_loc_id, src_name, src_name_len, & - dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) + hdferr = INT(H5Ocopy(src_loc_id, c_src_name, & + dst_loc_id, c_dst_name, ocpypl_id_default, lcpl_id_default)) END SUBROUTINE h5ocopy_f !> !! \ingroup FH5O !! +!! \brief Asynchronously copies an object in an HDF5 file. +!! +!! \param src_loc_id Object identifier indicating the location of the source object to be copied. +!! \param src_name Name of the source object to be copied. +!! \param dst_loc_id Location identifier specifying the destination. +!! \param dst_name Name to be assigned to the new copy. +!! \param ocpypl_id Object copy property list. +!! \param lcpl_id Link creation property list for the new hard link. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Ocopy_async() +!! + SUBROUTINE h5ocopy_async_f(src_loc_id, src_name, dst_loc_id, dst_name, es_id, hdferr, & + ocpypl_id, lcpl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: src_loc_id + CHARACTER(LEN=*), INTENT(IN) :: src_name + INTEGER(HID_T) , INTENT(IN) :: dst_loc_id + CHARACTER(LEN=*), INTENT(IN) :: dst_name + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: ocpypl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line + + INTEGER(HID_T) :: ocpypl_id_default, lcpl_id_default + CHARACTER(LEN=LEN_TRIM(src_name)+1,KIND=C_CHAR) :: c_src_name + CHARACTER(LEN=LEN_TRIM(dst_name)+1,KIND=C_CHAR) :: c_dst_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(C_INT) FUNCTION H5Ocopy_async(file, func, line, src_loc_id, src_name, dst_loc_id, dst_name, & + ocpypl_id_default, lcpl_id_default, es_id) BIND(C,NAME='H5Ocopy_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT) , VALUE :: line + INTEGER(HID_T) , VALUE :: src_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: src_name + INTEGER(HID_T) , VALUE :: dst_loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: dst_name + INTEGER(HID_T) , VALUE :: ocpypl_id_default + INTEGER(HID_T) , VALUE :: lcpl_id_default + INTEGER(HID_T) , VALUE :: es_id + END FUNCTION H5Ocopy_async + END INTERFACE + + c_src_name = TRIM(src_name)//C_NULL_CHAR + c_dst_name = TRIM(dst_name)//C_NULL_CHAR + + ocpypl_id_default = H5P_DEFAULT_F + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(ocpypl_id)) ocpypl_id_default = ocpypl_id + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + hdferr = INT(H5Ocopy_async(file_default, func_default, line_default, & + src_loc_id, c_src_name, & + dst_loc_id, c_dst_name, ocpypl_id_default, lcpl_id_default, es_id)) + + END SUBROUTINE h5ocopy_async_f + +!> +!! \ingroup FH5O +!! !! \brief Decrements an object reference count. !! !! \param object_id Object identifier. @@ -577,7 +788,6 @@ CONTAINS !! \param n Object to open. !! \param obj_id An object identifier for the opened object. !! \param hdferr \fortran_error -!! !! \param lapl_id Link access property list. !! !! See C API: @ref H5Oopen_by_idx() @@ -585,43 +795,123 @@ CONTAINS SUBROUTINE h5oopen_by_idx_f(loc_id, group_name, index_type, order, n, obj_id, & hdferr, lapl_id) IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: group_name - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) , INTENT(OUT) :: obj_id - INTEGER , INTENT(OUT) :: hdferr - INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id - INTEGER(SIZE_T) :: group_namelen + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(group_name)+1,KIND=C_CHAR) :: c_group_name INTERFACE - INTEGER FUNCTION h5oopen_by_idx_c(loc_id, group_name, group_namelen, index_type, order, n, obj_id, lapl_id_default) & - BIND(C,NAME='h5oopen_by_idx_c') - IMPORT :: C_CHAR - IMPORT :: HID_T, SIZE_T, HSIZE_T + INTEGER(HID_T) FUNCTION H5Oopen_by_idx(loc_id, group_name, index_type, order, n, lapl_id_default) & + BIND(C,NAME='H5Oopen_by_idx') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name - INTEGER(SIZE_T) , INTENT(IN) :: group_namelen - INTEGER , INTENT(IN) :: index_type - INTEGER , INTENT(IN) :: order - INTEGER(HSIZE_T), INTENT(IN) :: n - INTEGER(HID_T) , INTENT(OUT) :: obj_id - INTEGER(HID_T) , INTENT(IN) :: lapl_id_default + INTEGER(HID_T) , VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: group_name + INTEGER(C_INT) , VALUE :: index_type + INTEGER(C_INT) , VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + INTEGER(HID_T) , VALUE :: lapl_id_default + END FUNCTION H5Oopen_by_idx + END INTERFACE + + c_group_name = TRIM(group_name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + obj_id = H5Oopen_by_idx(loc_id, c_group_name, INT(index_type, C_INT), INT(order, C_INT), n, lapl_id_default) + + hdferr = 0 + IF(obj_id.LT.0) hdferr = -1 + + END SUBROUTINE H5oopen_by_idx_f + +!> +!! \ingroup FH5O +!! +!! \brief Asynchronously open the nth object in a group. +!! +!! \param loc_id A file or group identifier. +!! \param group_name Name of group, relative to loc_id, in which object is located. +!! \param index_type Type of index by which objects are ordered. +!! \param order Order of iteration within index, NOTE: zero-based. +!! \param n Object to open. +!! \param obj_id An object identifier for the opened object. +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! +!! \param lapl_id Link access property list. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Oopen_by_idx_async() +!! + SUBROUTINE h5oopen_by_idx_async_f(loc_id, group_name, index_type, order, n, obj_id, es_id, & + hdferr, lapl_id, file, func, line) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(IN) :: n + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN), OPTIONAL :: line - END FUNCTION h5oopen_by_idx_c + INTEGER(HID_T) :: lapl_id_default + CHARACTER(LEN=LEN_TRIM(group_name)+1,KIND=C_CHAR) :: c_group_name + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + + INTERFACE + INTEGER(HID_T) FUNCTION H5Oopen_by_idx_async(file, func, line, & + loc_id, group_name, index_type, order, n, lapl_id_default, es_id) & + BIND(C,NAME='H5Oopen_by_idx_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T, HSIZE_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT) , VALUE :: line + INTEGER(HID_T) , VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: group_name + INTEGER(C_INT) , VALUE :: index_type + INTEGER(C_INT) , VALUE :: order + INTEGER(HSIZE_T), VALUE :: n + INTEGER(HID_T) , VALUE :: lapl_id_default + INTEGER(HID_T) , VALUE :: es_id + END FUNCTION H5Oopen_by_idx_async END INTERFACE - group_namelen = LEN(group_name) + c_group_name = TRIM(group_name)//C_NULL_CHAR lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) - hdferr = h5oopen_by_idx_c(loc_id, group_name, group_namelen, index_type, order, n, obj_id, lapl_id_default) + obj_id = H5Oopen_by_idx_async(file_default, func_default, line_default, & + loc_id, c_group_name, INT(index_type, C_INT), INT(order, C_INT), n, lapl_id_default, es_id) - END SUBROUTINE H5Oopen_by_idx_f + hdferr = 0 + IF(obj_id.LT.0) hdferr = -1 + + END SUBROUTINE H5oopen_by_idx_async_f !> !! \ingroup FH5O @@ -794,43 +1084,108 @@ CONTAINS INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id INTEGER , INTENT(IN) , OPTIONAL :: fields - INTEGER(SIZE_T) :: namelen INTEGER(HID_T) :: lapl_id_default TYPE(C_PTR) :: ptr INTEGER :: fields_c + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name - INTERFACE - INTEGER FUNCTION h5oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, object_info, fields) & - BIND(C, NAME='h5oget_info_by_name_c') - IMPORT :: c_char, c_ptr - IMPORT :: HID_T, SIZE_T - IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: loc_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(SIZE_T) , INTENT(IN) :: namelen - INTEGER(HID_T) , INTENT(IN) :: lapl_id_default - TYPE(C_PTR), VALUE :: object_info - INTEGER , INTENT(IN) :: fields - END FUNCTION h5oget_info_by_name_c - END INTERFACE + ! Async -- Not Used -- + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + INTEGER(HID_T) :: es_id = -1 fields_c = H5O_INFO_ALL_F IF(PRESENT(fields)) fields_c = fields - namelen = LEN(name) + c_name = TRIM(name)//C_NULL_CHAR lapl_id_default = H5P_DEFAULT_F IF(PRESENT(lapl_id)) lapl_id_default = lapl_id ptr = C_LOC(object_info) - hdferr = H5Oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, ptr, fields_c) + hdferr = H5Oget_info_by_name_c(loc_id, c_name, lapl_id_default, ptr, fields_c, & + es_id, file_default, func_default, line_default) END SUBROUTINE H5Oget_info_by_name_f !> !! \ingroup FH5O !! +!! \brief Asynchronously retrieves the metadata for an object, identifying the object by location and relative name. +!! +!! \param loc_id File or group identifier specifying location of group in which object is located. +!! \param name Name of group, relative to loc_id. +!! \param object_info Pointer to buffer returning object information, points to variable of datatype TYPE(C_H5O_INFO_T). +!! \param es_id \es_id +!! \param hdferr \fortran_error +!! \param lapl_id Link access property list. +!! \param fields Flags specifying the fields to include in object_info. +!! \param file \fortran_file +!! \param func \fortran_func +!! \param line \fortran_line +!! +!! See C API: @ref H5Oget_info_by_name_async() +!! + SUBROUTINE h5oget_info_by_name_async_f(loc_id, name, object_info, es_id, hdferr, & + lapl_id, fields, file, func, line) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(C_PTR) , INTENT(INOUT) :: object_info + INTEGER(HID_T) , INTENT(IN) :: es_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id + INTEGER , INTENT(IN) , OPTIONAL :: fields + TYPE(C_PTR), OPTIONAL :: file + TYPE(C_PTR), OPTIONAL :: func + INTEGER , INTENT(IN) , OPTIONAL :: line + + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR) :: file_default = C_NULL_PTR + TYPE(C_PTR) :: func_default = C_NULL_PTR + INTEGER(KIND=C_INT) :: line_default = 0 + INTEGER(C_INT) :: fields_c + + INTERFACE + INTEGER(C_INT) FUNCTION H5Oget_info_by_name_async(file, func, line, & + loc_id, name, object_info, fields, lapl_id_default, es_id) BIND(C,NAME='H5Oget_info_by_name_async') + IMPORT :: C_CHAR, C_INT, C_PTR + IMPORT :: HID_T + IMPLICIT NONE + TYPE(C_PTR), VALUE :: file + TYPE(C_PTR), VALUE :: func + INTEGER(C_INT), VALUE :: line + INTEGER(HID_T), VALUE :: loc_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + TYPE(C_PTR), VALUE :: object_info + INTEGER(C_INT), VALUE :: fields + INTEGER(HID_T), VALUE :: lapl_id_default + INTEGER(HID_T), VALUE :: es_id + END FUNCTION H5Oget_info_by_name_async + END INTERFACE + + fields_c = INT(H5O_INFO_ALL_F, C_INT) + IF(PRESENT(fields)) fields_c = INT(fields, C_INT) + IF(PRESENT(file)) file_default = file + IF(PRESENT(func)) func_default = func + IF(PRESENT(line)) line_default = INT(line, C_INT) + + c_name = TRIM(name)//C_NULL_CHAR + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + hdferr = H5Oget_info_by_name_async(file_default, func_default, line_default, & + loc_id, c_name, object_info, fields_c, lapl_id_default, es_id) + + END SUBROUTINE H5oget_info_by_name_async_f + +!> +!! \ingroup FH5O +!! !! \brief Retrieves the metadata for an object specified by an identifier. !! !! \param object_id Identifier for target object. diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 7371814..38eba37 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1802,10 +1802,6 @@ h5pget_nfilters_c(hid_t_f *prp_id, int_f *nfilters) * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 - * Modifications: - * Since cd_nelmts has IN/OUT attributes, fixed the input and - * returned value of cd_nelmnts to satisfy this specification. - * MSB January 27, 2009 *---------------------------------------------------------------------------*/ int_f h5pget_filter_c(hid_t_f *prp_id, int_f *filter_number, int_f *flags, size_t_f *cd_nelmts, int_f *cd_values, @@ -5262,7 +5258,6 @@ h5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) * Returns: 0 on success, -1 on failure * Programmer: M. Scot Breitenfeld * April 13, 2009 - * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -5295,7 +5290,6 @@ h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nby * Returns: 0 on success, -1 on failure * Programmer: M. Scot Breitenfeld * April 13, 2009 - * Modifications: *---------------------------------------------------------------------------*/ int_f diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 75d7365..75cd323 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -188,7 +188,7 @@ MODULE H5P !> @brief H5FD_subfiling_params_t derived type used in the subfiling VFD. TYPE, BIND(C) :: H5FD_subfiling_params_t - INTEGER(ENUM_T) :: ioc_selection !< Method to select I/O concentrators + INTEGER(C_INT) :: ioc_selection !< Method to select I/O concentrators INTEGER(C_INT64_T) :: stripe_size !< Size (in bytes) of data stripes in subfiles INTEGER(C_INT32_T) :: stripe_count !< Target number of subfiles to use END TYPE H5FD_subfiling_params_t @@ -524,15 +524,13 @@ CONTAINS !! !! See C API: @ref H5Pget_version() !! - SUBROUTINE h5pget_version_f(prp_id, boot, freelist, & - stab, shhdr, hdferr) + SUBROUTINE h5pget_version_f(prp_id, boot, freelist, stab, shhdr, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, DIMENSION(:), INTENT(OUT) :: boot - INTEGER, DIMENSION(:), INTENT(OUT) :: freelist - - INTEGER, DIMENSION(:), INTENT(OUT) :: stab - INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr + INTEGER, DIMENSION(*), INTENT(OUT) :: boot + INTEGER, DIMENSION(*), INTENT(OUT) :: freelist + INTEGER, DIMENSION(*), INTENT(OUT) :: stab + INTEGER, DIMENSION(*), INTENT(OUT) :: shhdr INTEGER, INTENT(OUT) :: hdferr INTERFACE @@ -2698,7 +2696,8 @@ CONTAINS !! \param memb_map Mapping array. !! \param memb_fapl Property list for each memory usage type. !! \param memb_name Names of member file. -!! \param memb_addr Offsets within the virtual address space, from 0 (zero) to HADDR_MAX_F, at which each type of data storage begins. +!! \param memb_addr Offsets within the virtual address space, from 0 (zero) to HADDR_MAX_F, +!! at which each type of data storage begins. !! \param relax Flag. !! \param hdferr \fortran_error !! @@ -2781,7 +2780,8 @@ CONTAINS !! \param memb_map Mapping array. !! \param memb_fapl Property list for each memory usage type. !! \param memb_name Names of member file. -!! \param memb_addr Offsets within the virtual address space, from 0 (zero) to HADDR_MAX_F, at which each type of data storage begins. +!! \param memb_addr Offsets within the virtual address space, from 0 (zero) to HADDR_MAX_F, at which +!! each type of data storage begins. !! \param relax Flag. !! \param hdferr \fortran_error !! \param maxlen_out Maximum length for memb_name array element. @@ -2793,7 +2793,7 @@ CONTAINS INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: memb_fapl CHARACTER(LEN=*), DIMENSION(*), INTENT(OUT) :: memb_name REAL, DIMENSION(*), INTENT(OUT) :: memb_addr - INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out + INTEGER, INTENT(OUT), OPTIONAL :: maxlen_out LOGICAL, INTENT(OUT) :: relax INTEGER, INTENT(OUT) :: hdferr @@ -3201,7 +3201,7 @@ CONTAINS INTEGER, INTENT(OUT) :: low INTEGER, INTENT(OUT) :: high INTEGER, INTENT(OUT) :: hdferr - INTEGER(ENUM_T) :: low_c, high_c + INTEGER(C_INT) :: low_c, high_c INTEGER(C_INT) :: hdferr_c ! ! MS FORTRAN needs explicit interface for C functions called here. @@ -3209,11 +3209,11 @@ CONTAINS INTERFACE INTEGER(C_INT) FUNCTION h5pget_libver_bounds(fapl_id, low, high) & BIND(C,NAME='H5Pget_libver_bounds') - IMPORT :: C_INT, HID_T, ENUM_T + IMPORT :: C_INT, HID_T IMPLICIT NONE INTEGER(HID_T) , INTENT(IN) , VALUE :: fapl_id - INTEGER(ENUM_T), INTENT(OUT) :: low - INTEGER(ENUM_T), INTENT(OUT) :: high + INTEGER(C_INT), INTENT(OUT) :: low + INTEGER(C_INT), INTENT(OUT) :: high END FUNCTION h5pget_libver_bounds END INTERFACE @@ -3252,15 +3252,15 @@ CONTAINS INTERFACE INTEGER(C_INT) FUNCTION h5pset_libver_bounds(fapl_id, low, high) & BIND(C,NAME='H5Pset_libver_bounds') - IMPORT :: C_INT, HID_T, ENUM_T + IMPORT :: C_INT, HID_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id - INTEGER(ENUM_T), INTENT(IN), VALUE :: low - INTEGER(ENUM_T), INTENT(IN), VALUE :: high + INTEGER(C_INT), INTENT(IN), VALUE :: low + INTEGER(C_INT), INTENT(IN), VALUE :: high END FUNCTION h5pset_libver_bounds END INTERFACE - hdferr_c = h5pset_libver_bounds(fapl_id, INT(low, ENUM_T), INT(high, ENUM_T)) + hdferr_c = h5pset_libver_bounds(fapl_id, INT(low, C_INT), INT(high, C_INT)) hdferr = 0 IF(hdferr_c.LT.0) hdferr = -1 @@ -5523,14 +5523,14 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTERFACE INTEGER FUNCTION h5pset_virtual_view(dapl_id, view) BIND(C,NAME='H5Pset_virtual_view') - IMPORT :: HID_T, ENUM_T + IMPORT :: C_INT, HID_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: dapl_id - INTEGER(ENUM_T), INTENT(IN), VALUE :: view + INTEGER(C_INT), INTENT(IN), VALUE :: view END FUNCTION h5pset_virtual_view END INTERFACE - hdferr = INT( h5pset_virtual_view(dapl_id, INT(view,ENUM_T)) ) + hdferr = INT( h5pset_virtual_view(dapl_id, INT(view,C_INT)) ) END SUBROUTINE h5pset_virtual_view_f @@ -5553,13 +5553,13 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) INTEGER(HID_T), INTENT(IN) :: dapl_id INTEGER , INTENT(INOUT) :: view INTEGER , INTENT(OUT) :: hdferr - INTEGER(ENUM_T) :: view_enum + INTEGER(C_INT) :: view_enum INTERFACE INTEGER FUNCTION h5pget_virtual_view(dapl_id, view) BIND(C,NAME='H5Pget_virtual_view') - IMPORT :: HID_T, ENUM_T + IMPORT :: C_INT, HID_T IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: dapl_id - INTEGER(ENUM_T), INTENT(OUT) :: view + INTEGER(C_INT), INTENT(OUT) :: view END FUNCTION h5pget_virtual_view END INTERFACE @@ -5636,8 +5636,10 @@ SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) !! !! \brief Sets the mapping between virtual and source datasets. !! -!! \param dcpl_id The identifier of the dataset creation property list that will be used when creating the virtual dataset. -!! \param vspace_id The dataspace identifier with the selection within the virtual dataset applied, possibly an unlimited selection. +!! \param dcpl_id The identifier of the dataset creation property list that will be used when creating the +!! virtual dataset. +!! \param vspace_id The dataspace identifier with the selection within the virtual dataset applied, possibly an +!! unlimited selection. !! \param src_file_name The name of the HDF5 file where the source dataset is located. !! \param src_dset_name The path to the HDF5 dataset in the file specified by src_file_name. !! \param src_space_id The source dataset’s dataspace identifier with a selection applied, possibly an unlimited selection. @@ -6051,7 +6053,8 @@ END SUBROUTINE h5pget_virtual_dsetname_f LOGICAL(C_BOOL) :: c_ignore_flag INTERFACE - INTEGER FUNCTION h5pget_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pget_file_locking') + INTEGER FUNCTION h5pget_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) & + BIND(C, NAME='H5Pget_file_locking') IMPORT :: HID_T, C_BOOL IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id @@ -6090,7 +6093,8 @@ END SUBROUTINE h5pget_virtual_dsetname_f LOGICAL(C_BOOL) :: c_ignore_flag INTERFACE - INTEGER FUNCTION h5pset_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) BIND(C, NAME='H5Pset_file_locking') + INTEGER FUNCTION h5pset_file_locking(fapl_id, use_file_locking, ignore_disabled_locks) & + BIND(C, NAME='H5Pset_file_locking') IMPORT :: HID_T, C_BOOL IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: fapl_id diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index 3aed34a..1b2cd8a 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -497,7 +497,7 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size CHARACTER(LEN=*), INTENT(INOUT) :: name INTEGER, INTENT(OUT) :: hdferr @@ -533,7 +533,7 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size CHARACTER(LEN=*), INTENT(INOUT) :: name INTEGER, INTENT(OUT) :: hdferr INTEGER(SIZE_T) :: size_default @@ -580,7 +580,7 @@ CONTAINS TYPE(C_PTR), INTENT(IN) :: ref CHARACTER(LEN=*), INTENT(INOUT) :: name INTEGER, INTENT(OUT) :: hdferr - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size INTEGER(SIZE_T) :: size_default INTEGER(SIZE_T) :: name_len @@ -601,21 +601,20 @@ CONTAINS !! !! \brief Retrieves the type of object that an object reference points to. !! -!! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. -!! ref_type - Type of reference to query. -!! ref - Reference to query. -!! obj_type - Type of referenced object: -!! \li H5G_UNKNOWN_F -!! \li H H5G_GROUP_F -!! \li H H5G_DATASET_F -!! \li H H5G_TYPE_F -!! hdferr - \fortran_error +!! \param loc_id Identifier for the dataset containing the reference or for the group that dataset is in. +!! \param ref_type Type of reference to query. +!! \param ref Reference to query. +!! \param obj_type Type of referenced object: +!! \li H5G_UNKNOWN_F +!! \li H5G_GROUP_F +!! \li H5G_DATASET_F +!! \li H5G_TYPE_F +!! \param hdferr \fortran_error !! !! See C API: @ref H5Rget_obj_type3() !! SUBROUTINE h5rget_obj_type_f(loc_id, ref_type, ref, obj_type, hdferr) - USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER, INTENT(IN) :: ref_type diff --git a/fortran/src/H5Sff.F90 b/fortran/src/H5Sff.F90 index 9a2f89a..72627d9 100644 --- a/fortran/src/H5Sff.F90 +++ b/fortran/src/H5Sff.F90 @@ -58,10 +58,10 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(IN) :: rank - INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(1:rank) :: dims INTEGER(HID_T), INTENT(OUT) :: space_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank) + INTEGER(HSIZE_T), INTENT(IN), OPTIONAL, DIMENSION(1:rank) :: maxdims INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: f_maxdims INTERFACE @@ -81,9 +81,9 @@ CONTAINS RETURN ENDIF IF (PRESENT(maxdims)) THEN - f_maxdims = maxdims + f_maxdims(1:rank) = maxdims(1:rank) ELSE - f_maxdims = dims + f_maxdims(1:rank) = dims(1:rank) ENDIF hdferr = h5screate_simple_c(rank, dims, f_maxdims, space_id) DEALLOCATE(f_maxdims) @@ -823,8 +823,8 @@ CONTAINS INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count INTEGER, INTENT(OUT) :: hdferr - INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride - INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: BLOCK + INTEGER(HSIZE_T), DIMENSION(:), INTENT(IN), OPTIONAL :: stride + INTEGER(HSIZE_T), DIMENSION(:), INTENT(IN), OPTIONAL :: BLOCK INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride INTEGER :: rank @@ -1225,7 +1225,7 @@ CONTAINS CHARACTER(LEN=*), INTENT(OUT) :: buf INTEGER(SIZE_T), INTENT(INOUT) :: nalloc INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: fapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: fapl_id INTEGER(HID_T) :: fapl_id_default INTERFACE diff --git a/fortran/src/H5Tff.F90 b/fortran/src/H5Tff.F90 index 006aa79..84b9654 100644 --- a/fortran/src/H5Tff.F90 +++ b/fortran/src/H5Tff.F90 @@ -80,7 +80,7 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(OUT) :: type_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: tapl_id INTEGER :: namelen ! Name length INTEGER(HID_T) :: tapl_id_default @@ -126,9 +126,9 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(IN) :: type_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: tcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: tapl_id INTEGER :: namelen ! Name length @@ -1793,8 +1793,8 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: loc_id INTEGER(HID_T), INTENT(IN) :: dtype_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: tcpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: tapl_id INTEGER(HID_T) :: tcpl_id_default INTEGER(HID_T) :: tapl_id_default diff --git a/fortran/src/H5VLff.F90 b/fortran/src/H5VLff.F90 index 11ac349..3b451d0 100644 --- a/fortran/src/H5VLff.F90 +++ b/fortran/src/H5VLff.F90 @@ -64,7 +64,8 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: name INTEGER(HID_T), INTENT(OUT) :: vol_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: vipl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: vipl_id + CHARACTER(LEN=LEN_TRIM(name)+1,KIND=C_CHAR) :: c_name INTEGER(HID_T) :: vipl_id_default @@ -73,8 +74,8 @@ CONTAINS BIND(C,NAME='H5VLregister_connector_by_name') IMPORT :: C_CHAR IMPORT :: HID_T - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - INTEGER(HID_T), INTENT(IN), VALUE :: vipl_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(HID_T), VALUE :: vipl_id END FUNCTION H5VLregister_connector_by_name END INTERFACE @@ -105,7 +106,7 @@ CONTAINS INTEGER, INTENT(IN) :: connector_value INTEGER(HID_T), INTENT(OUT) :: vol_id INTEGER, INTENT(OUT) :: hdferr - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: vipl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: vipl_id INTEGER(HID_T) :: vipl_id_default INTERFACE @@ -114,7 +115,7 @@ CONTAINS IMPORT :: HID_T IMPORT :: C_INT INTEGER(C_INT), VALUE :: connector_value - INTEGER(HID_T), INTENT(IN), VALUE :: vipl_id + INTEGER(HID_T), VALUE :: vipl_id END FUNCTION H5VLregister_connector_by_value END INTERFACE @@ -151,7 +152,7 @@ CONTAINS INTEGER(C_INT) FUNCTION H5VLis_connector_registered_by_name(name) BIND(C,NAME='H5VLis_connector_registered_by_name') IMPORT :: C_CHAR IMPORT :: C_INT - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name END FUNCTION H5VLis_connector_registered_by_name END INTERFACE @@ -219,7 +220,7 @@ CONTAINS INTERFACE INTEGER(HID_T) FUNCTION H5VLget_connector_id(obj_id) BIND(C,NAME='H5VLget_connector_id') IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER(HID_T), VALUE :: obj_id END FUNCTION H5VLget_connector_id END INTERFACE @@ -254,7 +255,7 @@ CONTAINS INTEGER(HID_T) FUNCTION H5VLget_connector_id_by_name(name) BIND(C,NAME='H5VLget_connector_id_by_name') IMPORT :: C_CHAR IMPORT :: HID_T - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name END FUNCTION H5VLget_connector_id_by_name END INTERFACE @@ -327,9 +328,9 @@ CONTAINS INTEGER(SIZE_T) FUNCTION H5VLget_connector_name(obj_id, name, size) BIND(C,NAME='H5VLget_connector_name') IMPORT :: HID_T, SIZE_T, C_PTR, C_CHAR IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN), VALUE :: obj_id - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name - INTEGER(SIZE_T), INTENT(IN), VALUE :: size + INTEGER(HID_T) , VALUE :: obj_id + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + INTEGER(SIZE_T), VALUE :: size END FUNCTION H5VLget_connector_name END INTERFACE @@ -367,7 +368,7 @@ CONTAINS INTERFACE INTEGER FUNCTION H5VLclose(vol_id) BIND(C, NAME='H5VLclose') IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN), VALUE :: vol_id + INTEGER(HID_T), VALUE :: vol_id END FUNCTION H5VLclose END INTERFACE @@ -393,7 +394,7 @@ CONTAINS INTERFACE INTEGER FUNCTION H5VLunregister_connector(plugin_id) BIND(C, NAME='H5VLunregister_connector') IMPORT :: HID_T - INTEGER(HID_T), INTENT(IN), VALUE :: plugin_id + INTEGER(HID_T), VALUE :: plugin_id END FUNCTION H5VLunregister_connector END INTERFACE diff --git a/fortran/src/H5_buildiface.F90 b/fortran/src/H5_buildiface.F90 index c473e51..4572b4c 100644 --- a/fortran/src/H5_buildiface.F90 +++ b/fortran/src/H5_buildiface.F90 @@ -717,9 +717,9 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp' WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' @@ -756,9 +756,9 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp' WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' @@ -790,9 +790,9 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' WRITE(11,'(A)') ' CHARACTER(LEN=*), INTENT(INOUT)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp' WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' @@ -829,9 +829,9 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' WRITE(11,'(A)') ' REAL(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp' WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' @@ -867,9 +867,9 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' WRITE(11,'(A)') ' INTEGER(KIND='//TRIM(ADJUSTL(chr2))//'),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp' WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' @@ -900,9 +900,9 @@ PROGRAM H5_buildiface WRITE(11,'(A)') ' INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims' WRITE(11,'(A)') ' CHARACTER(LEN=*),INTENT(IN)'//TRIM(rank_dim_line(j))//', TARGET :: buf' WRITE(11,'(A)') ' INTEGER, INTENT(OUT) :: hdferr' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id' - WRITE(11,'(A)') ' INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: mem_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: file_space_id' + WRITE(11,'(A)') ' INTEGER(HID_T), INTENT(IN), OPTIONAL :: xfer_prp' WRITE(11,'(A)') ' INTEGER(HID_T) :: xfer_prp_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: mem_space_id_default' WRITE(11,'(A)') ' INTEGER(HID_T) :: file_space_id_default' diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 90ca7d6..3e1b65d 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -386,6 +386,7 @@ h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f * * h5d_size_flags - H5D interface flags of type size_t * h5e_flags - H5E interface flags * h5e_hid_flags - H5E interface flags of type hid_t + * h5es_flags - H5ES interface flags * h5f_flags - H5F interface flags * h5fd_flags - H5FD interface flags * h5fd_hid_flags - H5FD interface flags of type hid_t @@ -424,10 +425,11 @@ h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f * */ int_f h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, - int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, - int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, hid_t_f *h5p_flags, int_f *h5p_flags_int, - int_f *h5r_flags, int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, - int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, haddr_t_f *h5_haddr_generic_flags) + H5ES_status_t *h5es_flags, hid_t_f *h5es_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, + hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, + int_f *h5o_flags, hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, + hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, int_f *h5z_flags, + int_f *h5_generic_flags, haddr_t_f *h5_haddr_generic_flags) /******/ { /* @@ -475,6 +477,15 @@ h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid h5e_flags[1] = (int_f)H5E_MINOR; h5e_flags[2] = (int_f)H5E_WALK_UPWARD; h5e_flags[3] = (int_f)H5E_WALK_DOWNWARD; + /* + * H5ES flags + */ + h5es_hid_flags[0] = (hid_t_f)H5ES_NONE; + + h5es_flags[0] = H5ES_STATUS_IN_PROGRESS; + h5es_flags[1] = H5ES_STATUS_SUCCEED; + h5es_flags[2] = H5ES_STATUS_CANCELED; + h5es_flags[3] = H5ES_STATUS_FAIL; /* * H5F flags diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 31e0d28..f952cac 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -89,6 +89,13 @@ MODULE H5LIB INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags ! + ! H5ES flags declaration + ! + INTEGER, PARAMETER :: H5ES_FLAGS_LEN = 4 + INTEGER, DIMENSION(1:H5ES_FLAGS_LEN) :: H5ES_flags + INTEGER, PARAMETER :: H5ES_HID_FLAGS_LEN = 1 + INTEGER(HID_T), DIMENSION(1:H5ES_HID_FLAGS_LEN) :: H5ES_hid_flags + ! ! H5FD flags declaration ! INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 22 @@ -186,6 +193,8 @@ CONTAINS i_H5D_size_flags,& i_H5E_flags, & i_H5E_hid_flags, & + i_H5ES_flags, & + i_H5ES_hid_flags, & i_H5F_flags, & i_H5FD_flags, & i_H5FD_hid_flags, & @@ -207,6 +216,7 @@ CONTAINS IMPORT :: HID_T, SIZE_T, HSIZE_T, HADDR_T IMPORT :: H5D_FLAGS_LEN, H5D_SIZE_FLAGS_LEN, & H5E_FLAGS_LEN, H5E_HID_FLAGS_LEN, & + H5ES_FLAGS_LEN, H5ES_HID_FLAGS_LEN, & H5F_FLAGS_LEN, H5G_FLAGS_LEN, H5FD_FLAGS_LEN, & H5FD_HID_FLAGS_LEN, H5I_FLAGS_LEN, H5L_FLAGS_LEN, & H5O_FLAGS_LEN, H5P_FLAGS_LEN, H5P_FLAGS_INT_LEN, & @@ -217,6 +227,8 @@ CONTAINS INTEGER(SIZE_T) , DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags INTEGER , DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags INTEGER(HID_T) , DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER , DIMENSION(1:H5ES_FLAGS_LEN) :: i_H5ES_flags + INTEGER(HID_T) , DIMENSION(1:H5ES_HID_FLAGS_LEN) :: i_H5ES_hid_flags INTEGER , DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags INTEGER , DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags INTEGER , DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags @@ -244,7 +256,7 @@ CONTAINS END FUNCTION h5init1_flags_c END INTERFACE - + error = 0 ! Check if H5open_f has already been called. If so, skip doing it again. IF(H5OPEN_NUM_OBJ .NE. 0) RETURN @@ -303,6 +315,8 @@ CONTAINS H5D_size_flags, & H5E_flags, & H5E_hid_flags, & + H5ES_flags, & + H5ES_hid_flags, & H5F_flags, & H5FD_flags, & H5FD_hid_flags, & @@ -422,6 +436,19 @@ CONTAINS H5E_WALK_UPWARD_F = H5E_flags(3) H5E_WALK_DOWNWARD_F = H5E_flags(4) ! + ! H5ES flags + ! + H5ES_NONE_F = H5ES_hid_flags(1) + + H5ES_STATUS_IN_PROGRESS_F = INT(H5ES_flags(1)) + H5ES_STATUS_SUCCEED_F = INT(H5ES_flags(2)) + H5ES_STATUS_CANCELED_F = INT(H5ES_flags(3)) + H5ES_STATUS_FAIL_F = INT(H5ES_flags(4)) + + H5ES_WAIT_FOREVER_F = HUGE(0_C_INT64_T) + H5ES_WAIT_NONE_F = 0_C_INT64_T + + ! ! H5FD flags ! H5FD_MPIO_INDEPENDENT_F = H5FD_flags(1) diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake index 46dfb69..34fb091 100644 --- a/fortran/src/H5config_f.inc.cmake +++ b/fortran/src/H5config_f.inc.cmake @@ -76,3 +76,9 @@ ! Fortran compiler id #define H5_Fortran_COMPILER_ID @CMAKE_Fortran_COMPILER_ID@ + +! Define if deprecated public API symbols are disabled +#cmakedefine01 H5_NO_DEPRECATED_SYMBOLS +#if H5_NO_DEPRECATED_SYMBOLS == 0 +#undef H5_NO_DEPRECATED_SYMBOLS +#endif \ No newline at end of file diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index 0ce33ec..7fb76e1 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -74,3 +74,6 @@ ! Fortran compiler name #undef Fortran_COMPILER_ID +! Define if deprecated public API symbols are disabled +#undef NO_DEPRECATED_SYMBOLS + diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 30bab33..984cae9 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -28,15 +28,8 @@ MODULE H5GLOBAL IMPLICIT NONE - ! Enumerate data type that is interoperable with C. - ENUM, BIND(C) - ENUMERATOR :: enum_dtype - END ENUM - !> \addtogroup FH5 !> @{ - INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) !< Enumerate data type that is interoperable with C. - ! Parameters used in the function 'h5kind_to_type' located in H5_ff.F90. ! The flag is used to tell the function whether the kind input variable ! is for a REAL or INTEGER data type. @@ -382,10 +375,10 @@ MODULE H5GLOBAL INTEGER :: H5D_VDS_FIRST_MISSING_F !< H5D_VDS_FIRST_MISSING INTEGER :: H5D_VDS_LAST_AVAILABLE_F !< H5D_VDS_LAST_AVAILABLE INTEGER :: H5D_VIRTUAL_F !< H5D_VIRTUAL -!> @} ! ! H5E flags declaration ! +!> @} !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F @@ -402,6 +395,28 @@ MODULE H5GLOBAL INTEGER :: H5E_WALK_DOWNWARD_F !< H5E_WALK_DOWNWARD !> @} ! + ! H5ES flags declaration + ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5ES_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5ES_STATUS_IN_PROGRESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5ES_STATUS_SUCCEED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5ES_STATUS_CANCELED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5ES_STATUS_FAIL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5ES_WAIT_FOREVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5ES_WAIT_NONE_F + !DEC$endif +!> \addtogroup FH5ES +!> @{ + INTEGER(HID_T) :: H5ES_NONE_F !< H5ES_NONE + INTEGER :: H5ES_STATUS_IN_PROGRESS_F !< H5ES_STATUS_IN_PROGRESS + INTEGER :: H5ES_STATUS_SUCCEED_F !< H5ES_STATUS_SUCCEED + INTEGER :: H5ES_STATUS_CANCELED_F !< H5ES_STATUS_CANCELED + INTEGER :: H5ES_STATUS_FAIL_F !< H5ES_STATUS_FAIL + INTEGER(C_INT64_T) :: H5ES_WAIT_FOREVER_F !< H5ES_WAIT_FOREVER + INTEGER(C_INT64_T) :: H5ES_WAIT_NONE_F !< H5ES_WAIT_NONE +!> @} + ! ! H5FD file drivers flags declaration ! !DEC$if defined(BUILD_HDF5_DLL) diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index f2a8419..11addfa 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -353,8 +353,8 @@ H5_FCDLL int_f h5oget_info_c(hid_t_f *object_id, H5O_info_t_f *object_info, int_ H5_FCDLL int_f h5oget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, H5O_info_t_f *object_info, int_f *fields); -H5_FCDLL int_f h5oget_info_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, - H5O_info_t_f *object_info, int_f *fields); +H5_FCDLL int_f h5oget_info_by_name_c(hid_t_f *loc_id, char *name, hid_t_f *lapl_id, H5O_info_t_f *object_info, + int_f *fields, hid_t_f *es_id, char *file, char *func, int_f *line); H5_FCDLL int_f h5ocopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, hid_t_f *ocpypl_id, hid_t_f *lcpl_id); H5_FCDLL int_f h5odecr_refcount_c(hid_t_f *object_id); @@ -580,12 +580,12 @@ H5_FCDLL int_f h5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *i H5_FCDLL int_f h5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen); H5_FCDLL int_f h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, - hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, - hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, - int_f *h5o_flags, hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, - int_f *h5s_flags, hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, - int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags, - haddr_t_f *h5_haddr_generic_flags); + hid_t_f *h5e_hid_flags, H5ES_status_t *h5es_flags, hid_t_f *h5es_hid_flags, + int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, + int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, hid_t_f *h5p_flags, + int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, + hid_t_f *h5s_hid_flags, hsize_t_f *h5s_hsize_flags, int_f *h5t_flags, + int_f *h5z_flags, int_f *h5_generic_flags, haddr_t_f *h5_haddr_generic_flags); H5_FCDLL int_f h5init1_flags_c(int_f *h5lib_flags); H5_FCDLL int_f h5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum); H5_FCDLL int_f h5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum); diff --git a/fortran/src/HDF5.F90 b/fortran/src/HDF5.F90 index 9fe6e19..faedc40 100644 --- a/fortran/src/HDF5.F90 +++ b/fortran/src/HDF5.F90 @@ -28,6 +28,7 @@ MODULE HDF5 USE H5F USE H5G USE H5E + USE H5ES USE H5I USE H5L USE H5S diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 7d4154e..d42a41d 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -41,7 +41,7 @@ endif # Source files for the library. libhdf5_fortran_la_SOURCES=H5fortran_types.F90 H5f90global.F90 \ - H5_ff.F90 H5Aff.F90 H5Dff.F90 H5Eff.F90 \ + H5_ff.F90 H5Aff.F90 H5Dff.F90 H5Eff.F90 H5ESff.F90 \ H5Fff.F90 H5Gff.F90 H5Iff.F90 H5Lff.F90 H5Off.F90 H5Pff.F90 H5Rff.F90 H5Sff.F90 \ H5Tff.F90 H5VLff.F90 H5Zff.F90 H5_gen.F90 H5fortkit.F90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ @@ -143,10 +143,11 @@ H5f90global.lo: $(srcdir)/H5f90global.F90 H5fortran_types.lo H5_buildiface.lo: $(srcdir)/H5_buildiface.F90 H5_ff.lo: $(srcdir)/H5_ff.F90 H5Fff.lo H5f90global.lo H5Aff.lo: $(srcdir)/H5Aff.F90 H5f90global.lo -H5Dff.lo: $(srcdir)/H5Dff.F90 H5f90global.lo H5_ff.lo +H5Dff.lo: $(srcdir)/H5Dff.F90 H5f90global.lo H5_ff.lo H5Sff.lo H5Eff.lo: $(srcdir)/H5Eff.F90 H5f90global.lo +H5ESff.lo: $(srcdir)/H5ESff.F90 H5f90global.lo H5Fff.lo: $(srcdir)/H5Fff.F90 H5f90global.lo -H5Gff.lo: $(srcdir)/H5Gff.F90 H5f90global.lo +H5Gff.lo: $(srcdir)/H5Gff.F90 H5f90global.lo H5Pff.lo H5Iff.lo: $(srcdir)/H5Iff.F90 H5f90global.lo H5Lff.lo: $(srcdir)/H5Lff.F90 H5f90global.lo H5Off.lo: $(srcdir)/H5Off.F90 H5f90global.lo @@ -159,7 +160,7 @@ H5Zff.lo: $(srcdir)/H5Zff.F90 H5f90global.lo H5_gen.lo: H5_gen.F90 H5f90global.lo H5Aff.lo H5Dff.lo H5Pff.lo HDF5.lo: $(srcdir)/HDF5.F90 H5f90global.lo H5_ff.lo H5Aff.lo \ H5Dff.lo \ - H5Eff.lo \ + H5Eff.lo H5ESff.lo \ H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ H5Off.lo H5Pff.lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Zff.lo H5_gen.lo diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 4fa6f6a..e55be46 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -13,8 +13,9 @@ H5LIB_mp_H5GMTIME H5A_mp_H5AWRITE_CHAR_SCALAR H5A_mp_H5AREAD_CHAR_SCALAR H5A_mp_H5ACREATE_F +H5A_mp_H5ACREATE_ASYNC_F H5A_mp_H5AOPEN_NAME_F -H5A_mp_H5AOPEN_IDX_F +@H5_NO_DEPRECATED_SYMBOLS@H5A_mp_H5AOPEN_IDX_F H5A_mp_H5AGET_SPACE_F H5A_mp_H5AGET_TYPE_F H5A_mp_H5AGET_NAME_F @@ -22,27 +23,41 @@ H5A_mp_H5AGET_NAME_BY_IDX_F H5A_mp_H5AGET_NUM_ATTRS_F H5A_mp_H5ADELETE_F H5A_mp_H5ACLOSE_F +H5A_mp_H5ACLOSE_ASYNC_F H5A_mp_H5AGET_STORAGE_SIZE_F H5A_mp_H5AGET_CREATE_PLIST_F H5A_mp_H5ARENAME_BY_NAME_F +H5A_mp_H5ARENAME_BY_NAME_ASYNC_F H5A_mp_H5AOPEN_F +H5A_mp_H5AOPEN_ASYNC_F H5A_mp_H5ADELETE_BY_IDX_F H5A_mp_H5ADELETE_BY_NAME_F H5A_mp_H5AOPEN_BY_IDX_F +H5A_mp_H5AOPEN_BY_IDX_ASYNC_F H5A_mp_H5AGET_INFO_F H5A_mp_H5AGET_INFO_BY_IDX_F H5A_mp_H5AGET_INFO_BY_NAME_F H5A_mp_H5ACREATE_BY_NAME_F +H5A_mp_H5ACREATE_BY_NAME_ASYNC_F H5A_mp_H5AEXISTS_F +H5A_mp_H5AEXISTS_ASYNC_F H5A_mp_H5AEXISTS_BY_NAME_F +H5A_mp_H5AEXISTS_BY_NAME_ASYNC_F H5A_mp_H5AOPEN_BY_NAME_F +H5A_mp_H5AOPEN_BY_NAME_ASYNC_F H5A_mp_H5AWRITE_PTR +H5A_mp_H5AWRITE_ASYNC_F H5A_mp_H5AREAD_PTR +H5A_mp_H5AREAD_ASYNC_F H5A_mp_H5ARENAME_F +H5A_mp_H5ARENAME_ASYNC_F ; H5D H5D_mp_H5DCREATE_F +H5D_mp_H5DCREATE_ASYNC_F H5D_mp_H5DOPEN_F +H5D_mp_H5DOPEN_ASYNC_F H5D_mp_H5DCLOSE_F +H5D_mp_H5DCLOSE_ASYNC_F H5D_mp_H5DWRITE_REFERENCE_OBJ H5D_mp_H5DWRITE_REFERENCE_DSETREG H5D_mp_H5DWRITE_CHAR_SCALAR @@ -50,8 +65,10 @@ H5D_mp_H5DREAD_REFERENCE_OBJ H5D_mp_H5DREAD_REFERENCE_DSETREG H5D_mp_H5DREAD_CHAR_SCALAR H5D_mp_H5DGET_SPACE_F +H5D_mp_H5DGET_SPACE_ASYNC_F H5D_mp_H5DGET_TYPE_F H5D_mp_H5DSET_EXTENT_F +H5D_mp_H5DSET_EXTENT_ASYNC_F H5D_mp_H5DGET_CREATE_PLIST_F H5D_mp_H5DGET_STORAGE_SIZE_F H5D_mp_H5DVLEN_GET_MAX_LEN_F @@ -82,6 +99,8 @@ H5D_mp_H5DREAD_PTR H5D_mp_H5DVLEN_RECLAIM_F H5D_mp_H5DREAD_MULTI_F H5D_mp_H5DWRITE_MULTI_F +H5D_mp_H5DWRITE_ASYNC_F +H5D_mp_H5DREAD_ASYNC_F ; H5E H5E_mp_H5ECLEAR_F H5E_mp_H5EPRINT_F @@ -90,15 +109,20 @@ H5E_mp_H5EGET_MINOR_F H5E_mp_H5ESET_AUTO_F ; H5F H5F_mp_H5FCREATE_F +H5F_mp_H5FCREATE_ASYNC_F H5F_mp_H5FFLUSH_F +H5F_mp_H5FFLUSH_ASYNC_F H5F_mp_H5FCLOSE_F +H5F_mp_H5FCLOSE_ASYNC_F H5F_mp_H5FGET_OBJ_COUNT_F H5F_mp_H5FGET_OBJ_IDS_F H5F_mp_H5FGET_FREESPACE_F H5F_mp_H5FMOUNT_F H5F_mp_H5FUNMOUNT_F H5F_mp_H5FOPEN_F +H5F_mp_H5FOPEN_ASYNC_F H5F_mp_H5FREOPEN_F +H5F_mp_H5FREOPEN_ASYNC_F H5F_mp_H5FGET_CREATE_PLIST_F H5F_mp_H5FGET_ACCESS_PLIST_F H5F_mp_H5FIS_ACCESSIBLE_F @@ -111,8 +135,11 @@ H5F_mp_H5FGET_DSET_NO_ATTRS_HINT_F H5F_mp_H5FSET_DSET_NO_ATTRS_HINT_F ; H5G H5G_mp_H5GOPEN_F +H5G_mp_H5GOPEN_ASYNC_F H5G_mp_H5GCREATE_F +H5G_mp_H5GCREATE_ASYNC_F H5G_mp_H5GCLOSE_F +H5G_mp_H5GCLOSE_ASYNC_F H5G_mp_H5GGET_OBJ_INFO_IDX_F H5G_mp_H5GN_MEMBERS_F H5G_mp_H5GLINK_F @@ -125,9 +152,15 @@ H5G_mp_H5GSET_COMMENT_F H5G_mp_H5GGET_COMMENT_F H5G_mp_H5GCREATE_ANON_F H5G_mp_H5GGET_CREATE_PLIST_F -H5G_mp_H5GGET_INFO_F -H5G_mp_H5GGET_INFO_BY_IDX_F -H5G_mp_H5GGET_INFO_BY_NAME_F +H5G_mp_H5GGET_INFO_F90 +H5G_mp_H5GGET_INFO_BY_IDX_F90 +H5G_mp_H5GGET_INFO_BY_NAME_F90 +H5G_mp_H5GGET_INFO_F03 +H5G_mp_H5GGET_INFO_BY_IDX_F03 +H5G_mp_H5GGET_INFO_BY_NAME_F03 +H5G_mp_H5GGET_INFO_ASYNC_F +H5G_mp_H5GGET_INFO_BY_IDX_ASYNC_F +H5G_mp_H5GGET_INFO_BY_NAME_ASYNC_F H5G_mp_H5GGET_OBJ_INFO_IDX_F ; H5GLOBAL ; PREDEFINED_TYPES DATA @@ -160,21 +193,29 @@ H5I_mp_H5IIS_VALID_F ; H5L H5L_mp_H5LCOPY_F H5L_mp_H5LDELETE_F +H5L_mp_H5LDELETE_ASYNC_F H5L_mp_H5LCREATE_SOFT_F +H5L_mp_H5LCREATE_SOFT_ASYNC_F H5L_mp_H5LCREATE_HARD_F +H5L_mp_H5LCREATE_HARD_ASYNC_F H5L_mp_H5LCREATE_EXTERNAL_F H5L_mp_H5LDELETE_BY_IDX_F +H5L_mp_H5LDELETE_BY_IDX_ASYNC_F H5L_mp_H5LEXISTS_F +H5L_mp_H5LEXISTS_ASYNC_F H5L_mp_H5LGET_INFO_F H5L_mp_H5LGET_INFO_BY_IDX_F H5L_mp_H5LIS_REGISTERED_F H5L_mp_H5LMOVE_F H5L_mp_H5LGET_NAME_BY_IDX_F H5L_mp_H5LITERATE_F +H5L_mp_H5LITERATE_ASYNC_F H5L_mp_H5LITERATE_BY_NAME_F ; H5O H5O_mp_H5OCLOSE_F +H5O_mp_H5OCLOSE_ASYNC_F H5O_mp_H5OCOPY_F +H5O_mp_H5OCOPY_ASYNC_F H5O_mp_H5ODECR_REFCOUNT_F H5O_mp_H5OEXISTS_BY_NAME_F H5O_mp_H5OGET_COMMENT_F @@ -183,11 +224,14 @@ H5O_mp_H5OINCR_REFCOUNT_F H5O_mp_H5OLINK_F H5O_mp_H5OOPEN_BY_TOKEN_F H5O_mp_H5OOPEN_BY_IDX_F +H5O_mp_H5OOPEN_BY_IDX_ASYNC_F H5O_mp_H5OOPEN_F +H5O_mp_H5OOPEN_ASYNC_F H5O_mp_H5OSET_COMMENT_F H5O_mp_H5OSET_COMMENT_BY_NAME_F H5O_mp_H5OGET_INFO_BY_IDX_F H5O_mp_H5OGET_INFO_BY_NAME_F +H5O_mp_H5OGET_INFO_BY_NAME_ASYNC_F H5O_mp_H5OGET_INFO_F H5O_mp_H5OVISIT_BY_NAME_F H5O_mp_H5OVISIT_F diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 7d85a27..6ceddd6 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -47,7 +47,7 @@ fortranlib_test_1_8_SOURCES = tH5O.F90 tH5A_1_8.F90 tH5G_1_8.F90 tH5MISC_1_8.F90 fortranlib_test_1_8.F90 fortranlib_test_F03_SOURCES = tH5E_F03.F90 tH5F_F03.F90 tH5L_F03.F90 \ - tH5O_F03.F90 tH5P_F03.F90 tH5T_F03.F90 tHDF5_F03.F90 fortranlib_test_F03.F90 + tH5O_F03.F90 tH5P_F03.F90 tH5T_F03.F90 tHDF5_F03.F90 fortranlib_test_F03.F90 vol_connector_SOURCES=vol_connector.F90 diff --git a/fortran/test/t.c b/fortran/test/t.c index f6bc0f9..b89e8ae 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -36,7 +36,6 @@ * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Friday, September 13, 2002 - * Modifications: *---------------------------------------------------------------------------*/ int_f nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl, _fcd full_name, size_t_f *full_namelen) @@ -78,7 +77,6 @@ done: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, September 19, 2002 - * Modifications: *---------------------------------------------------------------------------*/ int_f nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl) @@ -128,7 +126,6 @@ DONE: * Returns: none * Programmer: Quincey Koziol * Tuesday, December 14, 2004 - * Modifications: *---------------------------------------------------------------------------*/ void nh5_exit_c(int_f *status) @@ -145,7 +142,6 @@ nh5_exit_c(int_f *status) * Returns: none * Programmer: M.S. Breitenfeld * September 30, 2008 - * Modifications: *---------------------------------------------------------------------------*/ void nh5_env_nocleanup_c(int_f *status) diff --git a/fortran/test/tH5A_1_8.F90 b/fortran/test/tH5A_1_8.F90 index 5344f4b..d43279e 100644 --- a/fortran/test/tH5A_1_8.F90 +++ b/fortran/test/tH5A_1_8.F90 @@ -2614,6 +2614,7 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) WRITE(chr5,'(I5.5)') u attrname = 'attr '//chr5 CALL H5Aexists_f( gid, attrname, exists, error) + CALL check("H5Aexists_f", error, total_error) CALL verify("H5Aexists",exists,.FALSE.,total_error ) CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error, lapl_id = H5P_DEFAULT_F) @@ -2623,9 +2624,11 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) CALL check("h5acreate_f",error,total_error) CALL H5Aexists_f(gid, attrname, exists, error) + CALL check("H5Aexists_f", error, total_error) CALL verify("H5Aexists",exists,.TRUE.,total_error ) CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) + CALL check("H5Aexists_by_name_f", error, total_error) CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) attr_data1(1) = u @@ -2638,9 +2641,11 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) CALL check("h5aclose_f",error,total_error) CALL H5Aexists_f(gid, attrname, exists, error) + CALL check("H5Aexists_f", error, total_error) CALL verify("H5Aexists",exists,.TRUE.,total_error ) CALL H5Aexists_by_name_f(fid, GROUP1_NAME, attrname, exists, error) + CALL check("H5Aexists_by_name_f", error, total_error) CALL verify("H5Aexists_by_name_f",exists,.TRUE.,total_error ) ENDDO diff --git a/fortran/test/tH5G_1_8.F90 b/fortran/test/tH5G_1_8.F90 index 755c96d..c820d78 100644 --- a/fortran/test/tH5G_1_8.F90 +++ b/fortran/test/tH5G_1_8.F90 @@ -163,6 +163,7 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure INTEGER :: nlinks ! Number of links in group INTEGER :: max_corder ! Current maximum creation order value for group + TYPE(H5G_info_t) :: ginfo INTEGER :: u,v ! Local index variables CHARACTER(LEN=2) :: chr2 @@ -283,29 +284,61 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL check("H5Gget_info_f", error, total_error) ! Check (new/empty) group's information - CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_f", max_corder, 0, total_error) - CALL verify("H5Gget_info_f", nlinks, 0, total_error) + CALL verify("H5Gget_info_f.storage_type", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_f.max_corder", max_corder, 0, total_error) + CALL VERIFY("H5Gget_info_f.nlinks", nlinks, 0, total_error) CALL verify("H5Gget_info_f.mounted", mounted,.FALSE.,total_error) + ! Retrieve group's information (F03) + CALL H5Gget_info_f(group_id2, ginfo, error) + CALL check("H5Gget_info_f", error, total_error) + + CALL VERIFY("H5Gget_info_f.storage_type", & + ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F,C_INT), total_error) + CALL verify("H5Gget_info_f.max_corder", ginfo%max_corder, 0_C_INT64_T, total_error) + CALL verify("H5Gget_info_f.nlinks", ginfo%nlinks, 0_HSIZE_T, total_error) + CALL verify("H5Gget_info_f.mounted", LOGICAL(ginfo%mounted), .FALSE.,total_error) + ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error, mounted=mounted) CALL check("H5Gget_info_by_name_f", error, total_error) ! Check (new/empty) group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) - CALL verify("H5Gget_info_by_name_f.mounted", mounted,.FALSE.,total_error) + CALL verify("H5Gget_info_by_name_f.storage_type", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) + CALL verify("H5Gget_info_by_name_f.max_corder", max_corder, 0, total_error) + CALL verify("H5Gget_info_by_name_f.nlinks", nlinks, 0, total_error) + CALL verify("H5Gget_info_by_name_f.mounted", mounted, .FALSE., total_error) + + ! Retrieve group's information (F03) + CALL H5Gget_info_by_name_f(group_id, objname, ginfo, error) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check (new/empty) group's information + CALL VERIFY("H5Gget_info_by_name_f.storage_type", & + ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL verify("H5Gget_info_by_name_f.max_corder", ginfo%max_corder, 0_C_INT64_T, total_error) + CALL verify("H5Gget_info_by_name_f.nlinks", ginfo%nlinks, 0_HSIZE_T, total_error) + CALL VERIFY("H5Gget_info_by_name_f.mounted", LOGICAL(ginfo%mounted), .FALSE.,total_error) ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name", error, total_error) ! Check (new/empty) group's information - CALL verify("H5Gget_info_by_name_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) - CALL verify("H5Gget_info_by_name_f", max_corder, 0, total_error) - CALL verify("H5Gget_info_by_name_f", nlinks, 0, total_error) + CALL VERIFY("H5Gget_info_by_name_f.storage_type", & + ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL verify("H5Gget_info_by_name_f.max_corder", ginfo%max_corder, 0_C_INT64_T, total_error) + CALL verify("H5Gget_info_by_name_f.nlinks", ginfo%nlinks, 0_HSIZE_T, total_error) + + ! Retrieve group's information (F03) + CALL H5Gget_info_by_name_f(group_id2, ".", ginfo, error) + CALL check("H5Gget_info_by_name", error, total_error) + + ! Check (new/empty) group's information + CALL VERIFY("H5Gget_info_by_name_f.storage_type", & + ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL verify("H5Gget_info_by_name_f.max_corder", ginfo%max_corder, 0_C_INT64_T, total_error) + CALL verify("H5Gget_info_by_name_f.nlinks", ginfo%nlinks, 0_HSIZE_T, total_error) ! Create objects in new group created DO v = 0, u @@ -331,6 +364,15 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_f", nlinks, u+1, total_error) + ! Retrieve group's information (F03) + CALL H5Gget_info_f(group_id2, ginfo, error) + CALL check("H5Gget_info_f", error, total_error) + + ! Check (new) group's information + CALL VERIFY("H5Gget_info_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL VERIFY("H5Gget_info_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL VERIFY("H5Gget_info_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) + ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id, objname, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) @@ -340,6 +382,15 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_by_name_f",max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + ! Retrieve group's information (F03) + CALL H5Gget_info_by_name_f(group_id, objname, ginfo, error) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check (new) group's information + CALL VERIFY("H5Gget_info_by_name_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL VERIFY("H5Gget_info_by_name_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL VERIFY("H5Gget_info_by_name_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) + ! Retrieve group's information CALL H5Gget_info_by_name_f(group_id2, ".", storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) @@ -349,6 +400,15 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + ! Retrieve group's information (F03) + CALL H5Gget_info_by_name_f(group_id2, ".", ginfo, error) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check (new) group's information + CALL VERIFY("H5Gget_info_by_name_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL VERIFY("H5Gget_info_by_name_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL VERIFY("H5Gget_info_by_name_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) + ! Retrieve group's information IF(order.NE.H5_ITER_NATIVE_F)THEN IF(order.EQ.H5_ITER_INC_F) THEN @@ -356,16 +416,31 @@ SUBROUTINE group_info(cleanup, fapl, total_error) storage_type, nlinks, max_corder, error,lapl_id=H5P_DEFAULT_F, mounted=mounted) CALL check("H5Gget_info_by_idx_f", error, total_error) CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) + + CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(u,HSIZE_T), & + ginfo, error,lapl_id=H5P_DEFAULT_F) + CALL check("H5Gget_info_by_idx_f", error, total_error) + CALL VERIFY("H5Gget_info_by_idx_f", LOGICAL(ginfo%mounted), .FALSE., total_error) + ELSE CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), & storage_type, nlinks, max_corder, error, mounted=mounted) + CALL check("H5Gget_info_by_idx_f", error, total_error) CALL verify("H5Gget_info_by_idx_f", mounted,.FALSE.,total_error) + + CALL H5Gget_info_by_idx_f(group_id, ".", idx_type, order, INT(0,HSIZE_T), & + ginfo, error) CALL check("H5Gget_info_by_idx_f", error, total_error) + CALL verify("H5Gget_info_by_idx_f", LOGICAL(ginfo%mounted),.FALSE.,total_error) ENDIF ! Check (new) group's information CALL verify("H5Gget_info_by_idx_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_by_idx_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_idx_f", nlinks, u+1, total_error) + + CALL VERIFY("H5Gget_info_by_idx_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL verify("H5Gget_info_by_idx_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL verify("H5Gget_info_by_idx_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) ENDIF ! Close group created CALL H5Gclose_f(group_id2, error) @@ -380,6 +455,15 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_f", nlinks, u+1, total_error) + ! Retrieve main group's information (F03) + CALL H5Gget_info_f(group_id, ginfo, error) + CALL check("H5Gget_info_f", error, total_error) + + ! Check main group's information + CALL VERIFY("H5Gget_info_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL verify("H5Gget_info_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL verify("H5Gget_info_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) + ! Retrieve main group's information, by name CALL H5Gget_info_by_name_f(file_id, CORDER_GROUP_NAME, storage_type, nlinks, max_corder, error) CALL check("H5Gget_info_by_name_f", error, total_error) @@ -389,6 +473,15 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + ! Retrieve main group's information, by name (F03) + CALL H5Gget_info_by_name_f(file_id, CORDER_GROUP_NAME, ginfo, error) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check main group's information + CALL VERIFY("H5Gget_info_by_name_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F,C_INT), total_error) + CALL verify("H5Gget_info_by_name_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL verify("H5Gget_info_by_name_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) + ! Retrieve main group's information, by name CALL H5Gget_info_by_name_f(group_id, ".", storage_type, nlinks, max_corder, error, H5P_DEFAULT_F) CALL check("H5Gget_info_by_name_f", error, total_error) @@ -398,6 +491,15 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_by_name_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_by_name_f", nlinks, u+1, total_error) + ! Retrieve main group's information, by name + CALL H5Gget_info_by_name_f(group_id, ".", ginfo, error, H5P_DEFAULT_F) + CALL check("H5Gget_info_by_name_f", error, total_error) + + ! Check main group's information + CALL VERIFY("H5Gget_info_by_name_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL verify("H5Gget_info_by_name_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL verify("H5Gget_info_by_name_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) + ! Create soft link in another group, to objects in main group valname = CORDER_GROUP_NAME//objname @@ -411,31 +513,39 @@ SUBROUTINE group_info(cleanup, fapl, total_error) CALL verify("H5Gget_info_f", storage_type, H5G_STORAGE_TYPE_COMPACT_F, total_error) CALL verify("H5Gget_info_f", max_corder, u+1, total_error) CALL verify("H5Gget_info_f", nlinks, u+1, total_error) + + ! Retrieve soft link group's information, by name (F03) + CALL H5Gget_info_f(soft_group_id, ginfo, error) + CALL check("H5Gget_info_f", error, total_error) + + ! Check soft link group's information + CALL VERIFY("H5Gget_info_f", ginfo%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL verify("H5Gget_info_f", ginfo%max_corder, INT(u+1,C_INT64_T), total_error) + CALL verify("H5Gget_info_f", ginfo%nlinks, INT(u+1, HSIZE_T), total_error) ENDDO ! Close the groups - CALL H5Gclose_f(group_id, error) - CALL check("H5Gclose_f", error, total_error) - CALL H5Gclose_f(soft_group_id, error) - CALL check("H5Gclose_f", error, total_error) + CALL H5Gclose_f(group_id, error) + CALL check("H5Gclose_f", error, total_error) + CALL H5Gclose_f(soft_group_id, error) + CALL check("H5Gclose_f", error, total_error) - ! Close the file - CALL H5Fclose_f(file_id, error) - CALL check("H5Fclose_f", error, total_error) - ENDDO + ! Close the file + CALL H5Fclose_f(file_id, error) + CALL check("H5Fclose_f", error, total_error) ENDDO ENDDO + ENDDO - ! Free resources - CALL H5Pclose_f(gcpl_id, error) - CALL check("H5Pclose_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) + ! Free resources + CALL H5Pclose_f(gcpl_id, error) + CALL check("H5Pclose_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(prefix, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) - END SUBROUTINE group_info +END SUBROUTINE group_info !------------------------------------------------------------------------- ! * Function: timestamps @@ -639,8 +749,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! * Programmer: Adapted from C test by: ! * M.S. Breitenfeld ! * -! * Modifications: -! * ! *------------------------------------------------------------------------- ! @@ -732,8 +840,6 @@ SUBROUTINE group_info(cleanup, fapl, total_error) ! * Programmer: M.S. Breitenfeld ! * March 3, 2008 ! * -! * Modifications: -! * ! *------------------------------------------------------------------------- ! @@ -1080,8 +1186,6 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) ! * Programmer: M.S. Breitenfeld ! * April 14, 2008 ! * -! * Modifications: Modified original C code -! * ! *------------------------------------------------------------------------- ! @@ -1125,9 +1229,11 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL H5Lexists_f(file,"d1",Lexists, error) + CALL check("H5Lexists_f", error, total_error) CALL verify("H5Lexists", Lexists,.TRUE.,total_error) CALL H5Lexists_f(file,"grp1/hard",Lexists, error) + CALL check("H5Lexists_f", error, total_error) CALL verify("H5Lexists", Lexists,.TRUE.,total_error) ! Cleanup @@ -1488,8 +1594,6 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! * Modified C routine ! * March 12, 2008 ! * -! * Modifications: -! * ! *------------------------------------------------------------------------- ! @@ -1858,8 +1962,6 @@ END SUBROUTINE objcopy ! * Programmer: James Laird ! * Tuesday, June 6, 2006 ! * -! * Modifications: -! * ! *------------------------------------------------------------------------- ! diff --git a/fortran/test/tH5MISC_1_8.F90 b/fortran/test/tH5MISC_1_8.F90 index 2eea6ba..5413169 100644 --- a/fortran/test/tH5MISC_1_8.F90 +++ b/fortran/test/tH5MISC_1_8.F90 @@ -341,8 +341,6 @@ END SUBROUTINE test_h5s_encode ! Programmer: M. Scot Breitenfeld ! Decemeber 11, 2010 ! -! Modifications: -! !------------------------------------------------------------------------- ! diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index ad505d4..0875b81 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -85,8 +85,6 @@ CONTAINS ! * Programmer: M. Scot Breitenfeld ! * June 24, 2008 ! * -! * Modifications: -! * ! *------------------------------------------------------------------------- ! diff --git a/fortran/test/tH5T.F90 b/fortran/test/tH5T.F90 index 82a908e..1fee036 100644 --- a/fortran/test/tH5T.F90 +++ b/fortran/test/tH5T.F90 @@ -953,8 +953,6 @@ CONTAINS ! * Fortran Programmer: M.S. Breitenfeld ! * September 9, 2008 ! * -! * Modifications: -! * ! *------------------------------------------------------------------------- ! diff --git a/fortran/test/tH5T_F03.F90 b/fortran/test/tH5T_F03.F90 index 9535d3a..2256b50 100644 --- a/fortran/test/tH5T_F03.F90 +++ b/fortran/test/tH5T_F03.F90 @@ -2917,13 +2917,6 @@ END SUBROUTINE setup_buffer ! Programmer: M. Scot Breitenfeld ! Decemeber 7, 2010 ! -! Modifications: Moved this subroutine from the 1.8 test file and -! modified it to use F2003 features. -! This routine requires 4 byte reals, so we use F2003 features to -! ensure the requirement is satisfied in a portable way. -! The need for this arises when a user specifies the default real is 8 bytes. -! MSB 7/31/12 -! !------------------------------------------------------------------------- ! diff --git a/fortran/test/tf.F90 b/fortran/test/tf.F90 index 0c518f5..73f43bc 100644 --- a/fortran/test/tf.F90 +++ b/fortran/test/tf.F90 @@ -36,6 +36,8 @@ MODULE TH5_MISC INTEGER, PARAMETER :: sp = SELECTED_REAL_KIND(5) ! This should map to REAL*4 on most modern processors INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(10) ! This should map to REAL*8 on most modern processors + INTEGER, PARAMETER :: TAB_SPACE = 88 ! Tab spacing for printing results + ! generic compound datatype TYPE :: comp_datatype SEQUENCE @@ -57,6 +59,84 @@ CONTAINS !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: write_test_header +!DEC$endif + SUBROUTINE write_test_header(title_header) + + ! Writes the test header + + IMPLICIT NONE + + CHARACTER(LEN=*), INTENT(IN) :: title_header ! test name + INTEGER, PARAMETER :: width = TAB_SPACE+10 + CHARACTER(LEN=2*width) ::title_centered =" " + INTEGER :: len, i + + len=LEN_TRIM(title_header) + title_centered(1:3) ="| |" + title_centered((width-len)/2:(width-len)/2+len) = TRIM(title_header) + title_centered(width-1:width+2) ="| |" + + WRITE(*,'(1X)', ADVANCE="NO") + DO i = 1, width-1 + WRITE(*,'("_")', ADVANCE="NO") + ENDDO + WRITE(*,'()') + WRITE(*,'("| ")', ADVANCE="NO") + DO i = 1, width-5 + WRITE(*,'("_")', ADVANCE="NO") + ENDDO + WRITE(*,'(" |")') + + WRITE(*,'("| |")', ADVANCE="NO") + DO i = 1, width-5 + WRITE(*,'(1X)', ADVANCE="NO") + ENDDO + WRITE(*,'("| |")') + + WRITE(*,'(A)') title_centered + + WRITE(*,'("| |")', ADVANCE="NO") + DO i = 1, width-5 + WRITE(*,'(1X)', ADVANCE="NO") + ENDDO + WRITE(*,'("| |")') + + WRITE(*,'("| |")', ADVANCE="NO") + DO i = 1, width-5 + WRITE(*,'("_")', ADVANCE="NO") + ENDDO + WRITE(*,'("| |")') + + WRITE(*,'("|")', ADVANCE="NO") + DO i = 1, width-1 + WRITE(*,'("_")', ADVANCE="NO") + ENDDO + WRITE(*,'("|",/)') + + END SUBROUTINE write_test_header + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) +!DEC$attributes dllexport :: write_test_footer +!DEC$endif + SUBROUTINE write_test_footer() + + ! Writes the test footer + + IMPLICIT NONE + INTEGER, PARAMETER :: width = TAB_SPACE+10 + INTEGER :: i + + DO i = 1, width + WRITE(*,'("_")', ADVANCE="NO") + ENDDO + WRITE(*,'(/)') + + END SUBROUTINE write_test_footer + +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_TEST_DLL) !DEC$attributes dllexport :: write_test_status !DEC$endif SUBROUTINE write_test_status( test_result, test_title, total_error) @@ -78,7 +158,7 @@ CONTAINS CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' CHARACTER(LEN=8), PARAMETER :: skip = '--SKIP--' - + CHARACTER(LEN=10) :: FMT error_string = failure IF (test_result == 0) THEN @@ -86,8 +166,8 @@ CONTAINS ELSE IF (test_result == -1) THEN error_string = skip ENDIF - - WRITE(*, fmt = '(A, T88, A)') test_title, error_string + WRITE(FMT,'("(A,T",I0,",A)")') TAB_SPACE + WRITE(*, fmt = FMT) test_title, error_string IF(test_result.GT.0) total_error = total_error + test_result diff --git a/fortran/test/vol_connector.F90 b/fortran/test/vol_connector.F90 index 2cc6cee..e2235f4 100644 --- a/fortran/test/vol_connector.F90 +++ b/fortran/test/vol_connector.F90 @@ -235,8 +235,9 @@ PROGRAM vol_connector INTEGER :: error INTEGER :: ret_total_error LOGICAL :: cleanup, status - CHARACTER(LEN=12) :: VOL_CONNECTOR_ENV + CHARACTER(LEN=32) :: VOL_CONNECTOR_ENV INTEGER :: LEN = 0 + INTEGER :: CONN_NAME_LEN CALL h5open_f(error) cleanup = .TRUE. @@ -251,8 +252,9 @@ PROGRAM vol_connector ! Check to see if the VOL connector was set with an env variable CALL GET_ENVIRONMENT_VARIABLE("HDF5_VOL_CONNECTOR", VOL_CONNECTOR_ENV, LEN) + CONN_NAME_LEN = INDEX(VOL_CONNECTOR_ENV, ' ') IF(LEN.NE.0)THEN - NATIVE_VOL_CONNECTOR_NAME = TRIM(VOL_CONNECTOR_ENV) + NATIVE_VOL_CONNECTOR_NAME = TRIM(VOL_CONNECTOR_ENV(1:CONN_NAME_LEN)) ELSE NATIVE_VOL_CONNECTOR_NAME = "native" ENDIF diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 58ef95d..ca241f6 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -98,6 +98,46 @@ if(MSVC) set_property(TARGET subfiling_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() +#-- Adding test for async_test +add_executable (async_test + async.F90 +) +target_include_directories (async_test + PRIVATE ${TESTPAR_INCLUDES} +) +target_compile_options(async_test + PRIVATE + "${HDF5_CMAKE_Fortran_FLAGS}" + $<$:${WIN_COMPILE_FLAGS}> +) +if (NOT BUILD_SHARED_LIBS) + target_link_libraries (async_test + PRIVATE + ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS} + $<$:"ws2_32.lib"> + ) + set_target_properties (async_test PROPERTIES + FOLDER test/fortran + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static + ) +else () + target_link_libraries (async_test + PRIVATE + ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_Fortran_LIBS} + $<$:"ws2_32.lib"> + ) + set_target_properties (async_test PROPERTIES + FOLDER test/fortran + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared + ) +endif () + +if(MSVC) + set_property(TARGET async_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") +endif() + if (HDF5_TEST_FORTRAN AND HDF5_TEST_PARALLEL) include (CMakeTests.cmake) endif () diff --git a/fortran/testpar/Makefile.am b/fortran/testpar/Makefile.am index b1cefbc..7f9f284 100644 --- a/fortran/testpar/Makefile.am +++ b/fortran/testpar/Makefile.am @@ -32,7 +32,7 @@ else endif # These are our main targets -TEST_PROG_PARA=parallel_test subfiling_test +TEST_PROG_PARA=parallel_test subfiling_test async_test check_PROGRAMS=$(TEST_PROG_PARA) # Temporary files @@ -41,6 +41,7 @@ CHECK_CLEANFILES+=parf[12].h5 subf.h5* # Test source files parallel_test_SOURCES=ptest.F90 hyper.F90 mdset.F90 multidsetrw.F90 subfiling_test_SOURCES=subfiling.F90 +async_test_SOURCES=async.F90 # The tests depend on several libraries. LDADD=$(LIBH5FTEST) $(LIBH5TEST) $(LIBH5F) $(LIBHDF5) diff --git a/fortran/testpar/async.F90 b/fortran/testpar/async.F90 new file mode 100644 index 0000000..e3a80ad --- /dev/null +++ b/fortran/testpar/async.F90 @@ -0,0 +1,1417 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! All rights reserved. * +! * +! This file is part of HDF5. The full HDF5 copyright notice, including * +! terms governing use, modification, and redistribution, is contained in * +! the COPYING file, which can be found at the root of the source code * +! distribution tree, or in https://www.hdfgroup.org/licenses. * +! If you do not have access to either file, you may request a copy from * +! help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! Tests async Fortran wrappers. It needs an async VOL. It will skip the tests if +! HDF5_VOL_CONNECTOR is not set or is set to a non-supporting async VOL. +! +MODULE test_async_APIs + + USE MPI + USE HDF5 + USE TH5_MISC + USE TH5_MISC_GEN + + INTEGER(C_INT), PARAMETER :: op_data_type = 200 + INTEGER(C_INT), PARAMETER :: op_data_command = 99 + + LOGICAL :: async_enabled = .TRUE. + LOGICAL :: mpi_thread_mult = .TRUE. + + ! Custom group iteration callback data + TYPE, bind(c) :: iter_info + CHARACTER(KIND=C_CHAR), DIMENSION(1:12) :: name ! The name of the object + INTEGER(c_int) :: TYPE ! The TYPE of the object + INTEGER(c_int) :: command ! The TYPE of RETURN value + END TYPE iter_info + + CHARACTER(LEN=10), TARGET :: app_file = "async.F90"//C_NULL_CHAR + CHARACTER(LEN=10), TARGET :: app_func = "func_name"//C_NULL_CHAR + INTEGER :: app_line = 42 + +CONTAINS + + INTEGER(KIND=C_INT) FUNCTION liter_cb(group, name, link_info, op_data) bind(C) + + IMPLICIT NONE + + INTEGER(HID_T), VALUE :: group + CHARACTER(LEN=1), DIMENSION(1:12) :: name + TYPE (H5L_info_t) :: link_info + TYPE(iter_info) :: op_data + + liter_cb = 0 + + op_data%name(1:12) = name(1:12) + + SELECT CASE (op_data%command) + + CASE(0) + liter_cb = 0 + CASE(2) + liter_cb = op_data%command*10 + END SELECT + op_data%command = op_data_command + op_data%type = op_data_type + + END FUNCTION liter_cb + + SUBROUTINE H5ES_tests(cleanup, total_error) + ! + ! Test H5ES routines + ! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER :: nerrors = 0 + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: file_id + CHARACTER(len=80) :: filename = "h5es_tests.h5" + INTEGER :: hdferror + + INTEGER(HID_T) :: es_id + INTEGER(SIZE_T) :: count + INTEGER(C_INT64_T) :: counter + INTEGER(SIZE_T) :: num_not_canceled + INTEGER(SIZE_T) :: num_in_progress + LOGICAL :: err_occurred + + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_id, hdferror) + CALL check("h5pcreate_f", hdferror, nerrors) + + CALL h5pset_fapl_mpio_f(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL, hdferror) + CALL check("h5pset_fapl_mpio_f", hdferror, nerrors) + + CALL H5EScreate_f(es_id, hdferror) + CALL check("H5EScreate_f", hdferror, nerrors) + + CALL H5ESget_count_f(es_id, count, hdferror) + CALL check("H5ESget_count_f", hdferror, nerrors) + CALL VERIFY("H5ESget_count_f", count, 0_SIZE_T,total_error) + + CALL H5EScancel_f(es_id, num_not_canceled, err_occurred, hdferror) + CALL check("H5EScancel_f", hdferror, nerrors) + CALL VERIFY("H5EScancel_f", num_not_canceled, 0_size_t, total_error) + CALL VERIFY("H5EScancel_f", err_occurred, .FALSE., total_error) + + CALL H5Fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, hdferror, access_prp = fapl_id) + CALL check("h5fcreate_f", hdferror, nerrors) + + CALL H5ESget_count_f(es_id, count, hdferror) + CALL check("H5ESget_count_f", hdferror, nerrors) + IF(async_enabled)THEN + CALL VERIFY("H5ESget_count_f", count, 2_SIZE_T,total_error) + ELSE + CALL VERIFY("H5ESget_count_f", count, 0_SIZE_T,total_error) + ENDIF + + CALL H5ESget_op_counter_f(es_id, counter, hdferror) + CALL check("H5ESget_op_counter_f", hdferror, nerrors) + IF(async_enabled)THEN + CALL VERIFY("H5ESget_op_counter_f", counter, 2_C_INT64_T, total_error) + ELSE + CALL VERIFY("H5ESget_op_counter_f", counter, 0_C_INT64_T, total_error) + ENDIF + + CALL H5Pclose_f(fapl_id, hdferror) + CALL check("h5pclose_f", hdferror, nerrors) + + CALL H5Fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_f", hdferror, nerrors) + CALL H5ESget_count_f(es_id, count, hdferror) + CALL check("H5ESget_count_f", hdferror, nerrors) + IF(async_enabled)THEN + CALL VERIFY("H5ESget_count_f", count, 3_SIZE_T,total_error) + ELSE + CALL VERIFY("H5ESget_count_f", count, 0_SIZE_T,total_error) + ENDIF + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror); + CALL check("H5ESwait_f", hdferror, nerrors) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + CALL H5ESget_count_f(es_id, count, hdferror) + CALL check("H5ESget_count_f", hdferror, nerrors) + CALL VERIFY("H5ESget_count_f", count, 0_SIZE_T,total_error) + + CALL H5ESclose_f(es_id, hdferror) + CALL check("H5ESclose_f", hdferror, nerrors) + + END SUBROUTINE H5ES_tests + + SUBROUTINE H5A_async_tests(cleanup, total_error) + ! + ! Test H5A async routines + ! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: file_id + CHARACTER(len=80) :: filename = "h5a_tests.h5" + INTEGER :: hdferror + INTEGER(HID_T) :: es_id + INTEGER(SIZE_T) :: num_in_progress + LOGICAL :: err_occurred + + CHARACTER(LEN=4), PARAMETER :: attr_name = "ATTR" + INTEGER, TARGET :: attr_data0 = 100 + INTEGER, TARGET :: attr_data1 = 101 + INTEGER, TARGET :: attr_data2 = 101 + INTEGER, TARGET :: attr_rdata0 + INTEGER, TARGET :: attr_rdata1 + INTEGER, TARGET :: attr_rdata2 + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: attr_id0, attr_id1, attr_id2 + LOGICAL :: exists + LOGICAL(C_BOOL), TARGET :: exists0 = .FALSE., exists1 = .FALSE., exists2 = .FALSE., exists3 = .FALSE. + TYPE(C_PTR) :: f_ptr, f_ptr1, f_ptr2 + + CALL H5EScreate_f(es_id, hdferror) + CALL check("H5EScreate_f", hdferror, total_error) + ! + ! Create the file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_id, hdferror) + CALL check("h5pcreate_f", hdferror, total_error) + + CALL h5pset_fapl_mpio_f(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL, hdferror) + CALL check("h5pset_fapl_mpio_f", hdferror, total_error) + + CALL h5fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, hdferror, access_prp = fapl_id ) + CALL check("h5fcreate_f",hdferror, total_error) + + CALL H5Screate_f(H5S_SCALAR_F, space_id, hdferror) + CALL check("H5Screate_f", hdferror, total_error) + + f_ptr1 = C_LOC(app_file) + f_ptr2 = C_LOC(app_func) + CALL h5acreate_async_f(file_id, attr_name, H5T_NATIVE_INTEGER, space_id, attr_id0, es_id, hdferror, & + file=f_ptr1, func=f_ptr2, line=app_line) + CALL check("h5acreate_f",hdferror,total_error) + + f_ptr = C_LOC(attr_data0) + CALL H5Awrite_async_f(attr_id0, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror) + CALL check("H5Awrite_async_f",hdferror,total_error) + + CALL H5Aclose_async_f(attr_id0, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror,total_error) + + CALL h5acreate_by_name_async_f(file_id, "/", TRIM(attr_name)//"00", & + H5T_NATIVE_INTEGER, space_id, attr_id1, es_id, hdferror) + CALL check("h5acreate_by_name_async_f",hdferror,total_error) + + CALL h5acreate_by_name_async_f(file_id, "/", TRIM(attr_name)//"01", & + H5T_NATIVE_INTEGER, space_id, attr_id2, es_id, hdferror) + CALL check("h5acreate_by_name_async_f",hdferror,total_error) + + f_ptr = C_LOC(attr_data1) + CALL H5Awrite_async_f(attr_id1, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror) + CALL check("H5Awrite_async_f",hdferror,total_error) + + CALL H5Aclose_async_f(attr_id1, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror,total_error) + + f_ptr = C_LOC(attr_data2) + CALL H5Awrite_async_f(attr_id2, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror) + CALL check("H5Awrite_async_f",hdferror,total_error) + + CALL H5Aclose_async_f(attr_id2, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror,total_error) + + CALL H5Sclose_f(space_id, hdferror) + CALL check("H5Sclose_f",hdferror,total_error) + CALL H5Fclose_async_f(file_id, es_id, hdferror) + CALL check("H5Fclose_async_f",hdferror, total_error) + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror) + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + CALL h5fopen_async_f(filename, H5F_ACC_RDWR_F, file_id, es_id, hdferror, access_prp = fapl_id ) + CALL check("h5fopen_async_f",hdferror, total_error) + + f_ptr = C_LOC(exists0) + CALL H5Aexists_async_f(file_id, attr_name, f_ptr, es_id, hdferror) + CALL check("H5Aexists_async_f",hdferror, total_error) + + f_ptr = C_LOC(exists1) + CALL H5Aexists_async_f(file_id, TRIM(attr_name)//"00", f_ptr, es_id, hdferror) + CALL check("H5Aexists_async_f",hdferror, total_error) + + f_ptr = C_LOC(exists2) + CALL H5Aexists_by_name_async_f(file_id, "/", attr_name, f_ptr, es_id, hdferror) + CALL check("H5Aexists_by_name_async_f",hdferror, total_error) + + f_ptr = C_LOC(exists3) + CALL H5Aexists_by_name_async_f(file_id, "/", TRIM(attr_name)//"00", f_ptr, es_id, hdferror) + CALL check("H5Aexists_by_name_async_f",hdferror, total_error) + + CALL H5Aopen_async_f(file_id, attr_name, attr_id0, es_id, hdferror) + CALL check("H5Aopen_async_f", hdferror, total_error) + + f_ptr = C_LOC(attr_rdata0) + CALL H5Aread_async_f(attr_id0, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror) + CALL check("H5Aread_async_f", hdferror, total_error) + + CALL H5Aclose_async_f(attr_id0, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror,total_error) + + CALL H5Aopen_by_name_async_f(file_id, "/", TRIM(attr_name)//"00", attr_id1, es_id, hdferror) + CALL check("H5Aopen_by_name_async_f", hdferror, total_error) + + f_ptr = C_LOC(attr_rdata1) + CALL H5Aread_async_f(attr_id1, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror) + CALL check("H5Aread_async_f", hdferror, total_error) + + CALL H5Aclose_async_f(attr_id1, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror,total_error) + + CALL H5Aopen_by_idx_async_f(file_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, INT(2,HSIZE_T), attr_id2, es_id, hdferror) + CALL check("H5Aopen_by_idx_async_f", hdferror, total_error) + + f_ptr = C_LOC(attr_rdata2) + CALL H5Aread_async_f(attr_id2, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror) + CALL check("H5Aread_async_f", hdferror, total_error) + + CALL H5Aclose_async_f(attr_id2, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror,total_error) + + CALL H5Arename_async_f(file_id, TRIM(attr_name)//"00", TRIM(attr_name)//"05", es_id, hdferror) + CALL check("H5Arename_async_f",hdferror,total_error) + + CALL H5Arename_by_name_async_f(file_id, ".", TRIM(attr_name)//"01", TRIM(attr_name)//"06", es_id, hdferror) + CALL check("H5Arename_by_name_async_f",hdferror,total_error) + + CALL H5Fclose_async_f(file_id, es_id, hdferror) + CALL check("H5Fclose_async_f",hdferror,total_error) + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror) + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + CALL VERIFY("H5Aexists_async_f", LOGICAL(exists0), .TRUE., total_error) + CALL VERIFY("H5Aexists_async_f", LOGICAL(exists1), .TRUE., total_error) + CALL VERIFY("H5Aexists_by_name_async_f", LOGICAL(exists2), .TRUE., total_error) + CALL VERIFY("H5Aexists_by_name_async_f", LOGICAL(exists3), .TRUE., total_error) + + CALL VERIFY("H5Aread_async_f", attr_rdata0, attr_data0, total_error) + CALL VERIFY("H5Aread_async_f", attr_rdata1, attr_data1, total_error) + CALL VERIFY("H5Aread_async_f", attr_rdata2, attr_data2, total_error) + + CALL h5fopen_f(filename, H5F_ACC_RDWR_F, file_id, hdferror, access_prp = fapl_id ) + CALL check("h5fopen_f",hdferror, total_error) + + CALL H5Aexists_f(file_id, TRIM(attr_name)//"05", exists, hdferror) + CALL check("H5Aexist_f",hdferror, total_error) + CALL VERIFY("H5Arename_async_f", exists, .TRUE., total_error) + + CALL H5Aexists_f(file_id, TRIM(attr_name)//"06", exists, hdferror) + CALL check("H5Aexist_f",hdferror, total_error) + CALL VERIFY("H5Arename_by_name_async_f", exists, .TRUE., total_error) + + CALL H5Aexists_f(file_id, TRIM(attr_name)//"01", exists, hdferror) + CALL check("H5Aexist_f",hdferror, total_error) + CALL VERIFY("H5Arename_async_f", exists, .FALSE., total_error) + + CALL H5Aexists_f(file_id, TRIM(attr_name)//"02", exists, hdferror) + CALL check("H5Aexist_f",hdferror, total_error) + CALL VERIFY("H5Arename_by_name_async_f", exists, .FALSE., total_error) + + CALL H5Fclose_f(file_id, hdferror) + CALL check("H5Fclose_f",hdferror,total_error) + + CALL H5Pclose_f(fapl_id, hdferror) + CALL check(" H5Pclose_f",hdferror, total_error) + + CALL H5ESclose_f(es_id, hdferror) + CALL check("H5ESclose_f", hdferror, total_error) + + END SUBROUTINE H5A_async_tests + + SUBROUTINE H5D_async_tests(cleanup, total_error) + ! + ! Test H5D async routines + ! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: file_id + CHARACTER(len=80) :: filename = "h5d_tests.h5" + INTEGER :: hdferror + INTEGER(HID_T) :: es_id + INTEGER(SIZE_T) :: num_in_progress + LOGICAL :: err_occurred + + CHARACTER(LEN=8), PARAMETER :: dsetname = "IntArray" + INTEGER(HID_T) :: crp_list ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + + INTEGER(HID_T) :: filespace ! Dataspace identifier in file + INTEGER(HID_T) :: memspace ! Dataspace identifier in memory + INTEGER(HID_T) :: xfer_prp ! Property list identifier + TYPE(C_PTR) :: f_ptr + + INTEGER(HSIZE_T), DIMENSION(1) :: dims = (/4/) + INTEGER(HSIZE_T), DIMENSION(1) :: dimsf + + INTEGER(HSIZE_T), DIMENSION(1) :: count + INTEGER(HSSIZE_T), DIMENSION(1) :: offset + INTEGER, ALLOCATABLE, DIMENSION(:), TARGET :: idata + INTEGER, ALLOCATABLE, DIMENSION(:), TARGET :: rdata + INTEGER(HSIZE_T), DIMENSION(1) :: idims, imaxdims + INTEGER(HSIZE_T), DIMENSION(1) :: maxdims + INTEGER(HSIZE_T) :: i + INTEGER(HSIZE_T), DIMENSION(1) :: extend_dim + INTEGER, TARGET :: fillvalue = 99 + + INTEGER :: error ! Error flags + INTEGER :: mpierror ! MPI error flag + INTEGER :: comm, info + INTEGER :: mpi_size, mpi_rank + + comm = MPI_COMM_WORLD + info = MPI_INFO_NULL + + CALL MPI_COMM_SIZE(comm, mpi_size, mpierror) + CALL MPI_COMM_RANK(comm, mpi_rank, mpierror) + + CALL H5EScreate_f(es_id, hdferror) + CALL check("H5EScreate_f", hdferror, total_error) + ! + ! Create the file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_id, hdferror) + CALL check("h5pcreate_f", hdferror, total_error) + + CALL h5pset_fapl_mpio_f(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL, hdferror) + CALL check("h5pset_fapl_mpio_f", hdferror, total_error) + + CALL h5fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, error, access_prp = fapl_id ) + CALL check("h5fcreate_f",hdferror, total_error) + + dimsf(1) = dims(1)*mpi_size + ALLOCATE(idata(1:dims(1))) + + idata(:) = mpi_rank + + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, hdferror) + CALL h5pset_chunk_f(crp_list, 1, dims, error) + f_ptr = C_LOC(fillvalue) + CALL h5pset_fill_value_f(crp_list, H5T_NATIVE_INTEGER, f_ptr, hdferror) + + ! + ! Create data space for the dataset. + ! + maxdims(1) = H5S_UNLIMITED_F + CALL h5screate_simple_f(1, dimsf, filespace, hdferror, maxdims) + CALL check("h5screate_simple_f", hdferror, total_error) + + ! + ! create contiguous dataset in the file. + CALL h5dcreate_async_f(file_id, dsetname, H5T_NATIVE_INTEGER, filespace, & + dset_id, es_id, hdferror, crp_list) + CALL check("h5dcreate_async_f", hdferror, total_error) + + COUNT(1) = dims(1) + offset(1) = mpi_rank * COUNT(1) + CALL h5screate_simple_f(1, dims(1), memspace, hdferror) + CALL check("h5screate_simple_f", hdferror, total_error) + + CALL h5sselect_hyperslab_f (filespace, H5S_SELECT_SET_F, offset, count, hdferror) + CALL check("h5sselect_hyperslab_f", hdferror, total_error) + + CALL h5pcreate_f(H5P_DATASET_XFER_F, xfer_prp, error) + CALL h5pset_dxpl_mpio_f(xfer_prp, H5FD_MPIO_COLLECTIVE_F, error) + + ! + ! Write data to the dataset + ! + f_ptr = C_LOC(idata) + CALL h5dwrite_async_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror, & + mem_space_id = memspace, file_space_id = filespace, xfer_prp = xfer_prp) + CALL check("h5dwrite_async_f", hdferror, total_error) + ! + ! Terminate access to the dataset. + ! + CALL h5dclose_async_f(dset_id, es_id, error) + CALL check("h5dclose_f",error,total_error) + + ! + ! Close dataspaces. + ! + CALL h5sclose_f(filespace, hdferror) + CALL check("h5sclose_f",hdferror,total_error) + CALL h5sclose_f(memspace, error) + CALL check("h5sclose_f",hdferror,total_error) + CALL h5pclose_f(crp_list, hdferror) + CALL check("h5pclose_f",hdferror,total_error) + + ! + ! Close the file. + ! + CALL h5fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + ! Complete the operations + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror); + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + CALL VERIFY("H5ESwait_f", num_in_progress, 0_size_t , total_error) + + CALL h5fopen_async_f(filename, H5F_ACC_RDWR_F, file_id, es_id, hdferror, access_prp = fapl_id) + CALL check("h5fopen_async_f",hdferror,total_error) + + CALL h5dopen_async_f(file_id, dsetname, dset_id, es_id, hdferror) + CALL check("h5dopen_async_f",hdferror,total_error) + + CALL H5Dget_space_async_f(dset_id, filespace, es_id, hdferror) + CALL check("h5dopen_async_f",hdferror,total_error) + + CALL h5sget_simple_extent_dims_f(filespace, idims, imaxdims, hdferror) + CALL check("h5sget_simple_extent_dims_f", hdferror, total_error) + CALL VERIFY("h5sget_simple_extent_dims_f", idims(1), dimsf(1), total_error) + CALL VERIFY("h5sget_simple_extent_dims_f", imaxdims(1), H5S_UNLIMITED_F, total_error) + + ! Check reading the data back + ALLOCATE(rdata(1:dims(1))) + + CALL h5screate_simple_f(1, dims(1), memspace, hdferror) + CALL check("h5screate_simple_f", hdferror, total_error) + + CALL h5sselect_hyperslab_f (filespace, H5S_SELECT_SET_F, offset, count, hdferror) + CALL check("h5sselect_hyperslab_f", hdferror, total_error) + + f_ptr = C_LOC(rdata) + CALL h5dread_async_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, es_id, hdferror, & + mem_space_id = memspace, file_space_id = filespace, xfer_prp = xfer_prp) + CALL check("h5dread_async_f", hdferror, total_error) + + CALL h5sclose_f(filespace, hdferror) + CALL check("h5sclose_f",hdferror,total_error) + + CALL h5sclose_f(memspace, hdferror) + CALL check("h5sclose_f",hdferror,total_error) + + ! Extend the dataset + extend_dim(1) = dimsf(1)*2 + CALL H5Dset_extent_async_f(dset_id, extend_dim, es_id, hdferror) + CALL check("H5Dset_extent_async_f", error, total_error) + + CALL h5dclose_async_f(dset_id, es_id, error) + CALL check("h5dclose_async_f",error,total_error) + + CALL h5fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror) + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + ! Verify the data read + DO i = 1, dims(1) + CALL VERIFY("h5dread_f", idata(i), rdata(i), total_error) + ENDDO + + CALL h5fopen_f(filename, H5F_ACC_RDWR_F, file_id, hdferror, access_prp = fapl_id ) + CALL check("h5fopen_f",error,total_error) + + CALL h5dopen_f(file_id, dsetname, dset_id, hdferror) + CALL check("h5dopen_async_f",hdferror,total_error) + + CALL H5Dget_space_f(dset_id, filespace, hdferror) + CALL check("h5dopen_async_f",hdferror,total_error) + + CALL H5Sget_simple_extent_dims_f(filespace, idims, imaxdims, hdferror) + CALL check("h5sget_simple_extent_dims_f", hdferror, total_error) + CALL VERIFY("h5sget_simple_extent_dims_f", idims(1), extend_dim(1), total_error) + CALL VERIFY("h5sget_simple_extent_dims_f", imaxdims(1), H5S_UNLIMITED_F, total_error) + + CALL h5sclose_f(filespace, hdferror) + CALL check("h5sclose_f",hdferror,total_error) + + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f",error,total_error) + + CALL h5fclose_f(file_id, hdferror) + CALL check("h5fclose_f",hdferror,total_error) + + END SUBROUTINE H5D_async_tests + + + SUBROUTINE H5G_async_tests(cleanup, total_error) + ! + ! Test H5G async routines + ! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: file_id + CHARACTER(len=80) :: filename = "h5g_tests.h5" + INTEGER :: hdferror + INTEGER(HID_T) :: es_id + INTEGER(SIZE_T) :: num_in_progress + LOGICAL :: err_occurred + + CHARACTER(LEN=6), PARAMETER:: grpname="group1" + + INTEGER(HID_T) :: group_id, group_id1 + INTEGER(HID_T) :: gcpl_id + CHARACTER(LEN=2) :: chr2 + CHARACTER(LEN=7) :: objname ! Object name + INTEGER :: v, i + + TYPE(H5G_info_t), DIMENSION(1:3) :: ginfo + + INTEGER :: error + INTEGER :: mpierror ! MPI error flag + INTEGER :: comm, info + INTEGER :: mpi_size, mpi_rank + + comm = MPI_COMM_WORLD + info = MPI_INFO_NULL + + CALL MPI_COMM_SIZE(comm, mpi_size, mpierror) + CALL MPI_COMM_RANK(comm, mpi_rank, mpierror) + + CALL H5EScreate_f(es_id, hdferror) + CALL check("H5EScreate_f", hdferror, total_error) + ! + ! Create the file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_id, hdferror) + CALL check("h5pcreate_f", hdferror, total_error) + + CALL h5pset_fapl_mpio_f(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL, hdferror) + CALL check("h5pset_fapl_mpio_f", hdferror, total_error) + + CALL h5fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, error, access_prp = fapl_id ) + CALL check("h5fcreate_f",hdferror, total_error) + + ! Test group API + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, hdferror ) + CALL check("H5Pcreate_f", hdferror, total_error) + + CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), hdferror) + CALL check("H5Pset_link_creation_order_f", hdferror, total_error) + + CALL H5Gcreate_async_f (file_id, grpname, group_id, es_id, hdferror, gcpl_id=gcpl_id) + CALL check("H5Gcreate_async_f", hdferror, total_error) + + ! Create objects in new group created + DO v = 0, 2 + ! Make name for link + WRITE(chr2,'(I2.2)') v + objname = 'fill '//chr2 + + ! Create hard link, with group object + CALL H5Gcreate_async_f(group_id, objname, group_id1, es_id, hdferror, gcpl_id=gcpl_id) + CALL check("H5Gcreate_async_f", hdferror, total_error) + + ! Close group created + CALL H5Gclose_async_f(group_id1, es_id, hdferror) + CALL check("H5Gclose_async_f", hdferror, total_error) + ENDDO + + CALL H5Pclose_f(gcpl_id, hdferror) + CALL check("H5Pclose_f", hdferror, total_error) + + CALL H5Gclose_async_f(group_id, es_id, hdferror) + CALL check("H5Gclose_async_f", hdferror, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + ! Complete the operations + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror); + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + CALL VERIFY("H5ESwait_f", num_in_progress, 0_size_t , total_error) + + CALL h5fopen_async_f(filename, H5F_ACC_RDWR_F, file_id, es_id, hdferror, access_prp = fapl_id ) + CALL check("h5fopen_async_f",hdferror,total_error) + + CALL h5gopen_async_f(file_id, grpname, group_id, es_id, hdferror) + CALL check("h5gopen_async_f",hdferror,total_error) + + CALL h5gget_info_async_f(group_id, ginfo(1), es_id, hdferror) + CALL check("H5Gget_info_async_f", hdferror, total_error) + + CALL H5Gget_info_by_name_async_f(group_id, ".", ginfo(2), es_id, hdferror) + CALL check("H5Gget_info_by_name_async_f", hdferror, total_error) + + CALL H5Gget_info_by_idx_async_f(group_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_INC_F, & + INT(0,HSIZE_T), ginfo(3), es_id, error) + CALL check("H5Gget_info_by_idx_async_f", hdferror, total_error) + + CALL H5Gclose_async_f(group_id, es_id, hdferror) + CALL check("H5Gclose_async_f", hdferror, total_error) + + CALL h5fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror) + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + ! Verify the group APIs + DO i = 1, 2 + CALL VERIFY("H5Gget_info_by_name_f.storage_type", & + ginfo(i)%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL VERIFY("H5Gget_info_by_name_f.max_corder", ginfo(i)%max_corder, 3_C_INT64_T, total_error) + CALL VERIFY("H5Gget_info_by_name_f.nlinks", ginfo(i)%nlinks, 3_HSIZE_T, total_error) + CALL VERIFY("H5Gget_info_f.mounted", LOGICAL(ginfo(i)%mounted),.FALSE.,total_error) + ENDDO + CALL VERIFY("H5Gget_info_by_name_f.storage_type", & + ginfo(3)%storage_type, INT(H5G_STORAGE_TYPE_COMPACT_F, C_INT), total_error) + CALL VERIFY("H5Gget_info_by_name_f.max_corder", ginfo(3)%max_corder, 0_C_INT64_T, total_error) + CALL VERIFY("H5Gget_info_by_name_f.nlinks", ginfo(3)%nlinks, 0_HSIZE_T, total_error) + CALL VERIFY("H5Gget_info_f.mounted", LOGICAL(ginfo(3)%mounted),.FALSE.,total_error) + + END SUBROUTINE H5G_async_tests + + SUBROUTINE H5F_async_tests(cleanup, total_error) + ! + ! Test H5F async routines + ! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: file_id + CHARACTER(len=80) :: filename = "h5f_tests.h5" + INTEGER :: hdferror + INTEGER(HID_T) :: es_id + INTEGER(SIZE_T) :: num_in_progress + LOGICAL :: err_occurred + + INTEGER(HID_T) :: ret_file_id + + INTEGER :: error ! Error flags + INTEGER :: mpierror ! MPI error flag + INTEGER :: comm, info + INTEGER :: mpi_size, mpi_rank + + comm = MPI_COMM_WORLD + info = MPI_INFO_NULL + + CALL MPI_COMM_SIZE(comm, mpi_size, mpierror) + CALL MPI_COMM_RANK(comm, mpi_rank, mpierror) + + CALL H5EScreate_f(es_id, hdferror) + CALL check("H5EScreate_f", hdferror, total_error) + ! + ! Create the file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_id, hdferror) + CALL check("h5pcreate_f", hdferror, total_error) + + CALL h5pset_fapl_mpio_f(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL, hdferror) + CALL check("h5pset_fapl_mpio_f", hdferror, total_error) + + CALL h5fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, error, access_prp = fapl_id ) + CALL check("h5fcreate_f",hdferror, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + ! Complete the operations + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror); + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + CALL VERIFY("H5ESwait_f", num_in_progress, 0_size_t , total_error) + + CALL H5Fopen_async_f(filename, H5F_ACC_RDWR_F, file_id, es_id, hdferror, access_prp = fapl_id ) + CALL check("h5fopen_async_f",hdferror,total_error) + + CALL H5Freopen_async_f(file_id, ret_file_id, es_id, hdferror) + CALL check("H5Freopen_async_f", hdferror, total_error) + + CALL H5Fclose_async_f(ret_file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + CALL H5Fflush_async_f(file_id, H5F_SCOPE_GLOBAL_F, es_id, hdferror) + CALL check("h5fflush_async_f",hdferror, total_error) + + CALL H5Fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror) + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + END SUBROUTINE H5F_async_tests + + SUBROUTINE H5L_async_tests(cleanup, total_error) + ! + ! Test H5L async routines + ! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: file_id + CHARACTER(len=80) :: filename = "h5l_tests.h5" + INTEGER :: hdferror + INTEGER(HID_T) :: es_id + INTEGER(SIZE_T) :: num_in_progress + LOGICAL :: err_occurred + + INTEGER(hid_t) :: gid = -1, gid2 = -1, gid3 = -1 ! Group IDs + INTEGER(hid_t) :: aid = -1, aid2 = -1, aid3 = -1 ! Attribute ID + INTEGER(hid_t) :: sid = -1 ! Dataspace ID + CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME = "corder_group" + CHARACTER(LEN=12), PARAMETER :: CORDER_GROUP_NAME2 = "corder_grp00" + LOGICAL(C_BOOL), TARGET :: exists1, exists2 + LOGICAL :: exists + TYPE(C_PTR) :: f_ptr + + INTEGER(HID_T) :: group_id ! Group ID + INTEGER(HID_T) :: gcpl_id ! Group creation property list ID + + INTEGER :: idx_type ! Type of index to operate on + LOGICAL, DIMENSION(1:2) :: use_index = (/.FALSE.,.TRUE./) + ! Use index on creation order values + INTEGER :: max_compact ! Maximum # of links to store in group compactly + INTEGER :: min_dense ! Minimum # of links to store in group "densely" + + CHARACTER(LEN=7) :: objname ! Object name + + INTEGER :: u ! Local index variable + INTEGER :: Input1, i + INTEGER(HID_T) :: group_id2 + INTEGER :: iorder ! Order within in the index + CHARACTER(LEN=2) :: chr2 + ! + INTEGER(hsize_t) idx ! Index in the group + TYPE(iter_info), TARGET :: info + TYPE(C_FUNPTR) :: f1 + TYPE(C_PTR) :: f2 + INTEGER(C_INT) :: ret_value + + INTEGER :: error ! Error flags + INTEGER :: mpierror ! MPI error flag + INTEGER :: comm + INTEGER :: mpi_size, mpi_rank + + INTEGER(SIZE_T) :: count + + comm = MPI_COMM_WORLD + + CALL MPI_COMM_SIZE(comm, mpi_size, mpierror) + CALL MPI_COMM_RANK(comm, mpi_rank, mpierror) + + CALL H5EScreate_f(es_id, hdferror) + CALL check("H5EScreate_f", hdferror, total_error) + ! + ! Create the file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl_id, hdferror) + CALL check("h5pcreate_f", hdferror, total_error) + + CALL h5pset_fapl_mpio_f(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL, hdferror) + CALL check("h5pset_fapl_mpio_f", hdferror, total_error) + + CALL h5fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, error, access_prp = fapl_id ) + CALL check("h5fcreate_f",hdferror, total_error) + + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, hdferror ) + CALL check("H5Pcreate_f", hdferror, total_error) + + CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, H5P_CRT_ORDER_INDEXED_F), hdferror) + CALL check("H5Pset_link_creation_order_f", hdferror, total_error) + + ! Create group with creation order tracking on + CALL H5Gcreate_async_f(file_id, CORDER_GROUP_NAME, gid3, es_id, hdferror, gcpl_id=gcpl_id) + CALL check("H5Gcreate_f", hdferror, total_error) + + ! Create group + CALL H5Gcreate_async_f(file_id, "/Group1", gid, es_id, hdferror) + CALL check("H5Gcreate_async_f",hdferror, total_error) + + ! Create nested group + CALL H5Gcreate_async_f(gid, "Group2", gid2, es_id, hdferror) + CALL check("H5Gcreate_async_f",hdferror, total_error) + + CALL H5Screate_f(H5S_SCALAR_F, sid, hdferror) + CALL check("H5Screate_f",hdferror, total_error) + CALL H5Acreate_async_f(gid2, "Attr1", H5T_NATIVE_INTEGER, sid, aid, es_id, hdferror) + CALL check("H5Acreate_async_f",hdferror, total_error) + CALL H5Acreate_async_f(gid2, "Attr2", H5T_NATIVE_INTEGER, sid, aid2, es_id, hdferror) + CALL check("H5Acreate_async_f",hdferror, total_error) + CALL H5Acreate_async_f(gid2, "Attr3", H5T_NATIVE_INTEGER, sid, aid3, es_id, hdferror) + CALL check("H5Acreate_async_f",hdferror, total_error) + CALL H5Aclose_async_f(aid, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror, total_error) + CALL H5Aclose_async_f(aid2, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror, total_error) + CALL H5Aclose_async_f(aid3, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror, total_error) + CALL H5Sclose_f(sid,hdferror) + CALL check("H5Sclose_f",hdferror, total_error) + + ! Close groups + CALL h5gclose_async_f(gid2, es_id, hdferror) + CALL check("h5gclose_async_f",hdferror, total_error) + CALL h5gclose_async_f(gid, es_id, hdferror) + CALL check("h5gclose_async_f",hdferror, total_error) + CALL h5gclose_async_f(gid3, es_id, hdferror) + CALL check("h5gclose_async_f",hdferror, total_error) + + ! Close the group creation property list + CALL H5Pclose_f(gcpl_id, hdferror) + CALL check("H5Pclose_f", hdferror, total_error) + + ! Create soft links to groups created + CALL H5Lcreate_soft_async_f("/Group1", file_id, "/soft_one", es_id, hdferror) + CALL H5Lcreate_soft_async_f("/Group1/Group2", file_id, "/soft_two", es_id, hdferror) + + ! Create hard links to all groups + CALL H5Lcreate_hard_async_f(file_id, "/", file_id, "hard_zero", es_id, hdferror) + CALL check("H5Lcreate_hard_async_f",hdferror, total_error) + CALL H5Lcreate_hard_async_f(file_id, "/Group1", file_id, "hard_one", es_id, hdferror) + CALL check("H5Lcreate_hard_async_f",hdferror, total_error) + CALL H5Lcreate_hard_async_f(file_id, "/Group1/Group2", file_id, "hard_two", es_id, hdferror) + CALL check("H5Lcreate_hard_async_f",hdferror, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + ! Complete the operations + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror); + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + CALL VERIFY("H5ESwait_f", num_in_progress, 0_size_t , total_error) + + CALL H5Fopen_async_f(filename, H5F_ACC_RDWR_F, file_id, es_id, hdferror, access_prp = fapl_id ) + CALL check("h5fopen_async_f",hdferror,total_error) + + exists1 = .FALSE. + f_ptr = C_LOC(exists1) + CALL H5Lexists_async_f(file_id, "hard_zero", f_ptr, es_id, hdferror) + CALL check("H5Lexists_async_f",hdferror,total_error) + + exists2 = .FALSE. + f_ptr = C_LOC(exists2) + CALL H5Lexists_async_f(file_id, "hard_two", f_ptr, es_id, hdferror) + CALL check("H5Lexists_async_f",hdferror,total_error) + + CALL H5Ldelete_async_f(file_id, "hard_two", es_id, hdferror) + CALL check("H5Ldelete_async_f",hdferror,total_error) + + CALL H5Fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_async_f",hdferror,total_error) + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror) + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + CALL VERIFY("H5Lexists_async_f", LOGICAL(exists1), .TRUE., total_error) + CALL VERIFY("H5Lexists_async_f", LOGICAL(exists2), .TRUE., total_error) + + CALL h5fopen_f(filename, H5F_ACC_RDWR_F, file_id, hdferror, access_prp = fapl_id ) + CALL check("h5fopen_f",hdferror, total_error) + + ! Verify the link was deleted + CALL H5Lexists_f(file_id, "hard_two", exists, hdferror) + CALL check("H5Lexist_f",hdferror, total_error) + CALL VERIFY("H5Ldelete_async_f", exists, .FALSE., total_error) + + CALL H5Fclose_f(file_id, hdferror) + CALL check("H5Fclose_f", hdferror,total_error) + + ! Loop over operating on different indices on link fields + DO idx_type = H5_INDEX_NAME_F, H5_INDEX_CRT_ORDER_F + ! Loop over operating in different orders + DO iorder = H5_ITER_INC_F, H5_ITER_DEC_F + ! Loop over using index for creation order value + DO i = 1, 2 + ! Create file + CALL H5Fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, hdferror, access_prp=fapl_id) + CALL check("H5Fcreate_async_f", hdferror, total_error) + + ! Create group creation property list + CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl_id, hdferror ) + CALL check("H5Pcreate_f", hdferror, total_error) + + ! Set creation order tracking & indexing on group + IF(use_index(i))THEN + Input1 = H5P_CRT_ORDER_INDEXED_F + ELSE + Input1 = 0 + ENDIF + + CALL H5Pset_link_creation_order_f(gcpl_id, IOR(H5P_CRT_ORDER_TRACKED_F, Input1), hdferror) + CALL check("H5Pset_link_creation_order_f", hdferror, total_error) + + ! Create group with creation order tracking on + CALL H5Gcreate_async_f(file_id, CORDER_GROUP_NAME2, group_id, es_id, hdferror, gcpl_id=gcpl_id) + CALL check("H5Gcreate_async_f", hdferror, total_error) + + ! Query the group creation properties + CALL H5Pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferror) + CALL check("H5Pget_link_phase_change_f", hdferror, total_error) + + ! Create several links, up to limit of compact form + DO u = 0, max_compact-1 + ! Make name for link + WRITE(chr2,'(I2.2)') u + objname = 'fill '//chr2 + + ! Create hard link, with group object + CALL H5Gcreate_async_f(group_id, objname, group_id2, es_id, hdferror) + CALL check("H5Gcreate_async_f", hdferror, total_error) + CALL H5Gclose_async_f(group_id2, es_id, hdferror) + CALL check("H5Gclose_async_f", hdferror, total_error) + ENDDO + + ! Delete links from compact group + DO u = 0, (max_compact - 1) -1 + ! Delete first link in appropriate order + CALL H5Ldelete_by_idx_async_f(group_id, ".", idx_type, iorder, INT(0,HSIZE_T), es_id, hdferror) + CALL check("H5Ldelete_by_idx_async_f", hdferror, total_error) + ENDDO + + idx = 0 + info%command = 2 + f1 = C_FUNLOC(liter_cb) + f2 = C_LOC(info) + + CALL H5Literate_async_f(file_id, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, es_id, hdferror) + CALL check("H5Literate_async_f", error, total_error) + + ! Close the group + CALL H5Gclose_async_f(group_id, es_id, hdferror) + CALL check("H5Gclose_async_f", hdferror, total_error) + ! Close the group creation property list + CALL H5Pclose_f(gcpl_id, hdferror) + CALL check("H5Pclose_f", hdferror, total_error) + ! Close the file + CALL H5Fclose_async_f(file_id, es_id, hdferror) + CALL check("H5Fclose_async_f", hdferror, total_error) + + CALL H5ESget_count_f(es_id, count, hdferror) + + ! Complete the operations + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror); + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + CALL VERIFY("H5ESwait_f", num_in_progress, 0_size_t , total_error) + + ! NOTE: ret_value will not be correct since H5Literate_async is not returning a pointer return value, herr_t. + CALL VERIFY("H5Literate_async_f", info%type, op_data_type, total_error) + CALL VERIFY("H5Literate_async_f", info%command, op_data_command, total_error) + CALL VERIFY("H5Literate_async_f", info%name(1)(1:1), CORDER_GROUP_NAME2(1:1), total_error) + + ENDDO + ENDDO + + ENDDO + + CALL H5Pclose_f(fapl_id, hdferror) + CALL check(" H5Pclose_f",hdferror, total_error) + + CALL H5ESclose_f(es_id, hdferror) + CALL check("H5ESclose_f", hdferror, total_error) + + + END SUBROUTINE H5L_async_tests + + SUBROUTINE H5O_async_tests(cleanup, total_error) + ! + ! Test H5O async routines + ! + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T) :: file_id + INTEGER(HID_T) :: group_id, group_id1, group_id2, group_id3 + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: attr_id + INTEGER(HID_T) :: dset_id + INTEGER(HID_T) :: fapl_id + INTEGER(HID_T) :: lcpl_id + INTEGER(HID_T) :: ocpypl_id + TYPE(C_H5O_INFO_T), TARGET :: oinfo_f + TYPE(C_PTR) :: f_ptr + CHARACTER(len=80) :: filename = "h5o_tests.h5" + + INTEGER :: hdferror ! Value returned from API calls + + ! Data for tested h5ocopy_async_f + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims2 = (/dim0/) ! size read/write buffer + INTEGER(C_INT), DIMENSION(1:8) :: atime, btime, ctime, mtime + + INTEGER(HID_T) :: es_id + INTEGER(SIZE_T) :: num_in_progress + LOGICAL :: err_occurred + + ! Make a FAPL that uses the "use the latest version of the format" bounds + CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl_id,hdferror) + CALL check("h5Pcreate_f",hdferror,total_error) + + ! Set the "use the latest version of the format" bounds for creating objects in the file + CALL H5Pset_libver_bounds_f(fapl_id, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, hdferror) + CALL check("H5Pset_libver_bounds_f",hdferror, total_error) + + CALL h5pset_fapl_mpio_f(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL, hdferror) + + CALL H5EScreate_f(es_id, hdferror) + CALL check("H5EScreate_f", hdferror, total_error) + + ! Create a new HDF5 file + CALL H5Fcreate_async_f(filename, H5F_ACC_TRUNC_F, file_id, es_id, hdferror, H5P_DEFAULT_F, fapl_id) + CALL check("H5Fcreate_f", hdferror, total_error) + + ! Close the FAPL + CALL h5pclose_f(fapl_id, hdferror) + CALL check("h5pclose_f",hdferror,total_error) + + ! + ! Create dataspace. Setting size to be the current size. + ! + CALL h5screate_simple_f(1, dims2, space_id, hdferror) + CALL check("h5screate_simple_f", hdferror, total_error) + ! + ! Create intermediate groups + ! + CALL h5gcreate_async_f(file_id,"/G1",group_id1,es_id,hdferror) + CALL check("h5gcreate_f", hdferror, total_error) + CALL h5gcreate_async_f(file_id,"/G1/G2",group_id2,es_id,hdferror) + CALL check("h5gcreate_f", hdferror, total_error) + CALL h5gcreate_async_f(file_id,"/G1/G2/G3",group_id3,es_id,hdferror) + CALL check("h5gcreate_f", hdferror, total_error) + + ! + ! Create the dataset + ! + CALL h5dcreate_async_f(group_id3, dataset, H5T_STD_I32LE, space_id, dset_id, es_id, hdferror) + CALL check("h5dcreate_f", hdferror, total_error) + + ! Create a soft link to /G1 + CALL h5lcreate_soft_async_f("/G1", file_id, "/G1_LINK", es_id, hdferror) + CALL check("h5lcreate_soft_f", hdferror, total_error) + + ! Create a soft link to /G1000, does not exist + CALL h5lcreate_soft_async_f("/G1000", file_id, "/G1_FALSE", es_id, hdferror) + CALL check("h5lcreate_soft_f", hdferror, total_error) + + ! Create a soft link to /G1_LINK + CALL h5lcreate_soft_async_f("/G1_FALSE", file_id, "/G2_FALSE", es_id, hdferror) + CALL check("h5lcreate_soft_f", hdferror, total_error) + ! + ! Close and release resources. + ! + CALL h5dclose_async_f(dset_id, es_id, hdferror) + CALL check(" h5dclose_f", hdferror, total_error) + CALL h5sclose_f(space_id, hdferror) + CALL check("h5sclose_f", hdferror, total_error) + CALL h5gclose_async_f(group_id1, es_id, hdferror) + CALL check("h5gclose_async_f", hdferror, total_error) + CALL h5gclose_async_f(group_id2, es_id, hdferror) + CALL check("h5gclose_async_f", hdferror, total_error) + CALL h5gclose_async_f(group_id3, es_id, hdferror) + CALL check("h5gclose_async_f", hdferror, total_error) + + ! Test opening an object by index + CALL h5oopen_by_idx_async_f(file_id, "/G1/G2/G3", H5_INDEX_NAME_F, H5_ITER_INC_F, 0_hsize_t, group_id, es_id, hdferror) + CALL check("h5oopen_by_idx_f", hdferror, total_error) + + CALL h5oclose_async_f(group_id, es_id, hdferror) + CALL check("h5gclose_f", hdferror, total_error) + + ! Test opening an object + CALL h5oopen_async_f(file_id, "/G1/G2/G3", group_id, es_id, hdferror) + CALL check("h5oopen_by_idx_f", hdferror, total_error) + + CALL H5Screate_f(H5S_SCALAR_F, space_id, hdferror) + CALL check("H5Screate_f", hdferror, total_error) + + CALL h5acreate_async_f(group_id, "ATTR", H5T_NATIVE_INTEGER, space_id, attr_id, es_id, hdferror) + CALL check("h5acreate_f",hdferror,total_error) + + CALL H5Aclose_async_f(attr_id, es_id, hdferror) + CALL check("H5Aclose_async_f",hdferror,total_error) + + CALL h5oclose_async_f(group_id, es_id, hdferror) + CALL check("h5gclose_f", hdferror, total_error) + + f_ptr = C_LOC(oinfo_f) + CALL H5Oget_info_by_name_async_f(file_id, "/G1/G2/G3", f_ptr, es_id, hdferror, fields=H5O_INFO_ALL_F) + CALL check("H5Oget_info_by_name_async_f", hdferror, total_error) + ! + ! create property to pass copy options + ! + CALL h5pcreate_f(H5P_LINK_CREATE_F, lcpl_id, hdferror) + CALL check("h5Pcreate_f", hdferror, total_error) + + CALL h5pset_create_inter_group_f(lcpl_id, 1, hdferror) + CALL check("H5Pset_create_inter_group_f", hdferror, total_error) + ! + ! Check optional parameter lcpl_id, this would fail if lcpl_id was not specified + ! + CALL h5ocopy_async_f(file_id, "/G1/G2/G3/DS1", file_id, "/G1/G_cp1/DS2", es_id, hdferror, lcpl_id=lcpl_id) + CALL check("h5ocopy_f -- W/ OPTION: lcpl_id", hdferror ,total_error) + + CALL h5pclose_f(lcpl_id, hdferror) + CALL check("h5pclose_f",hdferror,total_error) + + CALL h5pcreate_f(H5P_OBJECT_COPY_F, ocpypl_id, hdferror) + CALL check("h5Pcreate_f",hdferror,total_error) + + CALL h5pset_copy_object_f(ocpypl_id, H5O_COPY_SHALLOW_HIERARCHY_F, hdferror) + CALL check("H5Pset_copy_object_f",hdferror,total_error) + + CALL h5ocopy_async_f(file_id, "/G1/G2", file_id, "/G1/G_cp2", es_id, hdferror, ocpypl_id=ocpypl_id) + CALL check("h5ocopy_f",hdferror,total_error) + + CALL h5pclose_f(ocpypl_id, hdferror) + CALL check("h5pclose_f",hdferror,total_error) + + CALL h5fclose_async_f(file_id, es_id, hdferror) + CALL check("h5fclose_f",hdferror,total_error) + + CALL H5ESwait_f(es_id, H5ES_WAIT_FOREVER_F, num_in_progress, err_occurred, hdferror) + CALL check("H5ESwait_f", hdferror, total_error) + CALL VERIFY("H5ESwait_f", err_occurred, .FALSE., total_error) + + IF( oinfo_f%fileno.LE.0 )THEN + hdferror = -1 + CALL check("H5Oget_info_by_name_async_f", hdferror, total_error) + ENDIF + + atime(1:8) = h5gmtime(oinfo_f%atime) + btime(1:8) = h5gmtime(oinfo_f%btime) + ctime(1:8) = h5gmtime(oinfo_f%ctime) + mtime(1:8) = h5gmtime(oinfo_f%mtime) + + IF( atime(1) .LT. 2021 .OR. & + btime(1).LT. 2021 .OR. & + ctime(1) .LT. 2021 .OR. & + mtime(1) .LT. 2021 )THEN + hdferror = -1 + ENDIF + CALL check("H5Oget_info_by_name_async_f", hdferror, total_error) + + CALL VERIFY("H5Oget_info_by_name_async_f", oinfo_f%num_attrs, 1_HSIZE_T, total_error) + CALL VERIFY("H5Oget_info_by_name_async_f", oinfo_f%type, INT(H5G_GROUP_F, C_INT), total_error) + + CALL H5ESclose_f(es_id, hdferror) + CALL check("H5ESclose_f", hdferror, total_error) + + END SUBROUTINE H5O_async_tests + +END MODULE test_async_APIs + +! +! The main program for async HDF5 Fortran tests +! +PROGRAM async_test + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_INT64_T + USE HDF5 + USE MPI + USE TH5_MISC + USE TH5_MISC_GEN + USE test_async_APIs + + IMPLICIT NONE + + INTEGER :: total_error = 0 ! sum of the number of errors + INTEGER :: mpierror ! MPI hdferror flag + INTEGER :: mpi_size ! number of processes in the group of communicator + INTEGER :: mpi_rank ! rank of the calling process in the communicator + INTEGER :: required, provided + + INTEGER(HID_T) :: vol_id + INTEGER :: hdferror + LOGICAL :: registered + INTEGER :: sum + INTEGER :: nerrors = 0 + + LOGICAL :: cleanup + INTEGER :: ret_total_error = 0 + + ! + ! initialize MPI + ! + required = MPI_THREAD_MULTIPLE + CALL mpi_init_thread(required, provided, mpierror) + IF (mpierror .NE. MPI_SUCCESS) THEN + WRITE(*,*) "MPI_INIT_THREAD *FAILED*" + nerrors = nerrors + 1 + ENDIF + IF (provided .NE. required) THEN + mpi_thread_mult = .FALSE. + ENDIF + + CALL mpi_comm_rank( MPI_COMM_WORLD, mpi_rank, mpierror ) + IF (mpierror .NE. MPI_SUCCESS) THEN + WRITE(*,*) "MPI_COMM_RANK *FAILED* Process = ", mpi_rank + nerrors = nerrors + 1 + ENDIF + CALL mpi_comm_size( MPI_COMM_WORLD, mpi_size, mpierror ) + IF (mpierror .NE. MPI_SUCCESS) THEN + WRITE(*,*) "MPI_COMM_SIZE *FAILED* Process = ", mpi_rank + nerrors = nerrors + 1 + ENDIF + + IF(nerrors.NE.0)THEN + IF(mpi_rank==0) CALL write_test_status(sum, & + 'Testing Initializing mpi_init_thread', total_error) + CALL MPI_Barrier(MPI_COMM_WORLD, mpierror) + CALL mpi_abort(MPI_COMM_WORLD, 1, mpierror) + ENDIF + + IF(mpi_rank==0) CALL write_test_header("ASYNC FORTRAN TESTING") + + ! + ! Initialize the HDF5 fortran interface + ! + CALL h5open_f(hdferror) + + + ! CHECK ASYNC VOLS AVAILABILITY + ! + ! (1) Check if ASYNC VOL is available + CALL H5VLis_connector_registered_by_name_f("async", registered, hdferror) + CALL check("H5VLis_connector_registered_by_name_f", hdferror, total_error) + + IF(.NOT.registered)THEN + + ! (2) check if the DAOS VOL is available + CALL H5VLis_connector_registered_by_name_f("daos", registered, hdferror) + CALL check("H5VLis_connector_registered_by_name_f", hdferror, total_error) + + IF(.NOT.registered)THEN + ! No async compatible VOL found + async_enabled = .FALSE. + ELSE + CALL H5Vlregister_connector_by_name_f("daos", vol_id, hdferror) + CALL check("H5Vlregister_connector_by_name_f", hdferror, total_error) + ENDIF + + ELSE + CALL H5Vlregister_connector_by_name_f("async", vol_id, hdferror) + CALL check("H5Vlregister_connector_by_name_f", hdferror, total_error) + ENDIF + + IF ( (async_enabled .EQV. .TRUE.) .AND. (mpi_thread_mult .EQV. .FALSE.) ) THEN + total_error = -1 ! Skip test + IF(mpi_rank==0) CALL write_test_status(total_error, & + "No MPI_Init_thread support for MPI_THREAD_MULTIPLE", total_error) + CALL MPI_Barrier(MPI_COMM_WORLD, mpierror) + CALL MPI_Finalize(mpierror) + STOP + ENDIF + +! IF(total_error.LT.0)THEN +! IF(mpi_rank==0) CALL write_test_status(total_error, & +! 'Testing async APIs', total_error) +! STOP +! ENDIF + + ! H5ES API TESTING + ret_total_error = 0 + CALL H5ES_tests(cleanup, ret_total_error) + IF(mpi_rank==0) CALL write_test_status(ret_total_error, & + 'H5ES API tests', total_error) + + ! H5A ASYNC API TESTING + ret_total_error = 0 + CALL H5A_async_tests(cleanup, ret_total_error) + IF(mpi_rank==0) CALL write_test_status(ret_total_error, & + 'H5A async API tests', total_error) + + ! H5D ASYNC API TESTING + ret_total_error = 0 + CALL H5D_async_tests(cleanup, ret_total_error) + IF(mpi_rank==0) CALL write_test_status(ret_total_error, & + 'H5D async API tests', total_error) + + ! H5G ASYNC API TESTING + ret_total_error = 0 + CALL H5G_async_tests(cleanup, ret_total_error) + IF(mpi_rank==0) CALL write_test_status(ret_total_error, & + 'H5G async API tests', total_error) + + ! H5F ASYNC API TESTING + ret_total_error = 0 + CALL H5F_async_tests(cleanup, ret_total_error) + IF(mpi_rank==0) CALL write_test_status(ret_total_error, & + 'H5F async API tests', total_error) + + ! H5L ASYNC API TESTING + ret_total_error = 0 + CALL H5L_async_tests(cleanup, ret_total_error) + IF(mpi_rank==0) CALL write_test_status(ret_total_error, & + 'H5L async API tests', total_error) + + ! H5O ASYNC API TESTING + ret_total_error = 0 + CALL H5O_async_tests(cleanup, ret_total_error) + IF(mpi_rank==0) CALL write_test_status(ret_total_error, & + 'H5O async API tests', total_error) + + IF(async_enabled)THEN + CALL H5VLclose_f(vol_id, hdferror) + CALL check("H5VLclose_f", hdferror, total_error) + ENDIF + + ! + ! close HDF5 interface + ! + CALL h5close_f(hdferror) + + CALL MPI_ALLREDUCE(total_error, sum, 1, MPI_INTEGER, MPI_SUM, MPI_COMM_WORLD, mpierror) + + IF(mpi_rank==0) CALL write_test_footer() + + ! + ! close MPI + ! + IF (sum == 0) THEN + CALL mpi_finalize(mpierror) + IF (mpierror .NE. MPI_SUCCESS) THEN + WRITE(*,*) "MPI_FINALIZE *FAILED* Process = ", mpi_rank + ENDIF + ELSE + WRITE(*,*) 'Errors detected in process ', mpi_rank + CALL mpi_abort(MPI_COMM_WORLD, 1, mpierror) + IF (mpierror .NE. MPI_SUCCESS) THEN + WRITE(*,*) "MPI_ABORT *FAILED* Process = ", mpi_rank + ENDIF + ENDIF + + ! + ! end main program + ! + +END PROGRAM async_test diff --git a/fortran/testpar/ptest.F90 b/fortran/testpar/ptest.F90 index 2974933..b754e29 100644 --- a/fortran/testpar/ptest.F90 +++ b/fortran/testpar/ptest.F90 @@ -55,6 +55,9 @@ PROGRAM parallel_test ! initialize the HDF5 fortran interface ! CALL h5open_f(hdferror) + + IF(mpi_rank==0) CALL write_test_header("COMPREHENSIVE PARALLEL FORTRAN TESTS") + ! ! test write/read dataset by hyperslabs (contiguous/chunk) with independent/collective MPI I/O ! @@ -94,6 +97,8 @@ PROGRAM parallel_test CALL MPI_ALLREDUCE(total_error, sum, 1, MPI_INTEGER, MPI_SUM, MPI_COMM_WORLD, mpierror) + IF(mpi_rank==0) CALL write_test_footer() + ! ! close MPI ! diff --git a/fortran/testpar/subfiling.F90 b/fortran/testpar/subfiling.F90 index 18614b6..043ac6c 100644 --- a/fortran/testpar/subfiling.F90 +++ b/fortran/testpar/subfiling.F90 @@ -91,6 +91,8 @@ PROGRAM subfiling_test ! CALL h5open_f(hdferror) + IF(mpi_rank==0) CALL write_test_header("SUBFILING FORTRAN TESTING") + ! *********************************** ! Test H5Pset/get_mpi_params_f APIs ! *********************************** @@ -384,6 +386,9 @@ PROGRAM subfiling_test WRITE(*,*) "MPI_ABORT *FAILED* Process = ", mpi_rank ENDIF ENDIF + + IF(mpi_rank==0) CALL write_test_footer() + ! ! end main program ! @@ -392,8 +397,13 @@ PROGRAM subfiling_test CALL mpi_init(mpierror) CALL mpi_comm_rank(MPI_COMM_WORLD, mpi_rank, mpierror) - IF(mpi_rank==0) CALL write_test_status( -1, & - 'Subfiling not enabled', total_error) + + IF(mpi_rank==0) THEN + CALL write_test_header("SUBFILING FORTRAN TESTING") + CALL write_test_status( -1, 'Subfiling not enabled', total_error) + CALL write_test_footer() + ENDIF + CALL mpi_finalize(mpierror) #endif diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index 6e812f8..2084826 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -37,8 +37,6 @@ herr_t H5IM_get_palette(hid_t loc_id, const char *image_name, int pal_number, hi * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -134,8 +132,6 @@ H5IMmake_image_8bitf(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t * INTERLACE_PLANE [pixel components][height][width] * * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -244,8 +240,6 @@ H5IMmake_image_24bitf(hid_t loc_id, const char *dset_name, hsize_t width, hsize_ * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -302,8 +296,6 @@ out: * * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -395,8 +387,6 @@ H5IMmake_palettef(hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, i * * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -434,8 +424,6 @@ H5IMget_palettef(hid_t loc_id, const char *image_name, int pal_number, int_f *pa * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index 30b70dc..cead871 100644 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -29,9 +29,6 @@ * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -84,9 +81,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -134,9 +128,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -197,9 +188,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -274,9 +262,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -320,9 +305,6 @@ h5imis_image_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -370,9 +352,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -430,9 +409,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -490,9 +466,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -546,9 +519,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -605,9 +575,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -658,9 +625,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 2819f1b..c888eec 100644 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -29,9 +29,6 @@ * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -93,9 +90,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -148,9 +142,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -208,9 +199,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -261,9 +249,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -361,9 +346,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -443,9 +425,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -513,9 +492,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -568,9 +544,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -614,9 +587,6 @@ h5ltfind_dataset_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name) * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -687,9 +657,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -750,9 +717,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -830,9 +794,6 @@ done: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ diff --git a/hl/fortran/src/H5LTff.F90 b/hl/fortran/src/H5LTff.F90 index 8ced874..fe54627 100644 --- a/hl/fortran/src/H5LTff.F90 +++ b/hl/fortran/src/H5LTff.F90 @@ -615,8 +615,6 @@ CONTAINS ! ! Comments: ! - ! Modifications: - ! !------------------------------------------------------------------------- SUBROUTINE h5ltmake_dataset_int_f_1 (loc_id,& @@ -790,8 +788,6 @@ CONTAINS ! ! Comments: ! - ! Modifications: - ! !------------------------------------------------------------------------- SUBROUTINE h5ltread_dataset_int_f_1(loc_id,& @@ -953,8 +949,6 @@ CONTAINS ! ! Comments: ! - ! Modifications: - ! !------------------------------------------------------------------------- SUBROUTINE h5ltmake_dataset_string_f(loc_id,& @@ -1003,8 +997,6 @@ CONTAINS ! ! Comments: ! - ! Modifications: - ! !------------------------------------------------------------------------- SUBROUTINE h5ltread_dataset_string_f(loc_id,& diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 43e5bed..25381fd 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -27,8 +27,6 @@ * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -83,9 +81,6 @@ H5IMmake_image_8bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t * INTERLACE_PIXEL [height][width][pixel components] * INTERLACE_PLANE [pixel components][height][width] * - * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -154,8 +149,6 @@ H5IMmake_image_24bit(hid_t loc_id, const char *dset_name, hsize_t width, hsize_t * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -197,8 +190,6 @@ find_palette(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const * Comments: * The function uses H5Aiterate2 with the operator function find_palette * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -223,8 +214,6 @@ H5IM_find_palette(hid_t loc_id) * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -390,8 +379,6 @@ out: * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -437,8 +424,6 @@ out: * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -493,8 +478,6 @@ H5IMmake_palette(hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, co * palettes to be viewed with. The dataset will have an attribute * which contains an array of object reference pointers which refer to palettes in the file. * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -660,8 +643,6 @@ out: * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -756,8 +737,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -842,8 +821,6 @@ out: * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -951,8 +928,6 @@ out: * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -1053,8 +1028,6 @@ out: * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -1154,8 +1127,6 @@ out: * Comments: * based on HDF5 Image and Palette Specification * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 6a4975f..4c61aa8 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -559,9 +559,6 @@ out: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -585,9 +582,6 @@ H5LTmake_dataset(hid_t loc_id, const char *dset_name, int rank, const hsize_t *d * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -610,9 +604,6 @@ H5LTmake_dataset_char(hid_t loc_id, const char *dset_name, int rank, const hsize * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -635,9 +626,6 @@ H5LTmake_dataset_short(hid_t loc_id, const char *dset_name, int rank, const hsiz * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -660,9 +648,6 @@ H5LTmake_dataset_int(hid_t loc_id, const char *dset_name, int rank, const hsize_ * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -685,9 +670,6 @@ H5LTmake_dataset_long(hid_t loc_id, const char *dset_name, int rank, const hsize * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -710,9 +692,6 @@ H5LTmake_dataset_float(hid_t loc_id, const char *dset_name, int rank, const hsiz * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -736,9 +715,6 @@ H5LTmake_dataset_double(hid_t loc_id, const char *dset_name, int rank, const hsi * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -1293,8 +1269,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -1380,8 +1354,6 @@ H5_GCC_CLANG_DIAG_ON("cast-qual") * * Comments: If the attribute already exists, it is overwritten * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2034,8 +2006,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t @@ -2083,8 +2053,6 @@ out: * * Date: 29 September 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ static char * @@ -2155,8 +2123,6 @@ out: * * Date: December 6, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static char * @@ -2189,8 +2155,6 @@ out: * * Programmer: Raymond Lu * - * Modifications: - * *-----------------------------------------------------------------------*/ static char * print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) @@ -2323,8 +2287,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -2374,8 +2336,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ char * @@ -2984,8 +2944,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3031,8 +2989,6 @@ H5LTget_attribute_string(hid_t loc_id, const char *obj_name, const char *attr_na * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3058,8 +3014,6 @@ H5LTget_attribute_char(hid_t loc_id, const char *obj_name, const char *attr_name * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3085,8 +3039,6 @@ H5LTget_attribute_uchar(hid_t loc_id, const char *obj_name, const char *attr_nam * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3112,8 +3064,6 @@ H5LTget_attribute_short(hid_t loc_id, const char *obj_name, const char *attr_nam * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3139,8 +3089,6 @@ H5LTget_attribute_ushort(hid_t loc_id, const char *obj_name, const char *attr_na * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3166,8 +3114,6 @@ H5LTget_attribute_int(hid_t loc_id, const char *obj_name, const char *attr_name, * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3193,8 +3139,6 @@ H5LTget_attribute_uint(hid_t loc_id, const char *obj_name, const char *attr_name * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3220,8 +3164,6 @@ H5LTget_attribute_long(hid_t loc_id, const char *obj_name, const char *attr_name * * Comments: This function was added to support INTEGER*8 Fortran types * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3247,8 +3189,6 @@ H5LTget_attribute_long_long(hid_t loc_id, const char *obj_name, const char *attr * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3274,8 +3214,6 @@ H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -3301,8 +3239,6 @@ H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_na * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3329,8 +3265,6 @@ H5LTget_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_nam * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3357,8 +3291,6 @@ H5LTget_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_na * * Comments: Private function * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3390,8 +3322,6 @@ H5LTget_attribute(hid_t loc_id, const char *obj_name, const char *attr_name, hid * * Comments: Private function * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3451,8 +3381,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3500,8 +3428,6 @@ out: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index 8f0b323..9d5d627 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -58,13 +58,6 @@ static herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); * currently. Fill data is not necessary because the * table is initially of size 0. * - * Modifications: - * Mar 1, 2016 - * This function is added to replace H5PTcreate_fl and it differs - * from H5PTcreate_fl only because its last argument is plist_id - * instead of compression; this is to allow flexible compression. - * -BMR - * *------------------------------------------------------------------------- */ hid_t @@ -183,8 +176,6 @@ error: * currently. Fill data is not necessary because the * table is initially of size 0. * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -297,13 +288,6 @@ error: * * Comments: * - * Modifications: - * - * John Mainzer -- 4/23/08 - * Added error check on malloc of table, initialized fields - * in table to keep lower level code from choking on bogus - * data in error cases. - * *------------------------------------------------------------------------- */ hid_t @@ -422,8 +406,6 @@ H5PT_free_id(void *id, void H5_ATTR_UNUSED **_ctx) * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -470,8 +452,6 @@ error: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -524,8 +504,6 @@ error: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -574,9 +552,6 @@ error: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -618,9 +593,6 @@ error: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -667,8 +639,6 @@ error: * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -720,8 +690,6 @@ H5PT_get_index(htbl_t *table, hsize_t *pt_index) * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -781,9 +749,6 @@ H5PTget_index(hid_t table_id, hsize_t *pt_index) * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -818,9 +783,6 @@ error: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -848,9 +810,6 @@ H5PTis_valid(hid_t table_id) * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ herr_t @@ -898,9 +857,6 @@ error: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -956,9 +912,6 @@ error: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ hid_t @@ -991,9 +944,6 @@ error: * * Comments: * - * Modifications: - * - * *------------------------------------------------------------------------- */ hid_t diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c index 17d864b..0a90870 100644 --- a/hl/tools/gif2h5/writehdf.c +++ b/hl/tools/gif2h5/writehdf.c @@ -25,9 +25,6 @@ * * Programmer: Unknown * - * Modifications: pvn - * Use the HDF5 IMAGE API to write the HDF5 image and palette - * * Date: January, 31, 2006 * *------------------------------------------------------------------------- diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index 86fab9d..ae37ceb 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.18) project (HDF5_JAVA C Java) -set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_DIR}") +set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR}") find_package (Java) #----------------------------------------------------------------------------- diff --git a/java/src/Makefile.am b/java/src/Makefile.am index f410942..aaa4052 100644 --- a/java/src/Makefile.am +++ b/java/src/Makefile.am @@ -127,7 +127,6 @@ CLEANFILES = classhdf5_java.stamp $(jarfile) $(JAVAROOT)/$(pkgpath)/callbacks/*. clean: rm -rf $(JAVAROOT)/* rm -f $(jarfile) - rm -rf javadoc rm -f classhdf5_java.stamp diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 1633846..274dd5c 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -5115,8 +5115,8 @@ public class H5 implements java.io.Serializable { * * @param name * IN: File name to check. - * @param file_id - * IN: File identifier for a currently-open HDF5 file + * @param fapl_id + * IN: File access property list identifier * * @return true if file is accessible, false if not. * @@ -5125,7 +5125,7 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * name is null. **/ - public synchronized static native boolean H5Fis_accessible(String name, long file_id) + public synchronized static native boolean H5Fis_accessible(String name, long fapl_id) throws HDF5LibraryException, NullPointerException; /** diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c index b915993..af06bdc 100644 --- a/java/src/jni/h5fImp.c +++ b/java/src/jni/h5fImp.c @@ -188,7 +188,7 @@ done: * Signature: (Ljava/lang/String;J)Z */ JNIEXPORT jboolean JNICALL -Java_hdf_hdf5lib_H5_H5Fis_1accessible(JNIEnv *env, jclass clss, jstring name, jlong file_id) +Java_hdf_hdf5lib_H5_H5Fis_1accessible(JNIEnv *env, jclass clss, jstring name, jlong fapl_id) { const char *fileName = NULL; htri_t bval = JNI_FALSE; @@ -200,7 +200,7 @@ Java_hdf_hdf5lib_H5_H5Fis_1accessible(JNIEnv *env, jclass clss, jstring name, jl PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Fis_accessible: file name not pinned"); - if ((bval = H5Fis_accessible(fileName, (hid_t)file_id)) < 0) + if ((bval = H5Fis_accessible(fileName, (hid_t)fapl_id)) < 0) H5_LIBRARY_ERROR(ENVONLY); bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; diff --git a/m4/aclocal_fc.f90 b/m4/aclocal_fc.f90 index bcefab5..68a8f1b 100644 --- a/m4/aclocal_fc.f90 +++ b/m4/aclocal_fc.f90 @@ -82,7 +82,7 @@ END PROGRAM PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE !---- START ----- Determine the available KINDs for REALs and INTEGERs PROGRAM FC_AVAIL_KINDS - USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stderr=>ERROR_UNIT + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : stdout=>OUTPUT_UNIT IMPLICIT NONE INTEGER :: ik, jk, k, kk, max_decimal_prec INTEGER :: prev_rkind, num_rkinds = 1, num_ikinds = 1 @@ -102,11 +102,11 @@ PROGRAM FC_AVAIL_KINDS ENDDO DO k = 1, num_ikinds - WRITE(stderr,'(I0)', ADVANCE='NO') list_ikinds(k) + WRITE(stdout,'(I0)', ADVANCE='NO') list_ikinds(k) IF(k.NE.num_ikinds)THEN - WRITE(stderr,'(A)',ADVANCE='NO') ',' + WRITE(stdout,'(A)',ADVANCE='NO') ',' ELSE - WRITE(stderr,'()') + WRITE(stdout,'()') ENDIF ENDDO @@ -139,17 +139,17 @@ PROGRAM FC_AVAIL_KINDS ENDDO prec DO k = 1, num_rkinds - WRITE(stderr,'(I0)', ADVANCE='NO') list_rkinds(k) + WRITE(stdout,'(I0)', ADVANCE='NO') list_rkinds(k) IF(k.NE.num_rkinds)THEN - WRITE(stderr,'(A)',ADVANCE='NO') ',' + WRITE(stdout,'(A)',ADVANCE='NO') ',' ELSE - WRITE(stderr,'()') + WRITE(stdout,'()') ENDIF ENDDO - WRITE(stderr,'(I0)') max_decimal_prec - WRITE(stderr,'(I0)') num_ikinds - WRITE(stderr,'(I0)') num_rkinds + WRITE(stdout,'(I0)') max_decimal_prec + WRITE(stdout,'(I0)') num_ikinds + WRITE(stdout,'(I0)') num_rkinds END PROGRAM FC_AVAIL_KINDS !---- END ----- Determine the available KINDs for REALs and INTEGERs diff --git a/release_docs/INSTALL b/release_docs/INSTALL index 177f3b6..2b8f3b6 100644 --- a/release_docs/INSTALL +++ b/release_docs/INSTALL @@ -417,7 +417,7 @@ CONTENTS 4.3.11. Backward compatibility - The 1.13 version of the HDF5 library can be configured to operate + The 1.14 version of the HDF5 library can be configured to operate identically to the v1.12 library with the --with-default-api-version=v112 configure flag, or identically to the v1.10 library with the @@ -427,7 +427,7 @@ CONTENTS configure flag, or identically to the v1.6 library with the --with-default-api-version=v16 configure flag. This allows existing code to be compiled with the - v1.13 library without requiring immediate changes to the application + v1.14 library without requiring immediate changes to the application source code. For additional configuration options and other details, see "API Compatibility Macros": diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index b5521f8..d2cb4af 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -27,11 +27,11 @@ Obtaining HDF5 source code 2. Obtain compressed (*.tar or *.zip) HDF5 source from https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMake and put it in "myhdfstuff". - Uncompress the file. There should be a hdf5-1.13."X" folder. + Uncompress the file. There should be a hdf5-1.14."X" folder. CMake version 1. We suggest you obtain the latest CMake from the Kitware web site. - The HDF5 1.13."X" product requires a minimum CMake version 3.12, + The HDF5 1.14."X" product requires a minimum CMake version 3.12, where "X" is the current HDF5 release version. If you are using VS2022, the minimum version is 3.21. @@ -54,7 +54,7 @@ The following files referenced below are available at the HDF web site: https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMake Single compressed file with all the files needed, including source: - CMake-hdf5-1.13.X.zip or CMake-hdf5-1.13.X.tar.gz + CMake-hdf5-1.14.X.zip or CMake-hdf5-1.14.X.tar.gz Individual files included in the above mentioned compressed files ----------------------------------------------- @@ -83,10 +83,10 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: 1. Change to the development directory "myhdfstuff". - 2. Download the CMake-hdf5-1.13.X.zip(.tar.gz) file to "myhdfstuff". + 2. Download the CMake-hdf5-1.14.X.zip(.tar.gz) file to "myhdfstuff". Uncompress the file. - 3. Change to the source directory "hdf5-1.13.x". + 3. Change to the source directory "hdf5-1.14.x". CTestScript.cmake file should not be modified. 4. Edit the platform configuration file, HDF5options.cmake, if you want to change @@ -96,6 +96,10 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: 5. From the "myhdfstuff" directory execute the CTest Script with the following options: + On 32-bit Windows with Visual Studio 2022, execute: + ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2022 -C Release -VV -O hdf5.log + On 64-bit Windows with Visual Studio 2022, execute: + ctest -S HDF5config.cmake,BUILD_GENERATOR=VS202264 -C Release -VV -O hdf5.log On 32-bit Windows with Visual Studio 2019, execute: ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2019 -C Release -VV -O hdf5.log On 64-bit Windows with Visual Studio 2019, execute: @@ -104,17 +108,13 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2017 -C Release -VV -O hdf5.log On 64-bit Windows with Visual Studio 2017, execute: ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log - On 32-bit Windows with Visual Studio 2015, execute: - ctest -S HDF5config.cmake,BUILD_GENERATOR=VS2015 -C Release -VV -O hdf5.log - On 64-bit Windows with Visual Studio 2015, execute: - ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201564 -C Release -VV -O hdf5.log On Linux and Mac, execute: ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -VV -O hdf5.log The supplied build scripts are versions of the above. The command above will configure, build, test, and create an install package in the myhdfstuff folder. It will have the format: - HDF5-1.13.NN-. + HDF5-1.14.NN-. On Unix, will be "Linux". A similar .sh file will also be created. On Windows, will be "win64" or "win32". If you have an @@ -135,13 +135,13 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: 6. To install, "X" is the current release version On Windows (with WiX installed), execute: - HDF5-1.13."X"-win32.msi or HDF5-1.13."X"-win64.msi + HDF5-1.14."X"-win32.msi or HDF5-1.14."X"-win64.msi By default this program will install the hdf5 library into the "C:\Program Files" directory and will create the following directory structure: HDF_Group --HDF5 - ----1.13."X" + ----1.14."X" ------bin ------include ------lib @@ -149,40 +149,40 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: On Linux, change to the install destination directory (create it if doesn't exist) and execute: - /myhdfstuff/HDF5-1.13."X"-Linux.sh + /myhdfstuff/HDF5-1.14."X"-Linux.sh After accepting the license, the script will prompt: By default the HDF5 will be installed in: - "/HDF5-1.13."X"-Linux" - Do you want to include the subdirectory HDF5-1.13."X"-Linux? + "/HDF5-1.14."X"-Linux" + Do you want to include the subdirectory HDF5-1.14."X"-Linux? Saying no will install in: "" [Yn]: Note that the script will create the following directory structure relative to the install point: HDF_Group --HDF5 - ----1.13."X" + ----1.14."X" ------bin ------include ------lib ------share - On Mac you will find HDF5-1.13."X"-Darwin.dmg in the myhdfstuff folder. Click + On Mac you will find HDF5-1.14."X"-Darwin.dmg in the myhdfstuff folder. Click on the dmg file to proceed with installation. After accepting the license, there will be a folder with the following structure: HDF_Group --HDF5 - ----1.13."X" + ----1.14."X" ------bin ------include ------lib ------share By default the installation will create the bin, include, lib and cmake - folders in the /HDF_Group/HDF5/1.13."X" + folders in the /HDF_Group/HDF5/1.14."X" The depends on the build platform; Windows will set the default to: - C:/Program Files/HDF_Group/HDF5/1.13."X" + C:/Program Files/HDF_Group/HDF5/1.14."X" Linux will set the default to: - "myhdfstuff/HDF_Group/HDF5/1.13."X" + "myhdfstuff/HDF_Group/HDF5/1.14."X" The default can be changed by adding ",INSTALLDIR=" to the "ctest -S HDF5config.cmake..." command. For example on linux: ctest -S HDF5config.cmake,INSTALLDIR=/usr/local/myhdf5,BUILD_GENERATOR=Unix -C Release -VV -O hdf5.log @@ -209,13 +209,13 @@ Notes: This short set of instructions is written for users who want to 5. Configure the C library, tools and tests with one of the following commands: On Windows 32 bit - cmake -G "Visual Studio 12 2013" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.13."X" + cmake -G "Visual Studio 12 2013" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.14."X" On Windows 64 bit - cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.13."X" + cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.14."X" On Linux and Mac - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5-1.13."X" + cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5-1.14."X" where "X" is the current release version. @@ -230,13 +230,13 @@ Notes: This short set of instructions is written for users who want to 9. To install On Windows (with WiX installed), execute: - HDF5-1.13."X"-win32.msi or HDF5-1.13."X"-win64.msi + HDF5-1.14."X"-win32.msi or HDF5-1.14."X"-win64.msi By default this program will install the hdf5 library into the "C:\Program Files" directory and will create the following directory structure: HDF_Group --HDF5 - ----1.13."X" + ----1.14."X" ------bin ------include ------lib @@ -244,28 +244,28 @@ Notes: This short set of instructions is written for users who want to On Linux, change to the install destination directory (create if doesn't exist) and execute: - /myhdfstuff/build/HDF5-1.13."X"-Linux.sh + /myhdfstuff/build/HDF5-1.14."X"-Linux.sh After accepting the license, the script will prompt: By default the HDF5 will be installed in: - "/HDF5-1.13."X"-Linux" - Do you want to include the subdirectory HDF5-1.13."X"-Linux? + "/HDF5-1.14."X"-Linux" + Do you want to include the subdirectory HDF5-1.14."X"-Linux? Saying no will install in: "" [Yn]: Note that the script will create the following directory structure relative to the install point: HDF_Group --HDF5 - ----1.13."X" + ----1.14."X" ------bin ------include ------lib ------share - On Mac you will find HDF5-1.13."X"-Darwin.dmg in the build folder. Click + On Mac you will find HDF5-1.14."X"-Darwin.dmg in the build folder. Click on the dmg file to proceed with installation. After accepting the license, there will be a folder with the following structure: HDF_Group --HDF5 - ----1.13."X" + ----1.14."X" ------bin ------include ------lib @@ -277,7 +277,7 @@ IV. Further considerations ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.13."X" product requires a minimum CMake version 3.18. + web site. The HDF5 1.14."X" product requires a minimum CMake version 3.18. 2. If you plan to use Zlib or Szip: A. Download the binary packages and install them in a central location. @@ -763,6 +763,8 @@ BUILD_SHARED_LIBS "Build Shared Libraries" ON BUILD_STATIC_LIBS "Build Static Libraries" ON BUILD_STATIC_EXECS "Build Static Executables" OFF BUILD_TESTING "Build HDF5 Unit Testing" ON +if (WINDOWS) + DISABLE_PDB_FILES "Do not install PDB files" OFF ---------------- HDF5 Build Options --------------------- HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF diff --git a/release_docs/INSTALL_Cygwin.txt b/release_docs/INSTALL_Cygwin.txt index 34d3e5a..a605f4d 100644 --- a/release_docs/INSTALL_Cygwin.txt +++ b/release_docs/INSTALL_Cygwin.txt @@ -2,7 +2,7 @@ HDF5 Build and Install Instructions for Cygwin ************************************************************************ -This document is a instruction on how to build, test and install HDF5 library on +This document is an instruction on how to build, test and install HDF5 library on Cygwin. See detailed information in hdf5/INSTALL. NOTE: hdf5 can be built with CMake, see the INSTALL_CMake.txt file for more guidance. @@ -98,19 +98,19 @@ Build, Test and Install HDF5 on Cygwin The HDF5 source code is distributed in a variety of formats which can be unpacked with the following commands, each of which creates - an `hdf5-1.13.x' directory. + an `hdf5-1.14.x' directory. 2.1 Non-compressed tar archive (*.tar) - $ tar xf hdf5-1.13.x.tar + $ tar xf hdf5-1.14.x.tar 2.2 Gzip'd tar archive (*.tar.gz) - $ gunzip < hdf5-1.13.x.tar.gz | tar xf - + $ gunzip < hdf5-1.14.x.tar.gz | tar xf - 2.3 Bzip'd tar archive (*.tar.bz2) - $ bunzip2 < hdf5-1.13.x.tar.bz2 | tar xf - + $ bunzip2 < hdf5-1.14.x.tar.bz2 | tar xf - 2. Setup Environment diff --git a/release_docs/README_HDF5_CMake b/release_docs/README_HDF5_CMake index 8b30112..1975d84 100644 --- a/release_docs/README_HDF5_CMake +++ b/release_docs/README_HDF5_CMake @@ -6,18 +6,18 @@ This tar file contains CTestScript.cmake HDF5config.cmake CMake scripts for building HDF5 HDF5options.cmake - hdf5-1.13.2 HDF5 1.13.2 source + hdf5-1.14.1 HDF5 1.14.1 source LIBAEC.tar.gz source for building SZIP replacement ZLib.tar.gz source for building ZLIB hdf5_plugins.tar.gz source for building compression plugins - HDF5Examples-2.0.1-Source.tar.gz source for building examples + HDF5Examples-2.0.3-Source.tar.gz source for building examples For more information about building HDF5 with CMake, see USING_HDF5_CMake.txt in -hdf5-1.13.2/release_docs, or +hdf5-1.14.1/release_docs, or https://portal.hdfgroup.org/display/support/Building+HDF5+with+CMake. For more information about building HDF5 with CMake on HPC machines, including -cross compiling on Cray XC40, see README_HPC in hdf5-1.13.2/release_docs. +cross compiling on Cray XC40, see README_HPC in hdf5-1.14.1/release_docs. diff --git a/release_docs/README_HPC b/release_docs/README_HPC index 02034b4..c2be492 100644 --- a/release_docs/README_HPC +++ b/release_docs/README_HPC @@ -154,10 +154,10 @@ If using ctest is undesirable, one can create a build directory and run the cmak configure command, for example "/projects/Mutrino/hpcsoft/cle6.0/common/cmake/3.18/bin/cmake" --C "/hdf5-1.13.3/config/cmake/cacheinit.cmake" +-C "/hdf5-1.14.x/config/cmake/cacheinit.cmake" -DCMAKE_BUILD_TYPE:STRING=Release -DHDF5_BUILD_FORTRAN:BOOL=ON -DHDF5_BUILD_JAVA:BOOL=OFF --DCMAKE_INSTALL_PREFIX:PATH=/HDF_Group/HDF5/1.13.3 +-DCMAKE_INSTALL_PREFIX:PATH=/HDF_Group/HDF5/1.14.x -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_PARALLEL:BOOL=ON -DHDF5_BUILD_CPP_LIB:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DHDF5_ENABLE_THREADSAFE:BOOL=OFF @@ -168,7 +168,7 @@ configure command, for example -DLOCAL_BATCH_SCRIPT_NAME:STRING=knl_ctestS.sl -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=knl_ctestP.sl -DSITE:STRING=mutrino -DBUILDNAME:STRING=par-knl_GCC493-SHARED-Linux-4.4.156-94.61.1.16335.0.PTF.1107299-default-x86_64 -"-GUnix Makefiles" "" "/hdf5-1.13.3" +"-GUnix Makefiles" "" "/hdf5-1.14.x" followed by make and batch jobs to run tests. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4caa6c0..a06e2a7 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -99,8 +99,9 @@ New Features Fortran Library: ---------------- - - + - Added Fortran async APIs + H5A, H5D, H5ES, H5G, H5F, H5L and H5O async APIs were added. C++ Library: ------------ @@ -148,14 +149,70 @@ Bug Fixes since HDF5-1.14.0 release =================================== Library ------- - - Fixed memory leaks that could occur when reading a dataset from a malformed - file + - Fixed memory leaks when processing malformed object header continuation messages + + Malformed object header continuation messages can result in a too-small + buffer being passed to the decode function, which could lead to reading + past the end of the buffer. Additionally, errors in processing these + malformed messages can lead to allocated memory not being cleaned up. + + This fix adds bounds checking and cleanup code to the object header + continuation message processing. + + Fixes GitHub issue #2604 + + - Fixed memory leaks, aborts, and overflows in H5O EFL decode + + The external file list code could call assert(), read past buffer + boundaries, and not properly clean up resources when parsing malformed + external data files messages. + + This fix cleans up allocated memory, adds buffer bounds checks, and + converts asserts to HDF5 error checking. + + Fixes GitHub issue #2605 + + - Fixed potential heap buffer overflow in decoding of link info message + + Detections of buffer overflow were added for decoding version, index + flags, link creation order value, and the next three addresses. The + checkings will remove the potential invalid read of any of these + values that could be triggered by a malformed file. + + Fixes GitHub issue #2603 + + - Memory leak + + Memory leak was detected when running h5dump with "pov". The memory was allocated + via H5FL__malloc() in hdf5/src/H5FL.c - When attempting to read layout, pline, and efl information for a dataset, - memory leaks could occur if attempting to read pline/efl information threw - an error, which is due to memory being allocated for pline and efl not being - properly cleaned up on error. + The fuzzed file "pov" was an HDF5 file containing an illegal continuation message. + When deserializing the object header chunks for the file, memory is allocated for the + array of continuation messages (cont_msg_info->msgs) in continuation message info struct. + As error is encountered in loading the illegal message, the memory allocated for + cont_msg_info->msgs needs to be freed. + + Fixes GitHub issue #2599 + + - Fixed memory leaks that could occur when reading a dataset from a + malformed file + When attempting to read layout, pline, and efl information for a + dataset, memory leaks could occur if attempting to read pline/efl + information threw an error, which is due to the memory that was + allocated for pline and efl not being properly cleaned up on error. + + Fixes GitHub issue #2602 + + - Fixed potential heap buffer overrun in group info header decoding from malformed file + + H5O__ginfo_decode could sometimes read past allocated memory when parsing a + group info message from the header of a malformed file. + + It now checks buffer size before each read to properly throw an error in these cases. + + Fixes GitHub issue #2601 + - Fixed potential buffer overrun issues in some object header decode routines Several checks were added to H5O__layout_decode and H5O__sdspace_decode to @@ -180,19 +237,6 @@ Bug Fixes since HDF5-1.14.0 release Also added a regression test for these two I/O concentrator selection strategies to prevent future issues. - - Memory leak - - Memory leak was detected when running h5dump with "pov". The memory was allocated - via H5FL__malloc() in hdf5/src/H5FL.c - - The fuzzed file "pov" was an HDF5 file containing an illegal continuation message. - When deserializing the object header chunks for the file, memory is allocated for the - array of continuation messages (cont_msg_info->msgs) in continuation message info struct. - As error is encountered in loading the illegal message, the memory allocated for - cont_msg_info->msgs needs to be freed. - - Fixes GitHub issue #2599 - - Fixed a heap buffer overflow that occurs when reading from a dataset with a compact layout within a malformed HDF5 file @@ -224,24 +268,6 @@ Bug Fixes since HDF5-1.14.0 release being copied when projecting the point selection onto the hyperslab selection's dataspace. - - Fixed issues in the Subfiling VFD when using the SELECT_IOC_EVERY_NTH_RANK - or SELECT_IOC_TOTAL I/O concentrator selection strategies - - Multiple bugs involving these I/O concentrator selection strategies - were fixed, including: - - * A bug that caused the selection strategy to be altered when - criteria for the strategy was specified in the - H5FD_SUBFILING_IOC_SELECTION_CRITERIA environment variable as - a single value, rather than in the old and undocumented - 'integer:integer' format - * Two bugs which caused a request for 'N' I/O concentrators to - result in 'N - 1' I/O concentrators being assigned, which also - lead to issues if only 1 I/O concentrator was requested - - Also added a regression test for these two I/O concentrator selection - strategies to prevent future issues. - - Fixed an issue with collective metadata writes of global heap data New test failures in parallel netCDF started occurring with debug @@ -270,6 +296,18 @@ Bug Fixes since HDF5-1.14.0 release Fixes GitHub issue #2458 + - Fixed buffer overflow error in image decoding function. + + The error occurred in the function for decoding address from the specified + buffer, which is called many times from the function responsible for image + decoding. The length of the buffer is known in the image decoding function, + but no checks are produced, so the buffer overflow can occur in many places, + including callee functions for address decoding. + + The error was fixed by inserting corresponding checks for buffer overflow. + + Fixes GitHub issue #2432 + Java Library ------------ @@ -495,26 +533,6 @@ Platforms Tested Known Problems ============== - ************************************************************ - * _ * - * (_) * - * __ ____ _ _ __ _ __ _ _ __ __ _ * - * \ \ /\ / / _` | '__| '_ \| | '_ \ / _` | * - * \ V V / (_| | | | | | | | | | | (_| | * - * \_/\_/ \__,_|_| |_| |_|_|_| |_|\__, | * - * __/ | * - * |___/ * - * * - * Please refrain from running any program (including * - * HDF5 tests) which uses the subfiling VFD on Perlmutter * - * at the National Energy Research Scientific Computing * - * Center, NERSC. * - * Doing so may cause a system disruption due to subfiling * - * crashing Lustre. The sytem's Lustre bug is expected * - * to be resolved by 2023. * - * * - ************************************************************ - CMake files do not behave correctly with paths containing spaces. Do not use spaces in paths because the required escaping for handling spaces results in very complex and fragile build files. diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index 853fa4f..4439296 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -21,7 +21,7 @@ I. Preconditions ======================================================================== 1. We suggest you obtain the latest CMake for your platform from the Kitware - web site. The HDF5 1.13.x product requires a minimum CMake version + web site. The HDF5 1.14.x product requires a minimum CMake version of 3.18. If you are using VS2022, the minimum version is 3.21. 2. You have installed the HDF5 library built with CMake, by executing diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index e8e50df..698b275 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -38,7 +38,7 @@ I. Preconditions ======================================================================== 1. We suggest you obtain the latest CMake for your platform from the Kitware - web site. The HDF5 1.13.x product requires a minimum CMake version + web site. The HDF5 1.14.x product requires a minimum CMake version of 3.18. If you are using VS2022, the minimum version is 3.21. 2. You have installed the HDF5 library built with CMake, by executing @@ -50,24 +50,24 @@ I. Preconditions or environment variable, set(ENV{HDF5_ROOT} "") to the installed location of HDF5. On Windows: - HDF5_ROOT=C:/Program Files/HDF_Group/HDF5/1.13.x/ + HDF5_ROOT=C:/Program Files/HDF_Group/HDF5/1.14.x/ On unix: - HDF5_ROOT=/HDF_Group/HDF5/1.13.x/ + HDF5_ROOT=/HDF_Group/HDF5/1.14.x/ If you are using shared libraries, you may need to add to the path environment variable. Set the path environment variable to the installed location of the library files for HDF5. On Windows (*.dll): - PATH=%PATH%;C:/Program Files/HDF_Group/HDF5/1.13.x/bin + PATH=%PATH%;C:/Program Files/HDF_Group/HDF5/1.14.x/bin On unix (*.so): - LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/HDF_Group/HDF5/1.13.x/lib + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/HDF_Group/HDF5/1.14.x/lib If you are using filter plugin libraries, you will need to set the HDF5_PLUGIN_PATH environment variable. On Windows: - HDF5_PLUGIN_PATH=C:/Program Files/HDF_Group/HDF5/1.13.x/lib/plugin + HDF5_PLUGIN_PATH=C:/Program Files/HDF_Group/HDF5/1.14.x/lib/plugin On unix: - HDF5_PLUGIN_PATH=/HDF_Group/HDF5/1.13.x/lib/plugin + HDF5_PLUGIN_PATH=/HDF_Group/HDF5/1.14.x/lib/plugin (Note there are no quote characters used on Windows and all platforms use forward slashes) @@ -126,6 +126,9 @@ These steps are described in more detail below. * Visual Studio 16 2019 * ... in addition VS2019 will need to set the "-A" option, * ... [Win32, x64, ARM, ARM64] + * Visual Studio 17 2022 + * ... in addition VS2022 will need to set the "-A" option, + * ... [Win32, x64, ARM, ARM64] is: * BUILD_TESTING:BOOL=ON diff --git a/release_docs/USING_HDF5_VS.txt b/release_docs/USING_HDF5_VS.txt index 5ec9996..d604806 100644 --- a/release_docs/USING_HDF5_VS.txt +++ b/release_docs/USING_HDF5_VS.txt @@ -54,11 +54,11 @@ Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 and select "x64". 2.2 Find the box "Show directories for", choose "Include files", add the - header path (i.e. c:\Program Files\HDF_Group\HDF5\1.13.x\include) + header path (i.e. c:\Program Files\HDF_Group\HDF5\1.14.x\include) to the included directories. 2.3 Find the box "Show directories for", choose "Library files", add the - library path (i.e. c:\Program Files\HDF_Group\HDF5\1.13.x\lib) + library path (i.e. c:\Program Files\HDF_Group\HDF5\1.14.x\lib) to the library directories. 2.4 If using Fortran libraries, you will also need to setup the path diff --git a/src/H5AC.c b/src/H5AC.c index 49ff0d3..2b4c297 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -312,7 +312,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list") } /* end if */ - /* construct the candidate slist for all processes. + /* construct the candidate skip list for all processes. * when the distributed strategy is selected as all processes * will use it in the case of a flush. */ @@ -413,14 +413,6 @@ done: * Programmer: Robb Matzke * Jul 9 1997 * - * Changes: - * - * In the parallel case, added code to setup the MDC slist - * before the call to H5AC__flush_entries() and take it down - * afterwards. - * - * JRM -- 7/29/20 - * *------------------------------------------------------------------------- */ herr_t @@ -447,34 +439,25 @@ H5AC_dest(H5F_t *f) /* Check if log messages are being emitted */ if (H5C_get_logging_status(f->shared->cache, &log_enabled, &curr_logging) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to get logging status") - if (log_enabled && curr_logging) { - - if (H5C_log_write_destroy_cache_msg(f->shared->cache) < 0) - - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") - } /* Tear down logging */ if (log_enabled) { + if (curr_logging) + if (H5C_log_write_destroy_cache_msg(f->shared->cache) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") if (H5C_log_tear_down(f->shared->cache) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "mdc logging tear-down failed") - } + HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "metadata cache logging tear-down failed") + } /* end if */ #ifdef H5_HAVE_PARALLEL - /* destroying the cache, so clear all collective entries */ if (H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't clear collective entries") aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); - if (aux_ptr) { - /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); @@ -488,7 +471,7 @@ H5AC_dest(H5F_t *f) * H5AC__flush_entries() and disable it afterwards, as the * skip list will be disabled after the previous flush. * - * Note that H5C_dest() does slist setup and take down as well. + * Note that H5C_dest() does skip list setup and take down as well. * Unfortunately, we can't do the setup and take down just once, * as H5C_dest() is called directly in the test code. * @@ -496,59 +479,45 @@ H5AC_dest(H5F_t *f) * point, so the overhead should be minimal. */ if (H5F_ACC_RDWR & H5F_INTENT(f)) { - - /* enable and load the slist */ + /* enable and load the skip list */ if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't enable skip list") if (H5AC__flush_entries(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") - /* disable the slist -- should be empty */ + /* disable the skip list -- should be empty */ if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist failed") - } - } -#endif /* H5_HAVE_PARALLEL */ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't disable skip list") + } /* end if */ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ if (H5C_dest(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") f->shared->cache = NULL; #ifdef H5_HAVE_PARALLEL - if (aux_ptr != NULL) { - if (aux_ptr->d_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->d_slist_ptr) == 0); H5SL_close(aux_ptr->d_slist_ptr); - } /* end if */ if (aux_ptr->c_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); H5SL_close(aux_ptr->c_slist_ptr); - } /* end if */ if (aux_ptr->candidate_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); H5SL_close(aux_ptr->candidate_slist_ptr); - } /* end if */ aux_ptr->magic = 0; aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); - } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -1191,13 +1160,12 @@ done: * * Function: H5AC_prep_for_file_flush * - * Purpose: This function should be called just prior to the first - * call to H5AC_flush() during a file flush. + * Purpose: Handle any setup required prior to metadata cache flush. * - * Its purpose is to handly any setup required prior to - * metadata cache flush. + * This function should be called just prior to the first + * call to H5AC_flush() during a file flush. * - * Initially, this means setting up the slist prior to the + * Initially, this means setting up the skip list prior to the * flush. We do this in a separate call because * H5F__flush_phase2() make repeated calls to H5AC_flush(). * Handling this detail in separate calls allows us to avoid @@ -1209,8 +1177,6 @@ done: * Programmer: John Mainzer * 5/5/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -1226,13 +1192,10 @@ H5AC_prep_for_file_flush(H5F_t *f) HDassert(f->shared->cache); if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't enable skip list") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_prep_for_file_flush() */ /*------------------------------------------------------------------------- @@ -1242,14 +1205,11 @@ done: * Purpose: This function should be called just after the last * call to H5AC_flush() during a file flush. * - * Its purpose is to perform any necessary cleanup after the - * metadata cache flush. - * * The objective of the call is to allow the metadata cache * to do any necessary necessary cleanup work after a cache * flush. * - * Initially, this means taking down the slist after the + * Initially, this means taking down the skip list after the * flush. We do this in a separate call because * H5F__flush_phase2() make repeated calls to H5AC_flush(). * Handling this detail in separate calls allows us to avoid @@ -1261,8 +1221,6 @@ done: * Programmer: John Mainzer * 5/5/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -1278,13 +1236,10 @@ H5AC_secure_from_file_flush(H5F_t *f) HDassert(f->shared->cache); if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't disable skip list") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_secure_from_file_flush() */ /*------------------------------------------------------------------------- @@ -1474,24 +1429,6 @@ H5AC_resize_entry(void *thing, size_t new_size) * amounts of dirty metadata creation in other areas -- which will * cause aux_ptr->dirty_bytes to be incremented. * - * The bottom line is that this code is probably OK, but the above - * points should be kept in mind. - * - * One final observation: This comment is occasioned by a bug caused - * by moving the call to H5AC__log_dirtied_entry() after the call to - * H5C_resize_entry(), and then only calling H5AC__log_dirtied_entry() - * if entry_ptr->is_dirty was false. - * - * Since H5C_resize_entry() marks the target entry dirty unless there - * is not change in size, this had the effect of not calling - * H5AC__log_dirtied_entry() when it should be, and corrupting - * the cleaned and dirtied lists used by rank 0 in the parallel - * version of the metadata cache. - * - * The point here is that you should be very careful when working with - * this code, and not modify it unless you fully understand it. - * - * JRM -- 2/28/22 */ if ((!entry_ptr->is_dirty) && (entry_ptr->size != new_size)) { diff --git a/src/H5ACmodule.h b/src/H5ACmodule.h index a7f9a27..1ce26f6 100644 --- a/src/H5ACmodule.h +++ b/src/H5ACmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5AC package. Including this header means that the source file - * is part of the H5AC package. + * Purpose: This file contains declarations which define macros for the + * H5AC package. Including this header means that the source file + * is part of the H5AC package. */ #ifndef H5ACmodule_H #define H5ACmodule_H diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 197cc3c..e103a26 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -1860,8 +1860,6 @@ done: * Programmer: John Mainzer * April 28, 2010 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1890,12 +1888,9 @@ H5AC__rsp__p0_only__flush(H5F_t *f) * However, when flushing from within the close operation from a file, * it's possible to skip this barrier (on the second flush of the cache). */ - if (!H5CX_get_mpi_file_flushing()) { - + if (!H5CX_get_mpi_file_flushing()) if (MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result) - } /* Flush data to disk, from rank 0 process */ if (aux_ptr->mpi_rank == 0) { @@ -2104,31 +2099,28 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op) /* Sanity checks */ HDassert(f != NULL); - cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); - aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || (sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)); #ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION - HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/m/mu) = %zu/%u/%zu/%u/%zu/%u\n", aux_ptr->mpi_rank, + HDfprintf(stdout, "%d:%s...:%u: (u/uu/i/iu/m/mu) = %zu/%u/%zu/%u/%zu/%u\n", aux_ptr->mpi_rank, __func__, aux_ptr->dirty_bytes_propagations, aux_ptr->unprotect_dirty_bytes, aux_ptr->unprotect_dirty_bytes_updates, aux_ptr->insert_dirty_bytes, aux_ptr->insert_dirty_bytes_updates, aux_ptr->move_dirty_bytes, aux_ptr->move_dirty_bytes_updates); #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ - /* clear collective access flag on half of the entries in the - cache and mark them as independent in case they need to be - evicted later. All ranks are guaranteed to mark the same entries - since we don't modify the order of the collectively accessed - entries except through collective access. */ + /* Clear collective access flag on half of the entries in the cache and + * mark them as independent in case they need to be evicted later. All + * ranks are guaranteed to mark the same entries since we don't modify the + * order of the collectively accessed entries except through collective + * access. + */ if (H5C_clear_coll_entries(cache_ptr, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.") @@ -2190,7 +2182,6 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op) #endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */ done: - FUNC_LEAVE_NOAPI(ret_value) } /* H5AC__run_sync_point() */ diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index 8ccab4e..beb7ba7 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -11,18 +11,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: John Mainzer -- 4/19/06 + * Purpose: This file contains declarations which are normally visible + * only within the H5AC package (just H5AC.c at present). * - * Purpose: This file contains declarations which are normally visible - * only within the H5AC package (just H5AC.c at present). - * - * Source files outside the H5AC package should include - * H5ACprivate.h instead. - * - * The one exception to this rule is testpar/t_cache.c. The - * test code is easier to write if it can look at H5AC_aux_t. - * Indeed, this is the main reason why this file was created. + * Source files outside the H5AC package should include + * H5ACprivate.h instead. * + * The one exception to this rule is testpar/t_cache.c. The + * test code is easier to write if it can look at H5AC_aux_t. + * Indeed, this is the main reason why this file was created. */ #if !(defined H5AC_FRIEND || defined H5AC_MODULE) diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index 0967f77..5dc65c7 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -466,7 +466,7 @@ typedef struct H5AC_cache_config_t { /* general configuration fields: */ //! int version; - /**< Integer field indicating the the version of the H5AC_cache_config_t + /**< Integer field indicating the version of the H5AC_cache_config_t * in use. This field should be set to #H5AC__CURR_CACHE_CONFIG_VERSION * (defined in H5ACpublic.h). */ diff --git a/src/H5Amodule.h b/src/H5Amodule.h index 4823d0d..75a4c8c 100644 --- a/src/H5Amodule.h +++ b/src/H5Amodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5A package. Including this header means that the source file - * is part of the H5A package. + * Purpose: This file contains declarations which define macros for the + * H5A package. Including this header means that the source file + * is part of the H5A package. */ #ifndef H5Amodule_H #define H5Amodule_H diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 49dfda2..3a5c411 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Monday, Apr 20 - * * Purpose: This file contains declarations which are visible only within * the H5A package. Source files outside the H5A package should * include H5Aprivate.h instead. diff --git a/src/H5Apublic.h b/src/H5Apublic.h index e21e808..92df94a 100644 --- a/src/H5Apublic.h +++ b/src/H5Apublic.h @@ -127,7 +127,7 @@ H5_DLL herr_t H5Aclose_async(hid_t attr_id, hid_t es_id); * The attribute identifier returned by this function must be released * with H5Aclose() resource leaks will develop. * - * \note If \p loc_id is a file identifier, the attribute will be attached + * \note If \p loc_id is a file identifier, the attribute will be attached to * that file’s root group. * * \par Example @@ -246,8 +246,8 @@ H5_DLL herr_t H5Adelete(hid_t loc_id, const char *attr_name); * \param[in] obj_name Name of object, relative to location, from which * attribute is to be removed * \param[in] idx_type Type of index - * \param[in] order Order in which to iterate over index - * \param[in] n Offset within index + * \param[in] order Order in which to iterate over the index + * \param[in] n Offset within the index * \lapl_id * * \return \herr_t @@ -264,7 +264,7 @@ H5_DLL herr_t H5Adelete(hid_t loc_id, const char *attr_name); * The order in which the index is to be traversed is specified by * \p order. For example, if \p idx_type, \p order, * and \p n are set to #H5_INDEX_NAME, #H5_ITER_INC, and 5, - * respectively, the fifth attribute in lexicographic order of + * respectively, the fifth attribute in the lexicographic order of * attribute names will be removed. * * The link access property list, \p lapl_id, may provide @@ -354,7 +354,7 @@ H5_DLL herr_t H5Aexists_async(hid_t obj_id, const char *attr_name, hbool_t *exis * \p loc_id specifies a location in the file containing the object. * \p obj_name is the name of the object to which the attribute is * attached and can be a relative name, relative to \p loc_id, - * or an absolute name, based in the root group of the file. + * or an absolute name, based on the root group of the file. * * The link access property list, \p lapl_id, may provide * information regarding the properties of links required to access @@ -403,7 +403,7 @@ H5_DLL hid_t H5Aget_create_plist(hid_t attr_id); /** * \ingroup H5A * - * \brief Retrieves attribute information, by attribute identifier + * \brief Retrieves attribute information by attribute identifier * * \attr_id * \param[out] ainfo Attribute information struct @@ -438,7 +438,7 @@ H5_DLL herr_t H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/); * \details H5Aget_info_by_idx() retrieves information for an attribute * that is attached to an object, which is specified by its * location and name, \p loc_id and \p obj_name, respectively. - * The attribute is located by its index position and the attribute + * The attribute is located by its index position, and the attribute * information is returned in the \p ainfo struct. * * The attribute is located by means of an index type, an index @@ -458,7 +458,7 @@ H5_DLL herr_t H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t /** * \ingroup H5A * - * \brief Retrieves attribute information, by attribute name + * \brief Retrieves attribute information by attribute name * * \fgdt_loc_id * \param[in] obj_name Name of the object to which an attribute is attached, @@ -494,7 +494,7 @@ H5_DLL herr_t H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char * \param[out] buf Buffer to store name in * * \return Returns the length of the attribute's name, which may be longer - * than \p buf_size, if successful. Otherwise returns a negative + * than \p buf_size, if successful. Otherwise, returns a negative * value. * * \details H5Aget_name() retrieves the name of an attribute specified by @@ -529,7 +529,7 @@ H5_DLL ssize_t H5Aget_name(hid_t attr_id, size_t buf_size, char *buf); * \lapl_id * * \return Returns attribute name size, in bytes, if successful; - * otherwise returns a negative value. + * otherwise, returns a negative value. * * \details H5Aget_name_by_idx() retrieves the name of an attribute that is * attached to an object, which is specified by its location and @@ -584,7 +584,7 @@ H5_DLL hid_t H5Aget_space(hid_t attr_id); * \attr_id * * \return Returns the amount of storage size allocated for the attribute; - * otherwise returns 0 (zero). + * otherwise, returns 0 (zero). * * \details H5Aget_storage_size() returns the amount of storage that is * required for the specified attribute, \p attr_id. @@ -687,7 +687,7 @@ H5_DLL herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t ord * * \return \herr_t * Further note that this function returns the return value of - * the last operator if it was non-zero, which can be a negative + * the last operator if it is non-zero, which can be a negative * value, zero if all attributes were processed, or a positive value * indicating short-circuit success. * @@ -1150,7 +1150,7 @@ H5_DLL hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t spa * * \fgdt_loc_id * - * \return Returns the number of attributes if successful; otherwise returns + * \return Returns the number of attributes if successful; otherwise, returns * a negative value. * * \deprecation_note{H5Oget_info(), H5Oget_info_by_name(), and H5Oget_info_by_idx()} @@ -1207,8 +1207,8 @@ H5_DLL herr_t H5Aiterate1(hid_t loc_id, unsigned *idx, H5A_operator1_t op, void * * \deprecation_note{H5Aopen_by_idx()} * - * \details H5Aopen_idx() opens an attribute which is attached to the - * object specified with \p loc_id . The location object may be + * \details H5Aopen_idx() opens an attribute that is attached to the + * object specified with \p loc_id. The location object may be * either a group, dataset, or named datatype, all of which may * have any sort of attribute. The attribute specified by the index, * \p idx , indicates the attribute to access. The value of \p idx diff --git a/src/H5B2module.h b/src/H5B2module.h index 6a3131b..8eaea2f 100644 --- a/src/H5B2module.h +++ b/src/H5B2module.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5B2 package. Including this header means that the source file - * is part of the H5B2 package. + * Purpose: This file contains declarations which define macros for the + * H5B2 package. Including this header means that the source file + * is part of the H5B2 package. */ #ifndef H5B2module_H #define H5B2module_H diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index 626ae2f..668ea5d 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Monday, January 31, 2005 - * - * Purpose: This file contains declarations which are visible only within - * the H5B2 package. Source files outside the H5B2 package should - * include H5B2private.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5B2 package. Source files outside the H5B2 package should + * include H5B2private.h instead. */ #if !(defined H5B2_FRIEND || defined H5B2_MODULE) #error "Do not include this file outside the H5B2 package!" diff --git a/src/H5Bmodule.h b/src/H5Bmodule.h index 9c0f73b..0ded756 100644 --- a/src/H5Bmodule.h +++ b/src/H5Bmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5B package. Including this header means that the source file - * is part of the H5B package. + * Purpose: This file contains declarations which define macros for the + * H5B package. Including this header means that the source file + * is part of the H5B package. */ #ifndef H5Bmodule_H #define H5Bmodule_H diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 3147315..ef9f56e 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, May 15, 2003 - * - * Purpose: This file contains declarations which are visible only within - * the H5B package. Source files outside the H5B package should - * include H5Bprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5B package. Source files outside the H5B package should + * include H5Bprivate.h instead. */ #if !(defined H5B_FRIEND || defined H5B_MODULE) #error "Do not include this file outside the H5B package!" diff --git a/src/H5C.c b/src/H5C.c index 4262f00..8a97e47 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -93,43 +93,30 @@ typedef H5C_cache_entry_t *H5C_cache_entry_ptr_t; /********************/ static herr_t H5C__pin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); - static herr_t H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t update_rp); - static herr_t H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t update_rp); - static herr_t H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted); - static herr_t H5C__autoadjust__ageout(H5F_t *f, double hit_rate, enum H5C_resize_status *status_ptr, size_t *new_max_cache_size_ptr, hbool_t write_permitted); - static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t *cache_ptr); - static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitted); - static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t *cache_ptr); - static herr_t H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr); - static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr); - static herr_t H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t new_entry_size); - static herr_t H5C__flush_invalidate_cache(H5F_t *f, unsigned flags); - static herr_t H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); - static herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); - -static void *H5C__load_entry(H5F_t *f, +static void *H5C__load_entry(H5F_t *f, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ const H5C_class_t *type, haddr_t addr, void *udata); static herr_t H5C__mark_flush_dep_dirty(H5C_cache_entry_t *entry); - static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t *entry); +static herr_t H5C__mark_flush_dep_serialized(H5C_cache_entry_t *entry); +static herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t *entry); static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring); static herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); @@ -179,88 +166,11 @@ H5FL_SEQ_DEFINE_STATIC(H5C_cache_entry_ptr_t); * flag to determine whether writes are permitted. * * Return: Success: Pointer to the new instance. - * * Failure: NULL * * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/20/04 - * Updated for the addition of the hash table. - * - * JRM -- 10/5/04 - * Added call to H5C_reset_cache_hit_rate_stats(). Also - * added initialization for cache_is_full flag and for - * resize_ctl. - * - * JRM -- 11/12/04 - * Added initialization for the new size_decreased field. - * - * JRM -- 11/17/04 - * Added/updated initialization for the automatic cache - * size control data structures. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of - * the H5C_t structure. - * - * JRM -- 7/5/05 - * Added the new log_flush parameter and supporting code. - * - * JRM -- 9/21/05 - * Added the new aux_ptr parameter and supporting code. - * - * JRM -- 1/20/06 - * Added initialization of the new prefix field in H5C_t. - * - * JRM -- 3/16/06 - * Added initialization for the pinned entry related fields. - * - * JRM -- 5/31/06 - * Added initialization for the trace_file_ptr field. - * - * JRM -- 8/19/06 - * Added initialization for the flush_in_progress field. - * - * JRM -- 8/25/06 - * Added initialization for the slist_len_increase and - * slist_size_increase fields. These fields are used - * for sanity checking in the flush process, and are not - * compiled in unless H5C_DO_SANITY_CHECKS is TRUE. - * - * JRM -- 3/28/07 - * Added initialization for the new is_read_only and - * ro_ref_count fields. - * - * JRM -- 7/27/07 - * Added initialization for the new evictions_enabled - * field of H5C_t. - * - * JRM -- 12/31/07 - * Added initialization for the new flash cache size increase - * related fields of H5C_t. - * - * JRM -- 11/5/08 - * Added initialization for the new clean_index_size and - * dirty_index_size fields of H5C_t. - * - * - * Missing entries? - * - * - * JRM -- 4/20/20 - * Added initialization for the slist_enabled field. Recall - * that the slist is used to flush metadata cache entries - * in (roughly) increasing address order. While this is - * needed at flush and close, it is not used elsewhere. - * The slist_enabled field exists to allow us to construct - * the slist when needed, and leave it empty otherwise -- thus - * avoiding the overhead of maintaining it. - * - * JRM -- 4/29/20 - * *------------------------------------------------------------------------- */ H5C_t * @@ -351,7 +261,7 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->num_objs_corked = 0; /* slist field initializations */ - cache_ptr->slist_enabled = !H5C__SLIST_OPT_ENABLED; + cache_ptr->slist_enabled = FALSE; cache_ptr->slist_changed = FALSE; cache_ptr->slist_len = 0; cache_ptr->slist_size = (size_t)0; @@ -414,33 +324,33 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, cache_ptr->resize_in_progress = FALSE; cache_ptr->msic_in_progress = FALSE; - (cache_ptr->resize_ctl).version = H5C__CURR_AUTO_SIZE_CTL_VER; - (cache_ptr->resize_ctl).rpt_fcn = NULL; - (cache_ptr->resize_ctl).set_initial_size = FALSE; - (cache_ptr->resize_ctl).initial_size = H5C__DEF_AR_INIT_SIZE; - (cache_ptr->resize_ctl).min_clean_fraction = H5C__DEF_AR_MIN_CLEAN_FRAC; - (cache_ptr->resize_ctl).max_size = H5C__DEF_AR_MAX_SIZE; - (cache_ptr->resize_ctl).min_size = H5C__DEF_AR_MIN_SIZE; - (cache_ptr->resize_ctl).epoch_length = H5C__DEF_AR_EPOCH_LENGTH; - - (cache_ptr->resize_ctl).incr_mode = H5C_incr__off; - (cache_ptr->resize_ctl).lower_hr_threshold = H5C__DEF_AR_LOWER_THRESHHOLD; - (cache_ptr->resize_ctl).increment = H5C__DEF_AR_INCREMENT; - (cache_ptr->resize_ctl).apply_max_increment = TRUE; - (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT; - - (cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off; - (cache_ptr->resize_ctl).flash_multiple = 1.0; - (cache_ptr->resize_ctl).flash_threshold = 0.25; - - (cache_ptr->resize_ctl).decr_mode = H5C_decr__off; - (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; - (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT; - (cache_ptr->resize_ctl).apply_max_decrement = TRUE; - (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT; - (cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT; - (cache_ptr->resize_ctl).apply_empty_reserve = TRUE; - (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; + cache_ptr->resize_ctl.version = H5C__CURR_AUTO_SIZE_CTL_VER; + cache_ptr->resize_ctl.rpt_fcn = NULL; + cache_ptr->resize_ctl.set_initial_size = FALSE; + cache_ptr->resize_ctl.initial_size = H5C__DEF_AR_INIT_SIZE; + cache_ptr->resize_ctl.min_clean_fraction = H5C__DEF_AR_MIN_CLEAN_FRAC; + cache_ptr->resize_ctl.max_size = H5C__DEF_AR_MAX_SIZE; + cache_ptr->resize_ctl.min_size = H5C__DEF_AR_MIN_SIZE; + cache_ptr->resize_ctl.epoch_length = H5C__DEF_AR_EPOCH_LENGTH; + + cache_ptr->resize_ctl.incr_mode = H5C_incr__off; + cache_ptr->resize_ctl.lower_hr_threshold = H5C__DEF_AR_LOWER_THRESHHOLD; + cache_ptr->resize_ctl.increment = H5C__DEF_AR_INCREMENT; + cache_ptr->resize_ctl.apply_max_increment = TRUE; + cache_ptr->resize_ctl.max_increment = H5C__DEF_AR_MAX_INCREMENT; + + cache_ptr->resize_ctl.flash_incr_mode = H5C_flash_incr__off; + cache_ptr->resize_ctl.flash_multiple = 1.0; + cache_ptr->resize_ctl.flash_threshold = 0.25; + + cache_ptr->resize_ctl.decr_mode = H5C_decr__off; + cache_ptr->resize_ctl.upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; + cache_ptr->resize_ctl.decrement = H5C__DEF_AR_DECREMENT; + cache_ptr->resize_ctl.apply_max_decrement = TRUE; + cache_ptr->resize_ctl.max_decrement = H5C__DEF_AR_MAX_DECREMENT; + cache_ptr->resize_ctl.epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT; + cache_ptr->resize_ctl.apply_empty_reserve = TRUE; + cache_ptr->resize_ctl.empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; cache_ptr->epoch_markers_active = 0; @@ -561,12 +471,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case increase: - HDassert(hit_rate < (cache_ptr->resize_ctl).lower_hr_threshold); + HDassert(hit_rate < cache_ptr->resize_ctl.lower_hr_threshold); HDassert(old_max_cache_size < new_max_cache_size); HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n", - cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold); - + cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.lower_hr_threshold); HDfprintf(stdout, "%scache size increased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, new_max_cache_size, new_min_clean_size); break; @@ -575,9 +484,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, HDassert(old_max_cache_size < new_max_cache_size); HDfprintf(stdout, "%sflash cache resize(%d) -- size threshold = %zu.\n", cache_ptr->prefix, - (int)((cache_ptr->resize_ctl).flash_incr_mode), - cache_ptr->flash_size_increase_threshold); - + (int)(cache_ptr->resize_ctl.flash_incr_mode), cache_ptr->flash_size_increase_threshold); HDfprintf(stdout, "%s cache size increased from (%zu/%zu) to (%zu/%zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, new_max_cache_size, new_min_clean_size); break; @@ -585,20 +492,19 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, case decrease: HDassert(old_max_cache_size > new_max_cache_size); - switch ((cache_ptr->resize_ctl).decr_mode) { + switch (cache_ptr->resize_ctl.decr_mode) { case H5C_decr__off: HDfprintf(stdout, "%sAuto cache resize -- decrease off. HR = %lf\n", cache_ptr->prefix, hit_rate); break; case H5C_decr__threshold: - HDassert(hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold); + HDassert(hit_rate > cache_ptr->resize_ctl.upper_hr_threshold); HDfprintf(stdout, "%sAuto cache resize -- decrease by threshold. HR = %lf > %6.5lf\n", - cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); - + cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.upper_hr_threshold); HDfprintf(stdout, "%sout of bounds high (%6.5lf).\n", cache_ptr->prefix, - (cache_ptr->resize_ctl).upper_hr_threshold); + cache_ptr->resize_ctl.upper_hr_threshold); break; case H5C_decr__age_out: @@ -607,11 +513,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case H5C_decr__age_out_with_threshold: - HDassert(hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold); + HDassert(hit_rate > cache_ptr->resize_ctl.upper_hr_threshold); HDfprintf(stdout, "%sAuto cache resize -- decrease by ageout with threshold. HR = %lf > %6.5lf\n", - cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); + cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.upper_hr_threshold); break; default: @@ -625,7 +531,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, case at_max_size: HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n", - cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold); + cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.lower_hr_threshold); HDfprintf(stdout, "%s cache already at maximum size so no change.\n", cache_ptr->prefix); break; @@ -646,10 +552,10 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case not_full: - HDassert(hit_rate < (cache_ptr->resize_ctl).lower_hr_threshold); + HDassert(hit_rate < cache_ptr->resize_ctl.lower_hr_threshold); HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n", - cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold); + cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.lower_hr_threshold); HDfprintf(stdout, "%s cache not full so no increase in size.\n", cache_ptr->prefix); break; @@ -691,10 +597,7 @@ H5C_prep_for_file_close(H5F_t *f) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - /* For now at least, it is possible to receive the - * close warning more than once -- the following - * if statement handles this. - */ + /* It is possible to receive the close warning more than once */ if (cache_ptr->close_warning_received) HGOTO_DONE(SUCCEED) cache_ptr->close_warning_received = TRUE; @@ -707,8 +610,8 @@ H5C_prep_for_file_close(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cache image") #ifdef H5_HAVE_PARALLEL - if ((H5F_INTENT(f) & H5F_ACC_RDWR) && (!image_generated) && (cache_ptr->aux_ptr != NULL) && - (f->shared->fs_persist)) { + if ((H5F_INTENT(f) & H5F_ACC_RDWR) && !image_generated && cache_ptr->aux_ptr != NULL && + f->shared->fs_persist) { /* If persistent free space managers are enabled, flushing the * metadata cache may result in the deletion, insertion, and/or * dirtying of entries. @@ -759,34 +662,22 @@ done: * This function fails if any object are protected since the * resulting file might not be consistent. * - * Note that *cache_ptr has been freed upon successful return. + * Note: *cache_ptr has been freed upon successful return. * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 5/15/20 - * - * Updated the function to enable the slist prior to the - * call to H5C__flush_invalidate_cache(). - * - * Arguably, it shouldn't be necessary to re-enable the - * slist after the call to H5C__flush_invalidate_cache(), as - * the metadata cache should be discarded. However, in the - * test code, we make multiple calls to H5C_dest(). Thus - * we re-enable the slist on failure if it and the cache - * still exist. - * *------------------------------------------------------------------------- */ herr_t H5C_dest(H5F_t *f) { - H5C_t *cache_ptr = f->shared->cache; - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t *cache_ptr = f->shared->cache; + H5C_tag_info_t *item = NULL; + H5C_tag_info_t *tmp = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -802,21 +693,16 @@ H5C_dest(H5F_t *f) /* Enable the slist, as it is needed in the flush */ if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") /* Flush and invalidate all cache entries */ if (H5C__flush_invalidate_cache(f, H5C__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") /* Generate & write cache image if requested */ - if (cache_ptr->image_ctl.generate_image) { - + if (cache_ptr->image_ctl.generate_image) if (H5C__generate_cache_image(f, cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "Can't generate metadata cache image") - } /* Question: Is it possible for cache_ptr->slist be non-null at this * point? If no, shouldn't this if statement be an assert? @@ -826,12 +712,9 @@ H5C_dest(H5F_t *f) HDassert(cache_ptr->slist_size == 0); H5SL_close(cache_ptr->slist_ptr); - cache_ptr->slist_ptr = NULL; } - H5C_tag_info_t *item = NULL; - H5C_tag_info_t *tmp = NULL; HASH_ITER(hh, cache_ptr->tag_list, item, tmp) { HASH_DELETE(hh, cache_ptr->tag_list, item); @@ -843,12 +726,9 @@ H5C_dest(H5F_t *f) #ifndef NDEBUG #ifdef H5C_DO_SANITY_CHECKS - - if (cache_ptr->get_entry_ptr_from_addr_counter > 0) { - + if (cache_ptr->get_entry_ptr_from_addr_counter > 0) HDfprintf(stdout, "*** %" PRId64 " calls to H5C_get_entry_ptr_from_add(). ***\n", cache_ptr->get_entry_ptr_from_addr_counter); - } #endif /* H5C_DO_SANITY_CHECKS */ cache_ptr->magic = 0; @@ -857,18 +737,17 @@ H5C_dest(H5F_t *f) cache_ptr = H5FL_FREE(H5C_t, cache_ptr); done: - - if ((ret_value < 0) && (cache_ptr) && (cache_ptr->slist_ptr)) { - - /* need this for test code -- see change note for details */ - + if (ret_value < 0 && cache_ptr && cache_ptr->slist_ptr) + /* Arguably, it shouldn't be necessary to re-enable the slist after + * the call to H5C__flush_invalidate_cache(), as the metadata cache + * should be discarded. However, in the test code, we make multiple + * calls to H5C_dest(). Thus we re-enable the slist on failure if it + * and the cache still exist. JRM -- 5/15/20 + */ if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) - HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist on flush dest failure failed") - } FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_dest() */ /*------------------------------------------------------------------------- @@ -881,14 +760,6 @@ done: * Programmer: Vailin Choi * Dec 2013 * - * Modifications: - * - * JRM -- 5/5/20 - * - * Added code to enable the skip list prior to the call - * to H5C__flush_invalidate_cache(), and disable it - * afterwards. - * *------------------------------------------------------------------------- */ herr_t @@ -903,17 +774,14 @@ H5C_evict(H5F_t *f) /* Enable the slist, as it is needed in the flush */ if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") /* Flush and invalidate all cache entries except the pinned entries */ if (H5C__flush_invalidate_cache(f, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict entries in the cache") /* Disable the slist */ if (H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist disabled failed") done: @@ -923,9 +791,9 @@ done: /*------------------------------------------------------------------------- * Function: H5C_expunge_entry * - * Purpose: Use this function to tell the cache to expunge an entry - * from the cache without writing it to disk even if it is - * dirty. The entry may not be either pinned or protected. + * Purpose: Expunge an entry from the cache without writing it to disk + * even if it is dirty. The entry may not be either pinned or + * protected. * * Return: Non-negative on success/Negative on failure * @@ -953,7 +821,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag HDassert(H5F_addr_defined(addr)); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if (H5C_validate_lru_list(cache_ptr) < 0) + if (H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -988,7 +856,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if (H5C_validate_lru_list(cache_ptr) < 0) + if (H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1007,39 +875,11 @@ done: * function returns failure. * * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. + * a request to flush all items and an entry was protected. * * Programmer: John Mainzer * 6/2/04 * - * Changes: Modified function to test for slist chamges in - * pre_serialize and serialize callbacks, and re-start - * scans through the slist when such changes occur. - * - * This has been a potential problem for some time, - * and there has been code in this function to deal - * with elements of this issue. However the shift - * to the V3 cache in combination with the activities - * of some of the cache clients (in particular the - * free space manager and the fractal heap) have - * made this re-work necessary. - * - * JRM -- 12/13/14 - * - * Modified function to support rings. Basic idea is that - * every entry in the cache is assigned to a ring. Entries - * in the outermost ring are flushed first, followed by - * those in the next outermost ring, and so on until the - * innermost ring is flushed. See header comment on - * H5C_ring_t in H5Cprivate.h for a more detailed - * discussion. - * - * JRM -- 8/30/15 - * - * Modified function to call the free space manager - * settling functions. - * JRM -- 6/9/16 - * *------------------------------------------------------------------------- */ herr_t @@ -1095,8 +935,8 @@ H5C_flush_cache(H5F_t *f, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1116,7 +956,6 @@ H5C_flush_cache(H5F_t *f, unsigned flags) */ ring = H5C_RING_USER; while (ring < H5C_RING_NTYPES) { - /* Only call the free space manager settle routines when close * warning has been received. */ @@ -1226,8 +1065,6 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * Observe that this function cannot occasion a read. - * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer @@ -1271,8 +1108,8 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u #ifdef H5C_DO_EXTREME_SANITY_CHECKS /* no need to verify that entry is not already in the index as */ /* we already make that check below. */ - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1443,9 +1280,6 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u * oversized at the end of an unprotect. As a result, it is * possible to have a vastly oversized cache with no protected * entries as long as all the protects precede the unprotects. - * - * Since items 1 and 2 are not changing any time soon, I see - * no point in worrying about the third. */ if (H5C__make_space_in_cache(f, space_needed, write_permitted) < 0) @@ -1461,8 +1295,8 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL) #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1500,8 +1334,8 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1531,12 +1365,6 @@ done: * Programmer: John Mainzer * 5/15/06 * - * JRM -- 11/5/08 - * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY() to - * update the new clean_index_size and dirty_index_size - * fields of H5C_t in the case that the entry was clean - * prior to this call, and is pinned and not protected. - * *------------------------------------------------------------------------- */ herr_t @@ -1587,7 +1415,7 @@ H5C_mark_entry_dirty(void *thing) /* Modify cache data structures */ if (was_clean) - H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) + H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr, FAIL) if (!entry_ptr->in_slist) H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) @@ -1670,7 +1498,7 @@ H5C_mark_entry_clean(void *_thing) /* Modify cache data structures */ if (was_dirty) - H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr) + H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr, FAIL) if (entry_ptr->in_slist) H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE) @@ -1825,8 +1653,8 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd HDassert(H5F_addr_ne(old_addr, new_addr)); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1931,8 +1759,8 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1978,7 +1806,7 @@ H5C_resize_entry(void *thing, size_t new_size) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??") #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2007,41 +1835,35 @@ H5C_resize_entry(void *thing, size_t new_size) /* do a flash cache size increase if appropriate */ if (cache_ptr->flash_size_increase_possible) { - if (new_size > entry_ptr->size) { size_t size_increase; size_increase = new_size - entry_ptr->size; - - if (size_increase >= cache_ptr->flash_size_increase_threshold) { + if (size_increase >= cache_ptr->flash_size_increase_threshold) if (H5C__flash_increase_cache_size(cache_ptr, entry_ptr->size, new_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "flash cache increase failed") - } } } /* update the pinned and/or protected entry list */ - if (entry_ptr->is_pinned) { - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), (cache_ptr->pel_size), (entry_ptr->size), - (new_size)) - } /* end if */ - if (entry_ptr->is_protected) { - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pl_len), (cache_ptr->pl_size), (entry_ptr->size), - (new_size)) - } /* end if */ + if (entry_ptr->is_pinned) + H5C__DLL_UPDATE_FOR_SIZE_CHANGE(cache_ptr->pel_len, cache_ptr->pel_size, entry_ptr->size, + new_size, FAIL) + if (entry_ptr->is_protected) + H5C__DLL_UPDATE_FOR_SIZE_CHANGE(cache_ptr->pl_len, cache_ptr->pl_size, entry_ptr->size, new_size, + FAIL) #ifdef H5_HAVE_PARALLEL - if (entry_ptr->coll_access) { - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->coll_list_len), (cache_ptr->coll_list_size), - (entry_ptr->size), (new_size)) - } /* end if */ -#endif /* H5_HAVE_PARALLEL */ + if (entry_ptr->coll_access) + H5C__DLL_UPDATE_FOR_SIZE_CHANGE(cache_ptr->coll_list_len, cache_ptr->coll_list_size, + entry_ptr->size, new_size, FAIL) +#endif /* H5_HAVE_PARALLEL */ /* update statistics just before changing the entry size */ H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size); /* update the hash table */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_size, entry_ptr, was_clean); + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_size, entry_ptr, was_clean, FAIL); /* if the entry is in the skip list, update that too */ if (entry_ptr->in_slist) @@ -2074,7 +1896,7 @@ H5C_resize_entry(void *thing, size_t new_size) done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || (H5C_validate_pinned_entry_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2092,9 +1914,6 @@ done: * Programmer: John Mainzer * 4/26/06 * - * Changes: Added extreme sanity checks on entry and exit. - * JRM -- 4/26/14 - * *------------------------------------------------------------------------- */ herr_t @@ -2114,8 +1933,8 @@ H5C_pin_protected_entry(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2129,8 +1948,8 @@ H5C_pin_protected_entry(void *thing) done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2193,8 +2012,8 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign HDassert(H5F_addr_defined(addr)); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2242,16 +2061,16 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign if (entry_ptr->type != type) HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, NULL, "incorrect cache entry type") - /* if this is a collective metadata read, the entry is not - marked as collective, and is clean, it is possible that - other processes will not have it in its cache and will - expect a bcast of the entry from process 0. So process 0 - will bcast the entry to all other ranks. Ranks that _do_ have - the entry in their cache still have to participate in the - bcast. */ #ifdef H5_HAVE_PARALLEL + /* If this is a collective metadata read, the entry is not marked as + * collective, and is clean, it is possible that other processes will + * not have it in its cache and will expect a bcast of the entry from + * process 0. So process 0 will bcast the entry to all other ranks. + * Ranks that _do_ have the entry in their cache still have to + * participate in the bcast. + */ if (coll_access) { - if (!(entry_ptr->is_dirty) && !(entry_ptr->coll_access)) { + if (!entry_ptr->is_dirty && !entry_ptr->coll_access) { MPI_Comm comm; /* File MPI Communicator */ int mpi_code; /* MPI error code */ int buf_size; @@ -2272,14 +2091,11 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ - if (0 == mpi_rank) { - if (H5C__generate_image(f, cache_ptr, entry_ptr) < 0) { - /* If image generation fails, push an error but - * still participate in the following MPI_Bcast - */ - HDONE_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't generate entry's image") - } - } + if (0 == mpi_rank && H5C__generate_image(f, cache_ptr, entry_ptr) < 0) + /* If image generation fails, push an error but + * still participate in the following MPI_Bcast + */ + HDONE_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't generate entry's image") } /* end if */ HDassert(entry_ptr->image_ptr); @@ -2291,11 +2107,10 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign entry_ptr->coll_access = TRUE; H5C__INSERT_IN_COLL_LIST(cache_ptr, entry_ptr, NULL) } /* end if */ - else if (entry_ptr->coll_access) { + else if (entry_ptr->coll_access) H5C__MOVE_TO_TOP_IN_COLL_LIST(cache_ptr, entry_ptr, NULL) - } /* end else-if */ - } /* end if */ -#endif /* H5_HAVE_PARALLEL */ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ #ifdef H5C_DO_TAGGING_SANITY_CHECKS { @@ -2322,11 +2137,8 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign thing = (void *)entry_ptr; } else { - /* must try to load the entry from disk. */ - hit = FALSE; - if (NULL == (thing = H5C__load_entry(f, #ifdef H5_HAVE_PARALLEL coll_access, @@ -2350,12 +2162,10 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign /* If the entry is very large, and we are configured to allow it, * we may wish to perform a flash cache size increase. */ - if ((cache_ptr->flash_size_increase_possible) && - (entry_ptr->size > cache_ptr->flash_size_increase_threshold)) { - + if (cache_ptr->flash_size_increase_possible && + (entry_ptr->size > cache_ptr->flash_size_increase_threshold)) if (H5C__flash_increase_cache_size(cache_ptr, 0, entry_ptr->size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__flash_increase_cache_size failed") - } if (cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; @@ -2366,7 +2176,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign * that if evictions are enabled, we will call H5C__make_space_in_cache() * regardless if the min_free_space requirement is not met. */ - if ((cache_ptr->evictions_enabled) && + if (cache_ptr->evictions_enabled && (((cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size) || ((empty_space + cache_ptr->clean_index_size) < cache_ptr->min_clean_size))) { @@ -2415,24 +2225,16 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign * oversized at the end of an unprotect. As a result, it is * possible to have a vastly oversized cache with no protected * entries as long as all the protects precede the unprotects. - * - * Since items 1, 2, and 3 are not changing any time soon, I - * see no point in worrying about the fourth. */ - if (H5C__make_space_in_cache(f, space_needed, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") } /* end if */ - /* Insert the entry in the hash table. It can't be dirty yet, so - * we don't even check to see if it should go in the skip list. - * - * This is no longer true -- due to a bug fix, we may modify - * data on load to repair a file. + /* Insert the entry in the hash table. * * ******************************************* * - * Set the flush_last field + * Set the flush_me_last field * of the newly loaded entry before inserting it into the * index. Must do this, as the index tracked the number of * entries with the flush_last field set, but assumes that @@ -2444,11 +2246,8 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign entry_ptr->flush_me_last = flush_last; H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, NULL) - - if ((entry_ptr->is_dirty) && (!(entry_ptr->in_slist))) { - + if (entry_ptr->is_dirty && !entry_ptr->in_slist) H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, NULL) - } /* insert the entry in the data structures used by the replacement * policy. We are just going to take it out again when we update @@ -2477,28 +2276,23 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL) entry_ptr->is_protected = TRUE; - if (read_only) { entry_ptr->is_read_only = TRUE; entry_ptr->ro_ref_count = 1; } /* end if */ - entry_ptr->dirtied = FALSE; } /* end else */ H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) - H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) ret_value = thing; - if ((cache_ptr->evictions_enabled) && - ((cache_ptr->size_decreased) || - ((cache_ptr->resize_enabled) && - (cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length)))) { + if (cache_ptr->evictions_enabled && + (cache_ptr->size_decreased || + (cache_ptr->resize_enabled && (cache_ptr->cache_accesses >= cache_ptr->resize_ctl.epoch_length)))) { if (!have_write_permitted) { - if (cache_ptr->check_write_permitted != NULL) { if ((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted") @@ -2506,19 +2300,14 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign have_write_permitted = TRUE; } else { - - write_permitted = cache_ptr->write_permitted; - + write_permitted = cache_ptr->write_permitted; have_write_permitted = TRUE; } } - if (cache_ptr->resize_enabled && - (cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length)) { - + if (cache_ptr->resize_enabled && (cache_ptr->cache_accesses >= cache_ptr->resize_ctl.epoch_length)) if (H5C__auto_adjust_cache_size(f, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed") - } /* end if */ if (cache_ptr->size_decreased) { cache_ptr->size_decreased = FALSE; @@ -2531,7 +2320,6 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign * should also call H5C__make_space_in_cache() to bring us * into compliance. */ - if (cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; else @@ -2554,14 +2342,13 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign * the cache and protected. We must wait until it is protected so it is not * evicted during the notify callback. */ - if (was_loaded) { + if (was_loaded) /* If the entry's type has a 'notify' callback send a 'after load' * notice now that the entry is fully integrated into the cache. */ if (entry_ptr->type->notify && (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_LOAD, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, NULL, "can't notify client about entry inserted into cache") - } /* end if */ #ifdef H5_HAVE_PARALLEL /* Make sure the size of the collective entries in the cache remain in check */ @@ -2581,8 +2368,8 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -2689,7 +2476,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown incr_mode?!?!?") } /* end switch */ - /* logically, this is were configuration for flash cache size increases + /* logically, this is where configuration for flash cache size increases * should go. However, this configuration depends on max_cache_size, so * we wait until the end of the function, when this field is set. */ @@ -2700,21 +2487,21 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p break; case H5C_decr__threshold: - if ((config_ptr->upper_hr_threshold >= 1.0) || (config_ptr->decrement >= 1.0) || - ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0))) + if (config_ptr->upper_hr_threshold >= 1.0 || config_ptr->decrement >= 1.0 || + (config_ptr->apply_max_decrement && config_ptr->max_decrement <= 0)) cache_ptr->size_decrease_possible = FALSE; break; case H5C_decr__age_out: - if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) || - ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0))) + if ((config_ptr->apply_empty_reserve && config_ptr->empty_reserve >= 1.0) || + (config_ptr->apply_max_decrement && config_ptr->max_decrement <= 0)) cache_ptr->size_decrease_possible = FALSE; break; case H5C_decr__age_out_with_threshold: - if (((config_ptr->apply_empty_reserve) && (config_ptr->empty_reserve >= 1.0)) || - ((config_ptr->apply_max_decrement) && (config_ptr->max_decrement <= 0)) || - (config_ptr->upper_hr_threshold >= 1.0)) + if ((config_ptr->apply_empty_reserve && config_ptr->empty_reserve >= 1.0) || + (config_ptr->apply_max_decrement && config_ptr->max_decrement <= 0) || + config_ptr->upper_hr_threshold >= 1.0) cache_ptr->size_decrease_possible = FALSE; break; @@ -2732,8 +2519,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p * following: */ cache_ptr->resize_enabled = cache_ptr->size_increase_possible || cache_ptr->size_decrease_possible; - - cache_ptr->resize_ctl = *config_ptr; + cache_ptr->resize_ctl = *config_ptr; /* Resize the cache to the supplied initial value if requested, or as * necessary to force it within the bounds of the current automatic @@ -2752,7 +2538,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p else new_max_cache_size = cache_ptr->max_cache_size; - new_min_clean_size = (size_t)((double)new_max_cache_size * ((cache_ptr->resize_ctl).min_clean_fraction)); + new_min_clean_size = (size_t)((double)new_max_cache_size * (cache_ptr->resize_ctl.min_clean_fraction)); /* since new_min_clean_size is of type size_t, we have * @@ -2793,7 +2579,6 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p * If we haven't already ruled out flash cache size increases above, * go ahead and configure it. */ - if (cache_ptr->flash_size_increase_possible) { switch (config_ptr->flash_incr_mode) { case H5C_flash_incr__off: @@ -2803,8 +2588,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p case H5C_flash_incr__add_space: cache_ptr->flash_size_increase_possible = TRUE; cache_ptr->flash_size_increase_threshold = - (size_t)(((double)(cache_ptr->max_cache_size)) * - ((cache_ptr->resize_ctl).flash_threshold)); + (size_t)(((double)(cache_ptr->max_cache_size)) * (cache_ptr->resize_ctl.flash_threshold)); break; default: /* should be unreachable */ @@ -2842,8 +2626,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) /* There is no fundamental reason why we should not permit * evictions to be disabled while automatic resize is enabled. - * However, I can't think of any good reason why one would - * want to, and allowing it would greatly complicate testing + * However, allowing it would greatly complicate testing * the feature. Hence the following: */ if ((evictions_enabled != TRUE) && ((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || @@ -2912,10 +2695,6 @@ done: * Programmer: John Mainzer * 5/1/20 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -2927,24 +2706,13 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli FUNC_ENTER_NOAPI(FAIL) if ((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry") -#if H5C__SLIST_OPT_ENABLED - if (slist_enabled) { - - if (cache_ptr->slist_enabled) { - - HDassert(FALSE); + if (cache_ptr->slist_enabled) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist already enabled?") - } - - if ((cache_ptr->slist_len != 0) || (cache_ptr->slist_size != 0)) { - - HDassert(FALSE); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty (1)?") - } + if ((cache_ptr->slist_len != 0) || (cache_ptr->slist_size != 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty?") /* set cache_ptr->slist_enabled to TRUE so that the slist * maintenance macros will be enabled. @@ -2953,16 +2721,10 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli /* scan the index list and insert all dirty entries in the slist */ entry_ptr = cache_ptr->il_head; - while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - - if (entry_ptr->is_dirty) { - + if (entry_ptr->is_dirty) H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) - } - entry_ptr = entry_ptr->il_next; } @@ -2975,35 +2737,22 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli HDassert(cache_ptr->dirty_index_size == cache_ptr->slist_size); } else { /* take down the skip list */ - - if (!cache_ptr->slist_enabled) { - - HDassert(FALSE); + if (!cache_ptr->slist_enabled) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist already disabled?") - } if ((cache_ptr->slist_len != 0) || (cache_ptr->slist_size != 0)) { - if (clear_slist) { - H5SL_node_t *node_ptr; node_ptr = H5SL_first(cache_ptr->slist_ptr); - while (node_ptr != NULL) { - entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE); - node_ptr = H5SL_first(cache_ptr->slist_ptr); } } - else { - - HDassert(FALSE); - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty (2)?") - } + else + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty?") } cache_ptr->slist_enabled = FALSE; @@ -3012,16 +2761,8 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli HDassert(0 == cache_ptr->slist_size); } -#else /* H5C__SLIST_OPT_ENABLED is FALSE */ - - HDassert(cache_ptr->slist_enabled); - -#endif /* H5C__SLIST_OPT_ENABLED is FALSE */ - done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_set_slist_enabled() */ /*------------------------------------------------------------------------- @@ -3035,9 +2776,6 @@ done: * Programmer: John Mainzer * 3/22/06 * - * Changes: Added extreme sanity checks on entry and exit. - * JRM -- 4/26/14 - * *------------------------------------------------------------------------- */ herr_t @@ -3056,8 +2794,8 @@ H5C_unpin_entry(void *_entry_ptr) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3067,8 +2805,8 @@ H5C_unpin_entry(void *_entry_ptr) done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3098,81 +2836,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated for the addition of the hash table. - * - * JRM -- 10/28/04 - * Added code to set cache_full to TRUE whenever we try to - * make space in the cache. - * - * JRM -- 11/12/04 - * Added code to call to H5C_make_space_in_cache() after the - * call to H5C__auto_adjust_cache_size() if that function - * sets the size_decreased flag is TRUE. - * - * JRM -- 4/25/05 - * The size_decreased flag can also be set to TRUE in - * H5C_set_cache_auto_resize_config() if a new configuration - * forces an immediate reduction in cache size. Modified - * the code to deal with this eventuallity. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of H5C_t. - * - * JRM -- 10/22/05 - * Hand optimizations. - * - * JRM -- 5/3/06 - * Added code to set the new dirtied field in - * H5C_cache_entry_t to FALSE prior to return. - * - * JRM -- 6/23/06 - * Modified code to allow dirty entries to be loaded from - * disk. This is necessary as a bug fix in the object - * header code requires us to modify a header as it is read. - * - * JRM -- 3/28/07 - * Added the flags parameter and supporting code. At least - * for now, this parameter is used to allow the entry to - * be protected read only, thus allowing multiple protects. - * - * Also added code to allow multiple read only protects - * of cache entries. - * - * JRM -- 7/27/07 - * Added code supporting the new evictions_enabled field - * in H5C_t. - * - * JRM -- 1/3/08 - * Added to do a flash cache size increase if appropriate - * when a large entry is loaded. - * - * JRM -- 11/13/08 - * Modified function to call H5C_make_space_in_cache() when - * the min_clean_size is violated, not just when there isn't - * enough space for and entry that has just been loaded. - * - * The purpose of this modification is to avoid "metadata - * blizzards" in the write only case. In such instances, - * the cache was allowed to fill with dirty metadata. When - * we finally needed to evict an entry to make space, we had - * to flush out a whole cache full of metadata -- which has - * interesting performance effects. We hope to avoid (or - * perhaps more accurately hide) this effect by maintaining - * the min_clean_size, which should force us to start flushing - * entries long before we actually have to evict something - * to make space. - * - * - * Missing entries? - * - * - * JRM -- 5/8/20 - * Updated for the possibility that the slist will be - * disabled. - * *------------------------------------------------------------------------- */ herr_t @@ -3225,7 +2888,6 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) HDassert(!(free_file_space && take_ownership)); entry_ptr = (H5C_cache_entry_t *)thing; - HDassert(entry_ptr->addr == addr); /* also set the dirtied variable if the dirtied field is set in @@ -3235,9 +2897,8 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) was_clean = !(entry_ptr->is_dirty); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -3246,13 +2907,11 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) * drops to zero. */ if (entry_ptr->ro_ref_count > 1) { - /* Sanity check */ HDassert(entry_ptr->is_protected); HDassert(entry_ptr->is_read_only); if (dirtied) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") /* Reduce the RO ref count */ @@ -3260,35 +2919,26 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* Pin or unpin the entry as requested. */ if (pin_entry) { - /* Pin the entry from a client */ if (H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") } else if (unpin_entry) { - /* Unpin the entry from a client */ if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") - } /* end if */ } else { - if (entry_ptr->is_read_only) { - /* Sanity check */ HDassert(entry_ptr->ro_ref_count == 1); if (dirtied) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") entry_ptr->is_read_only = FALSE; entry_ptr->ro_ref_count = 0; - } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -3318,53 +2968,37 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) #endif /* H5_HAVE_PARALLEL */ if (!entry_ptr->is_protected) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Entry already unprotected??") /* Mark the entry as dirty if appropriate */ entry_ptr->is_dirty = (entry_ptr->is_dirty || dirtied); - - if (dirtied) { - - if (entry_ptr->image_up_to_date) { - - entry_ptr->image_up_to_date = FALSE; - - if (entry_ptr->flush_dep_nparents > 0) { - - if (H5C__mark_flush_dep_unserialized(entry_ptr) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, - "Can't propagate serialization status to fd parents") - - } /* end if */ - } /* end if */ - } /* end if */ + if (dirtied && entry_ptr->image_up_to_date) { + entry_ptr->image_up_to_date = FALSE; + if (entry_ptr->flush_dep_nparents > 0) + if (H5C__mark_flush_dep_unserialized(entry_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, + "Can't propagate serialization status to fd parents") + } /* end if */ /* Check for newly dirtied entry */ if (was_clean && entry_ptr->is_dirty) { - /* Update index for newly dirtied entry */ - H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) + H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr, FAIL) /* If the entry's type has a 'notify' callback send a * 'entry dirtied' notice now that the entry is fully * integrated into the cache. */ - if ((entry_ptr->type->notify) && - ((entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_DIRTIED, entry_ptr) < 0)) - + if (entry_ptr->type->notify && + (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_DIRTIED, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag set") /* Propagate the flush dep dirty flag up the flush dependency chain * if appropriate */ - if (entry_ptr->flush_dep_nparents > 0) { - + if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_dirty(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag") - } } /* end if */ /* Check for newly clean entry */ else if (!was_clean && !entry_ptr->is_dirty) { @@ -3373,36 +3007,28 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) * 'entry cleaned' notice now that the entry is fully * integrated into the cache. */ - if ((entry_ptr->type->notify) && - ((entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0)) - + if (entry_ptr->type->notify && + (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag cleared") /* Propagate the flush dep clean flag up the flush dependency chain * if appropriate */ - if (entry_ptr->flush_dep_nparents > 0) { - + if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_clean(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Can't propagate flush dep dirty flag") - } } /* end else-if */ /* Pin or unpin the entry as requested. */ if (pin_entry) { - /* Pin the entry from a client */ if (H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") } else if (unpin_entry) { - /* Unpin the entry from a client */ if (H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") } /* end if */ @@ -3417,52 +3043,36 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) * and then add it to the skip list if it isn't there already. */ if (entry_ptr->is_dirty) { - entry_ptr->flush_marker |= set_flush_marker; - - if (!entry_ptr->in_slist) { - + if (!entry_ptr->in_slist) /* this is a no-op if cache_ptr->slist_enabled is FALSE */ H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) - } } /* end if */ - /* this implementation of the "deleted" option is a bit inefficient, as + /* This implementation of the "deleted" option is a bit inefficient, as * we re-insert the entry to be deleted into the replacement policy * data structures, only to remove them again. Depending on how often * we do this, we may want to optimize a bit. - * - * On the other hand, this implementation is reasonably clean, and - * makes good use of existing code. - * JRM - 5/19/04 */ if (deleted) { - unsigned flush_flags = (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_INVALIDATE_FLAG); /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) if (test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") - else if (test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") /* Set the 'free file space' flag for the flush, if needed */ - if (free_file_space) { - + if (free_file_space) flush_flags |= H5C__FREE_FILE_SPACE_FLAG; - } /* Set the "take ownership" flag for the flush, if needed */ - if (take_ownership) { - + if (take_ownership) flush_flags |= H5C__TAKE_OWNERSHIP_FLAG; - } /* Delete the entry from the skip list on destroy */ flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; @@ -3470,29 +3080,22 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) HDassert((!cache_ptr->slist_enabled) || (((!was_clean) || dirtied) == (entry_ptr->in_slist))); if (H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush entry") - } /* end if */ #ifdef H5_HAVE_PARALLEL else if (clear_entry) { - - /* verify that the target entry is in the cache. */ + /* Verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) if (test_entry_ptr == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "entry not in hash table?!?") - else if (test_entry_ptr != entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") if (H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry") - } /* end else if */ #endif /* H5_HAVE_PARALLEL */ } @@ -3500,16 +3103,13 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) done: - #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_unprotect() */ /*------------------------------------------------------------------------- @@ -3681,27 +3281,20 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown config version") if ((tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0) { - if (config_ptr->max_size > H5C__MAX_MAX_CACHE_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "max_size too big") - if (config_ptr->min_size < H5C__MIN_MAX_CACHE_SIZE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_size too small") - if (config_ptr->min_size > config_ptr->max_size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_size > max_size") - if (config_ptr->set_initial_size && ((config_ptr->initial_size < config_ptr->min_size) || (config_ptr->initial_size > config_ptr->max_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "initial_size must be in the interval [min_size, max_size]") - if ((config_ptr->min_clean_fraction < 0.0) || (config_ptr->min_clean_fraction > 1.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "min_clean_fraction must be in the interval [0.0, 1.0]") - if (config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too small") - if (config_ptr->epoch_length > H5C__MAX_AR_EPOCH_LENGTH) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too big") } /* H5C_RESIZE_CFG__VALIDATE_GENERAL */ @@ -3714,7 +3307,6 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) if ((config_ptr->lower_hr_threshold < 0.0) || (config_ptr->lower_hr_threshold > 1.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "lower_hr_threshold must be in the range [0.0, 1.0]") - if (config_ptr->increment < 1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "increment must be greater than or equal to 1.0") @@ -3744,18 +3336,14 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) } /* H5C_RESIZE_CFG__VALIDATE_INCREMENT */ if ((tests & H5C_RESIZE_CFG__VALIDATE_DECREMENT) != 0) { - if ((config_ptr->decr_mode != H5C_decr__off) && (config_ptr->decr_mode != H5C_decr__threshold) && (config_ptr->decr_mode != H5C_decr__age_out) && - (config_ptr->decr_mode != H5C_decr__age_out_with_threshold)) { - + (config_ptr->decr_mode != H5C_decr__age_out_with_threshold)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid decr_mode") - } if (config_ptr->decr_mode == H5C_decr__threshold) { if (config_ptr->upper_hr_threshold > 1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be <= 1.0") - if ((config_ptr->decrement > 1.0) || (config_ptr->decrement < 0.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "decrement must be in the interval [0.0, 1.0]") @@ -3766,14 +3354,12 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) if ((config_ptr->decr_mode == H5C_decr__age_out) || (config_ptr->decr_mode == H5C_decr__age_out_with_threshold)) { - if (config_ptr->epochs_before_eviction < 1) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction must be positive") if (config_ptr->epochs_before_eviction > H5C__MAX_EPOCH_MARKERS) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epochs_before_eviction too big") - - if ((config_ptr->apply_empty_reserve) && - ((config_ptr->empty_reserve > 1.0) || (config_ptr->empty_reserve < 0.0))) + if (config_ptr->apply_empty_reserve && + (config_ptr->empty_reserve > 1.0 || config_ptr->empty_reserve < 0.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "empty_reserve must be in the interval [0.0, 1.0]") /* no need to check max_decrement as it is a size_t @@ -3781,12 +3367,11 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests) */ } /* H5C_decr__age_out || H5C_decr__age_out_with_threshold */ - if (config_ptr->decr_mode == H5C_decr__age_out_with_threshold) { + if (config_ptr->decr_mode == H5C_decr__age_out_with_threshold) if ((config_ptr->upper_hr_threshold > 1.0) || (config_ptr->upper_hr_threshold < 0.0)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "upper_hr_threshold must be in the interval [0.0, 1.0]") - } /* H5C_decr__age_out_with_threshold */ - } /* H5C_RESIZE_CFG__VALIDATE_DECREMENT */ + } /* H5C_RESIZE_CFG__VALIDATE_DECREMENT */ if ((tests & H5C_RESIZE_CFG__VALIDATE_INTERACTIONS) != 0) { if ((config_ptr->incr_mode == H5C_incr__threshold) && @@ -4249,9 +3834,9 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) HDassert(f); HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - HDassert(cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length); - HDassert(0.0 <= (cache_ptr->resize_ctl).min_clean_fraction); - HDassert((cache_ptr->resize_ctl).min_clean_fraction <= 100.0); + HDassert(cache_ptr->cache_accesses >= cache_ptr->resize_ctl.epoch_length); + HDassert(0.0 <= cache_ptr->resize_ctl.min_clean_fraction); + HDassert(cache_ptr->resize_ctl.min_clean_fraction <= 100.0); /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this * is a re-entrant call via a client callback called in the resize @@ -4268,55 +3853,43 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) if (!cache_ptr->resize_enabled) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Auto cache resize disabled") - HDassert(((cache_ptr->resize_ctl).incr_mode != H5C_incr__off) || - ((cache_ptr->resize_ctl).decr_mode != H5C_decr__off)); + HDassert((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || + (cache_ptr->resize_ctl.decr_mode != H5C_decr__off)); if (H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") HDassert((0.0 <= hit_rate) && (hit_rate <= 1.0)); - switch ((cache_ptr->resize_ctl).incr_mode) { + switch (cache_ptr->resize_ctl.incr_mode) { case H5C_incr__off: if (cache_ptr->size_increase_possible) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "size_increase_possible but H5C_incr__off?!?!?") break; case H5C_incr__threshold: - if (hit_rate < (cache_ptr->resize_ctl).lower_hr_threshold) { - - if (!cache_ptr->size_increase_possible) { - + if (hit_rate < cache_ptr->resize_ctl.lower_hr_threshold) { + if (!cache_ptr->size_increase_possible) status = increase_disabled; - } - else if (cache_ptr->max_cache_size >= (cache_ptr->resize_ctl).max_size) { - - HDassert(cache_ptr->max_cache_size == (cache_ptr->resize_ctl).max_size); + else if (cache_ptr->max_cache_size >= cache_ptr->resize_ctl.max_size) { + HDassert(cache_ptr->max_cache_size == cache_ptr->resize_ctl.max_size); status = at_max_size; } - else if (!cache_ptr->cache_full) { - + else if (!cache_ptr->cache_full) status = not_full; - } else { - new_max_cache_size = - (size_t)(((double)(cache_ptr->max_cache_size)) * (cache_ptr->resize_ctl).increment); + (size_t)(((double)(cache_ptr->max_cache_size)) * cache_ptr->resize_ctl.increment); /* clip to max size if necessary */ - if (new_max_cache_size > (cache_ptr->resize_ctl).max_size) { - - new_max_cache_size = (cache_ptr->resize_ctl).max_size; - } + if (new_max_cache_size > cache_ptr->resize_ctl.max_size) + new_max_cache_size = cache_ptr->resize_ctl.max_size; /* clip to max increment if necessary */ - if (((cache_ptr->resize_ctl).apply_max_increment) && - ((cache_ptr->max_cache_size + (cache_ptr->resize_ctl).max_increment) < - new_max_cache_size)) { - - new_max_cache_size = - cache_ptr->max_cache_size + (cache_ptr->resize_ctl).max_increment; - } + if (cache_ptr->resize_ctl.apply_max_increment && + ((cache_ptr->max_cache_size + cache_ptr->resize_ctl.max_increment) < + new_max_cache_size)) + new_max_cache_size = cache_ptr->max_cache_size + cache_ptr->resize_ctl.max_increment; status = increase; } @@ -4331,7 +3904,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) * must run the marker maintenance code, whether we run the size * reduction code or not. We do this in two places -- here we * insert a new marker if the number of active epoch markers is - * is less than the the current epochs before eviction, and after + * is less than the current epochs before eviction, and after * the ageout call, we cycle the markers. * * However, we can't call the ageout code or cycle the markers @@ -4339,9 +3912,9 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) * entry. The inserted_epoch_marker flag is used to track this. */ - if ((((cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out) || - ((cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold)) && - (cache_ptr->epoch_markers_active < (cache_ptr->resize_ctl).epochs_before_eviction)) { + if (((cache_ptr->resize_ctl.decr_mode == H5C_decr__age_out) || + (cache_ptr->resize_ctl.decr_mode == H5C_decr__age_out_with_threshold)) && + (cache_ptr->epoch_markers_active < cache_ptr->resize_ctl.epochs_before_eviction)) { if (H5C__autoadjust__ageout__insert_new_marker(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't insert new epoch marker") @@ -4355,42 +3928,32 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) */ if (status == in_spec) { - - switch ((cache_ptr->resize_ctl).decr_mode) { + switch (cache_ptr->resize_ctl.decr_mode) { case H5C_decr__off: break; case H5C_decr__threshold: - if (hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold) { - - if (!cache_ptr->size_decrease_possible) { - + if (hit_rate > cache_ptr->resize_ctl.upper_hr_threshold) { + if (!cache_ptr->size_decrease_possible) status = decrease_disabled; - } - else if (cache_ptr->max_cache_size <= (cache_ptr->resize_ctl).min_size) { - - HDassert(cache_ptr->max_cache_size == (cache_ptr->resize_ctl).min_size); + else if (cache_ptr->max_cache_size <= cache_ptr->resize_ctl.min_size) { + HDassert(cache_ptr->max_cache_size == cache_ptr->resize_ctl.min_size); status = at_min_size; } else { - - new_max_cache_size = (size_t)(((double)(cache_ptr->max_cache_size)) * - (cache_ptr->resize_ctl).decrement); + new_max_cache_size = + (size_t)(((double)(cache_ptr->max_cache_size)) * cache_ptr->resize_ctl.decrement); /* clip to min size if necessary */ - if (new_max_cache_size < (cache_ptr->resize_ctl).min_size) { - - new_max_cache_size = (cache_ptr->resize_ctl).min_size; - } + if (new_max_cache_size < cache_ptr->resize_ctl.min_size) + new_max_cache_size = cache_ptr->resize_ctl.min_size; /* clip to max decrement if necessary */ - if (((cache_ptr->resize_ctl).apply_max_decrement) && - (((cache_ptr->resize_ctl).max_decrement + new_max_cache_size) < - cache_ptr->max_cache_size)) { - + if (cache_ptr->resize_ctl.apply_max_decrement && + ((cache_ptr->resize_ctl.max_decrement + new_max_cache_size) < + cache_ptr->max_cache_size)) new_max_cache_size = - cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; - } + cache_ptr->max_cache_size - cache_ptr->resize_ctl.max_decrement; status = decrease; } @@ -4416,22 +3979,19 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) } /* cycle the epoch markers here if appropriate */ - if ((((cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out) || - ((cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold)) && - (!inserted_epoch_marker)) { - + if (((cache_ptr->resize_ctl.decr_mode == H5C_decr__age_out) || + (cache_ptr->resize_ctl.decr_mode == H5C_decr__age_out_with_threshold)) && + !inserted_epoch_marker) /* move last epoch marker to the head of the LRU list */ if (H5C__autoadjust__ageout__cycle_epoch_marker(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error cycling epoch marker") - } if ((status == increase) || (status == decrease)) { - old_max_cache_size = cache_ptr->max_cache_size; old_min_clean_size = cache_ptr->min_clean_size; new_min_clean_size = - (size_t)((double)new_max_cache_size * ((cache_ptr->resize_ctl).min_clean_fraction)); + (size_t)((double)new_max_cache_size * (cache_ptr->resize_ctl.min_clean_fraction)); /* new_min_clean_size is of size_t, and thus must be non-negative. * Hence we have @@ -4441,25 +4001,20 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) * by definition. */ HDassert(new_min_clean_size <= new_max_cache_size); - HDassert((cache_ptr->resize_ctl).min_size <= new_max_cache_size); - HDassert(new_max_cache_size <= (cache_ptr->resize_ctl).max_size); + HDassert(cache_ptr->resize_ctl.min_size <= new_max_cache_size); + HDassert(new_max_cache_size <= cache_ptr->resize_ctl.max_size); cache_ptr->max_cache_size = new_max_cache_size; cache_ptr->min_clean_size = new_min_clean_size; - if (status == increase) { - + if (status == increase) cache_ptr->cache_full = FALSE; - } - else if (status == decrease) { - + else if (status == decrease) cache_ptr->size_decreased = TRUE; - } /* update flash cache size increase fields as appropriate */ if (cache_ptr->flash_size_increase_possible) { - - switch ((cache_ptr->resize_ctl).flash_incr_mode) { + switch (cache_ptr->resize_ctl.flash_incr_mode) { case H5C_flash_incr__off: HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") @@ -4468,7 +4023,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) case H5C_flash_incr__add_space: cache_ptr->flash_size_increase_threshold = (size_t)(((double)(cache_ptr->max_cache_size)) * - ((cache_ptr->resize_ctl).flash_threshold)); + (cache_ptr->resize_ctl.flash_threshold)); break; default: /* should be unreachable */ @@ -4478,11 +4033,10 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) } } - if ((cache_ptr->resize_ctl).rpt_fcn != NULL) { - (*((cache_ptr->resize_ctl).rpt_fcn))(cache_ptr, H5C__CURR_AUTO_RESIZE_RPT_FCN_VER, hit_rate, status, - old_max_cache_size, new_max_cache_size, old_min_clean_size, - new_min_clean_size); - } + if (cache_ptr->resize_ctl.rpt_fcn != NULL) + (cache_ptr->resize_ctl.rpt_fcn)(cache_ptr, H5C__CURR_AUTO_RESIZE_RPT_FCN_VER, hit_rate, status, + old_max_cache_size, new_max_cache_size, old_min_clean_size, + new_min_clean_size); if (H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ @@ -4534,69 +4088,54 @@ H5C__autoadjust__ageout(H5F_t *f, double hit_rate, enum H5C_resize_status *statu HDassert((new_max_cache_size_ptr) && (*new_max_cache_size_ptr == 0)); /* remove excess epoch markers if any */ - if (cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction) + if (cache_ptr->epoch_markers_active > cache_ptr->resize_ctl.epochs_before_eviction) if (H5C__autoadjust__ageout__remove_excess_markers(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't remove excess epoch markers") - if (((cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out) || - (((cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold) && - (hit_rate >= (cache_ptr->resize_ctl).upper_hr_threshold))) { - - if (cache_ptr->max_cache_size > (cache_ptr->resize_ctl).min_size) { + if ((cache_ptr->resize_ctl.decr_mode == H5C_decr__age_out) || + ((cache_ptr->resize_ctl.decr_mode == H5C_decr__age_out_with_threshold) && + (hit_rate >= cache_ptr->resize_ctl.upper_hr_threshold))) { + if (cache_ptr->max_cache_size > cache_ptr->resize_ctl.min_size) { /* evict aged out cache entries if appropriate... */ if (H5C__autoadjust__ageout__evict_aged_out_entries(f, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries") /* ... and then reduce cache size if appropriate */ if (cache_ptr->index_size < cache_ptr->max_cache_size) { - - if ((cache_ptr->resize_ctl).apply_empty_reserve) { - - test_size = (size_t)(((double)cache_ptr->index_size) / - (1 - (cache_ptr->resize_ctl).empty_reserve)); - + if (cache_ptr->resize_ctl.apply_empty_reserve) { + test_size = + (size_t)(((double)cache_ptr->index_size) / (1 - cache_ptr->resize_ctl.empty_reserve)); if (test_size < cache_ptr->max_cache_size) { - *status_ptr = decrease; *new_max_cache_size_ptr = test_size; } } else { - *status_ptr = decrease; *new_max_cache_size_ptr = cache_ptr->index_size; } if (*status_ptr == decrease) { - /* clip to min size if necessary */ - if (*new_max_cache_size_ptr < (cache_ptr->resize_ctl).min_size) { - - *new_max_cache_size_ptr = (cache_ptr->resize_ctl).min_size; - } + if (*new_max_cache_size_ptr < cache_ptr->resize_ctl.min_size) + *new_max_cache_size_ptr = cache_ptr->resize_ctl.min_size; /* clip to max decrement if necessary */ - if (((cache_ptr->resize_ctl).apply_max_decrement) && - (((cache_ptr->resize_ctl).max_decrement + *new_max_cache_size_ptr) < - cache_ptr->max_cache_size)) { - + if ((cache_ptr->resize_ctl.apply_max_decrement) && + ((cache_ptr->resize_ctl.max_decrement + *new_max_cache_size_ptr) < + cache_ptr->max_cache_size)) *new_max_cache_size_ptr = - cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; - } + cache_ptr->max_cache_size - cache_ptr->resize_ctl.max_decrement; } } } - else { - + else *status_ptr = at_min_size; - } } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__autoadjust__ageout() */ /*------------------------------------------------------------------------- @@ -4630,18 +4169,14 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t *cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "No active epoch markers on entry?!?!?") /* remove the last marker from both the ring buffer and the LRU list */ - i = cache_ptr->epoch_marker_ringbuf[cache_ptr->epoch_marker_ringbuf_first]; - cache_ptr->epoch_marker_ringbuf_first = (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); - if (cache_ptr->epoch_marker_ringbuf_size <= 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") cache_ptr->epoch_marker_ringbuf_size -= 1; - - if ((cache_ptr->epoch_marker_active)[i] != TRUE) + if (cache_ptr->epoch_marker_active[i] != TRUE) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), (cache_ptr)->LRU_head_ptr, (cache_ptr)->LRU_tail_ptr, @@ -4650,23 +4185,20 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t *cache_ptr) /* now, re-insert it at the head of the LRU list, and at the tail of * the ring buffer. */ - - HDassert(((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i); - HDassert(((cache_ptr->epoch_markers)[i]).next == NULL); - HDassert(((cache_ptr->epoch_markers)[i]).prev == NULL); + HDassert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); + HDassert(cache_ptr->epoch_markers[i].next == NULL); + HDassert(cache_ptr->epoch_markers[i].prev == NULL); cache_ptr->epoch_marker_ringbuf_last = (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); - - (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; - + cache_ptr->epoch_marker_ringbuf[cache_ptr->epoch_marker_ringbuf_last] = i; if (cache_ptr->epoch_marker_ringbuf_size >= H5C__MAX_EPOCH_MARKERS) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow") cache_ptr->epoch_marker_ringbuf_size += 1; - H5C__DLL_PREPEND((&((cache_ptr->epoch_markers)[i])), (cache_ptr)->LRU_head_ptr, (cache_ptr)->LRU_tail_ptr, - (cache_ptr)->LRU_list_len, (cache_ptr)->LRU_list_size, (FAIL)) + H5C__DLL_PREPEND(&(cache_ptr->epoch_markers[i]), cache_ptr->LRU_head_ptr, cache_ptr->LRU_tail_ptr, + cache_ptr->LRU_list_len, cache_ptr->LRU_list_size, FAIL) done: FUNC_LEAVE_NOAPI(ret_value) @@ -4679,7 +4211,7 @@ done: * * Purpose: Evict clean entries in the cache that haven't * been accessed for at least - * (cache_ptr->resize_ctl).epochs_before_eviction epochs, + * cache_ptr->resize_ctl.epochs_before_eviction epochs, * and flush dirty entries that haven't been accessed for * that amount of time. * @@ -4704,8 +4236,6 @@ done: * will be re-calculated, and will be enforced the next time * we have to make space in the cache. * - * Observe that this function cannot occasion a read. - * * Return: Non-negative on success/Negative on failure. * * Programmer: John Mainzer, 11/22/04 @@ -4737,22 +4267,16 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte * to the equivalent of infinity. The current size of the index will * do nicely. */ - if ((cache_ptr->resize_ctl).apply_max_decrement) { - - eviction_size_limit = (cache_ptr->resize_ctl).max_decrement; - } - else { - + if (cache_ptr->resize_ctl.apply_max_decrement) + eviction_size_limit = cache_ptr->resize_ctl.max_decrement; + else eviction_size_limit = cache_ptr->index_size; /* i.e. infinity */ - } if (write_permitted) { - restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; - - while ((entry_ptr != NULL) && ((entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID) && - (bytes_evicted < eviction_size_limit)) { + while (entry_ptr != NULL && entry_ptr->type->id != H5AC_EPOCH_MARKER_ID && + bytes_evicted < eviction_size_limit) { hbool_t skipping_entry = FALSE; HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); @@ -4793,7 +4317,6 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte } /* end else */ } /* end if */ else if (!entry_ptr->prefetched_dirty) { - bytes_evicted += entry_ptr->size; if (H5C__flush_single_entry( @@ -4841,7 +4364,6 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte * min clean space requirement (assuming that requirement was met on * entry). */ - } /* end if */ else /* ! write_permitted */ { /* Since we are not allowed to write, all we can do is evict @@ -4913,14 +4435,13 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t *cache_ptr) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - if (cache_ptr->epoch_markers_active >= (cache_ptr->resize_ctl).epochs_before_eviction) + if (cache_ptr->epoch_markers_active >= cache_ptr->resize_ctl.epochs_before_eviction) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Already have a full complement of markers") /* find an unused marker */ i = 0; while ((cache_ptr->epoch_marker_active)[i] && i < H5C__MAX_EPOCH_MARKERS) i++; - if (i >= H5C__MAX_EPOCH_MARKERS) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't find unused marker") @@ -4932,25 +4453,19 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t *cache_ptr) cache_ptr->epoch_marker_ringbuf_last = (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); - (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; - - if (cache_ptr->epoch_marker_ringbuf_size >= H5C__MAX_EPOCH_MARKERS) { - + if (cache_ptr->epoch_marker_ringbuf_size >= H5C__MAX_EPOCH_MARKERS) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer overflow") - } cache_ptr->epoch_marker_ringbuf_size += 1; - H5C__DLL_PREPEND((&((cache_ptr->epoch_markers)[i])), (cache_ptr)->LRU_head_ptr, (cache_ptr)->LRU_tail_ptr, - (cache_ptr)->LRU_list_len, (cache_ptr)->LRU_list_size, (FAIL)) + H5C__DLL_PREPEND(&(cache_ptr->epoch_markers[i]), cache_ptr->LRU_head_ptr, cache_ptr->LRU_tail_ptr, + cache_ptr->LRU_list_len, cache_ptr->LRU_list_size, FAIL) cache_ptr->epoch_markers_active += 1; done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__autoadjust__ageout__insert_new_marker() */ /*------------------------------------------------------------------------- @@ -4991,23 +4506,21 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr) if (cache_ptr->epoch_marker_ringbuf_size <= 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") - cache_ptr->epoch_marker_ringbuf_size -= 1; - if ((cache_ptr->epoch_marker_active)[i] != TRUE) + if (cache_ptr->epoch_marker_active[i] != TRUE) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") /* remove the epoch marker from the LRU list */ - H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), (cache_ptr)->LRU_head_ptr, - (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, (cache_ptr)->LRU_list_size, - (FAIL)) + H5C__DLL_REMOVE(&(cache_ptr->epoch_markers[i]), cache_ptr->LRU_head_ptr, cache_ptr->LRU_tail_ptr, + cache_ptr->LRU_list_len, cache_ptr->LRU_list_size, FAIL) /* mark the epoch marker as unused. */ - (cache_ptr->epoch_marker_active)[i] = FALSE; + cache_ptr->epoch_marker_active[i] = FALSE; - HDassert(((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i); - HDassert(((cache_ptr->epoch_markers)[i]).next == NULL); - HDassert(((cache_ptr->epoch_markers)[i]).prev == NULL); + HDassert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); + HDassert(cache_ptr->epoch_markers[i].next == NULL); + HDassert(cache_ptr->epoch_markers[i].prev == NULL); /* decrement the number of active epoch markers */ cache_ptr->epoch_markers_active -= 1; @@ -5016,9 +4529,7 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr) } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__autoadjust__ageout__remove_all_markers() */ /*------------------------------------------------------------------------- @@ -5027,8 +4538,8 @@ done: * * Purpose: Remove epoch markers from the end of the LRU list and * mark them as inactive until the number of active markers - * equals the the current value of - * (cache_ptr->resize_ctl).epochs_before_eviction. + * equals the current value of + * cache_ptr->resize_ctl.epochs_before_eviction. * * Return: SUCCEED on success/FAIL on failure. * @@ -5048,14 +4559,13 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr) HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); - if (cache_ptr->epoch_markers_active <= (cache_ptr->resize_ctl).epochs_before_eviction) + if (cache_ptr->epoch_markers_active <= cache_ptr->resize_ctl.epochs_before_eviction) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry") - while (cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction) { + while (cache_ptr->epoch_markers_active > cache_ptr->resize_ctl.epochs_before_eviction) { /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ - ring_buf_index = cache_ptr->epoch_marker_ringbuf_first; i = (cache_ptr->epoch_marker_ringbuf)[ring_buf_index]; @@ -5064,23 +4574,21 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr) if (cache_ptr->epoch_marker_ringbuf_size <= 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ring buffer underflow") - cache_ptr->epoch_marker_ringbuf_size -= 1; - if ((cache_ptr->epoch_marker_active)[i] != TRUE) + if (cache_ptr->epoch_marker_active[i] != TRUE) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unused marker in LRU?!?") /* remove the epoch marker from the LRU list */ - H5C__DLL_REMOVE((&((cache_ptr->epoch_markers)[i])), (cache_ptr)->LRU_head_ptr, - (cache_ptr)->LRU_tail_ptr, (cache_ptr)->LRU_list_len, (cache_ptr)->LRU_list_size, - (FAIL)) + H5C__DLL_REMOVE(&(cache_ptr->epoch_markers[i]), cache_ptr->LRU_head_ptr, cache_ptr->LRU_tail_ptr, + cache_ptr->LRU_list_len, cache_ptr->LRU_list_size, FAIL) /* mark the epoch marker as unused. */ - (cache_ptr->epoch_marker_active)[i] = FALSE; + cache_ptr->epoch_marker_active[i] = FALSE; - HDassert(((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i); - HDassert(((cache_ptr->epoch_markers)[i]).next == NULL); - HDassert(((cache_ptr->epoch_markers)[i]).prev == NULL); + HDassert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); + HDassert(cache_ptr->epoch_markers[i].next == NULL); + HDassert(cache_ptr->epoch_markers[i].prev == NULL); /* decrement the number of active epoch markers */ cache_ptr->epoch_markers_active -= 1; @@ -5089,9 +4597,7 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr) } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__autoadjust__ageout__remove_excess_markers() */ /*------------------------------------------------------------------------- @@ -5100,7 +4606,7 @@ done: * * Purpose: If there is not at least new_entry_size - old_entry_size * bytes of free space in the cache and the current - * max_cache_size is less than (cache_ptr->resize_ctl).max_size, + * max_cache_size is less than cache_ptr->resize_ctl.max_size, * perform a flash increase in the cache size and then reset * the full cache hit rate statistics, and exit. * @@ -5134,13 +4640,9 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "old_entry_size >= new_entry_size") space_needed = new_entry_size - old_entry_size; - if (((cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size) && - (cache_ptr->max_cache_size < (cache_ptr->resize_ctl).max_size)) { - - /* we have work to do */ - - switch ((cache_ptr->resize_ctl).flash_incr_mode) { + (cache_ptr->max_cache_size < cache_ptr->resize_ctl.max_size)) { + switch (cache_ptr->resize_ctl.flash_incr_mode) { case H5C_flash_incr__off: HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") @@ -5148,14 +4650,11 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n case H5C_flash_incr__add_space: if (cache_ptr->index_size < cache_ptr->max_cache_size) { - HDassert((cache_ptr->max_cache_size - cache_ptr->index_size) < space_needed); space_needed -= cache_ptr->max_cache_size - cache_ptr->index_size; } - space_needed = (size_t)(((double)space_needed) * (cache_ptr->resize_ctl).flash_multiple); - + space_needed = (size_t)(((double)space_needed) * cache_ptr->resize_ctl.flash_multiple); new_max_cache_size = cache_ptr->max_cache_size + space_needed; - break; default: /* should be unreachable */ @@ -5163,16 +4662,11 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n break; } - if (new_max_cache_size > (cache_ptr->resize_ctl).max_size) { - - new_max_cache_size = (cache_ptr->resize_ctl).max_size; - } - + if (new_max_cache_size > cache_ptr->resize_ctl.max_size) + new_max_cache_size = cache_ptr->resize_ctl.max_size; HDassert(new_max_cache_size > cache_ptr->max_cache_size); - new_min_clean_size = - (size_t)((double)new_max_cache_size * ((cache_ptr->resize_ctl).min_clean_fraction)); - + new_min_clean_size = (size_t)((double)new_max_cache_size * cache_ptr->resize_ctl.min_clean_fraction); HDassert(new_min_clean_size <= new_max_cache_size); old_max_cache_size = cache_ptr->max_cache_size; @@ -5184,7 +4678,7 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n /* update flash cache size increase fields as appropriate */ HDassert(cache_ptr->flash_size_increase_possible); - switch ((cache_ptr->resize_ctl).flash_incr_mode) { + switch (cache_ptr->resize_ctl.flash_incr_mode) { case H5C_flash_incr__off: HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flash_size_increase_possible but H5C_flash_incr__off?!") @@ -5192,8 +4686,7 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n case H5C_flash_incr__add_space: cache_ptr->flash_size_increase_threshold = - (size_t)(((double)(cache_ptr->max_cache_size)) * - ((cache_ptr->resize_ctl).flash_threshold)); + (size_t)((double)cache_ptr->max_cache_size * cache_ptr->resize_ctl.flash_threshold); break; default: /* should be unreachable */ @@ -5206,17 +4699,16 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n * we don't. */ - if ((cache_ptr->resize_ctl).rpt_fcn != NULL) { - + if (cache_ptr->resize_ctl.rpt_fcn != NULL) { /* get the hit rate for the reporting function. Should still * be good as we haven't reset the hit rate statistics. */ if (H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") - (*((cache_ptr->resize_ctl).rpt_fcn))(cache_ptr, H5C__CURR_AUTO_RESIZE_RPT_FCN_VER, hit_rate, - status, old_max_cache_size, new_max_cache_size, - old_min_clean_size, new_min_clean_size); + (cache_ptr->resize_ctl.rpt_fcn)(cache_ptr, H5C__CURR_AUTO_RESIZE_RPT_FCN_VER, hit_rate, status, + old_max_cache_size, new_max_cache_size, old_min_clean_size, + new_min_clean_size); } if (H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) @@ -5225,9 +4717,7 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__flash_increase_cache_size() */ /*------------------------------------------------------------------------- @@ -5259,52 +4749,7 @@ done: * a request to flush all items and something was protected. * * Programmer: John Mainzer - * 3/24/065 - * - * Modifications: - * - * To support the fractal heap, the cache must now deal with - * entries being dirtied, resized, and/or renamed inside - * flush callbacks. Updated function to support this. - * - * -- JRM 8/27/06 - * - * Added code to detect and manage the case in which a - * flush callback changes the s-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that we should just scream and die if - * we ever detect the condition. - * - * -- JRM 10/13/07 - * - * Missing entries? - * - * - * Added support for the H5C__EVICT_ALLOW_LAST_PINS_FLAG. - * This flag is used to flush and evict all entries in - * the metadata cache that are not pinned -- typically, - * everything other than the superblock. - * - * ??? -- ??/??/?? - * - * Added sanity checks to verify that the skip list is - * enabled on entry. On the face of it, it would make - * sense to enable the slist on entry, and disable it - * on exit, as this function is not called repeatedly. - * However, since this function can be called from - * H5C_flush_cache(), this would create cases in the test - * code where we would have to check the flags to determine - * whether we must setup and take down the slist. - * - * JRM -- 5/5/20 + * 3/24/05 * *------------------------------------------------------------------------- */ @@ -5343,7 +4788,6 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); for (i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { - index_len += cache_ptr->index_ring_len[i]; index_size += cache_ptr->index_ring_size[i]; clean_index_size += cache_ptr->clean_index_ring_size[i]; @@ -5351,7 +4795,6 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) slist_len += cache_ptr->slist_ring_len[i]; slist_size += cache_ptr->slist_ring_size[i]; - } /* end for */ HDassert(cache_ptr->index_len == index_len); @@ -5364,63 +4807,48 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ /* remove ageout markers if present */ - if (cache_ptr->epoch_markers_active > 0) { - + if (cache_ptr->epoch_markers_active > 0) if (H5C__autoadjust__ageout__remove_all_markers(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error removing all epoch markers") - } /* flush invalidate each ring, starting from the outermost ring and * working inward. */ ring = H5C_RING_USER; - while (ring < H5C_RING_NTYPES) { - if (H5C__flush_invalidate_ring(f, ring, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") ring++; - } /* end while */ +#ifndef NDEBUG /* Invariants, after destroying all entries in the hash table */ if (!(flags & H5C__EVICT_ALLOW_LAST_PINS_FLAG)) { - HDassert(cache_ptr->index_size == 0); HDassert(cache_ptr->clean_index_size == 0); HDassert(cache_ptr->pel_len == 0); HDassert(cache_ptr->pel_size == 0); - } /* end if */ else { - H5C_cache_entry_t *entry_ptr; /* Cache entry */ unsigned u; /* Local index variable */ /* All rings except ring 4 should be empty now */ /* (Ring 4 has the superblock) */ for (u = H5C_RING_USER; u < H5C_RING_SB; u++) { - HDassert(cache_ptr->index_ring_len[u] == 0); HDassert(cache_ptr->index_ring_size[u] == 0); HDassert(cache_ptr->clean_index_ring_size[u] == 0); - } /* end for */ /* Check that any remaining pinned entries are in the superblock ring */ - entry_ptr = cache_ptr->pel_head_ptr; - while (entry_ptr) { - /* Check ring */ HDassert(entry_ptr->ring == H5C_RING_SB); /* Advance to next entry in pinned entry list */ entry_ptr = entry_ptr->next; - } /* end while */ } /* end else */ @@ -5431,11 +4859,10 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) HDassert(cache_ptr->pl_size == 0); HDassert(cache_ptr->LRU_list_len == 0); HDassert(cache_ptr->LRU_list_size == 0); +#endif /* NDEBUG */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__flush_invalidate_cache() */ /*------------------------------------------------------------------------- @@ -5472,20 +4899,6 @@ done: * Programmer: John Mainzer * 9/1/15 * - * Changes: Added support for the H5C__EVICT_ALLOW_LAST_PINS_FLAG. - * This flag is used to flush and evict all entries in - * the metadata cache that are not pinned -- typically, - * everything other than the superblock. - * - * ??? -- ??/??/?? - * - * A recent optimization turns off the slist unless a flush - * is in progress. This should not effect this function, as - * it is only called during a flush. Added an assertion to - * verify this. - * - * JRM -- 5/6/20 - * *------------------------------------------------------------------------- */ static herr_t @@ -5546,38 +4959,30 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * for some other cache entry), we can no longer promise to flush * the cache entries in increasing address order. * - * Instead, we just do the best we can -- making a pass through + * Instead, we make a pass through * the skip list, and then a pass through the "clean" entries, and * then repeating as needed. Thus it is quite possible that an * entry will be evicted from the cache only to be re-loaded later - * in the flush process (From what Quincey tells me, the pin - * mechanism makes this impossible, but even it it is true now, - * we shouldn't count on it in the future.) + * in the flush process. * * The bottom line is that entries will probably be flushed in close * to increasing address order, but there are no guarantees. */ /* compute the number of pinned entries in this ring */ - entry_ptr = cache_ptr->pel_head_ptr; cur_ring_pel_len = 0; - while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring >= ring); if (entry_ptr->ring == ring) cur_ring_pel_len++; entry_ptr = entry_ptr->next; - } /* end while */ - old_ring_pel_len = cur_ring_pel_len; while (cache_ptr->index_ring_len[ring] > 0) { - /* first, try to flush-destroy any dirty entries. Do this by * making a scan through the slist. Note that new dirty entries * may be created by the flush call backs. Thus it is possible @@ -5620,32 +5025,25 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) /* this done, start the scan of the slist */ restart_slist_scan = TRUE; - while (restart_slist_scan || (node_ptr != NULL)) { - if (restart_slist_scan) { - restart_slist_scan = FALSE; /* Start at beginning of skip list */ node_ptr = H5SL_first(cache_ptr->slist_ptr); - if (node_ptr == NULL) /* the slist is empty -- break out of inner loop */ break; /* Get cache entry for this node */ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if (NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); HDassert(next_entry_ptr->ring >= ring); - } /* end if */ entry_ptr = next_entry_ptr; @@ -5671,13 +5069,9 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * from the slist. */ node_ptr = H5SL_next(node_ptr); - if (node_ptr != NULL) { - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if (NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); @@ -5686,10 +5080,8 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(next_entry_ptr->ring >= ring); HDassert(entry_ptr != next_entry_ptr); } /* end if */ - else { - + else next_entry_ptr = NULL; - } /* Note that we now remove nodes from the slist as we flush * the associated entries, instead of leaving them there @@ -5704,23 +5096,17 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if (((!entry_ptr->flush_me_last) || ((entry_ptr->flush_me_last) && (cache_ptr->num_last_entries >= cache_ptr->slist_len))) && (entry_ptr->flush_dep_nchildren == 0) && (entry_ptr->ring == ring)) { - if (entry_ptr->is_protected) { - - /* we have major problems -- but lets flush + /* We have major problems -- but lets flush * everything we can before we flag an error. */ protected_entries++; - } /* end if */ else if (entry_ptr->is_pinned) { - if (H5C__flush_single_entry(f, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed") if (cache_ptr->slist_changed) { - /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -5731,20 +5117,16 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) restart_slist_scan = TRUE; cache_ptr->slist_changed = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr); - } /* end if */ } /* end else-if */ else { - if (H5C__flush_single_entry(f, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed") if (cache_ptr->slist_changed) { - /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -5771,10 +5153,8 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) */ if (node_ptr == NULL) { - HDassert(cache_ptr->slist_len == (uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase)); - HDassert(cache_ptr->slist_size == (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); } /* end if */ @@ -5792,7 +5172,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * Writes to disk are possible here. */ - /* reset the counters so that we can detect insertions, loads, + /* Reset the counters so that we can detect insertions, loads, * and moves caused by the pre_serialize and serialize calls. */ cache_ptr->entries_loaded_counter = 0; @@ -5800,9 +5180,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) cache_ptr->entries_relocated_counter = 0; next_entry_ptr = cache_ptr->il_head; - while (next_entry_ptr != NULL) { - entry_ptr = next_entry_ptr; HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring >= ring); @@ -5815,20 +5193,16 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) (entry_ptr->flush_dep_nchildren == 0) && (entry_ptr->ring == ring)) { if (entry_ptr->is_protected) { - /* we have major problems -- but lets flush and * destroy everything we can before we flag an * error. */ protected_entries++; - if (!entry_ptr->in_slist) { - + if (!entry_ptr->in_slist) HDassert(!(entry_ptr->is_dirty)); - } } /* end if */ - else if (!(entry_ptr->is_pinned)) { - + else if (!entry_ptr->is_pinned) { /* if *entry_ptr is dirty, it is possible * that one or more other entries may be * either removed from the cache, loaded @@ -5856,12 +5230,10 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * or three entries. */ cache_ptr->entry_watched_for_removal = next_entry_ptr; - if (H5C__flush_single_entry(f, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed") /* Restart the index list scan if necessary. Must @@ -5884,12 +5256,9 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) cache_ptr->entries_relocated_counter = 0; H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) - } /* end if */ - else { - + else cache_ptr->entry_watched_for_removal = NULL; - } } /* end if */ } /* end if */ } /* end for loop scanning hash table */ @@ -5907,49 +5276,39 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) cur_ring_pel_len = 0; while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->ring >= ring); - if (entry_ptr->ring == ring) { - + if (entry_ptr->ring == ring) cur_ring_pel_len++; - } entry_ptr = entry_ptr->next; - } /* end while */ /* Check if the number of pinned entries in the ring is positive, and * it is not declining. Scream and die if so. */ if ((cur_ring_pel_len > 0) && (cur_ring_pel_len >= old_ring_pel_len)) { - /* Don't error if allowed to have pinned entries remaining */ - if (evict_flags) { - + if (evict_flags) HGOTO_DONE(TRUE) - } - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, - "Pinned entry count not decreasing, cur_ring_pel_len = %d, old_ring_pel_len = " - "%d, ring = %d", - (int)cur_ring_pel_len, (int)old_ring_pel_len, (int)ring) + HGOTO_ERROR( + H5E_CACHE, H5E_CANTFLUSH, FAIL, + "Pinned entry count not decreasing, cur_ring_pel_len = %d, old_ring_pel_len = %d, ring = %d", + (int)cur_ring_pel_len, (int)old_ring_pel_len, (int)ring) } /* end if */ HDassert(protected_entries == cache_ptr->pl_len); if ((protected_entries > 0) && (protected_entries == cache_ptr->index_len)) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Only protected entries left in cache, protected_entries = %d", (int)protected_entries) - } /* main while loop */ /* Invariants, after destroying all entries in the ring */ for (i = (int)H5C_RING_UNDEFINED; i <= (int)ring; i++) { - HDassert(cache_ptr->index_ring_len[i] == 0); HDassert(cache_ptr->index_ring_size[i] == (size_t)0); HDassert(cache_ptr->clean_index_ring_size[i] == (size_t)0); @@ -5957,24 +5316,17 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(cache_ptr->slist_ring_len[i] == 0); HDassert(cache_ptr->slist_ring_size[i] == (size_t)0); - } /* end for */ HDassert(protected_entries <= cache_ptr->pl_len); - if (protected_entries > 0) { - + if (protected_entries > 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries") - } - else if (cur_ring_pel_len > 0) { - + else if (cur_ring_pel_len > 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't unpin all pinned entries in ring") - } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__flush_invalidate_ring() */ /*------------------------------------------------------------------------- @@ -6000,14 +5352,6 @@ done: * Programmer: John Mainzer * 9/1/15 * - * Changes: A recent optimization turns off the slist unless a flush - * is in progress. This should not effect this function, as - * it is only called during a flush. Added an assertion to - * verify this. - * - * JRM -- 5/6/20 - * - * *------------------------------------------------------------------------- */ static herr_t @@ -6041,22 +5385,17 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(ring < H5C_RING_NTYPES); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) - + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ ignore_protected = ((flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0); flush_marked_entries = ((flags & H5C__FLUSH_MARKED_ENTRIES_FLAG) != 0); - if (!flush_marked_entries) { - - for (i = (int)H5C_RING_UNDEFINED; i < (int)ring; i++) { - + if (!flush_marked_entries) + for (i = (int)H5C_RING_UNDEFINED; i < (int)ring; i++) HDassert(cache_ptr->slist_ring_len[i] == 0); - } - } HDassert(cache_ptr->flush_in_progress); @@ -6078,7 +5417,6 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) cache_ptr->slist_changed = FALSE; while ((cache_ptr->slist_ring_len[ring] > 0) && (protected_entries == 0) && (flushed_entries_last_pass)) { - flushed_entries_last_pass = FALSE; #ifdef H5C_DO_SANITY_CHECKS @@ -6121,33 +5459,24 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) #endif /* H5C_DO_SANITY_CHECKS */ restart_slist_scan = TRUE; - while ((restart_slist_scan) || (node_ptr != NULL)) { - if (restart_slist_scan) { - restart_slist_scan = FALSE; /* Start at beginning of skip list */ node_ptr = H5SL_first(cache_ptr->slist_ptr); - - if (node_ptr == NULL) { - + if (node_ptr == NULL) /* the slist is empty -- break out of inner loop */ break; - } /* Get cache entry for this node */ next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if (NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); - } /* end if */ entry_ptr = next_entry_ptr; @@ -6158,7 +5487,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * dirty, resize, or take ownership of other entries * in the cache. * - * To deal with this, I have inserted code to detect any + * To deal with this, there is code to detect any * change in the skip list not directly under the control * of this function. If such modifications are detected, * we must re-start the scan of the skip list to avoid @@ -6173,40 +5502,29 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(entry_ptr->in_slist); HDassert(entry_ptr->is_dirty); - if ((!flush_marked_entries) || (entry_ptr->flush_marker)) { - + if (!flush_marked_entries || entry_ptr->flush_marker) HDassert(entry_ptr->ring >= ring); - } /* Advance node pointer now, before we delete its target * from the slist. */ node_ptr = H5SL_next(node_ptr); - if (node_ptr != NULL) { - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if (NULL == next_entry_ptr) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") HDassert(next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(next_entry_ptr->is_dirty); HDassert(next_entry_ptr->in_slist); - if (!flush_marked_entries || next_entry_ptr->flush_marker) { - + if (!flush_marked_entries || next_entry_ptr->flush_marker) HDassert(next_entry_ptr->ring >= ring); - } HDassert(entry_ptr != next_entry_ptr); - } /* end if */ - else { - + else next_entry_ptr = NULL; - } if ((!flush_marked_entries || entry_ptr->flush_marker) && ((!entry_ptr->flush_me_last) || @@ -6218,23 +5536,18 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(entry_ptr->flush_dep_nunser_children == 0); if (entry_ptr->is_protected) { - /* we probably have major problems -- but lets * flush everything we can before we decide * whether to flag an error. */ tried_to_flush_protected_entry = TRUE; protected_entries++; - } /* end if */ else { - if (H5C__flush_single_entry(f, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry") if (cache_ptr->slist_changed) { - /* The slist has been modified by something * other than the simple removal of the * of the flushed entry after the flush. @@ -6245,11 +5558,9 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) restart_slist_scan = TRUE; cache_ptr->slist_changed = FALSE; H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) - } /* end if */ flushed_entries_last_pass = TRUE; - } /* end else */ } /* end if */ } /* while ( ( restart_slist_scan ) || ( node_ptr != NULL ) ) */ @@ -6261,28 +5572,22 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert((size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase) == cache_ptr->slist_size); #endif /* H5C_DO_SANITY_CHECKS */ - - } /* while */ + } /* while */ HDassert(protected_entries <= cache_ptr->pl_len); - if (((cache_ptr->pl_len > 0) && (!ignore_protected)) || (tried_to_flush_protected_entry)) - + if (((cache_ptr->pl_len > 0) && !ignore_protected) || tried_to_flush_protected_entry) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "cache has protected items") #ifdef H5C_DO_SANITY_CHECKS if (!flush_marked_entries) { - HDassert(cache_ptr->slist_ring_len[ring] == 0); HDassert(cache_ptr->slist_ring_size[ring] == 0); - } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__flush_ring() */ /*------------------------------------------------------------------------- @@ -6310,69 +5615,6 @@ done: * * Programmer: John Mainzer, 5/5/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * QAK -- 11/26/04 - * Updated function for the switch from TBBTs to skip lists. - * - * JRM -- 1/6/05 - * Updated function to reset the flush_marker field. - * Also replace references to H5F_FLUSH_INVALIDATE and - * H5F_FLUSH_CLEAR_ONLY with references to - * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG - * respectively. - * - * JRM -- 6/24/05 - * Added code to remove dirty entries from the slist after - * they have been flushed. Also added a sanity check that - * will scream if we attempt a write when writes are - * completely disabled. - * - * JRM -- 7/5/05 - * Added code to call the new log_flush callback whenever - * a dirty entry is written to disk. Note that the callback - * is not called if the H5C__FLUSH_CLEAR_ONLY_FLAG is set, - * as there is no write to file in this case. - * - * JRM -- 8/21/06 - * Added code maintaining the flush_in_progress and - * destroy_in_progress fields in H5C_cache_entry_t. - * - * Also added flush_flags parameter to the call to - * type_ptr->flush() so that the flush routine can report - * whether the entry has been resized or renamed. Added - * code using the flush_flags variable to detect the case - * in which the target entry is resized during flush, and - * update the caches data structures accordingly. - * - * JRM -- 3/29/07 - * Added sanity checks on the new is_read_only and - * ro_ref_count fields. - * - * QAK -- 2/07/08 - * Separated "destroy entry" concept from "remove entry from - * cache" concept, by adding the 'take_ownership' flag and - * the "destroy_entry" variable. - * - * JRM -- 11/5/08 - * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN() to - * maintain the new clean_index_size and clean_index_size - * fields of H5C_t. - * - * - * Missing entries?? - * - * - * JRM -- 5/8/20 - * Updated sanity checks for the possibility that the slist - * is disabled. - * - * Also updated main comment to conform more closely with - * the current state of the code. - * *------------------------------------------------------------------------- */ herr_t @@ -6419,26 +5661,18 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Set the flag for destroying the entry, based on the 'take ownership' * and 'destroy' flags */ - if (take_ownership) { - + if (take_ownership) destroy_entry = FALSE; - } - else { - + else destroy_entry = destroy; - } /* we will write the entry to disk if it exists, is dirty, and if the * clear only flag is not set. */ - if (entry_ptr->is_dirty && !clear_only) { - + if (entry_ptr->is_dirty && !clear_only) write_entry = TRUE; - } - else { - + else write_entry = FALSE; - } /* if we have received close warning, and we have been instructed to * generate a metadata cache image, and we have actually constructed @@ -6447,8 +5681,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * Set suppress_image_entry_writes to TRUE if indicated by the * image_ctl flags. */ - if ((cache_ptr->close_warning_received) && (cache_ptr->image_ctl.generate_image) && - (cache_ptr->num_entries_in_image > 0) && (cache_ptr->image_entries != NULL)) { + if (cache_ptr->close_warning_received && cache_ptr->image_ctl.generate_image && + cache_ptr->num_entries_in_image > 0 && cache_ptr->image_entries != NULL) { /* Sanity checks */ HDassert(entry_ptr->image_up_to_date || !(entry_ptr->include_in_image)); @@ -6459,58 +5693,37 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) suppress_image_entry_frees = TRUE; - if (cache_ptr->image_ctl.flags & H5C_CI__SUPRESS_ENTRY_WRITES) { - + if (cache_ptr->image_ctl.flags & H5C_CI__SUPRESS_ENTRY_WRITES) suppress_image_entry_writes = TRUE; - - } /* end if */ - } /* end if */ + } /* end if */ /* run initial sanity checks */ #ifdef H5C_DO_SANITY_CHECKS if (cache_ptr->slist_enabled) { - if (entry_ptr->in_slist) { - HDassert(entry_ptr->is_dirty); - - if ((entry_ptr->flush_marker) && (!entry_ptr->is_dirty)) - + if (entry_ptr->flush_marker && !entry_ptr->is_dirty) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry in slist failed sanity checks") } /* end if */ else { - HDassert(!entry_ptr->is_dirty); HDassert(!entry_ptr->flush_marker); - - if ((entry_ptr->is_dirty) || (entry_ptr->flush_marker)) - + if (entry_ptr->is_dirty || entry_ptr->flush_marker) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry failed sanity checks") - } /* end else */ } else { /* slist is disabled */ - HDassert(!entry_ptr->in_slist); - - if (!entry_ptr->is_dirty) { - + if (!entry_ptr->is_dirty) if (entry_ptr->flush_marker) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flush marked clean entry?") - } } #endif /* H5C_DO_SANITY_CHECKS */ - if (entry_ptr->is_protected) { - - HDassert(!entry_ptr->is_protected); - + if (entry_ptr->is_protected) /* Attempt to flush a protected entry -- scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, FAIL, "Attempt to flush a protected entry") - } /* end if */ - /* Set entry_ptr->flush_in_progress = TRUE and set * entry_ptr->flush_marker = FALSE * @@ -6528,13 +5741,9 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * entry. */ if (write_entry || generate_image) { - HDassert(entry_ptr->is_dirty); - if (NULL == entry_ptr->image_ptr) { - if (NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") @@ -6545,16 +5754,13 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) } /* end if */ - if (!(entry_ptr->image_up_to_date)) { - + if (!entry_ptr->image_up_to_date) { /* Sanity check */ HDassert(!entry_ptr->prefetched); /* Generate the entry's image */ if (H5C__generate_image(f, cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image") - } /* end if ( ! (entry_ptr->image_up_to_date) ) */ } /* end if */ @@ -6565,12 +5771,10 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * flag should only be used in test code. */ if (write_entry) { - HDassert(entry_ptr->is_dirty); #ifdef H5C_DO_SANITY_CHECKS - if ((cache_ptr->check_write_permitted) && (!(cache_ptr->write_permitted))) - + if (cache_ptr->check_write_permitted && !cache_ptr->write_permitted) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!") #endif /* H5C_DO_SANITY_CHECKS */ @@ -6581,48 +5785,37 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This * flag should only be used in test code */ - if (((!suppress_image_entry_writes) || (!entry_ptr->include_in_image)) && - (((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0)) { - + if ((!suppress_image_entry_writes || !entry_ptr->include_in_image) && + ((entry_ptr->type->flags & H5C__CLASS_SKIP_WRITES) == 0)) { H5FD_mem_t mem_type = H5FD_MEM_DEFAULT; #ifdef H5_HAVE_PARALLEL if (cache_ptr->coll_write_list) { - if (H5SL_insert(cache_ptr->coll_write_list, entry_ptr, &entry_ptr->addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to insert skip list item") } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ - if (entry_ptr->prefetched) { - HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); - mem_type = cache_ptr->class_table_ptr[entry_ptr->prefetch_type_id]->mem_type; } /* end if */ - else { - + else mem_type = entry_ptr->type->mem_type; - } if (H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file") #ifdef H5_HAVE_PARALLEL } -#endif /* H5_HAVE_PARALLEL */ - +#endif /* H5_HAVE_PARALLEL */ } /* end if */ /* if the entry has a notify callback, notify it that we have * just flushed the entry. */ - if ((entry_ptr->type->notify) && - ((entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, entry_ptr) < 0)) - + if (entry_ptr->type->notify && + (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client of entry flush") - } /* if ( write_entry ) */ /* At this point, all pre-serialize and serialize calls have been @@ -6635,21 +5828,15 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* start by updating the statistics */ if (clear_only) { - /* only log a clear if the entry was dirty */ - if (was_dirty) { - + if (was_dirty) H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) - - } /* end if */ } else if (write_entry) { - HDassert(was_dirty); /* only log a flush if we actually wrote to disk */ H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) - } /* end else if */ /* Note that the algorithm below is (very) similar to the set of operations @@ -6659,16 +5846,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Update the cache internal data structures. */ if (destroy) { - /* Sanity checks */ - if (take_ownership) { - + if (take_ownership) HDassert(!destroy_entry); - } - else { - + else HDassert(destroy_entry); - } HDassert(!entry_ptr->is_pinned); @@ -6679,9 +5861,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * to be removed from the cache, send a 'before eviction' notice while * the entry is still fully integrated in the cache. */ - if ((entry_ptr->type->notify) && - ((entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, entry_ptr) < 0)) - + if (entry_ptr->type->notify && + (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry to evict") /* Update the cache internal data structures as appropriate @@ -6702,19 +5883,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL) - if ((entry_ptr->in_slist) && (del_from_slist_on_destroy)) { - + if (entry_ptr->in_slist && del_from_slist_on_destroy) H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) - } #ifdef H5_HAVE_PARALLEL /* Check for collective read access flag */ if (entry_ptr->coll_access) { - entry_ptr->coll_access = FALSE; - H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL) - } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -6722,16 +5898,13 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Remove entry from tag list */ if (H5C__untag_entry(cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove entry from tag list") /* verify that the entry is no longer part of any flush dependencies */ HDassert(entry_ptr->flush_dep_nparents == 0); HDassert(entry_ptr->flush_dep_nchildren == 0); - } /* end if */ else { - HDassert(clear_only || write_entry); HDassert(entry_ptr->is_dirty); HDassert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); @@ -6741,12 +5914,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * A clear and a flush are the same from the point of * view of the replacement policy and the slist. * Hence no differentiation between them. - * - * JRM -- 7/7/07 */ - H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, FAIL) - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush) /* mark the entry as clean and update the index for @@ -6755,35 +5924,27 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ entry_ptr->is_dirty = FALSE; - H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr); + H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr, FAIL); /* Check for entry changing status and do notifications, etc. */ if (was_dirty) { - /* If the entry's type has a 'notify' callback send a * 'entry cleaned' notice now that the entry is fully * integrated into the cache. */ - if ((entry_ptr->type->notify) && - ((entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0)) - + if (entry_ptr->type->notify && + (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag cleared") /* Propagate the clean flag up the flush dependency chain * if appropriate */ - if (entry_ptr->flush_dep_ndirty_children != 0) { - + if (entry_ptr->flush_dep_ndirty_children != 0) HDassert(entry_ptr->flush_dep_ndirty_children == 0); - } - - if (entry_ptr->flush_dep_nparents > 0) { - + if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_clean(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKCLEAN, FAIL, "Can't propagate flush dep clean flag") - } } /* end if */ } /* end else */ @@ -6801,7 +5962,6 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * Now discard the entry if appropriate. */ if (destroy) { - /* Sanity check */ HDassert(0 == entry_ptr->flush_dep_nparents); @@ -6812,14 +5972,10 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * * Otherwise, free the buffer if it exists. */ - if (suppress_image_entry_frees && entry_ptr->include_in_image) { - + if (suppress_image_entry_frees && entry_ptr->include_in_image) entry_ptr->image_ptr = NULL; - } - else if (entry_ptr->image_ptr != NULL) { - + else if (entry_ptr->image_ptr != NULL) entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); - } /* If the entry is not a prefetched entry, verify that the flush * dependency parents addresses array has been transferred. @@ -6828,17 +5984,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * the flush dependency parents addresses array if necessary. */ if (!entry_ptr->prefetched) { - HDassert(0 == entry_ptr->fd_parent_count); HDassert(NULL == entry_ptr->fd_parent_addrs); - } /* end if */ /* Check whether we should free the space in the file that * the entry occupies */ if (free_file_space) { - hsize_t fsf_size; /* Sanity checks */ @@ -6859,22 +6012,15 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * Otherwise use entry_ptr->size. */ if (entry_ptr->type->fsf_size) { - if ((entry_ptr->type->fsf_size)((void *)entry_ptr, &fsf_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "unable to get file space free size") - - } /* end if */ - else { /* no file space free size callback -- use entry size */ - + } /* end if */ + else /* no file space free size callback -- use entry size */ fsf_size = entry_ptr->size; - } /* Release the space on disk */ if (H5MF_xfree(f, entry_ptr->type->mem_type, entry_ptr->addr, fsf_size) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "unable to free file space for cache entry") - } /* end if ( free_file_space ) */ /* Reset the pointer to the cache the entry is within. -QAK */ @@ -6898,17 +6044,13 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) cache_ptr->entries_removed_counter++; cache_ptr->last_entry_removed_ptr = entry_ptr; - if (entry_ptr == cache_ptr->entry_watched_for_removal) { - + if (entry_ptr == cache_ptr->entry_watched_for_removal) cache_ptr->entry_watched_for_removal = NULL; - } /* Check for actually destroying the entry in memory */ /* (As opposed to taking ownership of it) */ if (destroy_entry) { - if (entry_ptr->is_dirty) { - /* Reset dirty flag */ entry_ptr->is_dirty = FALSE; @@ -6916,12 +6058,10 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * 'entry cleaned' notice now that the entry is fully * integrated into the cache. */ - if ((entry_ptr->type->notify) && - ((entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0)) - + if (entry_ptr->type->notify && + (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "can't notify client about entry dirty flag cleared") - } /* end if */ /* we are about to discard the in core representation -- @@ -6934,20 +6074,15 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(entry_ptr->image_ptr == NULL); if (entry_ptr->type->free_icr((void *)entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed") - } /* end if */ else { - HDassert(take_ownership); - /* client is taking ownership of the entry. - * set bad magic here too so the cache will choke - * unless the entry is re-inserted properly + /* Client is taking ownership of the entry. Set bad magic here too + * so the cache will choke unless the entry is re-inserted properly */ entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; - } /* end else */ } /* if (destroy) */ @@ -6955,36 +6090,25 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * so it doesn't go out of date */ if (update_page_buffer) { - /* Sanity check */ HDassert(!destroy); HDassert(entry_ptr->image_ptr); - if ((f->shared->page_buf) && (f->shared->page_buf->page_size >= entry_ptr->size)) { - + if (f->shared->page_buf && (f->shared->page_buf->page_size >= entry_ptr->size)) if (H5PB_update_entry(f->shared->page_buf, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) > 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Failed to update PB with metadata cache") - } /* end if */ - } /* end if */ - - if (cache_ptr->log_flush) { + } /* end if */ + if (cache_ptr->log_flush) if ((cache_ptr->log_flush)(cache_ptr, entry_addr, was_dirty, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed") - } /* end if */ - done: - HDassert((ret_value != SUCCEED) || (destroy_entry) || (!entry_ptr->flush_in_progress)); - HDassert((ret_value != SUCCEED) || (destroy_entry) || (take_ownership) || (!entry_ptr->is_dirty)); FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__flush_single_entry() */ /*------------------------------------------------------------------------- @@ -7165,9 +6289,7 @@ H5C__load_entry(H5F_t *f, #ifdef H5_HAVE_PARALLEL if (!coll_access || 0 == mpi_rank) { #endif /* H5_HAVE_PARALLEL */ - if (H5F_block_read(f, type->mem_type, addr, len, image) < 0) { - #ifdef H5_HAVE_PARALLEL if (coll_access) { /* Push an error, but still participate in following MPI_Bcast */ @@ -7226,7 +6348,6 @@ H5C__load_entry(H5F_t *f, */ if (H5F_block_read(f, type->mem_type, addr + len, actual_len - len, image + len) < 0) { - #ifdef H5_HAVE_PARALLEL if (coll_access) { /* Push an error, but still participate in following MPI_Bcast */ @@ -7506,23 +6627,17 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) prev_is_dirty = prev_ptr->is_dirty; if (entry_ptr->is_dirty && (entry_ptr->tag_info && entry_ptr->tag_info->corked)) { - /* Skip "dirty" corked entries. */ ++num_corked_entries; didnt_flush_entry = TRUE; } - else if (((entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID) && (!entry_ptr->flush_in_progress) && - (!entry_ptr->prefetched_dirty)) { - + else if ((entry_ptr->type->id != H5AC_EPOCH_MARKER_ID) && !entry_ptr->flush_in_progress && + !entry_ptr->prefetched_dirty) { didnt_flush_entry = FALSE; - if (entry_ptr->is_dirty) { - #if H5C_COLLECT_CACHE_STATS - if ((cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size) { - + if ((cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size) cache_ptr->entries_scanned_to_make_space++; - } #endif /* H5C_COLLECT_CACHE_STATS */ /* reset entries_removed_counter and @@ -7585,9 +6700,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) } if (prev_ptr != NULL) { - - if (didnt_flush_entry) { - + if (didnt_flush_entry) /* epoch markers don't get flushed, and we don't touch * entries that are in the process of being flushed. * Hence no need for sanity checks, as we haven't @@ -7595,10 +6708,8 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) * and go on. */ entry_ptr = prev_ptr; - } - else if ((restart_scan) || (prev_ptr->is_dirty != prev_is_dirty) || - (prev_ptr->next != next_ptr) || (prev_ptr->is_protected) || (prev_ptr->is_pinned)) { - + else if (restart_scan || prev_ptr->is_dirty != prev_is_dirty || prev_ptr->next != next_ptr || + prev_ptr->is_protected || prev_ptr->is_pinned) { /* something has happened to the LRU -- start over * from the tail. */ @@ -7606,26 +6717,18 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) entry_ptr = cache_ptr->LRU_tail_ptr; H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) } - else { - + else entry_ptr = prev_ptr; - } } - else { - + else entry_ptr = NULL; - } entries_examined++; - if (cache_ptr->index_size >= cache_ptr->max_cache_size) { - + if (cache_ptr->index_size >= cache_ptr->max_cache_size) empty_space = 0; - } - else { - + else empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; - } HDassert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); } @@ -7637,18 +6740,14 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) cache_ptr->total_dirty_pf_entries_skipped_in_msic += dirty_pf_entries_skipped; cache_ptr->total_entries_scanned_in_msic += total_entries_scanned; - if (clean_entries_skipped > cache_ptr->max_entries_skipped_in_msic) { - + if (clean_entries_skipped > cache_ptr->max_entries_skipped_in_msic) cache_ptr->max_entries_skipped_in_msic = clean_entries_skipped; - } if (dirty_pf_entries_skipped > cache_ptr->max_dirty_pf_entries_skipped_in_msic) cache_ptr->max_dirty_pf_entries_skipped_in_msic = dirty_pf_entries_skipped; - if (total_entries_scanned > cache_ptr->max_entries_scanned_in_msic) { - + if (total_entries_scanned > cache_ptr->max_entries_scanned_in_msic) cache_ptr->max_entries_scanned_in_msic = total_entries_scanned; - } #endif /* H5C_COLLECT_CACHE_STATS */ /* NEED: work on a better assert for corked entries */ @@ -7667,7 +6766,6 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ } else { - HDassert(H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS); #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS @@ -7683,15 +6781,14 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) prev_ptr = entry_ptr->aux_prev; - if ((!(entry_ptr->prefetched_dirty)) + if (!entry_ptr->prefetched_dirty #ifdef H5_HAVE_PARALLEL - && (!(entry_ptr->coll_access)) + && !entry_ptr->coll_access #endif /* H5_HAVE_PARALLEL */ ) { if (H5C__flush_single_entry( f, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") - } /* end if */ /* we are scanning the clean LRU, so the serialize function @@ -7718,7 +6815,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C_validate_lru_list + * Function: H5C__validate_lru_list * * Purpose: Debugging function that scans the LRU list for errors. * @@ -7734,14 +6831,14 @@ done: */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS herr_t -H5C_validate_lru_list(H5C_t *cache_ptr) +H5C__validate_lru_list(H5C_t *cache_ptr) { int32_t len = 0; size_t size = 0; H5C_cache_entry_t *entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -7770,7 +6867,7 @@ H5C_validate_lru_list(H5C_t *cache_ptr) ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry has bad prev/next pointers") - if ((entry_ptr->is_pinned) || (entry_ptr->pinned_from_client) || (entry_ptr->pinned_from_cache)) + if (entry_ptr->is_pinned || entry_ptr->pinned_from_client || entry_ptr->pinned_from_cache) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "invalid entry 'pin origin' fields") len++; @@ -7786,12 +6883,12 @@ done: HDassert(0); FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_validate_lru_list() */ +} /* H5C__validate_lru_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_validate_pinned_entry_list + * Function: H5C__validate_pinned_entry_list * * Purpose: Debugging function that scans the pinned entry list for * errors. @@ -7808,14 +6905,14 @@ done: */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS herr_t -H5C_validate_pinned_entry_list(H5C_t *cache_ptr) +H5C__validate_pinned_entry_list(H5C_t *cache_ptr) { int32_t len = 0; size_t size = 0; H5C_cache_entry_t *entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -7863,12 +6960,12 @@ done: HDassert(0); FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_validate_pinned_entry_list() */ +} /* H5C__validate_pinned_entry_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_validate_protected_entry_list + * Function: H5C__validate_protected_entry_list * * Purpose: Debugging function that scans the protected entry list for * errors. @@ -7885,14 +6982,14 @@ done: */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS herr_t -H5C_validate_protected_entry_list(H5C_t *cache_ptr) +H5C__validate_protected_entry_list(H5C_t *cache_ptr) { int32_t len = 0; size_t size = 0; H5C_cache_entry_t *entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -7940,12 +7037,12 @@ done: HDassert(0); FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_validate_protected_entry_list() */ +} /* H5C__validate_protected_entry_list() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ /*------------------------------------------------------------------------- * - * Function: H5C_entry_in_skip_list + * Function: H5C__entry_in_skip_list * * Purpose: Debugging function that scans skip list to see if it * is in present. We need this, as it is possible for @@ -7960,11 +7057,15 @@ done: */ #ifdef H5C_DO_SLIST_SANITY_CHECKS hbool_t -H5C_entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) +H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) { H5SL_node_t *node_ptr; hbool_t in_slist; + hbool_t ret_value; + FUNC_ENTER_PACKAGE + + /* Assertions */ HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_ptr->slist_ptr); @@ -7987,8 +7088,12 @@ H5C_entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) node_ptr = H5SL_next(node_ptr); } - return (in_slist); -} /* H5C_entry_in_skip_list() */ + /* Set return value */ + ret_value = in_slist; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__entry_in_skip_list() */ #endif /* H5C_DO_SLIST_SANITY_CHECKS */ /*------------------------------------------------------------------------- @@ -8002,18 +7107,8 @@ H5C_entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) * Programmer: Mike McGreevy * November 3, 2010 * - * Changes: Modified function to setup the slist before calling - * H%C_flush_cache(), and take it down afterwards. Note - * that the slist need not be empty after the call to - * H5C_flush_cache() since we are only flushing marked - * entries. Thus must set the clear_slist parameter - * of H5C_set_slist_enabled to TRUE. - * - * JRM -- 5/6/20 - * *------------------------------------------------------------------------- */ - herr_t H5C__flush_marked_entries(H5F_t *f) { @@ -8026,12 +7121,10 @@ H5C__flush_marked_entries(H5F_t *f) /* Enable the slist, as it is needed in the flush */ if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") /* Flush all marked entries */ if (H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") /* Disable the slist. Set the clear_slist parameter to TRUE @@ -8039,13 +7132,10 @@ H5C__flush_marked_entries(H5F_t *f) * H5C__FLUSH_MARKED_ENTRIES_FLAG. */ if (H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist failed") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__flush_marked_entries */ /*------------------------------------------------------------------------- @@ -8265,7 +7355,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5C__mark_flush_dep_serialized(H5C_cache_entry_t *entry_ptr) { int i; /* Local index variable */ @@ -8315,7 +7405,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t *entry_ptr) { unsigned u; /* Local index variable */ @@ -8412,8 +7502,6 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t *entry, const H5C_cache_en * The initial need for this routine is to settle all entries * in the cache prior to construction of the metadata cache * image so that the size of the cache image can be calculated. - * However, I gather that other uses for the routine are - * under consideration. * * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. @@ -8476,8 +7564,8 @@ H5C__serialize_cache(H5F_t *f) #endif /* H5C_DO_SANITY_CHECKS */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -8582,16 +7670,16 @@ done: * If the cache contains protected entries in the specified * ring, the function will fail, as protected entries cannot * be serialized. However all unprotected entries in the - * target ring should be serialized before the function - * returns failure. + * target ring should be serialized before the function + * returns failure. * * If flush dependencies appear in the target ring, the * function makes repeated passes through the index list - * serializing entries in flush dependency order. + * serializing entries in flush dependency order. * - * All entries outside the H5C_RING_SBE are marked for - * inclusion in the cache image. Entries in H5C_RING_SBE - * and below are marked for exclusion from the image. + * All entries outside the H5C_RING_SBE are marked for + * inclusion in the cache image. Entries in H5C_RING_SBE + * and below are marked for exclusion from the image. * * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. @@ -8861,7 +7949,7 @@ H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry HDassert(!entry_ptr->flush_in_progress); HDassert(entry_ptr->type); - /* Set entry_ptr->flush_in_progress to TRUE so the the target entry + /* Set entry_ptr->flush_in_progress to TRUE so the target entry * will not be evicted out from under us. Must set it back to FALSE * when we are done. */ @@ -8910,10 +7998,6 @@ done: * Programmer: Mohamad Chaarawi * 2/10/16 * - * Changes: Updated sanity checks for the possibility that the skip - * list is disabled. - * JRM 5/16/20 - * *------------------------------------------------------------------------- */ static herr_t @@ -8945,15 +8029,12 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) if ((entry_ptr->type->pre_serialize) && ((entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, entry_ptr->addr, entry_ptr->size, &new_addr, &new_len, &serialize_flags) < 0)) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to pre-serialize entry") /* Check for any flags set in the pre-serialize callback */ if (serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) { - /* Check for unexpected flags from serialize callback */ if (serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | H5C__SERIALIZE_MOVED_FLAG)) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unknown serialize flag(s)") #ifdef H5_HAVE_PARALLEL @@ -8975,16 +8056,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) * in the parallel case, it will not detect an * entry that dirties, resizes, and/or moves * other entries during its flush. - * - * From what Quincey tells me, this test is - * sufficient for now, as any flush routine that - * does the latter will also do the former. - * - * If that ceases to be the case, further - * tests will be necessary. */ if (cache_ptr->aux_ptr != NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "resize/move in serialize occurred in parallel case") #endif @@ -8992,14 +8065,12 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) * data structures */ if (serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { - /* Sanity check */ HDassert(new_len > 0); /* Allocate a new image buffer */ if (NULL == (entry_ptr->image_ptr = H5MM_realloc(entry_ptr->image_ptr, new_len + H5C_IMAGE_EXTRA_SPACE))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") @@ -9013,14 +8084,14 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) /* Update the hash table for the size change */ H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len, entry_ptr, - !(entry_ptr->is_dirty)); + !entry_ptr->is_dirty, FAIL); /* The entry can't be protected since we are in the process of * flushing it. Thus we must update the replacement policy data * structures for the size change. The macro deals with the pinned * case. */ - H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); + H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len, FAIL); /* As we haven't updated the cache data structures for * for the flush or flush destroy yet, the entry should @@ -9035,20 +8106,17 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) /* Finally, update the entry for its new size */ entry_ptr->size = new_len; - } /* end if */ /* If required, udate the entry and the cache data structures * for a move */ if (serialize_flags & H5C__SERIALIZE_MOVED_FLAG) { - /* Update stats and entries relocated counter */ H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) /* We must update cache data structures for the change in address */ if (entry_ptr->addr == old_addr) { - /* Delete the entry from the hash table and the slist */ H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL); H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE); @@ -9059,18 +8127,14 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) /* And then reinsert in the index and slist */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL); H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); - - } /* end if */ - else { /* move is already done for us -- just do sanity checks */ - + } /* end if */ + else /* move is already done for us -- just do sanity checks */ HDassert(entry_ptr->addr == new_addr); - } } /* end if */ } /* end if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) */ /* Serialize object into buffer */ if (entry_ptr->type->serialize(f, entry_ptr->image_ptr, entry_ptr->size, (void *)entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry") #if H5C_DO_MEMORY_SANITY_CHECKS @@ -9088,12 +8152,9 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) */ HDassert(entry_ptr->flush_dep_nunser_children == 0); - if (entry_ptr->flush_dep_nparents > 0) { - + if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_serialized(entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, "Can't propagate serialization status to fd parents") - } done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5CXmodule.h b/src/H5CXmodule.h index f9844a1..ffb4804 100644 --- a/src/H5CXmodule.h +++ b/src/H5CXmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Sunday, February 25, 2018 - * - * Purpose: This file contains declarations which define macros for the - * H5CX package. Including this header means that the source file - * is part of the H5CX package. + * Purpose: This file contains declarations which define macros for the + * H5CX package. Including this header means that the source file + * is part of the H5CX package. */ #ifndef H5CXmodule_H #define H5CXmodule_H diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 4d74a0a..ed95bcd 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -259,12 +259,6 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) * Programmer: John Mainzer * 11/15/14 * - * Changes: Updated function for the slist_enabled field in H5C_t. - * Recall that to minimize slist overhead, the slist is - * empty and not maintained if cache_ptr->slist_enabled is - * false. - * JRM -- 5/6/20 - * *------------------------------------------------------------------------- */ #ifndef NDEBUG @@ -297,49 +291,33 @@ H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn) i = 0; node_ptr = H5SL_first(cache_ptr->slist_ptr); - - if (node_ptr != NULL) { - + if (node_ptr != NULL) entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - } - else { - + else entry_ptr = NULL; - } while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDfprintf(stdout, "%s%d 0x%016llx %4lld %d/%d %d %s\n", cache_ptr->prefix, i, (long long)(entry_ptr->addr), (long long)(entry_ptr->size), (int)(entry_ptr->is_protected), (int)(entry_ptr->is_pinned), (int)(entry_ptr->is_dirty), entry_ptr->type->name); - HDfprintf(stdout, " node_ptr = %p, item = %p\n", (void *)node_ptr, H5SL_item(node_ptr)); /* increment node_ptr before we delete its target */ - node_ptr = H5SL_next(node_ptr); - - if (node_ptr != NULL) { - + if (node_ptr != NULL) entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - } - else { - + else entry_ptr = NULL; - } i++; - } /* end while */ } /* end if */ HDfprintf(stdout, "\n\n"); FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_dump_cache_skip_list() */ #endif /* NDEBUG */ diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index f6de3ff..1b55080 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -45,7 +45,7 @@ * * As a strategy for automatic cache size reduction, the cache may insert * marker entries in the LRU list at the end of each epoch. These markers - * are then used to identify entries that have not been accessed for n + * are then used to identify entries that have not been accessed for 'n' * epochs so that they can be evicted from the cache. * ****************************************************************************/ @@ -98,7 +98,6 @@ const H5AC_class_t H5AC_EPOCH_MARKER[1] = { * * None of these functions should ever be called, so there is no point in * documenting them separately. - * JRM - 11/16/04 * ***************************************************************************/ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 6fbd936..b8f46f1 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -80,6 +80,48 @@ /* Maximum ring allowed in image */ #define H5C_MAX_RING_IN_IMAGE H5C_RING_MDFSM +/*********************************************************************** + * + * Stats collection macros + * + * The following macros must handle stats collection when collection + * is enabled, and evaluate to the empty string when it is not. + * + ***********************************************************************/ +#if H5C_COLLECT_CACHE_STATS +/* clang-format off */ +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) \ + (cache_ptr)->images_created++; +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) \ +{ \ + /* make sure image len is still good */ \ + HDassert((cache_ptr)->image_len > 0); \ + (cache_ptr)->images_read++; \ +} +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \ +{ \ + /* make sure image len is still good */ \ + HDassert((cache_ptr)->image_len > 0); \ + (cache_ptr)->images_loaded++; \ + (cache_ptr)->last_image_size = (cache_ptr)->image_len; \ +} +#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) \ +{ \ + (cache_ptr)->prefetches++; \ + if (dirty) \ + (cache_ptr)->dirty_prefetches++; \ +} +#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) \ + (cache_ptr)->prefetch_hits++; +/* clang-format on */ +#else /* H5C_COLLECT_CACHE_STATS */ +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) +#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) +#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) +#endif /* H5C_COLLECT_CACHE_STATS */ + /******************/ /* Local Typedefs */ /******************/ @@ -298,8 +340,8 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) HDassert(fake_cache_ptr->image_entries); for (u = 0; u < fake_cache_ptr->num_entries_in_image; u++) { - (fake_cache_ptr->image_entries)[u].magic = H5C_IMAGE_ENTRY_T_MAGIC; - (fake_cache_ptr->image_entries)[u].image_ptr = NULL; + fake_cache_ptr->image_entries[u].magic = H5C_IMAGE_ENTRY_T_MAGIC; + fake_cache_ptr->image_entries[u].image_ptr = NULL; /* touch up f->shared->cache to satisfy sanity checks... */ f->shared->cache = fake_cache_ptr; @@ -310,43 +352,42 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) f->shared->cache = cache_ptr; /* verify expected contents */ - HDassert((cache_ptr->image_entries)[u].addr == (fake_cache_ptr->image_entries)[u].addr); - HDassert((cache_ptr->image_entries)[u].size == (fake_cache_ptr->image_entries)[u].size); - HDassert((cache_ptr->image_entries)[u].type_id == (fake_cache_ptr->image_entries)[u].type_id); - HDassert((cache_ptr->image_entries)[u].lru_rank == (fake_cache_ptr->image_entries)[u].lru_rank); - HDassert((cache_ptr->image_entries)[u].is_dirty == (fake_cache_ptr->image_entries)[u].is_dirty); + HDassert(cache_ptr->image_entries[u].addr == fake_cache_ptr->image_entries[u].addr); + HDassert(cache_ptr->image_entries[u].size == fake_cache_ptr->image_entries[u].size); + HDassert(cache_ptr->image_entries[u].type_id == fake_cache_ptr->image_entries[u].type_id); + HDassert(cache_ptr->image_entries[u].lru_rank == fake_cache_ptr->image_entries[u].lru_rank); + HDassert(cache_ptr->image_entries[u].is_dirty == fake_cache_ptr->image_entries[u].is_dirty); /* don't check image_fd_height as it is not stored in * the metadata cache image block. */ - HDassert((cache_ptr->image_entries)[u].fd_child_count == - (fake_cache_ptr->image_entries)[u].fd_child_count); - HDassert((cache_ptr->image_entries)[u].fd_dirty_child_count == - (fake_cache_ptr->image_entries)[u].fd_dirty_child_count); - HDassert((cache_ptr->image_entries)[u].fd_parent_count == - (fake_cache_ptr->image_entries)[u].fd_parent_count); + HDassert(cache_ptr->image_entries[u].fd_child_count == + fake_cache_ptr->image_entries[u].fd_child_count); + HDassert(cache_ptr->image_entries[u].fd_dirty_child_count == + fake_cache_ptr->image_entries[u].fd_dirty_child_count); + HDassert(cache_ptr->image_entries[u].fd_parent_count == + fake_cache_ptr->image_entries[u].fd_parent_count); - for (v = 0; v < (cache_ptr->image_entries)[u].fd_parent_count; v++) - HDassert((cache_ptr->image_entries)[u].fd_parent_addrs[v] == - (fake_cache_ptr->image_entries)[u].fd_parent_addrs[v]); + for (v = 0; v < cache_ptr->image_entries[u].fd_parent_count; v++) + HDassert(cache_ptr->image_entries[u].fd_parent_addrs[v] == + fake_cache_ptr->image_entries[u].fd_parent_addrs[v]); /* free the fd_parent_addrs array if it exists */ - if ((fake_cache_ptr->image_entries)[u].fd_parent_addrs) { - HDassert((fake_cache_ptr->image_entries)[u].fd_parent_count > 0); - (fake_cache_ptr->image_entries)[u].fd_parent_addrs = - (haddr_t *)H5MM_xfree((fake_cache_ptr->image_entries)[u].fd_parent_addrs); - (fake_cache_ptr->image_entries)[u].fd_parent_count = 0; + if (fake_cache_ptr->image_entries[u].fd_parent_addrs) { + HDassert(fake_cache_ptr->image_entries[u].fd_parent_count > 0); + fake_cache_ptr->image_entries[u].fd_parent_addrs = + (haddr_t *)H5MM_xfree(fake_cache_ptr->image_entries[u].fd_parent_addrs); + fake_cache_ptr->image_entries[u].fd_parent_count = 0; } /* end if */ else - HDassert((fake_cache_ptr->image_entries)[u].fd_parent_count == 0); + HDassert(fake_cache_ptr->image_entries[u].fd_parent_count == 0); - HDassert((cache_ptr->image_entries)[u].image_ptr); - HDassert((fake_cache_ptr->image_entries)[u].image_ptr); - HDassert(!HDmemcmp((cache_ptr->image_entries)[u].image_ptr, - (fake_cache_ptr->image_entries)[u].image_ptr, - (cache_ptr->image_entries)[u].size)); + HDassert(cache_ptr->image_entries[u].image_ptr); + HDassert(fake_cache_ptr->image_entries[u].image_ptr); + HDassert(!HDmemcmp(cache_ptr->image_entries[u].image_ptr, + fake_cache_ptr->image_entries[u].image_ptr, cache_ptr->image_entries[u].size)); - (fake_cache_ptr->image_entries)[u].image_ptr = - H5MM_xfree((fake_cache_ptr->image_entries)[u].image_ptr); + fake_cache_ptr->image_entries[u].image_ptr = + H5MM_xfree(fake_cache_ptr->image_entries[u].image_ptr); } /* end for */ HDassert((size_t)(q - (const uint8_t *)cache_ptr->image_buffer) == @@ -452,10 +493,6 @@ done: * * Programmer: John Mainzer, 8/10/15 * - * Changes: Updated sanity checks for possibility that the slist - * is disabled. - * JRM -- 5/17/20 - * *------------------------------------------------------------------------- */ herr_t @@ -696,12 +733,10 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t pf_entry_ptr->image_ptr = NULL; if (pf_entry_ptr->is_dirty) { - HDassert(((cache_ptr->slist_enabled) && (pf_entry_ptr->in_slist)) || ((!cache_ptr->slist_enabled) && (!pf_entry_ptr->in_slist))); flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; - } /* end if */ if (H5C__flush_single_entry(f, pf_entry_ptr, flush_flags) < 0) @@ -830,7 +865,7 @@ H5C__free_image_entries_array(H5C_t *cache_ptr) H5C_image_entry_t *ie_ptr; /* Image entry to release */ /* Get pointer to image entry */ - ie_ptr = &((cache_ptr->image_entries)[u]); + ie_ptr = &(cache_ptr->image_entries[u]); /* Sanity checks */ HDassert(ie_ptr); @@ -991,7 +1026,6 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) int mpi_result; if ((NULL == aux_ptr) || (aux_ptr->mpi_rank == 0)) { - HDassert((NULL == aux_ptr) || (aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC)); #endif /* H5_HAVE_PARALLEL */ @@ -1007,21 +1041,16 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) #ifdef H5_HAVE_PARALLEL if (aux_ptr) { - /* Broadcast cache image */ if (MPI_SUCCESS != (mpi_result = MPI_Bcast(cache_ptr->image_buffer, (int)cache_ptr->image_len, MPI_BYTE, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) - } /* end if */ } /* end if */ else if (aux_ptr) { - /* Retrieve the contents of the metadata cache image from process 0 */ if (MPI_SUCCESS != (mpi_result = MPI_Bcast(cache_ptr->image_buffer, (int)cache_ptr->image_len, MPI_BYTE, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "can't receive cache image MPI_Bcast", mpi_result) } /* end else-if */ } /* end block */ @@ -1579,7 +1608,6 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl /* The collective metadata write code is not currently compatible * with cache image. Until this is fixed, suppress cache image silently * if there is more than one process. - * JRM -- 11/8/16 */ if (cache_ptr->aux_ptr) { H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL; @@ -1871,7 +1899,7 @@ H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint HDassert(buf); HDassert(*buf); HDassert(entry_num < cache_ptr->num_entries_in_image); - ie_ptr = &((cache_ptr->image_entries)[entry_num]); + ie_ptr = &(cache_ptr->image_entries[entry_num]); HDassert(ie_ptr); HDassert(ie_ptr->magic == H5C_IMAGE_ENTRY_T_MAGIC); @@ -2222,7 +2250,7 @@ H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, unsigne HDassert(buf); HDassert(*buf); HDassert(entry_num < cache_ptr->num_entries_in_image); - ie_ptr = &((cache_ptr->image_entries)[entry_num]); + ie_ptr = &(cache_ptr->image_entries[entry_num]); HDassert(ie_ptr->magic == H5C_IMAGE_ENTRY_T_MAGIC); /* Get pointer to buffer to encode into */ @@ -2296,22 +2324,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C__prep_for_file_close__compute_fd_heights * - * Purpose: Recent modifications to flush dependency support in the - * metadata cache have removed the notion of flush dependency - * height. This is a problem for the cache image feature, - * as flush dependency height is used to order entries in the - * cache image so that flush dependency parents appear before - * flush dependency children. (Recall that the flush dependency - * height of an entry in a flush dependency relationship is the - * length of the longest path from the entry to a leaf entry -- - * that is an entry with flush dependency parents, but no - * flush dependency children. With the introduction of the - * possibility of multiple flush dependency parents, we have - * a flush partial dependency latice, not a flush dependency - * tree. But since the partial latice is acyclic, the concept - * of flush dependency height still makes sense. - * - * The purpose of this function is to compute the flush + * Purpose: The purpose of this function is to compute the flush * dependency height of all entries that appear in the cache * image. * @@ -2944,12 +2957,14 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) HDassert(num_entries_in_image <= num_entries_tentatively_in_image); #ifndef NDEBUG - unsigned j = 0; - for (int i = H5C_MAX_RING_IN_IMAGE + 1; i <= H5C_RING_SB; i++) - j += cache_ptr->index_ring_len[i]; + { + unsigned j = 0; + for (int i = H5C_MAX_RING_IN_IMAGE + 1; i <= H5C_RING_SB; i++) + j += cache_ptr->index_ring_len[i]; - /* This will change */ - HDassert(entries_visited == (num_entries_tentatively_in_image + j)); + /* This will change */ + HDassert(entries_visited == (num_entries_tentatively_in_image + j)); + } #endif cache_ptr->num_entries_in_image = num_entries_in_image; @@ -3147,23 +3162,17 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) i = -1; entry_ptr = cache_ptr->LRU_head_ptr; - while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->type != NULL); if (entry_ptr->prefetched) { - HDassert(entry_ptr->lru_rank != 0); HDassert((entry_ptr->lru_rank == -1) || (entry_ptr->lru_rank > i)); if ((entry_ptr->lru_rank > 1) && (entry_ptr->lru_rank > i + 1)) - lru_rank_holes += entry_ptr->lru_rank - (i + 1); - i = entry_ptr->lru_rank; - } /* end if */ entry_ptr = entry_ptr->next; @@ -3188,10 +3197,8 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) */ hbool_t write_permitted = FALSE; - if (cache_ptr->check_write_permitted != NULL) { - if ((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "Can't get write_permitted") - } /* end if */ + if (cache_ptr->check_write_permitted && (cache_ptr->check_write_permitted)(f, &write_permitted) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "Can't get write_permitted") else write_permitted = cache_ptr->write_permitted; diff --git a/src/H5Cmodule.h b/src/H5Cmodule.h index a3ef4d6..64c5279 100644 --- a/src/H5Cmodule.h +++ b/src/H5Cmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5C package. Including this header means that the source file - * is part of the H5C package. + * Purpose: This file contains declarations which define macros for the + * H5C package. Including this header means that the source file + * is part of the H5C package. */ #ifndef H5Cmodule_H #define H5Cmodule_H diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index cfd0780..a92ac10 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -212,7 +212,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha /* Create skip list of entries for collective write */ if (NULL == (cache_ptr->coll_write_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for entries") + HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list for entries") } /* end if */ n = num_candidates / (unsigned)mpi_size; @@ -220,8 +220,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha if (NULL == (candidate_assignment_table = (unsigned *)H5MM_malloc(sizeof(unsigned) * (size_t)(mpi_size + 1)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, - "memory allocation failed for candidate assignment table") + HGOTO_ERROR(H5E_CACHE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table") candidate_assignment_table[0] = 0; candidate_assignment_table[mpi_size] = num_candidates; @@ -402,22 +401,11 @@ done: * shouldn't be used elsewhere. * * Return: Success: SUCCEED - * * Failure: FAIL * * Programmer: John Mainzer * 3/17/10 * - * Changes: With the slist optimization, the slist is not maintained - * unless a flush is in progress. Thus we can not longer use - * cache_ptr->slist_size to determine the total size of - * the entries we must insert in the candidate list. - * - * To address this, we now use cache_ptr->dirty_index_size - * instead. - * - * JRM -- 7/27/20 - * *------------------------------------------------------------------------- */ herr_t @@ -440,16 +428,14 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) HDassert((!cache_ptr->slist_enabled) || (space_needed == cache_ptr->slist_size)); - /* Recall that while we shouldn't have any protected entries at this - * point, it is possible that some dirty entries may reside on the - * pinned list at this point. + /* We shouldn't have any protected entries at this point, but it is + * possible that some dirty entries may reside on the pinned list. */ HDassert(cache_ptr->dirty_index_size <= (cache_ptr->dLRU_list_size + cache_ptr->pel_size)); HDassert((!cache_ptr->slist_enabled) || (cache_ptr->slist_len <= (cache_ptr->dLRU_list_len + cache_ptr->pel_len))); - if (space_needed > 0) { /* we have work to do */ - + if (space_needed > 0) { H5C_cache_entry_t *entry_ptr; unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; @@ -461,11 +447,9 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; - while ((nominated_entries_size < space_needed) && ((!cache_ptr->slist_enabled) || (nominated_entries_count < cache_ptr->slist_len)) && (entry_ptr != NULL)) { - HDassert(!(entry_ptr->is_protected)); HDassert(!(entry_ptr->is_read_only)); HDassert(entry_ptr->ro_ref_count == 0); @@ -473,15 +457,13 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) HDassert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); nominated_addr = entry_ptr->addr; - if (H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; - entry_ptr = entry_ptr->aux_prev; + entry_ptr = entry_ptr->aux_prev; } /* end while */ HDassert(entry_ptr == NULL); @@ -490,13 +472,10 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) * protected entry list as well -- scan it too if necessary */ entry_ptr = cache_ptr->pel_head_ptr; - while ((nominated_entries_size < space_needed) && ((!cache_ptr->slist_enabled) || (nominated_entries_count < cache_ptr->slist_len)) && (entry_ptr != NULL)) { - if (entry_ptr->is_dirty) { - HDassert(!(entry_ptr->is_protected)); HDassert(!(entry_ptr->is_read_only)); HDassert(entry_ptr->ro_ref_count == 0); @@ -504,29 +483,22 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) HDassert(entry_ptr->in_slist); nominated_addr = entry_ptr->addr; - if (H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; - } /* end if */ entry_ptr = entry_ptr->next; - } /* end while */ HDassert((!cache_ptr->slist_enabled) || (nominated_entries_count == cache_ptr->slist_len)); HDassert(nominated_entries_size == space_needed); - } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_construct_candidate_list__clean_cache() */ /*------------------------------------------------------------------------- @@ -545,12 +517,6 @@ done: * Programmer: John Mainzer * 3/17/10 * - * Changes: With the slist optimization, the slist is not maintained - * unless a flush is in progress. Updated sanity checks to - * reflect this. - * - * JRM -- 7/27/20 - * *------------------------------------------------------------------------- */ herr_t @@ -570,30 +536,20 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) if (cache_ptr->max_cache_size > cache_ptr->index_size) { if (((cache_ptr->max_cache_size - cache_ptr->index_size) + cache_ptr->cLRU_list_size) >= - cache_ptr->min_clean_size) { - + cache_ptr->min_clean_size) space_needed = 0; - } - else { - + else space_needed = cache_ptr->min_clean_size - ((cache_ptr->max_cache_size - cache_ptr->index_size) + cache_ptr->cLRU_list_size); - } } /* end if */ else { - - if (cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size) { - + if (cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size) space_needed = 0; - } - else { - + else space_needed = cache_ptr->min_clean_size - cache_ptr->cLRU_list_size; - } } /* end else */ if (space_needed > 0) { /* we have work to do */ - H5C_cache_entry_t *entry_ptr; unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; @@ -604,11 +560,9 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) * entries to free up the necessary space. */ entry_ptr = cache_ptr->dLRU_tail_ptr; - while ((nominated_entries_size < space_needed) && ((!cache_ptr->slist_enabled) || (nominated_entries_count < cache_ptr->slist_len)) && (entry_ptr != NULL) && (!entry_ptr->flush_me_last)) { - haddr_t nominated_addr; HDassert(!(entry_ptr->is_protected)); @@ -618,15 +572,13 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) HDassert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); nominated_addr = entry_ptr->addr; - if (H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed") nominated_entries_size += entry_ptr->size; nominated_entries_count++; - entry_ptr = entry_ptr->aux_prev; + entry_ptr = entry_ptr->aux_prev; } /* end while */ HDassert((!cache_ptr->slist_enabled) || (nominated_entries_count <= cache_ptr->slist_len)); @@ -702,8 +654,8 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr HDassert(ce_array_ptr != NULL); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if (H5C_validate_protected_entry_list(cache_ptr) < 0 || H5C_validate_pinned_entry_list(cache_ptr) < 0 || - H5C_validate_lru_list(cache_ptr) < 0) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -721,8 +673,8 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr } /* end else */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if (H5C_validate_protected_entry_list(cache_ptr) < 0 || - H5C_validate_pinned_entry_list(cache_ptr) < 0 || H5C_validate_lru_list(cache_ptr) < 0) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || + H5C__validate_pinned_entry_list(cache_ptr) < 0 || H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed in for loop") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -785,14 +737,8 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr * resizes, or removals of other entries can occur as * a side effect of the flush. Hence, there is no need * for the checks for entry removal / status change - * that I ported to H5C_apply_candidate_list(). + * that are in H5C_apply_candidate_list(). * - * However, if (in addition to allowing such operations - * in the parallel case), we allow such operations outside - * of the pre_serialize / serialize routines, this may - * cease to be the case -- requiring a review of this - * point. - * JRM -- 4/7/15 */ entries_cleared = 0; entries_examined = 0; @@ -857,10 +803,8 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr u = 0; entry_ptr = cache_ptr->pl_head_ptr; while (entry_ptr != NULL) { - if (entry_ptr->clear_on_unprotect) { - + if (entry_ptr->clear_on_unprotect) u++; - } entry_ptr = entry_ptr->next; } HDassert((entries_cleared + u) == ce_array_len); @@ -868,9 +812,9 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr done: #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if (H5C_validate_protected_entry_list(cache_ptr) < 0 || H5C_validate_pinned_entry_list(cache_ptr) < 0 || - H5C_validate_lru_list(cache_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) @@ -1086,8 +1030,6 @@ done: * Programmer: John Mainzer * 2/10/17 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -1148,8 +1090,8 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES #endif /* H5C_DO_SANITY_CHECKS */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if (H5C_validate_protected_entry_list(cache_ptr) < 0 || H5C_validate_pinned_entry_list(cache_ptr) < 0 || - H5C_validate_lru_list(cache_ptr) < 0) + if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || + H5C__validate_lru_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1240,8 +1182,8 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu HDassert(ring < H5C_RING_NTYPES); #ifdef H5C_DO_EXTREME_SANITY_CHECKS - if ((H5C_validate_protected_entry_list(cache_ptr) < 0) || - (H5C_validate_pinned_entry_list(cache_ptr) < 0) || (H5C_validate_lru_list(cache_ptr) < 0)) + if ((H5C__validate_protected_entry_list(cache_ptr) < 0) || + (H5C__validate_pinned_entry_list(cache_ptr) < 0) || (H5C__validate_lru_list(cache_ptr) < 0)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -1464,12 +1406,8 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - /* Add this entry to the list of entries to collectively write - * - * This comment is misleading -- the entry will be added to the - * collective write list only if said list exists. - * - * JRM -- 2/9/17 + /* Add this entry to the list of entries to collectively + * write, if the list exists. */ if (H5C__flush_single_entry(f, op_ptr, op_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't flush entry") @@ -1491,12 +1429,6 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu entry_ptr->is_protected || !entry_ptr->is_pinned)) { /* Something has happened to the pinned entry list -- start * over from the head. - * - * Recall that this code should be un-reachable at present, - * as all the operations by entries on flush that could cause - * it to be reachable are disallowed in the parallel case at - * present. Hence the following assertion which should be - * removed if the above changes. */ HDassert(!restart_scan); @@ -1505,7 +1437,13 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu HDassert(!entry_ptr->is_protected); HDassert(entry_ptr->is_pinned); - HDassert(FALSE); /* see comment above */ + /* This code should be un-reachable at present, + * as all the operations by entries on flush that could cause + * it to be reachable are disallowed in the parallel case at + * present. Hence the following assertion which should be + * removed if the above changes. + */ + HDassert(FALSE); restart_scan = FALSE; diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 4f826d1..056c181 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -59,12 +59,6 @@ #define H5C_FLUSH_DEP_PARENT_INIT 8 -/* Set to TRUE to enable the slist optimization. If this field is TRUE, - * the slist is disabled whenever a flush is not in progress. - */ -#define H5C__SLIST_OPT_ENABLED TRUE - - /**************************************************************************** * * We maintain doubly linked lists of instances of H5C_cache_entry_t for a @@ -83,100 +77,17 @@ * to the HGOTO_ERROR macro, which may not be appropriate in all cases. * If so, we will need versions of the insertion and deletion macros which * do not reference the sanity checking macros. - * JRM - 5/5/04 - * - * Changes: - * - * - Removed the line: - * - * ( ( (Size) == (entry_ptr)->size ) && ( (len) != 1 ) ) || - * - * from the H5C__DLL_PRE_REMOVE_SC macro. With the addition of the - * epoch markers used in the age out based cache size reduction algorithm, - * this invariant need not hold, as the epoch markers are of size 0. - * - * One could argue that I should have given the epoch markers a positive - * size, but this would break the index_size = LRU_list_size + pl_size - * + pel_size invariant. - * - * Alternatively, I could pass the current decr_mode in to the macro, - * and just skip the check whenever epoch markers may be in use. - * - * However, any size errors should be caught when the cache is flushed - * and destroyed. Until we are tracking such an error, this should be - * good enough. - * JRM - 12/9/04 - * - * - * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: - * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || - * - * with: - * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || - * - * Epoch markers have size 0, so we can now have a non-empty list with - * zero size. Hence the "( (Size) <= 0 )" clause cause false failures - * in the sanity check. Since "Size" is typically a size_t, it can't - * take on negative values, and thus the revised clause "( (Size) < 0 )" - * caused compiler warnings. - * JRM - 12/22/04 - * - * - In the H5C__DLL_SC macro, replaced the lines: - * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || ( (cache_ptr)->size <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || - * - * with - * - * ( ( (len) == 1 ) && - * ( ( (head_ptr) != (tail_ptr) ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) - * ) || - * - * Epoch markers have size 0, so we can now have a non-empty list with - * zero size. Hence the "( (Size) <= 0 )" clause cause false failures - * in the sanity check. Since "Size" is typically a size_t, it can't - * take on negative values, and thus the revised clause "( (Size) < 0 )" - * caused compiler warnings. - * JRM - 1/10/05 - * - * - Added the H5C__DLL_UPDATE_FOR_SIZE_CHANGE macro and the associated - * sanity checking macros. These macro are used to update the size of - * a DLL when one of its entries changes size. - * - * JRM - 9/8/05 - * - * - Added macros supporting the index list -- a doubly liked list of - * all entries in the index. This list is necessary to reduce the - * cost of visiting all entries in the cache, which was previously - * done via a scan of the hash table. - * - * JRM - 10/15/15 * ****************************************************************************/ #ifdef H5C_DO_SANITY_CHECKS -#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( (head_ptr) == NULL ) || \ ( (tail_ptr) == NULL ) || \ ( (entry_ptr) == NULL ) || \ ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ + ( (list_size) < (entry_ptr)->size ) || \ ( ( (entry_ptr)->prev == NULL ) && ( (head_ptr) != (entry_ptr) ) ) || \ ( ( (entry_ptr)->next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ ( ( (len) == 1 ) && \ @@ -184,23 +95,23 @@ if ( ( (head_ptr) == NULL ) || \ ( (tail_ptr) == (entry_ptr) ) && \ ( (entry_ptr)->next == NULL ) && \ ( (entry_ptr)->prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ + ( (list_size) == (entry_ptr)->size ) \ ) \ ) \ ) \ ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "DLL pre remove SC failed") \ } -#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ ( (len) < 0 ) || \ - ( (Size) < 0 ) || \ + ( (list_size) < 0 ) || \ ( ( (len) == 1 ) && \ ( ( (head_ptr) != (tail_ptr) ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -209,10 +120,10 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) \ ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL sanity check failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "DLL sanity check failed") \ } -#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( (entry_ptr) == NULL ) || \ ( (entry_ptr)->next != NULL ) || \ ( (entry_ptr)->prev != NULL ) || \ @@ -221,7 +132,7 @@ if ( ( (entry_ptr) == NULL ) || \ ) || \ ( ( (len) == 1 ) && \ ( ( (head_ptr) != (tail_ptr) ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -230,39 +141,39 @@ if ( ( (entry_ptr) == NULL ) || \ ) \ ) \ ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "DLL pre insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "DLL pre insert SC failed") \ } -#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size, fail_val) \ if ( ( (dll_len) <= 0 ) || \ ( (dll_size) <= 0 ) || \ ( (old_size) <= 0 ) || \ ( (old_size) > (dll_size) ) || \ ( (new_size) <= 0 ) || \ ( ( (dll_len) == 1 ) && ( (old_size) != (dll_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL pre size update SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "DLL pre size update SC failed") \ } -#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ +#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size, fail_val) \ if ( ( (new_size) > (dll_size) ) || \ ( ( (dll_len) == 1 ) && ( (new_size) != (dll_size) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "DLL post size update SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "DLL post size update SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ -#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_SC(head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) -#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) -#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) +#define H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size, fail_val) +#define H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size, fail_val) #endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, \ fail_val) \ if ( (head_ptr) == NULL ) \ { \ @@ -276,12 +187,12 @@ if ( ( (new_size) > (dll_size) ) || \ (tail_ptr) = (entry_ptr); \ } \ (len)++; \ - (Size) += (entry_ptr)->size; \ + (list_size) += (entry_ptr)->size; \ } /* H5C__DLL_APPEND() */ -#define H5C__DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + H5C__DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, \ fail_val) \ if ( (head_ptr) == NULL ) \ { \ @@ -295,12 +206,12 @@ if ( ( (new_size) > (dll_size) ) || \ (head_ptr) = (entry_ptr); \ } \ (len)++; \ - (Size) += entry_ptr->size; \ + (list_size) += (entry_ptr)->size; \ } /* H5C__DLL_PREPEND() */ -#define H5C__DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + H5C__DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, \ fail_val) \ { \ if ( (head_ptr) == (entry_ptr) ) \ @@ -319,53 +230,53 @@ if ( ( (new_size) > (dll_size) ) || \ } \ else \ (entry_ptr)->next->prev = (entry_ptr)->prev; \ - entry_ptr->next = NULL; \ - entry_ptr->prev = NULL; \ + (entry_ptr)->next = NULL; \ + (entry_ptr)->prev = NULL; \ (len)--; \ - (Size) -= entry_ptr->size; \ + (list_size) -= (entry_ptr)->size; \ } \ } /* H5C__DLL_REMOVE() */ -#define H5C__DLL_UPDATE_FOR_SIZE_CHANGE(dll_len, dll_size, old_size, new_size) \ +#define H5C__DLL_UPDATE_FOR_SIZE_CHANGE(dll_len, dll_size, old_size, new_size, fail_val) \ { \ - H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ + H5C__DLL_PRE_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size, fail_val) \ (dll_size) -= (old_size); \ (dll_size) += (new_size); \ - H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size) \ + H5C__DLL_POST_SIZE_UPDATE_SC(dll_len, dll_size, old_size, new_size, fail_val) \ } /* H5C__DLL_UPDATE_FOR_SIZE_CHANGE() */ #ifdef H5C_DO_SANITY_CHECKS -#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( (hd_ptr) == NULL ) || \ ( (tail_ptr) == NULL ) || \ ( (entry_ptr) == NULL ) || \ ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ - ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ + ( (list_size) < (entry_ptr)->size ) || \ + ( ( (list_size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ ( ( (entry_ptr)->aux_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ ( ( (entry_ptr)->aux_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ ( ( (len) == 1 ) && \ ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ ( (entry_ptr)->aux_next == NULL ) && \ ( (entry_ptr)->aux_prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ + ( (list_size) == (entry_ptr)->size ) \ ) \ ) \ ) \ ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "aux DLL pre remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "aux DLL pre remove SC failed") \ } -#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ ( (len) < 0 ) || \ - ( (Size) < 0 ) || \ + ( (list_size) < 0 ) || \ ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ( ( (head_ptr) != (tail_ptr) ) || ( (list_size) <= 0 ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -374,10 +285,10 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) \ ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL sanity check failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "AUX DLL sanity check failed") \ } -#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( (entry_ptr) == NULL ) || \ ( (entry_ptr)->aux_next != NULL ) || \ ( (entry_ptr)->aux_prev != NULL ) || \ @@ -385,8 +296,8 @@ if ( ( (entry_ptr) == NULL ) || \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ ( ( (len) == 1 ) && \ - ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ + ( ( (hd_ptr) != (tail_ptr) ) || ( (list_size) <= 0 ) || \ + ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -395,21 +306,21 @@ if ( ( (entry_ptr) == NULL ) || \ ) \ ) \ ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "AUX DLL pre insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "AUX DLL pre insert SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ -#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) -#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, Size, fv) -#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) +#define H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__AUX_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) #endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__AUX_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val)\ +#define H5C__AUX_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val)\ { \ - H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, \ fail_val) \ if ( (head_ptr) == NULL ) \ { \ @@ -423,12 +334,12 @@ if ( ( (entry_ptr) == NULL ) || \ (tail_ptr) = (entry_ptr); \ } \ (len)++; \ - (Size) += entry_ptr->size; \ + (list_size) += entry_ptr->size; \ } /* H5C__AUX_DLL_APPEND() */ -#define H5C__AUX_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__AUX_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ + H5C__AUX_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ if ( (head_ptr) == NULL ) \ { \ (head_ptr) = (entry_ptr); \ @@ -441,12 +352,12 @@ if ( ( (entry_ptr) == NULL ) || \ (head_ptr) = (entry_ptr); \ } \ (len)++; \ - (Size) += entry_ptr->size; \ + (list_size) += entry_ptr->size; \ } /* H5C__AUX_DLL_PREPEND() */ -#define H5C__AUX_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__AUX_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ + H5C__AUX_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ if ( (head_ptr) == (entry_ptr) ) \ { \ @@ -467,35 +378,34 @@ if ( ( (entry_ptr) == NULL ) || \ entry_ptr->aux_next = NULL; \ entry_ptr->aux_prev = NULL; \ (len)--; \ - (Size) -= entry_ptr->size; \ + (list_size) -= entry_ptr->size; \ } \ } /* H5C__AUX_DLL_REMOVE() */ #ifdef H5C_DO_SANITY_CHECKS -#define H5C__IL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +#define H5C__IL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( (hd_ptr) == NULL ) || \ ( (tail_ptr) == NULL ) || \ ( (entry_ptr) == NULL ) || \ ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ - ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ + ( (list_size) < (entry_ptr)->size ) || \ + ( ( (list_size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ ( ( (entry_ptr)->il_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ ( ( (entry_ptr)->il_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) || \ ( ( (len) == 1 ) && \ ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ ( (entry_ptr)->il_next == NULL ) && \ ( (entry_ptr)->il_prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ + ( (list_size) == (entry_ptr)->size ) \ ) \ ) \ ) \ ) { \ - HDassert(0 && "il DLL pre remove SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "il DLL pre remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "il DLL pre remove SC failed") \ } -#define H5C__IL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +#define H5C__IL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( (entry_ptr) == NULL ) || \ ( (entry_ptr)->il_next != NULL ) || \ ( (entry_ptr)->il_prev != NULL ) || \ @@ -503,8 +413,8 @@ if ( ( (entry_ptr) == NULL ) || \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ ( ( (len) == 1 ) && \ - ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ + ( ( (hd_ptr) != (tail_ptr) ) || ( (list_size) <= 0 ) || \ + ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -513,17 +423,16 @@ if ( ( (entry_ptr) == NULL ) || \ ) \ ) \ ) { \ - HDassert(0 && "IL DLL pre insert SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "IL DLL pre insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "IL DLL pre insert SC failed") \ } -#define H5C__IL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__IL_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ ( ( (len) == 1 ) && \ ( ( (head_ptr) != (tail_ptr) ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -532,22 +441,21 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) \ ) { \ - HDassert(0 && "IL DLL sanity check failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "IL DLL sanity check failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "IL DLL sanity check failed") \ } #else /* H5C_DO_SANITY_CHECKS */ -#define H5C__IL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) -#define H5C__IL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) -#define H5C__IL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) +#define H5C__IL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__IL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__IL_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) #endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__IL_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val)\ +#define H5C__IL_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val)\ { \ - H5C__IL_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + H5C__IL_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, \ fail_val) \ if ( (head_ptr) == NULL ) \ { \ @@ -561,13 +469,13 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ (tail_ptr) = (entry_ptr); \ } \ (len)++; \ - (Size) += entry_ptr->size; \ - H5C__IL_DLL_SC(head_ptr, tail_ptr, len, Size, fail_val) \ + (list_size) += entry_ptr->size; \ + H5C__IL_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) \ } /* H5C__IL_DLL_APPEND() */ -#define H5C__IL_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__IL_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__IL_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ + H5C__IL_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ if ( (head_ptr) == (entry_ptr) ) \ { \ @@ -588,9 +496,9 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ entry_ptr->il_next = NULL; \ entry_ptr->il_prev = NULL; \ (len)--; \ - (Size) -= entry_ptr->size; \ + (list_size) -= entry_ptr->size; \ } \ - H5C__IL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ + H5C__IL_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) \ } /* H5C__IL_DLL_REMOVE() */ @@ -608,61 +516,55 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ***********************************************************************/ #define H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) \ - (cache_ptr->cache_accesses)++; \ - if ( hit ) { \ - (cache_ptr->cache_hits)++; \ - } \ + (cache_ptr)->cache_accesses++; \ + if (hit) \ + (cache_ptr)->cache_hits++; #if H5C_COLLECT_CACHE_STATS #define H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->index_size > (cache_ptr)->max_index_size ) \ - (cache_ptr)->max_index_size = (cache_ptr)->index_size; \ - if ( (cache_ptr)->clean_index_size > \ - (cache_ptr)->max_clean_index_size ) \ - (cache_ptr)->max_clean_index_size = \ - (cache_ptr)->clean_index_size; \ - if ( (cache_ptr)->dirty_index_size > \ - (cache_ptr)->max_dirty_index_size ) \ - (cache_ptr)->max_dirty_index_size = \ - (cache_ptr)->dirty_index_size; + if ((cache_ptr)->index_size > (cache_ptr)->max_index_size) \ + (cache_ptr)->max_index_size = (cache_ptr)->index_size; \ + if ((cache_ptr)->clean_index_size > (cache_ptr)->max_clean_index_size) \ + (cache_ptr)->max_clean_index_size = (cache_ptr)->clean_index_size; \ + if ((cache_ptr)->dirty_index_size > (cache_ptr)->max_dirty_index_size) \ + (cache_ptr)->max_dirty_index_size = (cache_ptr)->dirty_index_size; #define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) \ - (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++; - -#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) \ - if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ - (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->dirty_pins[(entry_ptr)->type->id]++; + +#define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) \ + if ((cache_ptr)->slist_len > (cache_ptr)->max_slist_len) \ + (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ + if ((cache_ptr)->slist_size > (cache_ptr)->max_slist_size) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ((cache_ptr)->pel_len > (cache_ptr)->max_pel_len) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ((cache_ptr)->pel_size > (cache_ptr)->max_pel_size) \ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; -#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \ - if ( cache_ptr->flush_in_progress ) \ - ((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \ - if ( entry_ptr->flush_in_progress ) \ - ((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \ - (((cache_ptr)->moves)[(entry_ptr)->type->id])++; \ - (cache_ptr)->entries_relocated_counter++; +#define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \ + if ((cache_ptr)->flush_in_progress) \ + (cache_ptr)->cache_flush_moves[(entry_ptr)->type->id]++; \ + if ((entry_ptr)->flush_in_progress) \ + (cache_ptr)->entry_flush_moves[(entry_ptr)->type->id]++; \ + (cache_ptr)->moves[(entry_ptr)->type->id]++; \ + (cache_ptr)->entries_relocated_counter++; #define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\ - if ( cache_ptr->flush_in_progress ) \ - ((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \ - if ( entry_ptr->flush_in_progress ) \ - ((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->size < (new_size) ) { \ - ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \ - H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ - (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ - } else if ( (entry_ptr)->size > (new_size) ) { \ - ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \ - } + if ((cache_ptr)->flush_in_progress) \ + (cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id]++; \ + if ((entry_ptr)->flush_in_progress) \ + (cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id]++; \ + if ((entry_ptr)->size < (new_size)) { \ + (cache_ptr)->size_increases[(entry_ptr)->type->id]++; \ + H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ + if ((cache_ptr)->slist_size > (cache_ptr)->max_slist_size) \ + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ((cache_ptr)->pl_size > (cache_ptr)->max_pl_size) \ + (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ + } else if ((entry_ptr)->size > (new_size)) \ + (cache_ptr)->size_decreases[(entry_ptr)->type->id]++; #define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ (cache_ptr)->total_ht_insertions++; @@ -671,7 +573,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ (cache_ptr)->total_ht_deletions++; #define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) \ - if ( success ) { \ + if (success) { \ (cache_ptr)->successful_ht_searches++; \ (cache_ptr)->total_successful_ht_search_depth += depth; \ } else { \ @@ -680,48 +582,16 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ } #define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \ - ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; + (cache_ptr)->unpins[(entry_ptr)->type->id]++; #define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) \ - ((cache_ptr)->slist_scan_restarts)++; + (cache_ptr)->slist_scan_restarts++; #define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) \ - ((cache_ptr)->LRU_scan_restarts)++; + (cache_ptr)->LRU_scan_restarts++; #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) \ - ((cache_ptr)->index_scan_restarts)++; - -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) \ -{ \ - (cache_ptr)->images_created++; \ -} - -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) \ -{ \ - /* make sure image len is still good */ \ - HDassert((cache_ptr)->image_len > 0); \ - (cache_ptr)->images_read++; \ -} - -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \ -{ \ - /* make sure image len is still good */ \ - HDassert((cache_ptr)->image_len > 0); \ - (cache_ptr)->images_loaded++; \ - (cache_ptr)->last_image_size = (cache_ptr)->image_len; \ -} - -#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) \ -{ \ - (cache_ptr)->prefetches++; \ - if ( dirty ) \ - (cache_ptr)->dirty_prefetches++; \ -} - -#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) \ -{ \ - (cache_ptr)->prefetch_hits++; \ -} + (cache_ptr)->index_scan_restarts++; #if H5C_COLLECT_CACHE_ENTRY_STATS @@ -735,113 +605,96 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ { \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ + (cache_ptr)->clears[(entry_ptr)->type->id]++; \ if((entry_ptr)->is_pinned) \ - (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ - ((entry_ptr)->clears)++; \ + (cache_ptr)->pinned_clears[(entry_ptr)->type->id]++; \ + (entry_ptr)->clears++; \ } #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ { \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ + (cache_ptr)->flushes[(entry_ptr)->type->id]++; \ if((entry_ptr)->is_pinned) \ - (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ - ((entry_ptr)->flushes)++; \ + (cache_ptr)->pinned_flushes[(entry_ptr)->type->id]++; \ + (entry_ptr)->flushes++; \ } #define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership) \ { \ - if ( take_ownership ) \ - (((cache_ptr)->take_ownerships)[(entry_ptr)->type->id])++; \ + if (take_ownership) \ + (cache_ptr)->take_ownerships[(entry_ptr)->type->id]++; \ else \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->accesses > \ - ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_accesses)[(entry_ptr)->type->id] = \ - (entry_ptr)->accesses; \ - if ( (entry_ptr)->accesses < \ - ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->min_accesses)[(entry_ptr)->type->id] = \ - (entry_ptr)->accesses; \ - if ( (entry_ptr)->clears > \ - ((cache_ptr)->max_clears)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_clears)[(entry_ptr)->type->id] \ - = (entry_ptr)->clears; \ - if ( (entry_ptr)->flushes > \ - ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_flushes)[(entry_ptr)->type->id] \ - = (entry_ptr)->flushes; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ - = (entry_ptr)->size; \ - if ( (entry_ptr)->pins > \ - ((cache_ptr)->max_pins)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_pins)[(entry_ptr)->type->id] \ - = (entry_ptr)->pins; \ + (cache_ptr)->evictions[(entry_ptr)->type->id]++; \ + if ((entry_ptr)->accesses > (cache_ptr)->max_accesses[(entry_ptr)->type->id]) \ + (cache_ptr)->max_accesses[(entry_ptr)->type->id] = (entry_ptr)->accesses; \ + if ((entry_ptr)->accesses < (cache_ptr)->min_accesses[(entry_ptr)->type->id]) \ + (cache_ptr)->min_accesses[(entry_ptr)->type->id] = (entry_ptr)->accesses; \ + if ((entry_ptr)->clears > (cache_ptr)->max_clears[(entry_ptr)->type->id]) \ + (cache_ptr)->max_clears[(entry_ptr)->type->id] = (entry_ptr)->clears; \ + if ((entry_ptr)->flushes > (cache_ptr)->max_flushes[(entry_ptr)->type->id]) \ + (cache_ptr)->max_flushes[(entry_ptr)->type->id] = (entry_ptr)->flushes; \ + if ((entry_ptr)->size > (cache_ptr)->max_size[(entry_ptr)->type->id]) \ + (cache_ptr)->max_size[(entry_ptr)->type->id] = (entry_ptr)->size; \ + if ((entry_ptr)->pins > (cache_ptr)->max_pins[(entry_ptr)->type->id]) \ + (cache_ptr)->max_pins[(entry_ptr)->type->id] = (entry_ptr)->pins; \ } #define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ { \ - (((cache_ptr)->insertions)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) { \ - (((cache_ptr)->pinned_insertions)[(entry_ptr)->type->id])++; \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + (cache_ptr)->insertions[(entry_ptr)->type->id]++; \ + if ((entry_ptr)->is_pinned) { \ + (cache_ptr)->pinned_insertions[(entry_ptr)->type->id]++; \ + (cache_ptr)->pins[(entry_ptr)->type->id]++; \ (entry_ptr)->pins++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + if ((cache_ptr)->pel_len > (cache_ptr)->max_pel_len) \ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + if ((cache_ptr)->pel_size > (cache_ptr)->max_pel_size) \ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + if ((cache_ptr)->index_len > (cache_ptr)->max_index_len) \ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ + if ((cache_ptr)->slist_len > (cache_ptr)->max_slist_len) \ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ - if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ + if ((cache_ptr)->slist_size > (cache_ptr)->max_slist_size) \ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] \ - = (entry_ptr)->size; \ - cache_ptr->entries_inserted_counter++; \ + if ((entry_ptr)->size > (cache_ptr)->max_size[(entry_ptr)->type->id]) \ + (cache_ptr)->max_size[(entry_ptr)->type->id] = (entry_ptr)->size; \ + (cache_ptr)->entries_inserted_counter++; \ } #define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ { \ - if ( hit ) \ - ((cache_ptr)->hits)[(entry_ptr)->type->id]++; \ + if (hit) \ + (cache_ptr)->hits[(entry_ptr)->type->id]++; \ else \ - ((cache_ptr)->misses)[(entry_ptr)->type->id]++; \ - if ( ! ((entry_ptr)->is_read_only) ) { \ - ((cache_ptr)->write_protects)[(entry_ptr)->type->id]++; \ - } else { \ - ((cache_ptr)->read_protects)[(entry_ptr)->type->id]++; \ - if ( ((entry_ptr)->ro_ref_count) > \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_read_protects)[(entry_ptr)->type->id] = \ - ((entry_ptr)->ro_ref_count); \ + (cache_ptr)->misses[(entry_ptr)->type->id]++; \ + if (!(entry_ptr)->is_read_only) \ + (cache_ptr)->write_protects[(entry_ptr)->type->id]++; \ + else { \ + (cache_ptr)->read_protects[(entry_ptr)->type->id]++; \ + if ((entry_ptr)->ro_ref_count > (cache_ptr)->max_read_protects[(entry_ptr)->type->id]) \ + (cache_ptr)->max_read_protects[(entry_ptr)->type->id] = (entry_ptr)->ro_ref_count; \ } \ - if ( (cache_ptr)->index_len > (cache_ptr)->max_index_len ) \ + if ((cache_ptr)->index_len > (cache_ptr)->max_index_len) \ (cache_ptr)->max_index_len = (cache_ptr)->index_len; \ H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ - if ( (cache_ptr)->pl_len > (cache_ptr)->max_pl_len ) \ + if ((cache_ptr)->pl_len > (cache_ptr)->max_pl_len) \ (cache_ptr)->max_pl_len = (cache_ptr)->pl_len; \ - if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ + if ((cache_ptr)->pl_size > (cache_ptr)->max_pl_size) \ (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ - if ( (entry_ptr)->size > \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] ) \ - ((cache_ptr)->max_size)[(entry_ptr)->type->id] = (entry_ptr)->size; \ - ((entry_ptr)->accesses)++; \ + if ((entry_ptr)->size > (cache_ptr)->max_size[(entry_ptr)->type->id]) \ + (cache_ptr)->max_size[(entry_ptr)->type->id] = (entry_ptr)->size; \ + (entry_ptr)->accesses++; \ } #define H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) \ { \ - ((cache_ptr)->pins)[(entry_ptr)->type->id]++; \ + (cache_ptr)->pins[(entry_ptr)->type->id]++; \ (entry_ptr)->pins++; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + if ((cache_ptr)->pel_len > (cache_ptr)->max_pel_len) \ (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + if ((cache_ptr)->pel_size > (cache_ptr)->max_pel_size) \ (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; \ } @@ -851,24 +704,24 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ { \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; \ + (cache_ptr)->clears[(entry_ptr)->type->id]++; \ if((entry_ptr)->is_pinned) \ - (((cache_ptr)->pinned_clears)[(entry_ptr)->type->id])++; \ + (cache_ptr)->pinned_clears[(entry_ptr)->type->id]++; \ } #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ { \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->is_pinned ) \ - (((cache_ptr)->pinned_flushes)[(entry_ptr)->type->id])++; \ + (cache_ptr)->flushes[(entry_ptr)->type->id]++; \ + if ((entry_ptr)->is_pinned) \ + (cache_ptr)->pinned_flushes[(entry_ptr)->type->id]++; \ } #define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership) \ { \ - if ( take_ownership ) \ - (((cache_ptr)->take_ownerships)[(entry_ptr)->type->id])++; \ + if (take_ownership) \ + (cache_ptr)->take_ownerships[(entry_ptr)->type->id]++; \ else \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; \ + (cache_ptr)->evictions[(entry_ptr)->type->id]++; \ } #define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) \ @@ -889,7 +742,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - cache_ptr->entries_inserted_counter++; \ + (cache_ptr)->entries_inserted_counter++; \ } #define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ @@ -938,7 +791,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) #define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) #define H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) -#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) +#define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) {} #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) #define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership) #define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) @@ -947,11 +800,6 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) -#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) -#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) -#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) #endif /* H5C_COLLECT_CACHE_STATS */ @@ -966,28 +814,6 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ * When modifying these macros, remember to modify the similar macros * in tst/cache.c * - * Changes: - * - * - Updated existing index macros and sanity check macros to maintain - * the clean_index_size and dirty_index_size fields of H5C_t. Also - * added macros to allow us to track entry cleans and dirties. - * - * JRM -- 11/5/08 - * - * - Updated existing index macros and sanity check macros to maintain - * the index_ring_len, index_ring_size, clean_index_ring_size, and - * dirty_index_ring_size fields of H5C_t. - * - * JRM -- 9/1/15 - * - * - Updated existing index macros and sanity checks macros to - * maintain an doubly linked list of all entries in the index. - * This is necessary to reduce the computational cost of visiting - * all entries in the index, which used to be done by scanning - * the hash table. - * - * JRM -- 10/15/15 - * ***********************************************************************/ /* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */ @@ -1024,7 +850,6 @@ if ( ( (cache_ptr) == NULL ) || \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ - HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "pre HT insert SC failed") \ } @@ -1046,11 +871,10 @@ if ( ( (cache_ptr) == NULL ) || \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size) ) { \ - HDassert(FALSE); \ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post HT insert SC failed") \ } -#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ +#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr, fail_val) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ ( (cache_ptr)->index_len < 1 ) || \ @@ -1087,11 +911,10 @@ if ( ( (cache_ptr) == NULL ) || \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "pre HT remove SC failed") \ } -#define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) \ +#define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr, fail_val) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ ( (entry_ptr) == NULL ) || \ @@ -1113,20 +936,19 @@ if ( ( (cache_ptr) == NULL ) || \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "post HT remove SC failed") \ } /* (Keep in sync w/H5C_TEST__PRE_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ -#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ +#define H5C__PRE_HT_SEARCH_SC(cache_ptr, entry_addr, fail_val) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ - ( ! H5F_addr_defined(Addr) ) || \ - ( H5C__HASH_FCN(Addr) < 0 ) || \ - ( H5C__HASH_FCN(Addr) >= H5C__HASH_TABLE_LEN ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "pre HT search SC failed") \ + ( ! H5F_addr_defined(entry_addr) ) || \ + ( H5C__HASH_FCN(entry_addr) < 0 ) || \ + ( H5C__HASH_FCN(entry_addr) >= H5C__HASH_TABLE_LEN ) ) { \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "pre HT search SC failed") \ } /* (Keep in sync w/H5C_TEST__POST_SUC_HT_SEARCH_SC macro in test/cache_common.h -QAK) */ @@ -1148,7 +970,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \ ( ( (entry_ptr)->ht_next != NULL ) && \ ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post successful HT search SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "post successful HT search SC failed") \ } /* (Keep in sync w/H5C_TEST__POST_HT_SHIFT_TO_FRONT macro in test/cache_common.h -QAK) */ @@ -1156,11 +978,11 @@ if ( ( (cache_ptr) == NULL ) || \ if ( ( (cache_ptr) == NULL ) || \ ( ((cache_ptr)->index)[k] != (entry_ptr) ) || \ ( (entry_ptr)->ht_prev != NULL ) ) { \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, fail_val, "post HT shift to front SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "post HT shift to front SC failed") \ } #define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ + entry_ptr, was_clean, fail_val) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len <= 0 ) || \ ( (cache_ptr)->index_size <= 0 ) || \ @@ -1190,12 +1012,11 @@ if ( ( (cache_ptr) == NULL ) || \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT entry size change SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "pre HT entry size change SC failed") \ } #define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ + entry_ptr, fail_val) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len <= 0 ) || \ ( (cache_ptr)->index_size <= 0 ) || \ @@ -1220,11 +1041,10 @@ if ( ( (cache_ptr) == NULL ) || \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) || \ ( (cache_ptr)->index_len != (cache_ptr)->il_len ) || \ ( (cache_ptr)->index_size != (cache_ptr)->il_size ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT entry size change SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "post HT entry size change SC failed") \ } -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr, fail_val) \ if ( \ ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ @@ -1247,11 +1067,10 @@ if ( \ ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT update for entry clean SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "pre HT update for entry clean SC failed") \ } -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr, fail_val) \ if ( \ ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ @@ -1274,11 +1093,10 @@ if ( \ ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "pre HT update for entry dirty SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "pre HT update for entry dirty SC failed") \ } -#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) \ +#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr, fail_val) \ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ @@ -1290,11 +1108,10 @@ if ( ( (cache_ptr)->index_size != \ ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT update for entry clean SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "post HT update for entry clean SC failed") \ } -#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) \ +#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr, fail_val) \ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ @@ -1306,27 +1123,26 @@ if ( ( (cache_ptr)->index_size != \ ( (cache_ptr)->index_ring_size[(entry_ptr)->ring] != \ ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring] + \ (cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) ) ) { \ - HDassert(FALSE); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "post HT update for entry dirty SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "post HT update for entry dirty SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ #define H5C__PRE_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) #define H5C__POST_HT_INSERT_SC(cache_ptr, entry_ptr, fail_val) -#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) -#define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) +#define H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr, fail_val) +#define H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr, fail_val) +#define H5C__PRE_HT_SEARCH_SC(cache_ptr, entry_addr, fail_val) #define H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, k, fail_val) #define H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) -#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr, fail_val) +#define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr, fail_val) #define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) + entry_ptr, was_clean, fail_val) #define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) -#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) -#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) + entry_ptr, fail_val) +#define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr, fail_val) +#define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr, fail_val) #endif /* H5C_DO_SANITY_CHECKS */ @@ -1343,16 +1159,16 @@ if ( ( (cache_ptr)->index_size != \ ((cache_ptr)->index)[k] = (entry_ptr); \ (cache_ptr)->index_len++; \ (cache_ptr)->index_size += (entry_ptr)->size; \ - ((cache_ptr)->index_ring_len[entry_ptr->ring])++; \ - ((cache_ptr)->index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->index_ring_len[(entry_ptr)->ring])++; \ + ((cache_ptr)->index_ring_size[(entry_ptr)->ring]) \ += (entry_ptr)->size; \ if((entry_ptr)->is_dirty) { \ (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ - ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) \ += (entry_ptr)->size; \ } else { \ (cache_ptr)->clean_index_size += (entry_ptr)->size; \ - ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring]) \ += (entry_ptr)->size; \ } \ if((entry_ptr)->flush_me_last) { \ @@ -1369,7 +1185,7 @@ if ( ( (cache_ptr)->index_size != \ #define H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, fail_val) \ { \ int k; \ - H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr) \ + H5C__PRE_HT_REMOVE_SC(cache_ptr, entry_ptr, fail_val) \ k = H5C__HASH_FCN((entry_ptr)->addr); \ if((entry_ptr)->ht_next) \ (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ @@ -1381,16 +1197,16 @@ if ( ( (cache_ptr)->index_size != \ (entry_ptr)->ht_prev = NULL; \ (cache_ptr)->index_len--; \ (cache_ptr)->index_size -= (entry_ptr)->size; \ - ((cache_ptr)->index_ring_len[entry_ptr->ring])--; \ - ((cache_ptr)->index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->index_ring_len[(entry_ptr)->ring])--; \ + ((cache_ptr)->index_ring_size[(entry_ptr)->ring]) \ -= (entry_ptr)->size; \ if((entry_ptr)->is_dirty) { \ (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ - ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) \ -= (entry_ptr)->size; \ } else { \ (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ - ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring]) \ -= (entry_ptr)->size; \ } \ if((entry_ptr)->flush_me_last) { \ @@ -1401,18 +1217,18 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->il_tail, (cache_ptr)->il_len, \ (cache_ptr)->il_size, fail_val) \ H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ - H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr) \ + H5C__POST_HT_REMOVE_SC(cache_ptr, entry_ptr, fail_val) \ } -#define H5C__SEARCH_INDEX(cache_ptr, Addr, entry_ptr, fail_val) \ +#define H5C__SEARCH_INDEX(cache_ptr, entry_addr, entry_ptr, fail_val) \ { \ int k; \ int depth = 0; \ - H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ - k = H5C__HASH_FCN(Addr); \ + H5C__PRE_HT_SEARCH_SC(cache_ptr, entry_addr, fail_val) \ + k = H5C__HASH_FCN(entry_addr); \ entry_ptr = ((cache_ptr)->index)[k]; \ while(entry_ptr) { \ - if(H5F_addr_eq(Addr, (entry_ptr)->addr)) { \ + if(H5F_addr_eq(entry_addr, (entry_ptr)->addr)) { \ H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, k, fail_val) \ if(entry_ptr != ((cache_ptr)->index)[k]) { \ if((entry_ptr)->ht_next) \ @@ -1433,84 +1249,58 @@ if ( ( (cache_ptr)->index_size != \ H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ } -#define H5C__SEARCH_INDEX_NO_STATS(cache_ptr, Addr, entry_ptr, fail_val) \ -{ \ - int k; \ - H5C__PRE_HT_SEARCH_SC(cache_ptr, Addr, fail_val) \ - k = H5C__HASH_FCN(Addr); \ - entry_ptr = ((cache_ptr)->index)[k]; \ - while(entry_ptr) { \ - if(H5F_addr_eq(Addr, (entry_ptr)->addr)) { \ - H5C__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, k, fail_val) \ - if(entry_ptr != ((cache_ptr)->index)[k]) { \ - if((entry_ptr)->ht_next) \ - (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ - HDassert((entry_ptr)->ht_prev != NULL); \ - (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ - ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \ - (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \ - (entry_ptr)->ht_prev = NULL; \ - ((cache_ptr)->index)[k] = (entry_ptr); \ - H5C__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k, fail_val) \ - } \ - break; \ - } \ - (entry_ptr) = (entry_ptr)->ht_next; \ - } \ -} - -#define H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr) \ +#define H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr, fail_val) \ { \ - H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ + H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr, fail_val) \ (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ - ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) \ -= (entry_ptr)->size; \ (cache_ptr)->clean_index_size += (entry_ptr)->size; \ - ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring]) \ += (entry_ptr)->size; \ - H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ + H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr, fail_val) \ } -#define H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) \ +#define H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr, fail_val) \ { \ - H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ + H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr, fail_val) \ (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ - ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring]) \ -= (entry_ptr)->size; \ (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ - ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ + ((cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring]) \ += (entry_ptr)->size; \ - H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ + H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr, fail_val) \ } #define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ + entry_ptr, was_clean, fail_val) \ { \ H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ + entry_ptr, was_clean, fail_val) \ (cache_ptr)->index_size -= (old_size); \ (cache_ptr)->index_size += (new_size); \ - ((cache_ptr)->index_ring_size[entry_ptr->ring]) -= (old_size); \ - ((cache_ptr)->index_ring_size[entry_ptr->ring]) += (new_size); \ + ((cache_ptr)->index_ring_size[(entry_ptr)->ring]) -= (old_size); \ + ((cache_ptr)->index_ring_size[(entry_ptr)->ring]) += (new_size); \ if(was_clean) { \ (cache_ptr)->clean_index_size -= (old_size); \ - ((cache_ptr)->clean_index_ring_size[entry_ptr->ring])-= (old_size); \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring])-= (old_size); \ } else { \ (cache_ptr)->dirty_index_size -= (old_size); \ - ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring])-= (old_size); \ + ((cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring])-= (old_size); \ } \ if((entry_ptr)->is_dirty) { \ (cache_ptr)->dirty_index_size += (new_size); \ - ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring])+= (new_size); \ + ((cache_ptr)->dirty_index_ring_size[(entry_ptr)->ring])+= (new_size); \ } else { \ (cache_ptr)->clean_index_size += (new_size); \ - ((cache_ptr)->clean_index_ring_size[entry_ptr->ring])+= (new_size); \ + ((cache_ptr)->clean_index_ring_size[(entry_ptr)->ring])+= (new_size); \ } \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->il_len, \ (cache_ptr)->il_size, \ - (old_size), (new_size)) \ + (old_size), (new_size), (fail_val)) \ H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ + entry_ptr, fail_val) \ } @@ -1518,9 +1308,6 @@ if ( ( (cache_ptr)->index_size != \ * * Skip list insertion and deletion macros: * - * These used to be functions, but I converted them to macros to avoid some - * function call overhead. - * **************************************************************************/ /*------------------------------------------------------------------------- @@ -1535,56 +1322,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/10/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function to set the in_tree flag when inserting - * an entry into the tree. Also modified the function to - * update the tree size and len fields instead of the similar - * index fields. - * - * All of this is part of the modifications to support the - * hash table. - * - * JRM -- 7/27/04 - * Converted the function H5C_insert_entry_in_tree() into - * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of - * wringing a little more speed out of the cache. - * - * Note that we don't bother to check if the entry is already - * in the tree -- if it is, H5SL_insert() will fail. - * - * QAK -- 11/27/04 - * Switched over to using skip list routines. - * - * JRM -- 6/27/06 - * Added fail_val parameter. - * - * JRM -- 8/25/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. - * - * This version maintains the slist_len_increase and - * slist_size_increase fields that are used in sanity - * checks in the flush routines. - * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. - * - * JRM -- 12/13/14 - * Added code to set cache_ptr->slist_changed to TRUE - * when an entry is inserted in the slist. - * - * JRM -- 9/1/15 - * Added code to maintain the cache_ptr->slist_ring_len - * and cache_ptr->slist_ring_size arrays. - * - * JRM -- 4/29/20 - * Reworked macro to support the slist_enabled field - * of H5C_t. If slist_enabled == TRUE, the macro - * functions as before. Otherwise, the macro is a no-op, - * and the slist must be empty. - * *------------------------------------------------------------------------- */ @@ -1602,12 +1339,12 @@ if ( ( (cache_ptr)->index_size != \ #ifdef H5C_DO_SLIST_SANITY_CHECKS -#define ENTRY_IN_SLIST(cache_ptr, entry_ptr) \ - H5C_entry_in_skip_list((cache_ptr), (entry_ptr)) +#define H5C_ENTRY_IN_SLIST(cache_ptr, entry_ptr) \ + H5C__entry_in_skip_list((cache_ptr), (entry_ptr)) #else /* H5C_DO_SLIST_SANITY_CHECKS */ -#define ENTRY_IN_SLIST(cache_ptr, entry_ptr) FALSE +#define H5C_ENTRY_IN_SLIST(cache_ptr, entry_ptr) FALSE #endif /* H5C_DO_SLIST_SANITY_CHECKS */ @@ -1625,7 +1362,7 @@ if ( ( (cache_ptr)->index_size != \ HDassert( (entry_ptr)->size > 0 ); \ HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ HDassert( !((entry_ptr)->in_slist) ); \ - HDassert( ! ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ + HDassert( ! H5C_ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ HDassert( (entry_ptr)->ring < H5C_RING_NTYPES ); \ HDassert( (cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ @@ -1668,7 +1405,7 @@ if ( ( (cache_ptr)->index_size != \ \ HDassert( (entry_ptr) ); \ HDassert( (entry_ptr)->size > 0 ); \ - HDassert( ! ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ + HDassert( ! H5C_ENTRY_IN_SLIST((cache_ptr), (entry_ptr)) ); \ HDassert( H5F_addr_defined((entry_ptr)->addr) ); \ HDassert( !((entry_ptr)->in_slist) ); \ HDassert( (entry_ptr)->ring > H5C_RING_UNDEFINED ); \ @@ -1716,33 +1453,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/10/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM - 7/27/04 - * Converted from the function H5C_remove_entry_from_tree() - * to the macro H5C__REMOVE_ENTRY_FROM_TREE in the hopes of - * wringing a little more performance out of the cache. - * - * QAK -- 11/27/04 - * Switched over to using skip list routines. - * - * JRM -- 3/28/07 - * Updated sanity checks for the new is_read_only and - * ro_ref_count fields in H5C_cache_entry_t. - * - * JRM -- 12/13/14 - * Added code to set cache_ptr->slist_changed to TRUE - * when an entry is removed from the slist. - * - * JRM -- 4/29/20 - * Reworked macro to support the slist_enabled field - * of H5C_t. If slist_enabled == TRUE, the macro - * functions as before. Otherwise, the macro is a no-op, - * and the slist must be empty. - * *------------------------------------------------------------------------- */ @@ -1780,7 +1490,7 @@ if ( ( (cache_ptr)->index_size != \ HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ (cache_ptr)->slist_size -= (entry_ptr)->size; \ ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])--; \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ + HDassert( (cache_ptr)->slist_ring_size[((entry_ptr)->ring)] >= \ (entry_ptr)->size ); \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size;\ (cache_ptr)->slist_len_increase--; \ @@ -1827,7 +1537,7 @@ if ( ( (cache_ptr)->index_size != \ HDassert( (cache_ptr)->slist_size >= (entry_ptr)->size ); \ (cache_ptr)->slist_size -= (entry_ptr)->size; \ ((cache_ptr)->slist_ring_len[(entry_ptr)->ring])--; \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ + HDassert( (cache_ptr)->slist_ring_size[((entry_ptr)->ring)] >= \ (entry_ptr)->size ); \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size;\ (entry_ptr)->in_slist = FALSE; \ @@ -1853,33 +1563,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 9/07/05 * - * Modifications: - * - * JRM -- 8/27/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. - * - * This version maintains the slist_size_increase field - * that are used in sanity checks in the flush routines. - * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. - * - * JRM -- 12/13/14 - * Note that we do not set cache_ptr->slist_changed to TRUE - * in this case, as the structure of the slist is not - * modified. - * - * JRM -- 9/1/15 - * Added code to maintain the cache_ptr->slist_ring_len - * and cache_ptr->slist_ring_size arrays. - * - * JRM -- 4/29/20 - * Reworked macro to support the slist_enabled field - * of H5C_t. If slist_enabled == TRUE, the macro - * functions as before. Otherwise, the macro is a no-op, - * and the slist must be empty. - * *------------------------------------------------------------------------- */ @@ -1908,7 +1591,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_size -= (old_size); \ (cache_ptr)->slist_size += (new_size); \ \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] \ + HDassert( (cache_ptr)->slist_ring_size[((entry_ptr)->ring)] \ >= (old_size) ); \ \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ @@ -1953,7 +1636,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->slist_size -= (old_size); \ (cache_ptr)->slist_size += (new_size); \ \ - HDassert( (cache_ptr)->slist_ring_size[(entry_ptr->ring)] >= \ + HDassert( (cache_ptr)->slist_ring_size[((entry_ptr)->ring)] >= \ (old_size) ); \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (old_size); \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (new_size); \ @@ -1976,146 +1659,10 @@ if ( ( (cache_ptr)->index_size != \ * * Replacement policy update macros: * - * These used to be functions, but I converted them to macros to avoid some - * function call overhead. - * **************************************************************************/ /*------------------------------------------------------------------------- * - * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS - * - * Purpose: For efficiency, we sometimes change the order of flushes -- - * but doing so can confuse the replacement policy. This - * macro exists to allow us to specify an entry as the - * most recently touched so we can repair any such - * confusion. - * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the macro - * should switch on the current policy and act accordingly. - * - * Return: N/A - * - * Programmer: John Mainzer, 10/13/05 - * - * Modifications: - * - * JRM -- 3/20/06 - * Modified macro to ignore pinned entries. Pinned entries - * do not appear in the data structures maintained by the - * replacement policy code, and thus this macro has nothing - * to do if called for such an entry. - * - * JRM -- 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * - *------------------------------------------------------------------------- - */ - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - -#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head.\ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* Use the dirty flag to infer whether the entry is on the clean or \ - * dirty LRU list, and remove it. Then insert it at the head of \ - * the same LRU list. \ - * \ - * At least initially, all entries should be clean. That may \ - * change, so we may as well deal with both cases now. \ - */ \ - \ - if ( (entry_ptr)->is_dirty ) { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ - (cache_ptr)->dLRU_tail_ptr, \ - (cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, (fail_val)) \ - } else { \ - H5C__AUX_DLL_REMOVE((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - \ - H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->cLRU_head_ptr, \ - (cache_ptr)->cLRU_tail_ptr, \ - (cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, (fail_val)) \ - } \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ - -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - -#define H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, fail_val) \ -{ \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ - HDassert( !((entry_ptr)->is_protected) ); \ - HDassert( !((entry_ptr)->is_read_only) ); \ - HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ - HDassert( (entry_ptr)->size > 0 ); \ - \ - if ( ! ((entry_ptr)->is_pinned) ) { \ - \ - /* modified LRU specific code */ \ - \ - /* remove the entry from the LRU list, and re-insert it at the head \ - */ \ - \ - H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ - (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, (fail_val)) \ - \ - /* End modified LRU specific code. */ \ - } \ -} /* H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS */ - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - -/*------------------------------------------------------------------------- - * * Macro: H5C__UPDATE_RP_FOR_EVICTION * * Purpose: Update the replacement policy data structures for an @@ -2130,30 +1677,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/10/04 * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_eviction() to the - * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze - * a bit more performance out of the cache. - * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * the pre-processor, I'll have to remove them. - * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. - * - * JRM - 3/20/06 - * Pinned entries can't be evicted, so this entry should never - * be called on a pinned entry. Added assert to verify this. - * - * JRM -- 3/28/07 - * Added sanity checks for the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * *------------------------------------------------------------------------- */ @@ -2241,32 +1764,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/6/04 * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_flush() to the - * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze - * a bit more performance out of the cache. - * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. - * - * JRM - 7/28/04 - * Split macro into two versions, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. - * - * JRM - 3/20/06 - * While pinned entries can be flushed, they don't reside in - * the replacement policy data structures when unprotected. - * Thus I modified this macro to do nothing if the entry is - * pinned. - * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * *------------------------------------------------------------------------- */ @@ -2430,7 +1927,7 @@ if ( ( (cache_ptr)->index_size != \ * appropriate. \ */ \ \ - if ( entry_ptr->is_dirty ) { \ + if ( (entry_ptr)->is_dirty ) { \ H5C__AUX_DLL_APPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ (cache_ptr)->dLRU_tail_ptr, \ (cache_ptr)->dLRU_list_len, \ @@ -2499,34 +1996,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/17/04 * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_insertion() to the - * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze - * a bit more performance out of the cache. - * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. - * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. - * - * JRM - 3/10/06 - * This macro should never be called on a pinned entry. - * Inserted an assert to verify this. - * - * JRM - 8/9/06 - * Not any more. We must now allow insertion of pinned - * entries. Updated macro to support this. - * - * JRM - 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * *------------------------------------------------------------------------- */ @@ -2564,7 +2033,7 @@ if ( ( (cache_ptr)->index_size != \ * appropriate. \ */ \ \ - if ( entry_ptr->is_dirty ) { \ + if ( (entry_ptr)->is_dirty ) { \ H5C__AUX_DLL_PREPEND((entry_ptr), (cache_ptr)->dLRU_head_ptr, \ (cache_ptr)->dLRU_tail_ptr, \ (cache_ptr)->dLRU_list_len, \ @@ -2637,31 +2106,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/17/04 * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_protect() to the - * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze - * a bit more performance out of the cache. - * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. - * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. - * - * JRM - 3/17/06 - * Modified macro to attempt to remove pinned entriese from - * the pinned entry list instead of from the data structures - * maintained by the replacement policy. - * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * *------------------------------------------------------------------------- */ @@ -2803,7 +2247,7 @@ if ( ( (cache_ptr)->index_size != \ HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ HDassert( (entry_ptr)->size > 0 ); \ \ - if ( ! ( (entry_ptr)->is_pinned ) && ! ( (entry_ptr->is_protected ) ) ) {\ + if ( ! ( (entry_ptr)->is_pinned ) && ! ( ((entry_ptr)->is_protected ) ) ) {\ \ /* modified LRU specific code */ \ \ @@ -2880,7 +2324,7 @@ if ( ( (cache_ptr)->index_size != \ HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ HDassert( (entry_ptr)->size > 0 ); \ \ - if ( ! ( (entry_ptr)->is_pinned ) && ! ( (entry_ptr->is_protected ) ) ) {\ + if ( ! ( (entry_ptr)->is_pinned ) && ! ( ((entry_ptr)->is_protected ) ) ) {\ \ /* modified LRU specific code */ \ \ @@ -2927,18 +2371,12 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 8/23/06 * - * Modifications: - * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * *------------------------------------------------------------------------- */ #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS -#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ +#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size, fail_val) \ { \ HDassert( (cache_ptr) ); \ HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ @@ -2954,7 +2392,7 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->coll_list_len, \ (cache_ptr)->coll_list_size, \ (entry_ptr)->size, \ - (new_size)); \ + (new_size), (fail_val)); \ \ } \ \ @@ -2963,7 +2401,7 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ (cache_ptr)->pel_size, \ (entry_ptr)->size, \ - (new_size)); \ + (new_size), (fail_val)); \ \ } else { \ \ @@ -2974,7 +2412,7 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, \ (entry_ptr)->size, \ - (new_size)); \ + (new_size), (fail_val)); \ \ /* Similarly, update the size of the clean or dirty LRU list as \ * appropriate. At present, the entry must be clean, but that \ @@ -2986,14 +2424,14 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \ (cache_ptr)->dLRU_list_size, \ (entry_ptr)->size, \ - (new_size)); \ + (new_size), (fail_val)); \ \ } else { \ \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \ (cache_ptr)->cLRU_list_size, \ (entry_ptr)->size, \ - (new_size)); \ + (new_size), (fail_val)); \ } \ \ /* End modified LRU specific code. */ \ @@ -3003,7 +2441,7 @@ if ( ( (cache_ptr)->index_size != \ #else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ -#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size) \ +#define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size, fail_val) \ { \ HDassert( (cache_ptr) ); \ HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ @@ -3019,7 +2457,7 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ (cache_ptr)->pel_size, \ (entry_ptr)->size, \ - (new_size)); \ + (new_size), (fail_val)); \ \ } else { \ \ @@ -3030,7 +2468,7 @@ if ( ( (cache_ptr)->index_size != \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, \ (entry_ptr)->size, \ - (new_size)); \ + (new_size), (fail_val)); \ \ /* End modified LRU specific code. */ \ } \ @@ -3060,12 +2498,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 3/22/06 * - * Modifications: - * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. - * *------------------------------------------------------------------------- */ @@ -3181,27 +2613,6 @@ if ( ( (cache_ptr)->index_size != \ * * Programmer: John Mainzer, 5/19/04 * - * Modifications: - * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_unprotect() to - * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to - * squeeze a bit more performance out of the cache. - * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. - * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. - * - * JRM - 3/17/06 - * Modified macro to put pinned entries on the pinned entry - * list instead of inserting them in the data structures - * maintained by the replacement policy. - * *------------------------------------------------------------------------- */ @@ -3309,37 +2720,36 @@ if ( ( (cache_ptr)->index_size != \ #ifdef H5C_DO_SANITY_CHECKS -#define H5C__COLL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) \ +#define H5C__COLL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( (hd_ptr) == NULL ) || \ ( (tail_ptr) == NULL ) || \ ( (entry_ptr) == NULL ) || \ ( (len) <= 0 ) || \ - ( (Size) < (entry_ptr)->size ) || \ - ( ( (Size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ + ( (list_size) < (entry_ptr)->size ) || \ + ( ( (list_size) == (entry_ptr)->size ) && ( ! ( (len) == 1 ) ) ) || \ ( ( (entry_ptr)->coll_prev == NULL ) && ( (hd_ptr) != (entry_ptr) ) ) || \ ( ( (entry_ptr)->coll_next == NULL ) && ( (tail_ptr) != (entry_ptr) ) ) ||\ ( ( (len) == 1 ) && \ ( ! ( ( (hd_ptr) == (entry_ptr) ) && ( (tail_ptr) == (entry_ptr) ) && \ ( (entry_ptr)->coll_next == NULL ) && \ ( (entry_ptr)->coll_prev == NULL ) && \ - ( (Size) == (entry_ptr)->size ) \ + ( (list_size) == (entry_ptr)->size ) \ ) \ ) \ ) \ ) { \ - HDassert(0 && "coll DLL pre remove SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "coll DLL pre remove SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "coll DLL pre remove SC failed") \ } -#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) \ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (head_ptr) != (tail_ptr) ) \ ) || \ ( (len) < 0 ) || \ - ( (Size) < 0 ) || \ + ( (list_size) < 0 ) || \ ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ + ( ( (head_ptr) != (tail_ptr) ) || ( (list_size) <= 0 ) || \ + ( (head_ptr) == NULL ) || ( (head_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -3348,11 +2758,10 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ) \ ) \ ) { \ - HDassert(0 && "COLL DLL sanity check failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL sanity check failed")\ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "COLL DLL sanity check failed")\ } -#define H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv)\ +#define H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val)\ if ( ( (entry_ptr) == NULL ) || \ ( (entry_ptr)->coll_next != NULL ) || \ ( (entry_ptr)->coll_prev != NULL ) || \ @@ -3360,8 +2769,8 @@ if ( ( (entry_ptr) == NULL ) || \ ( (hd_ptr) != (tail_ptr) ) \ ) || \ ( ( (len) == 1 ) && \ - ( ( (hd_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || \ - ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (Size) ) \ + ( ( (hd_ptr) != (tail_ptr) ) || ( (list_size) <= 0 ) || \ + ( (hd_ptr) == NULL ) || ( (hd_ptr)->size != (list_size) ) \ ) \ ) || \ ( ( (len) >= 1 ) && \ @@ -3370,22 +2779,21 @@ if ( ( (entry_ptr) == NULL ) || \ ) \ ) \ ) { \ - HDassert(0 && "COLL DLL pre insert SC failed"); \ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fv), "COLL DLL pre insert SC failed") \ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, (fail_val), "COLL DLL pre insert SC failed") \ } #else /* H5C_DO_SANITY_CHECKS */ -#define H5C__COLL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) -#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) -#define H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, Size, fv) +#define H5C__COLL_DLL_PRE_REMOVE_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__COLL_DLL_SC(head_ptr, tail_ptr, len, list_size, fail_val) +#define H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, hd_ptr, tail_ptr, len, list_size, fail_val) #endif /* H5C_DO_SANITY_CHECKS */ -#define H5C__COLL_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fail_val) \ +#define H5C__COLL_DLL_APPEND(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, \ + H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, \ fail_val) \ if ( (head_ptr) == NULL ) \ { \ @@ -3399,12 +2807,12 @@ if ( ( (entry_ptr) == NULL ) || \ (tail_ptr) = (entry_ptr); \ } \ (len)++; \ - (Size) += entry_ptr->size; \ + (list_size) += entry_ptr->size; \ } /* H5C__COLL_DLL_APPEND() */ -#define H5C__COLL_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__COLL_DLL_PREPEND(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv)\ + H5C__COLL_DLL_PRE_INSERT_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val)\ if ( (head_ptr) == NULL ) \ { \ (head_ptr) = (entry_ptr); \ @@ -3417,12 +2825,12 @@ if ( ( (entry_ptr) == NULL ) || \ (head_ptr) = (entry_ptr); \ } \ (len)++; \ - (Size) += entry_ptr->size; \ + (list_size) += entry_ptr->size; \ } /* H5C__COLL_DLL_PREPEND() */ -#define H5C__COLL_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, Size, fv) \ +#define H5C__COLL_DLL_REMOVE(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val) \ { \ - H5C__COLL_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, Size, fv)\ + H5C__COLL_DLL_PRE_REMOVE_SC(entry_ptr, head_ptr, tail_ptr, len, list_size, fail_val)\ { \ if ( (head_ptr) == (entry_ptr) ) \ { \ @@ -3445,7 +2853,7 @@ if ( ( (entry_ptr) == NULL ) || \ entry_ptr->coll_next = NULL; \ entry_ptr->coll_prev = NULL; \ (len)--; \ - (Size) -= entry_ptr->size; \ + (list_size) -= entry_ptr->size; \ } \ } /* H5C__COLL_DLL_REMOVE() */ @@ -3525,9 +2933,9 @@ if ( ( (entry_ptr) == NULL ) || \ #define H5C__MOVE_TO_TOP_IN_COLL_LIST(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert( (cache_ptr) ); \ - HDassert( (cache_ptr)->magic == H5C__H5C_T_MAGIC ); \ - HDassert( (entry_ptr) ); \ + HDassert((cache_ptr)); \ + HDassert((cache_ptr)->magic == H5C__H5C_T_MAGIC); \ + HDassert((entry_ptr)); \ \ /* Remove entry and insert at the head of the list. */ \ H5C__COLL_DLL_REMOVE((entry_ptr), (cache_ptr)->coll_head_ptr, \ @@ -3608,24 +3016,9 @@ typedef struct H5C_tag_info_t { * While the cache was designed with multiple replacement policies in mind, * at present only a modified form of LRU is supported. * - * JRM - 4/26/04 - * - * Profiling has indicated that searches in the instance of H5TB_TREE are - * too expensive. To deal with this issue, I have augmented the cache - * with a hash table in which all entries will be stored. Given the - * advantages of flushing entries in increasing address order, the TBBT - * is retained, but only dirty entries are stored in it. At least for - * now, we will leave entries in the TBBT after they are flushed. - * - * Note that index_size and index_len now refer to the total size of - * and number of entries in the hash table. - * - * JRM - 7/19/04 - * - * The TBBT has since been replaced with a skip list. This change - * greatly predates this note. - * - * JRM - 9/26/05 + * The cache has a hash table in which all entries are stored. Given the + * advantages of flushing entries in increasing address order, a skip list + * is used to track dirty entries. * * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. * This field is used to validate pointers to instances of @@ -3719,13 +3112,8 @@ typedef struct H5C_tag_info_t { * The cache requires an index to facilitate searching for entries. The * following fields support that index. * - * Addendum: JRM -- 10/14/15 - * - * We sometimes need to visit all entries in the cache. In the past, this - * was done by scanning the hash table. However, this is expensive, and - * we have come to scan the hash table often enough that it has become a - * performance issue. To repair this, I have added code to maintain a - * list of all entries in the index -- call this list the index list. + * We sometimes need to visit all entries in the cache, they are stored in + * the index list. * * The index list is maintained by the same macros that maintain the * index, and must have the same length and size as the index proper. @@ -3759,12 +3147,10 @@ typedef struct H5C_tag_info_t { * dirty_index_size == index_size. * * WARNING: - * - * The value of the clean_index_size must not be mistaken - * for the current clean size of the cache. Rather, the - * clean size of the cache is the current value of - * clean_index_size plus the amount of empty space (if any) - * in the cache. + * The value of the clean_index_size must not be mistaken for + * the current clean size of the cache. Rather, the clean size + * of the cache is the current value of clean_index_size plus + * the amount of empty space (if any) in the cache. * * clean_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to * maintain the sum of the sizes of all clean entries in the @@ -3786,7 +3172,7 @@ typedef struct H5C_tag_info_t { * H5C__HASH_TABLE_LEN. At present, this value is a power * of two, not the usual prime number. * - * I hope that the variable size of cache elements, the large + * Hopefully the variable size of cache elements, the large * hash table size, and the way in which HDF5 allocates space * will combine to avoid problems with periodicity. If so, we * can use a trivial hash function (a bit-and and a 3 bit left @@ -3827,11 +3213,10 @@ typedef struct H5C_tag_info_t { * This field is NULL if the index is empty. * * - * With the addition of the take ownership flag, it is possible that - * an entry may be removed from the cache as the result of the flush of - * a second entry. In general, this causes little trouble, but it is - * possible that the entry removed may be the next entry in the scan of - * a list. In this case, we must be able to detect the fact that the + * It is possible that an entry may be removed from the cache as the result + * of the flush of a second entry. In general, this causes little trouble, + * but it is possible that the entry removed may be the next entry in the + * scan of a list. In this case, we must be able to detect the fact that the * entry has been removed, so that the scan doesn't attempt to proceed with * an entry that is no longer in the cache. * @@ -3859,29 +3244,19 @@ typedef struct H5C_tag_info_t { * one. * * entry_watched_for_removal: Pointer to an instance of H5C_cache_entry_t - * which contains the 'next' entry for an iteration. Removing - * this entry must trigger a rescan of the iteration, so each - * entry removed from the cache is compared against this pointer - * and the pointer is reset to NULL if the watched entry is - * removed. - * (This functions similarly to a "dead man's switch") + * which contains the 'next' entry for an iteration. Removing + * this entry must trigger a rescan of the iteration, so each + * entry removed from the cache is compared against this pointer + * and the pointer is reset to NULL if the watched entry is + * removed. (This functions similarly to a "dead man's switch") * * * When we flush the cache, we need to write entries out in increasing * address order. An instance of a skip list is used to store dirty entries in - * sorted order. Whether it is cheaper to sort the dirty entries as needed, - * or to maintain the list is an open question. At a guess, it depends - * on how frequently the cache is flushed. We will see how it goes. - * - * For now at least, I will not remove dirty entries from the list as they - * are flushed. (this has been changed -- dirty entries are now removed from - * the skip list as they are flushed. JRM - 10/25/05) + * sorted order. * - * Update 4/21/20: - * - * Profiling indicates that the cost of maintaining the skip list is - * significant. As it is only used on flush and close, maintaining it - * only when needed is an obvious optimization. + * The cost of maintaining the skip list is significant. As it is only used + * on flush and close, it is maintained only when needed. * * To do this, we add a flag to control maintenanace of the skip list. * This flag is initially set to FALSE, which disables all operations @@ -3940,30 +3315,21 @@ typedef struct H5C_tag_info_t { * order, which results in significant savings. * * b) It facilitates checking for adjacent dirty entries when - * attempting to evict entries from the cache. While we - * don't use this at present, I hope that this will allow - * some optimizations when I get to it. + * attempting to evict entries from the cache. * * num_last_entries: The number of entries in the cache that can only be * flushed after all other entries in the cache have - * been flushed. At this time, this will only ever be - * one entry (the superblock), and the code has been - * protected with HDasserts to enforce this. This restraint - * can certainly be relaxed in the future if the need for - * multiple entries being flushed last arises, though - * explicit tests for that case should be added when said - * HDasserts are removed. - * - * Update: There are now two possible last entries - * (superblock and file driver info message). This - * number will probably increase as we add superblock - * messages. JRM -- 11/18/14 - * - * With the addition of the fractal heap, the cache must now deal with - * the case in which entries may be dirtied, moved, or have their sizes - * changed during a flush. To allow sanity checks in this situation, the - * following two fields have been added. They are only compiled in when - * H5C_DO_SANITY_CHECKS is TRUE. + * been flushed. + * + * Note: At this time, the this field will only be applied to + * two types of entries: the superblock and the file driver info + * message. The code utilizing these flags is protected with + * HDasserts to enforce this. + * + * The cache must deal with the case in which entries may be dirtied, moved, + * or have their sizes changed during a flush. To allow sanity checks in this + * situation, the following two fields have been added. They are only + * compiled in when H5C_DO_SANITY_CHECKS is TRUE. * * slist_len_increase: Number of entries that have been added to the * slist since the last time this field was set to zero. @@ -4020,8 +3386,8 @@ typedef struct H5C_tag_info_t { * * * For very frequently used entries, the protect/unprotect overhead can - * become burdensome. To avoid this overhead, I have modified the cache - * to allow entries to be "pinned". A pinned entry is similar to a + * become burdensome. To avoid this overhead, the cache + * allows entries to be "pinned". A pinned entry is similar to a * protected entry, in the sense that it cannot be evicted, and that * the entry can be modified at any time. * @@ -4034,7 +3400,7 @@ typedef struct H5C_tag_info_t { * * 2) A pinned entry can be accessed or modified at any time. * This places an additional burden on the associated pre-serialize - * and serialize callbacks, which must ensure the the entry is in + * and serialize callbacks, which must ensure the entry is in * a consistent state before creating an image of it. * * 3) A pinned entry can be marked as dirty (and possibly @@ -4072,29 +3438,15 @@ typedef struct H5C_tag_info_t { * The cache must have a replacement policy, and the fields supporting this * policy must be accessible from this structure. * - * While there has been interest in several replacement policies for - * this cache, the initial development schedule is tight. Thus I have - * elected to support only a modified LRU (least recently used) policy - * for the first cut. - * - * To further simplify matters, I have simply included the fields needed - * by the modified LRU in this structure. When and if we add support for - * other policies, it will probably be easiest to just add the necessary - * fields to this structure as well -- we only create one instance of this - * structure per file, so the overhead is not excessive. - * - * * Fields supporting the modified LRU policy: * - * See most any OS text for a discussion of the LRU replacement policy. - * * When operating in parallel mode, we must ensure that a read does not * cause a write. If it does, the process will hang, as the write will * be collective and the other processes will not know to participate. * - * To deal with this issue, I have modified the usual LRU policy by adding + * To deal with this issue, the usual LRU policy has been modified by adding * clean and dirty LRU lists to the usual LRU list. In general, these - * lists are only exist in parallel builds. + * lists only exist in parallel builds. * * The clean LRU list is simply the regular LRU list with all dirty cache * entries removed. @@ -4191,7 +3543,7 @@ typedef struct H5C_tag_info_t { * While the default cache size is adequate for most cases, we can run into * cases where the default is too small. Ideally, we will let the user * adjust the cache size as required. However, this is not possible in all - * cases. Thus I have added automatic cache size adjustment code. + * cases, so the cache has automatic cache size adjustment code. * * The configuration for the automatic cache size adjustment is stored in * the structure described below: @@ -4222,10 +3574,9 @@ typedef struct H5C_tag_info_t { * * resize_enabled: This is another convenience flag which is set whenever * a new set of values for resize_ctl are provided. Very - * simply, + * simply: * - * resize_enabled = size_increase_possible || - * size_decrease_possible; + * resize_enabled = size_increase_possible || size_decrease_possible; * * cache_full: Boolean flag used to keep track of whether the cache is * full, so we can refrain from increasing the size of a @@ -4248,11 +3599,6 @@ typedef struct H5C_tag_info_t { * and to prevent the infinite recursion that would otherwise * occur. * - * Note that this issue is not hypothetical -- this field - * was added 12/29/15 to fix a bug exposed in the testing - * of changes to the file driver info superblock extension - * management code needed to support rings. - * * msic_in_progress: As the metadata cache has become re-entrant, and as * the free space manager code has become more tightly * integrated with the metadata cache, it is possible that @@ -4265,11 +3611,6 @@ typedef struct H5C_tag_info_t { * and prevent the infinite regression that would otherwise * occur. * - * Note that this is issue is not hypothetical -- this field - * was added 2/16/17 to address this issue when it was - * exposed by modifications to test/fheap.c to cause it to - * use paged allocation. - * * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration * data for automatic cache resizing. * @@ -4362,8 +3703,8 @@ typedef struct H5C_tag_info_t { * call to H5C_protect(). * * image_loaded: Boolean flag indicating that the metadata cache has - * loaded the metadata cache image as directed by the - * MDC cache image superblock extension message. + * loaded the metadata cache image as directed by the + * MDC cache image superblock extension message. * * delete_image: Boolean flag indicating whether the metadata cache image * superblock message should be deleted and the cache image @@ -4398,7 +3739,7 @@ typedef struct H5C_tag_info_t { * order, we scan the index repeatedly, once for each flush dependency * height in increasing order. * - * This operation is complicated by the fact that entries other the the + * This operation is complicated by the fact that entries other than the * target may be inserted, loaded, relocated, or removed from the cache * (either by eviction or the take ownership flag) as the result of a * pre_serialize or serialize callback. While entry removals are not @@ -4476,11 +3817,11 @@ typedef struct H5C_tag_info_t { * free space manager metadata. * * mdfsm_settled: Boolean flag indicating whether the meta data free space - * manager is settled -- i.e. whether the correct space has - * been allocated for it in the file. + * manager is settled -- i.e. whether the correct space has + * been allocated for it in the file. * - * Note that the name of this field is deceptive. In the - * multi file case, the flag applies only to free space + * Note that the name of this field is deceptive. In the + * multi-file case, the flag applies only to free space * managers that are involved in allocating space for free * space managers. * @@ -4699,16 +4040,16 @@ typedef struct H5C_tag_info_t { * close, this field should only be set at that time. * * images_read: Integer field containing the number of cache images - * read from file. Note that reading an image is different - * from loading it -- reading the image means just that, - * while loading the image refers to decoding it and loading - * it into the metadata cache. + * read from file. Note that reading an image is different + * from loading it -- reading the image means just that, + * while loading the image refers to decoding it and loading + * it into the metadata cache. * - * In the serial case, image_read should always equal - * images_loaded. However, in the parallel case, the - * image should only be read by process 0. All other - * processes should receive the cache image via a broadcast - * from process 0. + * In the serial case, image_read should always equal + * images_loaded. However, in the parallel case, the + * image should only be read by process 0. All other + * processes should receive the cache image via a broadcast + * from process 0. * * images_loaded: Integer field containing the number of cache images * loaded since the last time statistics were reset. @@ -4719,21 +4060,19 @@ typedef struct H5C_tag_info_t { * should only change on those events. * * last_image_size: Size of the most recently loaded metadata cache image - * loaded into the cache, or zero if no image has been - * loaded. + * loaded into the cache, or zero if no image has been loaded. * - * At present, at most one cache image can be loaded into - * the metadata cache for any given file, and this image - * will be loaded either on the first protect, or on file - * close if no entry is protected before then. + * At present, at most one cache image can be loaded into + * the metadata cache for any given file, and this image + * will be loaded either on the first protect, or on file + * close if no entry is protected before then. * * * Fields for tracking prefetched entries. Note that flushes and evictions * of prefetched entries are tracked in the flushes and evictions arrays * discussed above. * - * prefetches: Number of prefetched entries that are loaded to the - * cache. + * prefetches: Number of prefetched entries that are loaded to the cache. * * dirty_prefetches: Number of dirty prefetched entries that are loaded * into the cache. @@ -4741,9 +4080,9 @@ typedef struct H5C_tag_info_t { * prefetch_hits: Number of prefetched entries that are actually used. * * - * As entries are now capable of moving, loading, dirtying, and deleting - * other entries in their pre_serialize and serialize callbacks, it has - * been necessary to insert code to restart scans of lists so as to avoid + * Entries may move, load, dirty, and delete + * other entries in their pre_serialize and serialize callbacks, there is + * code to restart scans of lists so as to avoid * improper behavior if the next entry in the list is the target of one on * these operations. * @@ -4757,9 +4096,9 @@ typedef struct H5C_tag_info_t { * entry in the scan. * * LRU_scan_restarts: Number of times a scan of the LRU list (that contains - * calls to H5C__flush_single_entry()) has been restarted to - * avoid potential issues with change of status of the next - * entry in the scan. + * calls to H5C__flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next + * entry in the scan. * * index_scan_restarts: Number of times a scan of the index has been * restarted to avoid potential issues with load, insertion @@ -4794,14 +4133,14 @@ typedef struct H5C_tag_info_t { * flushed in the current epoch. * * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum size of any single entry + * are used to record the maximum size of any single entry * with type id equal to the array index that has resided in * the cache in the current epoch. * * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times that any single - * entry with type id equal to the array index that has been - * marked as pinned in the cache in the current epoch. + * are used to record the maximum number of times that any single + * entry with type id equal to the array index that has been + * marked as pinned in the cache in the current epoch. * * * Fields supporting testing: @@ -4811,9 +4150,9 @@ typedef struct H5C_tag_info_t { * the processes mpi rank. * * get_entry_ptr_from_addr_counter: Counter used to track the number of - * times the H5C_get_entry_ptr_from_addr() function has been - * called successfully. This field is only defined when - * NDEBUG is not #defined. + * times the H5C_get_entry_ptr_from_addr() function has been + * called successfully. This field is only defined when + * NDEBUG is not #defined. * ****************************************************************************/ @@ -5076,8 +4415,6 @@ H5_DLL herr_t H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags); H5_DLL herr_t H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr); H5_DLL herr_t H5C__load_cache_image(H5F_t *f); -H5_DLL herr_t H5C__mark_flush_dep_serialized(H5C_cache_entry_t * entry_ptr); -H5_DLL herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, size_t space_needed, hbool_t write_permitted); H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f); @@ -5089,6 +4426,16 @@ H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_ H5_DLL herr_t H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__untag_entry(H5C_t *cache, H5C_cache_entry_t *entry); +#ifdef H5C_DO_SLIST_SANITY_CHECKS +H5_DLL hbool_t H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr); +#endif + +#ifdef H5C_DO_EXTREME_SANITY_CHECKS +H5_DLL herr_t H5C__validate_lru_list(H5C_t *cache_ptr); +H5_DLL herr_t H5C__validate_pinned_entry_list(H5C_t *cache_ptr); +H5_DLL herr_t H5C__validate_protected_entry_list(H5C_t *cache_ptr); +#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + /* Testing functions */ #ifdef H5C_TESTING H5_DLL herr_t H5C__verify_cork_tag_test(hid_t fid, H5O_token_t tag_token, hbool_t status); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 109f5f6..a5330ce 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -42,8 +42,6 @@ /* This sanity checking constant was picked out of the air. Increase * or decrease it if appropriate. Its purposes is to detect corrupt * object sizes, so it probably doesn't matter if it is a bit big. - * - * JRM - 5/17/04 */ #define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024)) @@ -978,8 +976,6 @@ typedef int H5C_ring_t; * * The fields of this structure are discussed individually below: * - * JRM - 4/26/04 - * * magic: Unsigned 32 bit integer that must always be set to * H5C__H5C_CACHE_ENTRY_T_MAGIC when the entry is valid. * The field must be set to H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC @@ -1100,15 +1096,9 @@ typedef int H5C_ring_t; * be unpinned (and possibly unprotected) during the * flush. * - * JRM -- 3/16/06 - * * in_slist: Boolean flag indicating whether the entry is in the skip list - * As a general rule, entries are placed in the list when they - * are marked dirty. However they may remain in the list after - * being flushed. - * - * Update: Dirty entries are now removed from the skip list - * when they are flushed. + * As a general rule, entries are placed in the list when they are + * marked dirty. * * flush_marker: Boolean flag indicating that the entry is to be flushed * the next time H5C_flush_cache() is called with the @@ -1116,24 +1106,13 @@ typedef int H5C_ring_t; * the entry is flushed for whatever reason. * * flush_me_last: Boolean flag indicating that this entry should not be - * flushed from the cache until all other entries without - * the flush_me_last flag set have been flushed. - * - * Note: - * - * At this time, the flush_me_last - * flag will only be applied to one entry, the superblock, - * and the code utilizing these flags is protected with HDasserts - * to enforce this. This restraint can certainly be relaxed in - * the future if the the need for multiple entries getting flushed - * last or collectively arises, though the code allowing for that - * will need to be expanded and tested appropriately if that - * functionality is desired. + * flushed from the cache until all other entries without the + * flush_me_last flag set have been flushed. * - * Update: There are now two possible last entries - * (superblock and file driver info message). This - * number will probably increase as we add superblock - * messages. JRM -- 11/18/14 + * Note: At this time, the flush_me_last flag will only be applied to + * two types of entries: the superblock and the file driver info + * message. The code utilizing these flags is protected with + * HDasserts to enforce this. * * clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used * to implement the metadata cache In the parallel case, only @@ -1228,8 +1207,6 @@ typedef int H5C_ring_t; * If there are multiple entries in any hash bin, they are stored in a doubly * linked list. * - * Addendum: JRM -- 10/14/15 - * * We have come to scan all entries in the cache frequently enough that * the cost of doing so by scanning the hash table has become unacceptable. * To reduce this cost, the index now also maintains a doubly linked list @@ -1691,8 +1668,6 @@ typedef struct H5C_cache_entry_t { * * The fields of this structure are discussed individually below: * - * JRM - 8/5/15 - * * magic: Unsigned 32 bit integer that must always be set to * H5C_IMAGE_ENTRY_T_MAGIC when the entry is valid. * The field must be set to H5C_IMAGE_ENTRY_T_BAD_MAGIC @@ -1855,7 +1830,7 @@ typedef struct H5C_image_entry_t { * H5C_auto_size_ctl_t passed to the cache must have a known * version number, or an error will be flagged. * - * report_fcn: Pointer to the function that is to be called to report + * rpt_fcn: Pointer to the function that is to be called to report * activities each time the auto cache resize code is executed. If the * field is NULL, no call is made. * @@ -1978,10 +1953,6 @@ typedef struct H5C_image_entry_t { * performance, however the above flash increment algorithm will not be * triggered. * - * Hopefully, the add space algorithm detailed above will be sufficient - * for the performance problems encountered to date. However, we should - * expect to revisit the issue. - * * flash_multiple: Double containing the multiple described above in the * H5C_flash_incr__add_space section of the discussion of the * flash_incr_mode section. This field is ignored unless flash_incr_mode @@ -2048,8 +2019,8 @@ typedef struct H5C_image_entry_t { * The field is a double containing the multiplier used to derive the * new cache size from the old if a cache size decrement is triggered. * The decrement must be in the range 0.0 (in which case the cache will - * try to contract to its minimum size) to 1.0 (in which case the - * cache will never shrink). + * try to contract to its minimum size) to 1.0 (in which case the + * cache will never shrink). * * apply_max_decrement: Boolean flag used to determine whether decrements * in cache size are to be limited by the max_decrement field. @@ -2295,16 +2266,6 @@ H5_DLL herr_t H5C_cache_image_status(H5F_t *f, hbool_t *load_ci_ptr, hbool_t * H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr); H5_DLL herr_t H5C_get_mdc_image_info(const H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); -#ifdef H5C_DO_SLIST_SANITY_CHECKS -H5_DLL hbool_t H5C_entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr); -#endif - -#ifdef H5C_DO_EXTREME_SANITY_CHECKS -H5_DLL herr_t H5C_validate_lru_list(H5C_t *cache_ptr); -H5_DLL herr_t H5C_validate_pinned_entry_list(H5C_t *cache_ptr); -H5_DLL herr_t H5C_validate_protected_entry_list(H5C_t *cache_ptr); -#endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - /* Logging functions */ H5_DLL herr_t H5C_start_logging(H5C_t *cache); H5_DLL herr_t H5C_stop_logging(H5C_t *cache); diff --git a/src/H5Dint.c b/src/H5Dint.c index a8e7307..e930c6a 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1016,7 +1016,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) #endif /* H5O_ENABLE_BOGUS */ /* Add a modification time message, if using older format. */ - /* (If using v18 format versions and above, the the modification time is part of the object + /* (If using v18 format versions and above, the modification time is part of the object * header and doesn't use a separate message -QAK) */ if (!use_at_least_v18) @@ -1506,7 +1506,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id) if (H5FO_top_incr(dataset->oloc.file, dataset->oloc.addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINC, NULL, "can't increment object count") - /* We're the first dataset to use the the shared info */ + /* We're the first dataset to use the shared info */ dataset->shared->fo_count = 1; /* Set the external file prefix */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 08766dd..804054e 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -42,11 +42,12 @@ /* Format version bounds for layout */ const unsigned H5O_layout_ver_bounds[] = { - H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ - H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ /* H5O_LAYOUT_VERSION_DEFAULT */ - H5O_LAYOUT_VERSION_4, /* H5F_LIBVER_V110 */ - H5O_LAYOUT_VERSION_4, /* H5F_LIBVER_V112 */ - H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ + H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ + H5O_LAYOUT_VERSION_3, + /* H5F_LIBVER_V18 */ /* H5O_LAYOUT_VERSION_DEFAULT */ + H5O_LAYOUT_VERSION_4, /* H5F_LIBVER_V110 */ + H5O_LAYOUT_VERSION_4, /* H5F_LIBVER_V112 */ + H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; /*****************************/ @@ -589,7 +590,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) htri_t msg_exists; /* Whether a particular type of message exists */ hbool_t pline_copied = FALSE; /* Flag to indicate that pline's message was copied */ hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */ - hbool_t efl_copied = FALSE; /* Flag to indicate that efl message was copied */ + hbool_t efl_copied = FALSE; /* Flag to indicate that the EFL message was copied */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -606,7 +607,6 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) if (NULL == H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") pline_copied = TRUE; - /* Set the I/O pipeline info in the property list */ if (H5P_set(plist, H5O_CRT_PIPELINE_NAME, &dataset->shared->dcpl_cache.pline) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set pipeline") diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h index 4bdf936..eb58f68 100644 --- a/src/H5Dmodule.h +++ b/src/H5Dmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5D package. Including this header means that the source file - * is part of the H5D package. + * Purpose: This file contains declarations which define macros for the + * H5D package. Including this header means that the source file + * is part of the H5D package. */ #ifndef H5Dmodule_H #define H5Dmodule_H diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 1e66f80..8e413c1 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1404,7 +1404,11 @@ done: *------------------------------------------------------------------------- */ static herr_t +#ifdef H5Dmpio_DEBUG H5D__link_piece_collective_io(H5D_io_info_t *io_info, int mpi_rank) +#else +H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_rank) +#endif { MPI_Datatype chunk_final_mtype; /* Final memory MPI datatype for all chunks with selection */ hbool_t chunk_final_mtype_is_derived = FALSE; @@ -4697,8 +4701,10 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch /* Find the chunk entry according to its chunk index */ HASH_FIND(hh, chunk_hash_table, &chunk_idx, sizeof(hsize_t), chunk_entry); - HDassert(chunk_entry); - HDassert(mpi_rank == chunk_entry->new_owner); + if (chunk_entry == NULL) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFIND, FAIL, "unable to find chunk entry") + if (mpi_rank != chunk_entry->new_owner) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "chunk owner set to incorrect MPI rank") /* * Only process the chunk if its data buffer is allocated. diff --git a/src/H5Doh.c b/src/H5Doh.c index 1e498bc..42cb543 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -282,7 +282,7 @@ H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) HDassert(crt_info); HDassert(obj_loc); - /* Create the the dataset */ + /* Create the dataset */ if (NULL == (dset = H5D__create(f, crt_info->type_id, crt_info->space, crt_info->dcpl_id, crt_info->dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 6a09408..0906028 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Monday, April 14, 2003 - * - * Purpose: This file contains declarations which are visible only within - * the H5D package. Source files outside the H5D package should - * include H5Dprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5D package. Source files outside the H5D package should + * include H5Dprivate.h instead. */ #if !(defined H5D_FRIEND || defined H5D_MODULE) #error "Do not include this file outside the H5D package!" diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 45b941a..9ec6f70 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -279,7 +279,7 @@ extern "C" { * * \p loc_id may specify a file, group, dataset, named datatype, * or attribute. If an attribute, dataset, or named datatype is - * specified then the dataset will be created at the location + * specified, then the dataset will be created at the location * where the attribute, dataset, or named datatype is attached. * * \p name may be either an absolute path in the file or a relative @@ -290,7 +290,7 @@ extern "C" { * file location where the dataset will be created, the datatype * is copied and converted to a transient type. * - * The link creation property list, \p lcpl_id, governs creation + * The link creation property list, \p lcpl_id, governs the creation * of the link(s) by which the new dataset is accessed and the * creation of any intermediate groups that may be missing. * @@ -348,12 +348,12 @@ H5_DLL hid_t H5Dcreate_async(hid_t loc_id, const char *name, hid_t type_id, hid * * \p loc_id may specify a file, group, dataset, named datatype, * or attribute. If an attribute, dataset, or named datatype is - * specified then the dataset will be created at the location + * specified, then the dataset will be created at the location * where the attribute, dataset, or named datatype is attached. * * The dataset’s datatype and dataspace are specified by * \p type_id and \p space_id, respectively. These are the - * datatype and dataspace of the dataset as it will exist in + * datatype and dataspace of the dataset as they will exist in * the file, which may differ from the datatype and dataspace * in application memory. * @@ -692,7 +692,7 @@ H5_DLL herr_t H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, u * context \p op_data. * * \par Example - * For each chunk, print the allocated chunk size (0 for un-allocated chunks). + * For each chunk, print the allocated chunk size (0 for unallocated chunks). * \snippet H5D_examples.c H5Dchunk_iter_cb * Iterate over all chunked datasets and chunks in a file. * \snippet H5D_examples.c H5Ovisit_cb @@ -729,17 +729,17 @@ H5_DLL herr_t H5Dchunk_iter(hid_t dset_id, hid_t dxpl_id, H5D_chunk_iter_op_t cb * * \p chk_idx is the chunk index in the selection. The index value * may have a value of 0 up to the number of chunks stored in - * the file that have a nonempty intersection with the file - * dataspace selection + * the file that has a nonempty intersection with the file + * dataspace selection. * * \note As of 1.10.5, the dataspace intersection is not yet - * supported, hence, the index is of all the written chunks. + * supported. Hence, the index is of all the written chunks. * * \p fspace_id specifies the file dataspace selection. It is - * intended to take #H5S_ALL for specifying the current selection. + * intended to take #H5S_ALL to specify the current selection. * * \note Please be aware that this function currently does not - * support non-trivial selections, thus \p fspace_id has no + * support non-trivial selections; thus \p fspace_id has no * effect. Also, the implementation does not handle the #H5S_ALL * macro correctly. As a workaround, an application can get * the dataspace for the dataset using H5Dget_space() and pass that @@ -893,7 +893,7 @@ H5_DLL herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_ * * This function will produce the same results as \p count calls to * H5Dread(). Information listed in that function about the specifics - * of its behaviour also apply to H5Dread_multi(). By calling + * of its behavior also applies to H5Dread_multi(). By calling * H5Dread_multi() instead of multiple calls to H5Dread(), however, the * library can in some cases pass information about the entire I/O * operation to the file driver, which can improve performance. @@ -1156,7 +1156,7 @@ H5_DLL herr_t H5Dwrite_multi_async(size_t count, hid_t dset_id[], hid_t mem_type * the file. Only one chunk can be written with this function. * * \p filters is a mask providing a record of which filters are - * used with the the chunk. The default value of the mask is + * used with the chunk. The default value of the mask is * zero (0), indicating that all enabled filters are applied. A * filter is skipped if the bit corresponding to the filter’s * position in the pipeline (0 ≤ position < 32) is turned on. @@ -1489,7 +1489,7 @@ H5_DLL herr_t H5Drefresh(hid_t dset_id); * \p op and scatters it to the supplied buffer \p dst_buf in a * manner similar to data being written to a dataset. * - * \p dst_space_id is a dataspace which defines the extent of \p + * \p dst_space_id is a dataspace that defines the extent of \p * dst_buf and the selection within it to scatter the data to. * * \p type_id is the datatype of the data to be scattered in both @@ -1546,7 +1546,7 @@ H5_DLL herr_t H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hi * enough to hold all the data if the callback function \p op is * not provided. * - * \p op is a callback function which handles the gathered data. + * \p op is a callback function that handles the gathered data. * It is optional if \p dst_buf is large enough to hold all of the * gathered data; required otherwise. * @@ -1715,10 +1715,10 @@ H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type); * * H5Dcreate() and H5Dcreate_anon() return a dataset identifier for * success or a negative value for failure. The dataset identifier - * should eventually be closed by calling H5Dclose() to release + * should eventually be closed by calling H5Dclose() to release the * resources it uses. * - * See H5Dcreate_anon() for discussion of the differences between + * See H5Dcreate_anon() for a discussion of the differences between * H5Dcreate() and H5Dcreate_anon(). * * The HDF5 library provides flexible means of specifying a fill value, @@ -1794,7 +1794,7 @@ H5_DLL hid_t H5Dopen1(hid_t loc_id, const char *name); * * This function ensures that the dataset dimensions are of at least * the sizes specified in size. The function H5Dset_extent() must be - * used if the dataset dimension sizes are are to be reduced. + * used if the dataset dimension sizes are to be reduced. * * \version 1.8.0 Function deprecated in this release. Parameter size * syntax changed to \Code{const hsize_t size[]} in this release. @@ -1822,7 +1822,7 @@ H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t size[]); * The \p type_id must be the datatype stored in the buffer. The \p * space_id describes the selection for the memory buffer to free the * VL datatypes within. The \p dxpl_id is the dataset transfer property - * list which was used for the I/O transfer to create the buffer. And + * list that was used for the I/O transfer to create the buffer. And * \p buf is the pointer to the buffer to be reclaimed. * * The VL structures (\ref hvl_t) in the user's buffer are modified to diff --git a/src/H5EAmodule.h b/src/H5EAmodule.h index bba2a99..f992393 100644 --- a/src/H5EAmodule.h +++ b/src/H5EAmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5EA package. Including this header means that the source file - * is part of the H5EA package. + * Purpose: This file contains declarations which define macros for the + * H5EA package. Including this header means that the source file + * is part of the H5EA package. */ #ifndef H5EAmodule_H #define H5EAmodule_H diff --git a/src/H5EApkg.h b/src/H5EApkg.h index 272f1b8..5014cc5 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Tuesday, June 17, 2008 - * * Purpose: This file contains declarations which are visible only * within the H5EA package. Source files outside the H5EA * package should include H5EAprivate.h instead. diff --git a/src/H5ESmodule.h b/src/H5ESmodule.h index 1e333f7..f128fee 100644 --- a/src/H5ESmodule.h +++ b/src/H5ESmodule.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Monday, April 6, 2020 - * * Purpose: This file contains declarations which define macros for the * H5ES package. Including this header means that the source file * is part of the H5ES package. @@ -120,7 +117,7 @@ * * \brief Event Set Interface * - * \details \Bold{This interface can be only used with the HDF5 VOL connectors that + * \details \Bold{This interface can only be used with the HDF5 VOL connectors that * enable the asynchronous feature in HDF5.} The native HDF5 library has * only synchronous operations. * diff --git a/src/H5ESpkg.h b/src/H5ESpkg.h index 68e16c1..655efbb 100644 --- a/src/H5ESpkg.h +++ b/src/H5ESpkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Wednesday, April 8, 2020 - * - * Purpose: This file contains declarations which are visible only within - * the H5ES package. Source files outside the H5ES package should - * include H5ESprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5ES package. Source files outside the H5ES package should + * include H5ESprivate.h instead. */ #if !(defined H5ES_FRIEND || defined H5ES_MODULE) #error "Do not include this file outside the H5ES package!" diff --git a/src/H5Emodule.h b/src/H5Emodule.h index 0e4655c..7c4a836 100644 --- a/src/H5Emodule.h +++ b/src/H5Emodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5E package. Including this header means that the source file - * is part of the H5E package. + * Purpose: This file contains declarations which define macros for the + * H5E package. Including this header means that the source file + * is part of the H5E package. */ #ifndef H5Emodule_H #define H5Emodule_H diff --git a/src/H5Epkg.h b/src/H5Epkg.h index c6097e9..c761179 100644 --- a/src/H5Epkg.h +++ b/src/H5Epkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Wednesday, April 11, 2007 - * - * Purpose: This file contains declarations which are visible only within - * the H5E package. Source files outside the H5E package should - * include H5Eprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5E package. Source files outside the H5E package should + * include H5Eprivate.h instead. */ #if !(defined H5E_FRIEND || defined H5E_MODULE) #error "Do not include this file outside the H5E package!" diff --git a/src/H5Epublic.h b/src/H5Epublic.h index dbc3457..c02049a 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -203,7 +203,7 @@ typedef herr_t (*H5E_auto2_t)(hid_t estack, void *client_data); * \param[in] cls_name Name of the error class * \param[in] lib_name Name of the client library or application to which the error class belongs * \param[in] version Version of the client library or application to which the - error class belongs. Can be \c NULL. + error class belongs. It can be \c NULL. * \return Returns a class identifier on success; otherwise returns H5I_INVALID_ID. * * \details H5Eregister_class() registers a client library or application @@ -341,12 +341,12 @@ H5_DLL herr_t H5Eclose_stack(hid_t stack_id); * * \param[in] class_id Error class identifier * \param[out] name Buffer for the error class name - * \param[in] size The maximum number of characters the class name to be returned - * by this function in\p name. + * \param[in] size The maximum number of characters of the class name to be returned + * by this function in \p name. * \return Returns non-negative value as on success; otherwise returns negative value. * * \details H5Eget_class_name() retrieves the name of the error class specified - * by the class identifier. If non-NULL pointer is passed in for \p + * by the class identifier. If a non-NULL pointer is passed in for \p * name and \p size is greater than zero, the class name of \p size * long is returned. The length of the error class name is also * returned. If NULL is passed in as \p name, only the length of class @@ -817,7 +817,7 @@ H5_DLL herr_t H5Epush1(const char *file, const char *func, unsigned line, H5E_ma * \deprecated 1.8.0 Function H5Eprint() renamed to H5Eprint1() and * deprecated in this release. * - * \details H5Eprint1() prints prints the error stack for the current thread + * \details H5Eprint1() prints the error stack for the current thread * on the specified stream, \p stream. Even if the error stack is empty, a * one-line message of the following form will be printed: * \code{.unparsed} diff --git a/src/H5FAmodule.h b/src/H5FAmodule.h index 3fbdb90..8ef7582 100644 --- a/src/H5FAmodule.h +++ b/src/H5FAmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5FA package. Including this header means that the source file - * is part of the H5FA package. + * Purpose: This file contains declarations which define macros for the + * H5FA package. Including this header means that the source file + * is part of the H5FA package. */ #ifndef H5FAmodule_H #define H5FAmodule_H diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 48aa8df..c08e575 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -11,11 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: - * - * Purpose: This file contains declarations which are visible only within - * the H5FA package. Source files outside the H5FA package should - * include H5FAprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5FA package. Source files outside the H5FA package should + * include H5FAprivate.h instead. */ #if !(defined(H5FA_FRIEND) | defined(H5FA_MODULE)) #error "Do not include this file outside the H5FA package!" diff --git a/src/H5FD.c b/src/H5FD.c index fd82217..9de4ad9 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1501,8 +1501,6 @@ done: * * Programmer: JRM -- 6/10/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -1581,8 +1579,6 @@ done: * * Programmer: JRM -- 6/10/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -1678,8 +1674,6 @@ done: * * Programmer: NAF -- 5/19/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -1779,8 +1773,6 @@ done: * * Programmer: NAF -- 5/14/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5FDcore.h b/src/H5FDcore.h index fbff138..e4d792b 100644 --- a/src/H5FDcore.h +++ b/src/H5FDcore.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, August 2, 1999 - * * Purpose: The public header file for the core driver. */ #ifndef H5FDcore_H diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h index faa85db..7858dfd 100644 --- a/src/H5FDdirect.h +++ b/src/H5FDdirect.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * Wednesday, 20 September 2006 - * * Purpose: The public header file for the direct driver. */ #ifndef H5FDdirect_H diff --git a/src/H5FDdrvr_module.h b/src/H5FDdrvr_module.h index 4a7a4d1..c984cf5 100644 --- a/src/H5FDdrvr_module.h +++ b/src/H5FDdrvr_module.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5FD driver package. Including this header means that the source file - * is part of the H5FD driver package. + * Purpose: This file contains declarations which define macros for the + * H5FD driver package. Including this header means that the source file + * is part of the H5FD driver package. */ #ifndef H5FDdrvr_module_H #define H5FDdrvr_module_H diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h index b0c560f..76020f0 100644 --- a/src/H5FDfamily.h +++ b/src/H5FDfamily.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, August 4, 1999 - * * Purpose: The public header file for the family driver. */ #ifndef H5FDfamily_H diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index d81e8a5..2c64237 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -924,7 +924,7 @@ done: * or "meta" (any other flag) * * Prints filename and listing of total number of reads and bytes read, - * both as a grand total and separate meta- and rawdata reads. + * both as a grand total and separate meta- and raw data reads. * * If any reads were done, prints out two tables: * @@ -1153,11 +1153,11 @@ hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub, suffixes[suffix_i], /* bin ceiling */ m->count, /* metadata reads */ - r->count, /* rawdata reads */ + r->count, /* raw data reads */ bm_val, bm_suffix, /* metadata bytes */ - br_val, br_suffix, /* rawdata bytes */ + br_val, br_suffix, /* raw data bytes */ am_val, am_suffix, /* metadata average */ - ar_val, ar_suffix); /* rawdata average */ + ar_val, ar_suffix); /* raw data average */ HDfflush(stream); } diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index e3888d2..c8c2c37 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Jacob Smith - * 2018-04-23 - * * Purpose: The public header file for the hdfs driver. */ @@ -90,11 +87,6 @@ extern "C" { * * TBD: If -1, relies on a default value. * - * - * - * Programmer: Jacob Smith - * 2018-04-23 - * ****************************************************************************/ #define H5FD__CURR_HDFS_FAPL_T_VERSION 1 diff --git a/src/H5FDint.c b/src/H5FDint.c index e1cb5ff..c5b8713 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -346,8 +346,6 @@ done: * * Programmer: JRM -- 6/10/20 * - * Changes: None - * *------------------------------------------------------------------------- */ herr_t @@ -558,8 +556,6 @@ done: * * Programmer: JRM -- 6/10/20 * - * Changes: None - * *------------------------------------------------------------------------- */ herr_t @@ -742,8 +738,6 @@ done: * * Programmer: NAF -- 5/13/21 * - * Changes: None - * *------------------------------------------------------------------------- */ static herr_t @@ -1066,8 +1060,6 @@ done: * * Programmer: NAF -- 3/29/21 * - * Changes: None - * *------------------------------------------------------------------------- */ herr_t @@ -1232,8 +1224,6 @@ done: * * Programmer: NAF -- 5/19/21 * - * Changes: None - * *------------------------------------------------------------------------- */ herr_t @@ -1387,8 +1377,6 @@ done: * * Programmer: NAF -- 5/13/21 * - * Changes: None - * *------------------------------------------------------------------------- */ static herr_t @@ -1709,8 +1697,6 @@ done: * * Programmer: NAF -- 3/29/21 * - * Changes: None - * *------------------------------------------------------------------------- */ herr_t @@ -1867,8 +1853,6 @@ done: * * Programmer: NAF -- 5/19/21 * - * Changes: None - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5FDlog.h b/src/H5FDlog.h index 96ded83..ae4e2d0 100644 --- a/src/H5FDlog.h +++ b/src/H5FDlog.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Monday, April 17, 2000 - * * Purpose: The public header file for the log driver. */ #ifndef H5FDlog_H diff --git a/src/H5FDmodule.h b/src/H5FDmodule.h index 728b4b8..1e29ca9 100644 --- a/src/H5FDmodule.h +++ b/src/H5FDmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5FD package. Including this header means that the source file - * is part of the H5FD package. + * Purpose: This file contains declarations which define macros for the + * H5FD package. Including this header means that the source file + * is part of the H5FD package. */ #ifndef H5FDmodule_H #define H5FDmodule_H diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index e71c739..b7b7489 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -40,16 +40,6 @@ * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Changes: Reworked function to use the ctl callback so we can get - * rid of H5FD_class_mpi_t. Since there are no real limits - * on what the ctl callback can do, its file parameter can't - * be constant. Thus, I had to remove the const qualifier - * on this functions file parameter as well. Note also the - * circumlocution required to use the ctl callbacks output - * parameter to pass back the rank without introducing - * compiler warnings. - * JRM -- 8/13/21 - * *------------------------------------------------------------------------- */ int @@ -92,16 +82,6 @@ done: * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Changes: Reworked function to use the ctl callback so we can get - * rid of H5FD_class_mpi_t. Since there are no real limits - * on what the ctl callback can do, its file parameter can't - * be constant. Thus, I had to remove the const qualifier - * on this functions file parameter as well. Note also the - * circumlocution required to use the ctl callbacks output - * parameter to pass back the rank without introducing - * compiler warnings. - * JRM -- 8/13/21 - * *------------------------------------------------------------------------- */ int @@ -145,16 +125,6 @@ done: * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Changes: Reworked function to use the ctl callback so we can get - * rid of H5FD_class_mpi_t. Since there are no real limits - * on what the ctl callback can do, its file parameter can't - * be constant. Thus, I had to remove the const qualifier - * on this functions file parameter as well. Note also the - * circumlocution required to use the ctl callbacks output - * parameter to pass back the rank without introducing - * compiler warnings. - * JRM -- 8/13/21 - * *------------------------------------------------------------------------- */ MPI_Comm diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index fa3862b..9cee0e6 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Friday, January 30, 2004 - * * Purpose: The public header file for common items for all MPI VFL drivers */ #ifndef H5FDmpi_H diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index ee7fa2e..3678601 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, August 2, 1999 - * * Purpose: The public header file for the mpio driver. */ #ifndef H5FDmpio_H diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index e5975d3..23c3703 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, August 2, 1999 - * * Purpose: The public header file for the "multi" driver. */ #ifndef H5FDmulti_H @@ -226,17 +223,17 @@ H5_DLL herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map /*out*/, hid * * \par Example: * \code - * // Example 1: Both metadata and rawdata files are in the same + * // Example 1: Both metadata and raw data files are in the same * // directory. Use Station1-m.h5 and Station1-r.h5 as - * // the metadata and rawdata files. + * // the metadata and raw data files. * hid_t fapl, fid; * fapl = H5Pcreate(H5P_FILE_ACCESS); * H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT); * fid=H5Fcreate("Station1",H5F_ACC_TRUNC,H5P_DEFAULT,fapl); * - * // Example 2: metadata and rawdata files are in different + * // Example 2: metadata and raw data files are in different * // directories. Use PointA-m.h5 and /pfs/PointA-r.h5 as - * // the metadata and rawdata files. + * // the metadata and raw data files. * hid_t fapl, fid; * fapl = H5Pcreate(H5P_FILE_ACCESS); * H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "/pfs/%s-r.h5", H5P_DEFAULT); diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index 893486d..b1d929c 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, January 3, 2008 - * - * Purpose: This file contains declarations which are visible only within - * the H5FD package. Source files outside the H5FD package should - * include H5FDprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5FD package. Source files outside the H5FD package should + * include H5FDprivate.h instead. */ #if !(defined H5FD_FRIEND || defined H5FD_MODULE) #error "Do not include this file outside the H5FD package!" diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 0d5c323..c4ccfdd 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -10,10 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Robb Matzke - * Monday, July 26, 1999 - */ #ifndef H5FDprivate_H #define H5FDprivate_H diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 422cd18..891b348 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -10,10 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Robb Matzke - * Monday, July 26, 1999 - */ #ifndef H5FDpublic_H #define H5FDpublic_H diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 156da68..9a529d6 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -793,7 +793,7 @@ done: * or "meta" (any other flag) * * Prints filename and listing of total number of reads and bytes read, - * both as a grand total and separate meta- and rawdata reads. + * both as a grand total and separate meta- and raw data reads. * * If any reads were done, prints out two tables: * @@ -1042,11 +1042,11 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub, suffixes[suffix_i], /* bin ceiling */ m->count, /* metadata reads */ - r->count, /* rawdata reads */ + r->count, /* raw data reads */ bm_val, bm_suffix, /* metadata bytes */ - br_val, br_suffix, /* rawdata bytes */ + br_val, br_suffix, /* raw data bytes */ am_val, am_suffix, /* metadata average */ - ar_val, ar_suffix); /* rawdata average */ + ar_val, ar_suffix); /* raw data average */ HDfflush(stream); } diff --git a/src/H5FDros3.h b/src/H5FDros3.h index 4c9e77f..f84b1a4 100644 --- a/src/H5FDros3.h +++ b/src/H5FDros3.h @@ -13,9 +13,6 @@ /* * Read-Only S3 Virtual File Driver (VFD) * - * Programmer: John Mainzer - * 2017-10-10 - * * Purpose: The public header file for the ros3 driver. */ #ifndef H5FDros3_H diff --git a/src/H5FDs3comms.h b/src/H5FDs3comms.h index aa354d9..1b21ad7 100644 --- a/src/H5FDs3comms.h +++ b/src/H5FDs3comms.h @@ -45,11 +45,6 @@ * ``` * ...in destination buffer. * - * TODO: put documentation in a consistent place and point to it from here. - * - * Programmer: Jacob Smith - * 2017-11-30 - * *****************************************************************************/ #include "H5private.h" /* Generic Functions */ diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h index 5fa75b6..56f4575 100644 --- a/src/H5FDsec2.h +++ b/src/H5FDsec2.h @@ -11,10 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, August 2, 1999 - * - * Purpose: The public header file for the sec2 driver. + * Purpose: The public header file for the sec2 driver */ #ifndef H5FDsec2_H #define H5FDsec2_H diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h index 6ff5162..e2e05a7 100644 --- a/src/H5FDstdio.h +++ b/src/H5FDstdio.h @@ -11,10 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, August 2, 1999 - * - * Purpose: The public header file for the sec2 driver. + * Purpose: The public header file for the C stdio driver */ #ifndef H5FDstdio_H #define H5FDstdio_H diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c index 42f088e..ce5a000 100644 --- a/src/H5FDsubfiling/H5FDioc_int.c +++ b/src/H5FDsubfiling/H5FDioc_int.c @@ -91,7 +91,6 @@ cast_to_void(const void *data) * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ herr_t @@ -263,7 +262,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index fd6fc01..abf816d 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -105,8 +105,6 @@ static void ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_r * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ int @@ -264,8 +262,6 @@ finalize_ioc_threads(void *_sf_context) * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ static HG_THREAD_RETURN_TYPE @@ -339,7 +335,6 @@ ioc_thread_main(void *arg) * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ static int @@ -493,8 +488,6 @@ translate_opcode(io_op_t op) * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ static HG_THREAD_RETURN_TYPE @@ -591,8 +584,6 @@ handle_work_request(void *arg) * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ void @@ -612,8 +603,6 @@ H5FD_ioc_begin_thread_exclusive(void) * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ void @@ -679,8 +668,6 @@ from the thread pool threads... * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ static int @@ -870,8 +857,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ static int @@ -1217,8 +1202,6 @@ done: * Programmer: John Mainzer * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ @@ -1283,8 +1266,6 @@ done: * * Programmer: JRM -- 11/6/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ static ioc_io_queue_entry_t * @@ -1338,8 +1319,6 @@ ioc_io_queue_alloc_entry(void) * * Programmer: JRM -- 11/7/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ static void @@ -1461,8 +1440,6 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) * * Programmer: JRM -- 11/7/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ /* TODO: Keep an eye on statistics and optimize this algorithm if necessary. While it is O(N) @@ -1629,8 +1606,6 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) * * Programmer: JRM -- 11/7/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ static void @@ -1715,8 +1690,6 @@ ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_pt * * Programmer: JRM -- 11/6/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ static void diff --git a/src/H5FDsubfiling/H5FDsubfile_int.c b/src/H5FDsubfiling/H5FDsubfile_int.c index d4aef35..4c583e8 100644 --- a/src/H5FDsubfiling/H5FDsubfile_int.c +++ b/src/H5FDsubfiling/H5FDsubfile_int.c @@ -65,8 +65,6 @@ * * Programmer: JRM -- 12/13/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -280,8 +278,6 @@ done: * * Programmer: JRM -- 1/18/22 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index afdf073..e086190 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -429,8 +429,6 @@ done: * Programmer: John Mainzer * 9/10/17 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -945,8 +943,6 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * @@ -1028,8 +1024,6 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * @@ -1072,8 +1066,6 @@ done: * Programmer: John Mainzer * 9/8/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2055,8 +2047,6 @@ done: * * Programmer: RAW -- ??/??/21 * - * Changes: None. - * * Notes: Thus function doesn't actually implement vector read. * Instead, it comverts the vector read call into a series * of scalar read calls. Fix this when time permits. @@ -2219,8 +2209,6 @@ done: * * Programmer: RAW -- ??/??/21 * - * Changes: None. - * * Notes: Thus function doesn't actually implement vector write. * Instead, it comverts the vector write call into a series * of scalar read calls. Fix this when time permits. diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index e4dcf25..58f3643 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -596,7 +596,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ herr_t @@ -1709,7 +1708,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ static herr_t @@ -1898,7 +1896,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ static herr_t @@ -1961,8 +1958,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ static herr_t @@ -2038,8 +2033,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ static void @@ -2091,8 +2084,6 @@ clear_fid_map_entry(uint64_t file_id, int64_t sf_context_id) * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ static herr_t @@ -2653,7 +2644,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- @@ -2678,7 +2668,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. *------------------------------------------------------------------------- */ herr_t @@ -2980,8 +2969,6 @@ done: * Programmer: Richard Warren * 7/17/2020 * - * Changes: Initial Version/None. - * *------------------------------------------------------------------------- */ int64_t diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h index a43e16f..a491e54 100644 --- a/src/H5FDwindows.h +++ b/src/H5FDwindows.h @@ -11,11 +11,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Purpose: The public header file for the windows driver. + * Purpose: The public header file for the Windows driver */ #ifndef H5FDwindows_H #define H5FDwindows_H diff --git a/src/H5FLmodule.h b/src/H5FLmodule.h index 0485603..5e9f157 100644 --- a/src/H5FLmodule.h +++ b/src/H5FLmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5FL package. Including this header means that the source file - * is part of the H5FL package. + * Purpose: This file contains declarations which define macros for the + * H5FL package. Including this header means that the source file + * is part of the H5FL package. */ #ifndef H5FLmodule_H #define H5FLmodule_H diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index ca16360..0fb4b32 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -24,9 +24,6 @@ #define H5FLprivate_H /* Public headers needed by this file */ -#ifdef LATER -#include "H5FLpublic.h" /*API prototypes */ -#endif /* LATER */ /* Private headers needed by this file */ diff --git a/src/H5FOprivate.h b/src/H5FOprivate.h index 9db0b0d..1f44ec8 100644 --- a/src/H5FOprivate.h +++ b/src/H5FOprivate.h @@ -16,10 +16,6 @@ #ifndef H5FOprivate_H #define H5FOprivate_H -#ifdef LATER -#include "H5FOpublic.h" -#endif /* LATER */ - /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ #include "H5Fprivate.h" /* File access */ diff --git a/src/H5FSmodule.h b/src/H5FSmodule.h index 841b8fd..46bf8bf 100644 --- a/src/H5FSmodule.h +++ b/src/H5FSmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5FS package. Including this header means that the source file - * is part of the H5FS package. + * Purpose: This file contains declarations which define macros for the + * H5FS package. Including this header means that the source file + * is part of the H5FS package. */ #ifndef H5FSmodule_H #define H5FSmodule_H diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index 987e695..4ec7aaf 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Tuesday, May 2, 2006 - * * Purpose: This file contains declarations which are visible only within * the H5FS package. Source files outside the H5FS package should * include H5FSprivate.h instead. diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 2d02e2f..6812ab3 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5F package. Including this header means that the source file - * is part of the H5F package. + * Purpose: This file contains declarations which define macros for the + * H5F package. Including this header means that the source file + * is part of the H5F package. */ #ifndef H5Fmodule_H #define H5Fmodule_H diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 8e00327..9f7002f 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, September 28, 2000 - * - * Purpose: This file contains declarations which are visible only within - * the H5F package. Source files outside the H5F package should - * include H5Fprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5F package. Source files outside the H5F package should + * include H5Fprivate.h instead. */ #if !(defined H5F_FRIEND || defined H5F_MODULE) #error "Do not include this file outside the H5F package!" diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 7d2a5da..97bf22a 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -397,7 +397,7 @@ H5_DLL hid_t H5Fcreate_async(const char *filename, unsigned flags, hid_t fcpl_id * opened. * * The \p fapl_id parameter specifies the file access property list. - * Use of #H5P_DEFAULT specifies that default I/O access properties + * The use of #H5P_DEFAULT specifies that default I/O access properties * are to be used. * * The \p flags parameter specifies whether the file will be opened in @@ -529,7 +529,7 @@ H5_DLL hid_t H5Freopen_async(hid_t file_id, hid_t es_id); * \snippet H5F_examples.c flush * * \attention HDF5 does not possess full control over buffering. H5Fflush() - * flushes the internal HDF5 buffers then asks the operating system + * flushes the internal HDF5 buffers and then asks the operating system * (the OS) to flush the system buffers for the open files. After * that, the OS is responsible for ensuring that the data is * actually flushed to disk. @@ -567,7 +567,7 @@ H5_DLL herr_t H5Fflush_async(hid_t object_id, H5F_scope_t scope, hid_t es_id); * \snippet H5F_examples.c minimal * * \note \Bold{Delayed close:} Note the following deviation from the - * above-described behavior. If H5Fclose() is called for a file but one + * above-described behavior. If H5Fclose() is called for a file, but one * or more objects within the file remain open, those objects will remain * accessible until they are individually closed. Thus, if the dataset * \c data_sample is open when H5Fclose() is called for the file @@ -576,7 +576,7 @@ H5_DLL herr_t H5Fflush_async(hid_t object_id, H5F_scope_t scope, hid_t es_id); * automatically closed once all objects in the file have been closed.\n * Be warned, however, that there are circumstances where it is not * possible to delay closing a file. For example, an MPI-IO file close is - * a collective call; all of the processes that opened the file must + * a collective call; all of the processes that open the file must * close it collectively. The file cannot be closed at some time in the * future by each process in an independent fashion. Another example is * that an application using an AFS token-based file access privilege may @@ -1359,7 +1359,7 @@ H5_DLL herr_t H5Fstart_swmr_write(hid_t file_id); * \snippet this H5F_sect_info_t_snip * * This routine retrieves free-space section information for \p nsects - * sections or at most the maximum number of sections in the specified + * sections or, at most, the maximum number of sections in the specified * free-space manager. If the number of sections is not known, a * preliminary H5Fget_free_sections() call can be made by setting \p * sect_info to NULL and the total number of free-space sections for @@ -1661,7 +1661,7 @@ H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t * file_id. This setting is used to inform the library to create * minimized dataset object headers when \c TRUE. * - * The setting's value is returned in the boolean pointer minimize. + * The setting's value is returned in the boolean pointer minimized. * * \since 1.10.5 * @@ -1887,7 +1887,7 @@ H5_DLL herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *file_info); /** * \ingroup H5F * - * \brief Sets thelatest version of the library to be used for writing objects + * \brief Sets the latest version of the library to be used for writing objects * * \file_id * \param[in] latest_format Latest format flag diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 5d9b628..467e287 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -433,6 +433,8 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS if (H5F__superblock_prefix_decode(sblock, &image, udata, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode file superblock prefix") + const uint8_t *image_end = image + len - 1; + /* Check for older version of superblock format */ if (sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) { uint32_t status_flags; /* File status flags */ @@ -440,10 +442,18 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS unsigned snode_btree_k; /* B-tree symbol table internal node 'K' value */ unsigned chunk_btree_k; /* B-tree chunk internal node 'K' value */ + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, 1, image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Freespace version (hard-wired) */ if (HDF5_FREESPACE_VERSION != *image++) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad free space version number") + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, 1, image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Root group version number (hard-wired) */ if (HDF5_OBJECTDIR_VERSION != *image++) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad object directory version number") @@ -451,6 +461,10 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS /* Skip over reserved byte */ image++; + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, 1, image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Shared header version number (hard-wired) */ if (HDF5_SHAREDHEADER_VERSION != *image++) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad shared-header format version number") @@ -466,12 +480,20 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS /* Skip over reserved byte */ image++; + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, sizeof(uint16_t), image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Various B-tree sizes */ UINT16DECODE(image, sym_leaf_k); if (sym_leaf_k == 0) HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad symbol table leaf node 1/2 rank") udata->sym_leaf_k = sym_leaf_k; /* Keep a local copy also */ + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, sizeof(uint16_t), image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Need 'get' call to set other array values */ UINT16DECODE(image, snode_btree_k); if (snode_btree_k == 0) @@ -483,6 +505,10 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS * for the indexed storage B-tree internal 'K' value later. */ + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, sizeof(uint32_t), image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* File status flags (not really used yet) */ UINT32DECODE(image, status_flags); HDassert(status_flags <= 255); @@ -495,16 +521,29 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS * storage B-tree internal 'K' value */ if (sblock->super_vers > HDF5_SUPERBLOCK_VERSION_DEF) { + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, sizeof(uint16_t), image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + UINT16DECODE(image, chunk_btree_k); /* Reserved bytes are present only in version 1 */ - if (sblock->super_vers == HDF5_SUPERBLOCK_VERSION_1) + if (sblock->super_vers == HDF5_SUPERBLOCK_VERSION_1) { image += 2; /* reserved */ - } /* end if */ + + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, 1, image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + } + } /* end if */ else chunk_btree_k = HDF5_BTREE_CHUNK_IK_DEF; udata->btree_k[H5B_CHUNK_ID] = chunk_btree_k; + /* Check whether the image pointer will be out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, H5F_SIZEOF_ADDR(udata->f) * 4, image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Remainder of "variable-sized" portion of superblock */ H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->base_addr /*out*/); H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->ext_addr /*out*/); @@ -518,7 +557,7 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS "can't allocate space for root group symbol table entry") /* decode the root group symbol table entry */ - if (H5G_ent_decode(udata->f, (const uint8_t **)&image, sblock->root_ent) < 0) + if (H5G_ent_decode(udata->f, (const uint8_t **)&image, sblock->root_ent, image_end) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode root group symbol table entry") /* Set the root group address to the correct value */ @@ -544,16 +583,23 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS /* Skip over size of file addresses (already decoded) */ image++; udata->f->shared->sizeof_addr = sblock->sizeof_addr; /* Keep a local copy also */ - /* Skip over size of file sizes (already decoded) */ image++; udata->f->shared->sizeof_size = sblock->sizeof_size; /* Keep a local copy also */ + /* Check whether the image pointer is out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, 1, image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* File status flags (not really used yet) */ sblock->status_flags = *image++; if (sblock->status_flags & ~H5F_SUPER_ALL_FLAGS) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad flag value for superblock") + /* Check whether the image pointer will be out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, H5F_SIZEOF_ADDR(udata->f) * 4, image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Base, superblock extension, end of file & root group object header addresses */ H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->base_addr /*out*/); H5F_addr_decode(udata->f, (const uint8_t **)&image, &sblock->ext_addr /*out*/); @@ -562,6 +608,10 @@ H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUS /* checksum verification already done in verify_chksum cb */ + /* Check whether the image pointer will be out of bounds */ + if (H5_IS_BUFFER_OVERFLOW(image, sizeof(uint32_t), image_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, NULL, "image pointer is out of bounds") + /* Decode checksum */ UINT32DECODE(image, read_chksum); diff --git a/src/H5Gent.c b/src/H5Gent.c index f58ef5c..096e13e 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -93,7 +93,7 @@ H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, const uint8_t *p_end, H5 for (u = 0; u < n; u++) { if (*pp > p_end) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "ran off the end of the image buffer") - if (H5G_ent_decode(f, pp, ent + u) < 0) + if (H5G_ent_decode(f, pp, ent + u, p_end) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode") } @@ -117,7 +117,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) +H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, const uint8_t *p_end) { const uint8_t *p_ret = *pp; uint32_t tmp; @@ -130,11 +130,22 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) HDassert(pp); HDassert(ent); + if (H5_IS_BUFFER_OVERFLOW(*pp, ent->name_off, p_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, FAIL, "image pointer is out of bounds") + /* decode header */ H5F_DECODE_LENGTH(f, *pp, ent->name_off); + + if (H5_IS_BUFFER_OVERFLOW(*pp, H5F_SIZEOF_ADDR(f) + sizeof(uint32_t), p_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, FAIL, "image pointer is out of bounds") + H5F_addr_decode(f, pp, &(ent->header)); UINT32DECODE(*pp, tmp); *pp += 4; /*reserved*/ + + if (H5_IS_BUFFER_OVERFLOW(*pp, 1, p_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, FAIL, "image pointer is out of bounds") + ent->type = (H5G_cache_type_t)tmp; /* decode scratch-pad */ @@ -144,11 +155,15 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) case H5G_CACHED_STAB: HDassert(2 * H5F_SIZEOF_ADDR(f) <= H5G_SIZEOF_SCRATCH); + if (H5_IS_BUFFER_OVERFLOW(*pp, H5F_SIZEOF_ADDR(f) * 2, p_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, FAIL, "image pointer is out of bounds") H5F_addr_decode(f, pp, &(ent->cache.stab.btree_addr)); H5F_addr_decode(f, pp, &(ent->cache.stab.heap_addr)); break; case H5G_CACHED_SLINK: + if (H5_IS_BUFFER_OVERFLOW(*pp, sizeof(uint32_t), p_end)) + HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, FAIL, "image pointer is out of bounds") UINT32DECODE(*pp, ent->cache.slink.lval_offset); break; diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h index d4738f6..bebca87 100644 --- a/src/H5Gmodule.h +++ b/src/H5Gmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5G package. Including this header means that the source file - * is part of the H5G package. + * Purpose: This file contains declarations which define macros for the + * H5G package. Including this header means that the source file + * is part of the H5G package. */ #ifndef H5Gmodule_H #define H5Gmodule_H @@ -886,24 +883,24 @@ * objects appear in at least one group (with the possible exception of * the root object) and since objects can have names in more than one * group, the set of all objects in an HDF5 file is a directed - * graph. The internal nodes (nodes with out-degree greater than zero) - * must be groups while the leaf nodes (nodes with out-degree zero) are + * graph. The internal nodes (nodes with an out-degree greater than zero) + * must be groups, while the leaf nodes (nodes with an out-degree zero) are * either empty groups or objects of some other type. Exactly one * object in every non-empty file is the root object. The root object * always has a positive in-degree because it is pointed to by the file - * super block. + * superblock. * * \Bold{Locating objects in the HDF5 file hierarchy:} An object name * consists of one or more components separated from one another by - * slashes. An absolute name begins with a slash and the object is + * slashes. An absolute name begins with a slash, and the object is * located by looking for the first component in the root object, then * looking for the second component in the first object, etc., until * the entire name is traversed. A relative name does not begin with a - * slash and the traversal begins at the location specified by the + * slash, and the traversal begins at the location specified by the * create or access function. * * \Bold{Group implementations in HDF5:} The original HDF5 group - * implementation provided a single indexed structure for link + * implementation provided a single-indexed structure for link * storage. A new group implementation, in HDF5 Release 1.8.0, enables * more efficient compact storage for very small groups, improved link * indexing for large groups, and other advanced features. diff --git a/src/H5Goh.c b/src/H5Goh.c index 5e8ab02..94d51f0 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -246,7 +246,7 @@ H5O__group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) HDassert(crt_info); HDassert(obj_loc); - /* Create the the group */ + /* Create the group */ if (NULL == (grp = H5G__create(f, crt_info))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index ce85f27..fdc05ec 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Thursday, September 18, 1997 - * * Purpose: This file contains declarations which are visible * only within the H5G package. Source files outside the * H5G package should include H5Gprivate.h instead. diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 0042fb2..2819e4f 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -248,7 +248,7 @@ H5_DLL herr_t H5G_node_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, i * These functions operate on group object locations. */ H5_DLL herr_t H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent); -H5_DLL herr_t H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent); +H5_DLL herr_t H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, const uint8_t *p_end); /* * These functions operate on group hierarchy names. diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index ace2071..0e0a58b 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -406,7 +406,7 @@ H5_DLL herr_t H5Gget_info_by_idx_async(hid_t loc_id, const char *group_name, H5_ * \return \herr_t * * \details H5Gflush() causes all buffers associated with a group to be - * immediately flushed to disk without removing the data from + * immediately flushed to the disk without removing the data from * the cache. * * \attention @@ -414,7 +414,7 @@ H5_DLL herr_t H5Gget_info_by_idx_async(hid_t loc_id, const char *group_name, H5_ * flushes the internal HDF5 buffers and then asks the operating * system (the OS) to flush the system buffers for the open * files. After that, the OS is responsible for ensuring that - * the data is actually flushed to disk. + * the data is actually flushed to the disk. * * \since 1.8.0 * @@ -435,7 +435,7 @@ H5_DLL herr_t H5Gflush(hid_t group_id); * cleared and immediately re-loaded with updated contents from disk. * * This function essentially closes the group, evicts all - * metadata associated with it from the cache, and then re-opens + * metadata associated with it from the cache, and then reopens * the group. The reopened group is automatically re-registered * with the same identifier. * @@ -454,7 +454,7 @@ H5_DLL herr_t H5Grefresh(hid_t group_id); * * \return \herr_t * - * \details H5Gclose() releases resources used by a group which was + * \details H5Gclose() releases resources used by a group that was * opened by H5Gcreate() or H5Gopen(). After closing a group, * \p group_id cannot be used again until another H5Gcreate() * or H5Gopen() is called on it. @@ -926,7 +926,7 @@ H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment * \deprecated This function is deprecated in favor of the function * H5Oget_comment(). * - * \details H5Gget_comment() retrieves the comment for the the object specified + * \details H5Gget_comment() retrieves the comment for the object specified * by \p loc_id and \p name. The comment is returned in the buffer \p * buf. * @@ -987,7 +987,7 @@ H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char * * The operation receives the group identifier for the group being * iterated over, \p group, the name of the current object within * the group, \p name, and the pointer to the operator data - * passed in to H5Giterate(), \p op_data. + * passed into H5Giterate(), \p op_data. * * The return values from an operator are: * \li Zero causes the iterator to continue, returning zero when all @@ -1096,7 +1096,7 @@ H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link *------------------------------------------------------------------------- * \ingroup H5G * - * \brief Returns a name of an object specified by an index + * \brief Returns the name of an object specified by an index * * \fg_loc_id * \param[in] idx Transient index identifying object @@ -1109,7 +1109,7 @@ H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link * * \deprecated This function is deprecated in favor of the function H5Lget_name_by_idx(). * - * \details H5Gget_objname_by_idx() returns a name of the object specified by + * \details H5Gget_objname_by_idx() returns the name of the object specified by * the index \p idx in the group \p loc_id. * * The group is specified by a group identifier \p loc_id. If diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 3cb067c..ab01c1e 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -3385,7 +3385,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5 * If the entry is unprotected and unpinned, we simply * protect it. * - * If, however, the the child iblock is already protected, + * If, however, the child iblock is already protected, * but not pinned, we have a bit of a problem, as we have * no legitimate way of looking up its pointer in memory. * diff --git a/src/H5HFmodule.h b/src/H5HFmodule.h index 818c3d4..c4fb437 100644 --- a/src/H5HFmodule.h +++ b/src/H5HFmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5HF package. Including this header means that the source file - * is part of the H5HF package. + * Purpose: This file contains declarations which define macros for the + * H5HF package. Including this header means that the source file + * is part of the H5HF package. */ #ifndef H5HFmodule_H #define H5HFmodule_H diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index f1ac41d..83fda1f 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Friday, February 24, 2006 - * - * Purpose: This file contains declarations which are visible only within - * the H5HF package. Source files outside the H5HF package should - * include H5HFprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5HF package. Source files outside the H5HF package should + * include H5HFprivate.h instead. */ #if !(defined H5HF_FRIEND || defined H5HF_MODULE) #error "Do not include this file outside the H5HF package!" diff --git a/src/H5HGmodule.h b/src/H5HGmodule.h index 412223e..772ebe6 100644 --- a/src/H5HGmodule.h +++ b/src/H5HGmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5HG package. Including this header means that the source file - * is part of the H5HG package. + * Purpose: This file contains declarations which define macros for the + * H5HG package. Including this header means that the source file + * is part of the H5HG package. */ #ifndef H5HGmodule_H #define H5HGmodule_H diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 5623e8b..ab7cd09 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Wednesday, July 9, 2003 - * * Purpose: This file contains declarations which are visible * only within the H5HG package. Source files outside the * H5HG package should include H5HGprivate.h instead. diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index fae3713..892a0c7 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -10,10 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Robb Matzke - * Friday, March 27, 1998 - */ #ifndef H5HGprivate_H #define H5HGprivate_H diff --git a/src/H5HLmodule.h b/src/H5HLmodule.h index 5432f1a..1a871ab 100644 --- a/src/H5HLmodule.h +++ b/src/H5HLmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5HL package. Including this header means that the source file - * is part of the H5HL package. + * Purpose: This file contains declarations which define macros for the + * H5HL package. Including this header means that the source file + * is part of the H5HL package. */ #ifndef H5HLmodule_H #define H5HLmodule_H diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 9471bd9..47c2060 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Wednesday, July 9, 2003 - * * Purpose: This file contains declarations which are visible * only within the H5HL package. Source files outside the * H5HL package should include H5HLprivate.h instead. diff --git a/src/H5Imodule.h b/src/H5Imodule.h index 9470cc9..e682850 100644 --- a/src/H5Imodule.h +++ b/src/H5Imodule.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * * Purpose: This file contains declarations which define macros for the * H5I package. Including this header means that the source file * is part of the H5I package. diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index b921ea0..1009ecb 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, May 15, 2003 - * - * Purpose: This file contains declarations which are visible only within - * the H5I package. Source files outside the H5I package should - * include H5Iprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5I package. Source files outside the H5I package should + * include H5Iprivate.h instead. */ #if !(defined H5I_FRIEND || defined H5I_MODULE) #error "Do not include this file outside the H5I package!" diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index d699c92..69b2450 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -235,7 +235,7 @@ H5_DLL hid_t H5Iget_file_id(hid_t id); * \brief Retrieves a name of an object based on the object identifier * * \obj_id{id} - * \param[out] name A buffer for thename associated with the identifier + * \param[out] name A buffer for the name associated with the identifier * \param[in] size The size of the \p name buffer; usually the size of * the name in bytes plus 1 for a NULL terminator * @@ -339,7 +339,7 @@ H5_DLL int H5Iinc_ref(hid_t id); * with H5Iinc_ref(). When an object identifier’s reference count * reaches zero, the object will be closed. Calling an object * identifier’s \c close function decrements the reference count for - * the identifier which normally closes the object, but if the + * the identifier, which normally closes the object, but if the * reference count for the identifier has been incremented with * H5Iinc_ref(), the object will only be closed when the reference * count reaches zero with further calls to this function or the @@ -348,15 +348,15 @@ H5_DLL int H5Iinc_ref(hid_t id); * If the object ID was created by a collective parallel call (such as * H5Dcreate(), H5Gopen(), etc.), the reference count should be * modified by all the processes which have copies of the ID. - * Generally this means that group, dataset, attribute, file and named + * Generally, this means that group, dataset, attribute, file and named * datatype IDs should be modified by all the processes and that all * other types of IDs are safe to modify by individual processes. * - * This function is of particular value when an application is - * maintaining multiple copies of an object ID. The object ID can be + * This function is of particular value when an application + * maintains multiple copies of an object ID. The object ID can be * incremented when a copy is made. Each copy of the ID can then be * safely closed or decremented and the HDF5 object will be closed - * when the reference count for that that object drops to zero. + * when the reference count for that object drops to zero. * * \since 1.6.2 * @@ -643,7 +643,7 @@ H5_DLL htri_t H5Itype_exists(H5I_type_t type); * \details Valid identifiers are those that have been obtained by an * application and can still be used to access the original target. * Examples of invalid identifiers include: - * \li Out of range values: negative, for example + * \li Out-of-range values: negative, for example * \li Previously-valid identifiers that have been released: * for example, a dataset identifier for which the dataset has * been closed @@ -651,7 +651,7 @@ H5_DLL htri_t H5Itype_exists(H5I_type_t type); * H5Iis_valid() can be used with any type of identifier: object * identifier, property list identifier, attribute identifier, error * message identifier, etc. When necessary, a call to H5Iget_type() - * can determine the type of the object that \p id identifies. + * can determine the type of object that the \p id identifies. * * \since 1.8.3 * diff --git a/src/H5Ldevelop.h b/src/H5Ldevelop.h index 34e50a0..148a5a5 100644 --- a/src/H5Ldevelop.h +++ b/src/H5Ldevelop.h @@ -30,6 +30,16 @@ */ #define H5L_LINK_CLASS_T_VERS 1 +/** + * \brief Version of external link format + */ +#define H5L_EXT_VERSION 0 + +/** + * \brief Valid flags for external links + */ +#define H5L_EXT_FLAGS_ALL 0 + /*******************/ /* Public Typedefs */ /*******************/ diff --git a/src/H5Lmodule.h b/src/H5Lmodule.h index cbb5060..26f9045 100644 --- a/src/H5Lmodule.h +++ b/src/H5Lmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5L package. Including this header means that the source file - * is part of the H5L package. + * Purpose: This file contains declarations which define macros for the + * H5L package. Including this header means that the source file + * is part of the H5L package. */ #ifndef H5Lmodule_H #define H5Lmodule_H diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index 6fd15e7..53737d1 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird - * Friday, December 1, 2005 - * * Purpose: This file contains declarations which are visible * only within the H5L package. Source files outside the * H5L package should include H5Lprivate.h instead. @@ -34,12 +31,6 @@ /* Package Private Macros */ /**************************/ -/* Version of external link format */ -#define H5L_EXT_VERSION 0 - -/* Valid flags for external links */ -#define H5L_EXT_FLAGS_ALL 0 - /****************************/ /* Package Private Typedefs */ /****************************/ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 6feefcd..653bf27 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -209,7 +209,7 @@ H5_DLL herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc, const * * H5Lcopy() retains the creation time and the target of the original * link. However, since the link may be renamed, the character - * encoding is that specified in \p lcpl_id rather than that of the + * encoding is specified in \p lcpl_id rather than in that of the * original link. Other link creation properties are ignored. * * If the link is a soft link, also known as a symbolic link, its @@ -337,7 +337,7 @@ H5_DLL herr_t H5Lcreate_hard_async(hid_t cur_loc_id, const char *cur_name, hid_t * * For instance, if target_path is \c ./foo, \p link_loc_id specifies * \c ./x/y/bar, and the name of the new link is \c new_link, then a - * subsequent request for \c ./x/y/bar/new_link will return same the + * subsequent request for \c ./x/y/bar/new_link will return the same * object as would be found at \c ./foo. * * \note H5Lcreate_soft() is for use only if the target object is in the @@ -480,7 +480,7 @@ H5_DLL herr_t H5Ldelete_by_idx_async(hid_t loc_id, const char *group_name, H5_in * * \return \herr_t * - * \details H5Lget_val() returns the value of link \p name. For smbolic links, + * \details H5Lget_val() returns the value of link \p name. For symbolic links, * this is the path to which the link points, including the null * terminator. For external and user-defined links, it is the link * buffer. @@ -607,7 +607,7 @@ H5_DLL herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t * the link \c datasetD in the \c group group1/group2/softlink_to_group3/, * where \c group1 is a member of the group specified by \c loc_id: * - * 1. First use H5Lexists() to verify that \c group1 exists. + * 1. First, use H5Lexists() to verify that the \c group1 exists. * 2. If \c group1 exists, use H5Lexists() again, this time with name * set to \c group1/group2, to verify that \c group2 exists. * 3. If \c group2 exists, use H5Lexists() with name set to @@ -624,7 +624,7 @@ H5_DLL herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t * \c /group1/group2/softlink_to_group3, the first call to H5Lexists() * would have name set to \c /group1. * - * Note that this is an outline and does not include all necessary + * Note that this is an outline and does not include all the necessary * details. Depending on circumstances, for example, you may need to * verify that an intermediate link points to a group and that a soft * link points to an existing target. @@ -713,7 +713,7 @@ H5_DLL herr_t H5Lexists_async(hid_t loc_id, const char *name, hbool_t *exists, h * There will be additional valid values if user-defined links have * been registered. * - * \p corder specifies the link’s creation order position while + * \p corder specifies the link’s creation order position, while * \p corder_valid indicates whether the value in corder is valid. * * If \p corder_valid is \c TRUE, the value in \p corder is known to @@ -732,7 +732,7 @@ H5_DLL herr_t H5Lexists_async(hid_t loc_id, const char *name, hbool_t *exists, h * This value is set with #H5Pset_char_encoding. * * \c token is the location that a hard link points to, and - * \c val_size is the size of a soft link or user defined link value. + * \c val_size is the size of a soft link or user-defined link value. * H5O_token_t is used in the VOL layer. It is defined in H5public.h * as: * \snippet H5public.h H5O_token_t_snip @@ -1118,7 +1118,7 @@ H5_DLL herr_t H5Lvisit2(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order * (with an absolute name based in the file’s root group) or a group * relative to \p loc_id. If \p loc_id fully specifies the group that * is to serve as the root of the iteration, group_name should be '.' - * (a dot). (Note that when \p loc_id fully specifies the the group + * (a dot). (Note that when \p loc_id fully specifies the group * that is to serve as the root of the iteration, the user may wish to * consider using H5Lvisit2() instead of H5Lvisit_by_name2().) * @@ -1363,7 +1363,7 @@ H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval /*in*/, size_t link_si * If that target file does not exist, the new \p file_name after * stripping will be \c A.h5. * - For Windows, there are 6 cases: - * -# \p file_name is an absolute drive with absolute pathname. + * -# \p file_name is an absolute drive with an absolute pathname. * For example, consider a \p file_name of \c /tmp/A.h5. If that * target file does not exist, the new \p file_name after * stripping will be \c A.h5. @@ -1371,16 +1371,16 @@ H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval /*in*/, size_t link_si * name. For example, consider a \p file_name of \c /tmp/A.h5. * If that target file does not exist, the new \p file_name after * stripping will be \c A.h5. - * -# \p file_name is an absolute drive with relative pathname. + * -# \p file_name is an absolute drive with a relative pathname. * For example, consider a \p file_name of \c /tmp/A.h5. If that * target file does not exist, the new \p file_name after * stripping will be \c tmp\A.h5. * -# \p file_name is in UNC (Uniform Naming Convention) format with - * server name, share name, and pathname. For example, consider + * a server name, share name, and pathname. For example, consider * a \p file_name of \c /tmp/A.h5. If that target file does not * exist, the new \p file_name after stripping will be \c A.h5. * -# \p file_name is in Long UNC (Uniform Naming Convention) format - * with server name, share name, and pathname. For example, + * with a server name, share name, and pathname. For example, * consider a \p file_name of \c /tmp/A.h5. If that target file * does not exist, the new \p file_name after stripping will be * \c A.h5. @@ -1390,7 +1390,7 @@ H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval /*in*/, size_t link_si * does not exist, the new \p file_name after stripping will be * \c A.h5. * - * The library opens target file \p file_name with the file access + * The library opens the target file \p file_name with the file access * property list that is set via H5Pset_elink_fapl() when the external * link link_name is accessed. If no such property list is set, the * library uses the file access property list associated with the file @@ -1879,7 +1879,7 @@ H5_DLL herr_t H5Lvisit1(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order * (with an absolute name based in the file’s root group) or a group * relative to \p loc_id. If \p loc_id fully specifies the group that * is to serve as the root of the iteration, group_name should be '.' - * (a dot). (Note that when \p loc_id fully specifies the the group + * (a dot). (Note that when \p loc_id fully specifies the group * that is to serve as the root of the iteration, the user may wish to * consider using H5Lvisit1() instead of H5Lvisit_by_name1().) * diff --git a/src/H5MF.c b/src/H5MF.c index be71b2f..9f430c9 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3236,7 +3236,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) * multi file drivers, as the self referential free space * manager header and section info can be stored in up to * two different files -- requiring that up to two EOA's - * be stored in the the free space managers super block + * be stored in the free space manager's superblock * extension message. * * As of this writing, we are solving this problem by diff --git a/src/H5MFmodule.h b/src/H5MFmodule.h index 3e806c6..dd32cdc 100644 --- a/src/H5MFmodule.h +++ b/src/H5MFmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5MF package. Including this header means that the source file - * is part of the H5MF package. + * Purpose: This file contains declarations which define macros for the + * H5MF package. Including this header means that the source file + * is part of the H5MF package. */ #ifndef H5MFmodule_H #define H5MFmodule_H diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index 2711fcf..b679674 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Tuesday, January 8, 2008 - * * Purpose: This file contains declarations which are visible only within * the H5MF package. Source files outside the H5MF package should * include H5MFprivate.h instead. diff --git a/src/H5Mpublic.h b/src/H5Mpublic.h index 86fe433..f5874e8 100644 --- a/src/H5Mpublic.h +++ b/src/H5Mpublic.h @@ -211,7 +211,7 @@ extern "C" { * \details H5Mcreate() creates a new map object for storing key-value * pairs. The in-file datatype for keys is defined by \p key_type_id * and the in-file datatype for values is defined by \p val_type_id. \p - * loc_id specifies the location to create the the map object and \p + * loc_id specifies the location to create the map object and \p * name specifies the name of the link to the map object relative to * \p loc_id. * diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 3364a67..f2ce582 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -13,8 +13,6 @@ /*------------------------------------------------------------------------- * * Created: H5Oainfo.c - * Mar 6 2007 - * Quincey Koziol * * Purpose: Attribute Information messages. * @@ -88,27 +86,28 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); * * Return: Success: Ptr to new message in native form. * Failure: NULL - * - * Programmer: Quincey Koziol - * Mar 6 2007 - * *------------------------------------------------------------------------- */ static void * H5O__ainfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) + unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { - H5O_ainfo_t *ainfo = NULL; /* Attribute info */ - unsigned char flags; /* Flags for encoding attribute info */ - void *ret_value = NULL; /* Return value */ + const uint8_t *p_end = p + p_size - 1; /* End of input buffer */ + H5O_ainfo_t *ainfo = NULL; /* Attribute info */ + unsigned char flags; /* Flags for encoding attribute info */ + uint8_t sizeof_addr; /* Size of addresses in this file */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE - /* check args */ HDassert(f); HDassert(p); + sizeof_addr = H5F_sizeof_addr(f); + /* Version of message */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); if (*p++ != H5O_AINFO_VERSION) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for message") @@ -117,6 +116,8 @@ H5O__ainfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Get the flags for the message */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); flags = *p++; if (flags & ~H5O_AINFO_ALL_FLAGS) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad flag value for message") @@ -127,20 +128,30 @@ H5O__ainfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS ainfo->nattrs = HSIZET_MAX; /* Max. creation order value for the object */ - if (ainfo->track_corder) + if (ainfo->track_corder) { + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, ainfo->max_crt_idx) + } else ainfo->max_crt_idx = H5O_MAX_CRT_ORDER_IDX; /* Address of fractal heap to store "dense" attributes */ + if (H5_IS_BUFFER_OVERFLOW(p, sizeof_addr, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_addr_decode(f, &p, &(ainfo->fheap_addr)); /* Address of v2 B-tree to index names of attributes (names are always indexed) */ + if (H5_IS_BUFFER_OVERFLOW(p, sizeof_addr, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_addr_decode(f, &p, &(ainfo->name_bt2_addr)); /* Address of v2 B-tree to index creation order of links, if there is one */ - if (ainfo->index_corder) + if (ainfo->index_corder) { + if (H5_IS_BUFFER_OVERFLOW(p, sizeof_addr, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_addr_decode(f, &p, &(ainfo->corder_bt2_addr)); + } else ainfo->corder_bt2_addr = HADDR_UNDEF; diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 17c1535..8484678 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -517,7 +517,7 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size HDassert(H5F_addr_defined(oh->chunk[chunkno].addr)); /* Test to see if the specified chunk ends with a null messages. - * If successful, set the index of the the null message in extend_msg. + * If successful, set the index of the null message in extend_msg. */ for (u = 0; u < oh->nmesgs; u++) { /* Check for null message at end of proper chunk */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index e431cd2..1d48a78 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -112,95 +112,125 @@ H5FL_EXTERN(H5S_extent_t); Pointer to the new message in native order on success, NULL on failure DESCRIPTION This function decodes the "raw" disk form of a attribute message - into a struct in memory native format. The struct is allocated within this - function using malloc() and is returned to the caller. + into a struct in memory native format. The struct is allocated within this + function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p) { - H5A_t *attr = NULL; - H5S_extent_t *extent; /*extent dimensionality information */ - size_t name_len; /*attribute name length */ - size_t dt_size; /* Datatype size */ - hssize_t sds_size; /* Signed Dataspace size */ - hsize_t ds_size; /* Dataspace size */ - unsigned flags = 0; /* Attribute flags */ - H5A_t *ret_value = NULL; /* Return value */ + H5A_t *attr = NULL; + const uint8_t *p_end = p + p_size - 1; /* End of input buffer */ + size_t delta = 0; /* Amount to move p in next field */ + H5S_extent_t *extent = NULL; /* Extent dimensionality information */ + size_t name_len; /* Attribute name length */ + size_t dt_size; /* Datatype size */ + hssize_t sds_size; /* Signed Dataspace size */ + hsize_t ds_size; /* Dataspace size */ + unsigned flags = 0; /* Attribute flags */ + H5A_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE - /* check args */ HDassert(f); HDassert(p); if (NULL == (attr = H5FL_CALLOC(H5A_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if (NULL == (attr->shared = H5FL_CALLOC(H5A_shared_t))) HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared attr structure") /* Version number */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); attr->shared->version = *p++; if (attr->shared->version < H5O_ATTR_VERSION_1 || attr->shared->version > H5O_ATTR_VERSION_LATEST) HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "bad version number for attribute message") /* Get the flags byte if we have a later version of the attribute */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); if (attr->shared->version >= H5O_ATTR_VERSION_2) { flags = *p++; /* Check for unknown flag */ if (flags & (unsigned)~H5O_ATTR_FLAG_ALL) HGOTO_ERROR(H5E_ATTR, H5E_CANTLOAD, NULL, "unknown flag for attribute message") - } /* end if */ + } else - p++; /* Byte is unused when version<2 */ + p++; /* Byte is unused when version < 2 */ - /* - * Decode the sizes of the parts of the attribute. The sizes stored in + /* Decode the sizes of the parts of the attribute. The sizes stored in * the file are exact but the parts are aligned on 8-byte boundaries. */ - UINT16DECODE(p, name_len); /*including null*/ + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + UINT16DECODE(p, name_len); /* Including null */ + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, attr->shared->dt_size); + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, attr->shared->ds_size); - /* - * Decode the character encoding for the name for versions 3 or later, + /* Decode the character encoding for the name for versions 3 or later, * as well as some reserved bytes. */ - if (attr->shared->version >= H5O_ATTR_VERSION_3) + if (attr->shared->version >= H5O_ATTR_VERSION_3) { + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); attr->shared->encoding = (H5T_cset_t)*p++; + } - /* Decode and store the name */ - if (NULL == (attr->shared->name = H5MM_strdup((const char *)p))) + /* Decode and store the name + * + * NOTE: If the buffer overflow error message changes, test_corrupted_attnamelen() + * in titerate.c will fail since it looks for it explicitly. + */ + if (H5_IS_BUFFER_OVERFLOW(p, name_len, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + if (NULL == (attr->shared->name = H5MM_strndup((const char *)p, name_len - 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Make an attempt to detect corrupted name or name length - HDFFV-10588 */ - if (name_len != (HDstrlen(attr->shared->name) + 1)) + if (name_len != (HDstrnlen(attr->shared->name, name_len) + 1)) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "attribute name has different length than stored length") + /* Determine pointer movement and check if it's valid */ if (attr->shared->version < H5O_ATTR_VERSION_2) - p += H5O_ALIGN_OLD(name_len); /* advance the memory pointer */ + delta = H5O_ALIGN_OLD(name_len); else - p += name_len; /* advance the memory pointer */ + delta = name_len; + if (H5_IS_BUFFER_OVERFLOW(p, delta, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + p += delta; /* Decode the attribute's datatype */ + if (H5_IS_BUFFER_OVERFLOW(p, attr->shared->dt_size, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); if (NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)( f, open_oh, ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->dt_size, p))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype") + + /* Determine pointer movement and check if it's valid */ if (attr->shared->version < H5O_ATTR_VERSION_2) - p += H5O_ALIGN_OLD(attr->shared->dt_size); + delta = H5O_ALIGN_OLD(attr->shared->dt_size); else - p += attr->shared->dt_size; + delta = attr->shared->dt_size; + if (H5_IS_BUFFER_OVERFLOW(p, delta, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + p += delta; - /* decode the attribute dataspace. It can be shared in versions >= 3 + /* Decode the attribute dataspace. It can be shared in versions >= 3 * What's actually shared, though, is only the extent. */ if (NULL == (attr->shared->ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Decode attribute's dataspace extent */ + if (H5_IS_BUFFER_OVERFLOW(p, attr->shared->ds_size, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); if ((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)( f, open_oh, ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, attr->shared->ds_size, p)) == NULL) @@ -216,10 +246,14 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u if (H5S_select_all(attr->shared->ds, FALSE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection") + /* Determine pointer movement and check if it's valid */ if (attr->shared->version < H5O_ATTR_VERSION_2) - p += H5O_ALIGN_OLD(attr->shared->ds_size); + delta = H5O_ALIGN_OLD(attr->shared->ds_size); else - p += attr->shared->ds_size; + delta = attr->shared->ds_size; + if (H5_IS_BUFFER_OVERFLOW(p, delta, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + p += delta; /* Get the datatype & dataspace sizes */ if (0 == (dt_size = H5T_get_size(attr->shared->dt))) @@ -234,17 +268,18 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u if ((attr->shared->data_size / dt_size) != ds_size) HGOTO_ERROR(H5E_RESOURCE, H5E_OVERFLOW, NULL, "data size exceeds addressable range") - /* Go get the data */ + /* Get the data */ if (attr->shared->data_size) { /* Ensure that data size doesn't exceed buffer size, in case of - it's being corrupted in the file */ - if (attr->shared->data_size > p_size) - HGOTO_ERROR(H5E_RESOURCE, H5E_OVERFLOW, NULL, "data size exceeds buffer size") + * it's being corrupted in the file + */ + if (H5_IS_BUFFER_OVERFLOW(p, attr->shared->data_size, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); if (NULL == (attr->shared->data = H5FL_BLK_MALLOC(attr_buf, attr->shared->data_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") H5MM_memcpy(attr->shared->data, p, attr->shared->data_size); - } /* end if */ + } /* Increment the reference count for this object header message in cache(compact storage) or for the object from dense storage. */ @@ -254,15 +289,16 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u ret_value = attr; done: - if (NULL == ret_value) + if (NULL == ret_value) { if (attr) { - /* Free any dynamically allocated items */ if (attr->shared) if (H5A__shared_free(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't release attribute info") - attr = H5FL_FREE(H5A_t, attr); - } /* end if */ + } + if (extent) + extent = H5FL_FREE(H5S_extent_t, extent); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__attr_decode() */ diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index ff157da..c21b3b9 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -59,33 +59,32 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ #define H5O_BTREEK_VERSION 0 /*------------------------------------------------------------------------- - * Function: H5O__btreek_decode + * Function: H5O__btreek_decode * - * Purpose: Decode a shared message table message and return a pointer + * Purpose: Decode a shared message table message and return a pointer * to a newly allocated H5O_btreek_t struct. * - * Return: Success: Ptr to new message in native struct. - * Failure: NULL - * - * Programmer: Quincey Koziol - * Mar 1, 2007 - * + * Return: Success: Pointer to new message in native struct + * Failure: NULL *------------------------------------------------------------------------- */ static void * -H5O__btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) +H5O__btreek_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, + const uint8_t *p) { - H5O_btreek_t *mesg; /* Native message */ - void *ret_value = NULL; /* Return value */ + const uint8_t *p_end = p + p_size - 1; /* End of input buffer */ + H5O_btreek_t *mesg = NULL; /* Native message */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE - /* Sanity check */ HDassert(f); HDassert(p); /* Version of message */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); if (*p++ != H5O_BTREEK_VERSION) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for message") @@ -94,14 +93,22 @@ H5O__btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsig HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for v1 B-tree 'K' message") /* Retrieve non-default B-tree 'K' values */ + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, mesg->btree_k[H5B_CHUNK_ID]); + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, mesg->btree_k[H5B_SNODE_ID]); + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, mesg->sym_leaf_k); /* Set return value */ ret_value = (void *)mesg; done: + if (NULL == ret_value) + H5MM_free(mesg); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__btreek_decode() */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 0851493..42d8f35 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -1510,8 +1510,9 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t H5O_cont_t *cont; /* Decode continuation message */ - cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, NULL, 0, &ioflags, mesg->raw_size, - mesg->raw); + if (NULL == (cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, NULL, 0, &ioflags, + mesg->raw_size, mesg->raw))) + HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "bad continuation message found") H5_CHECKED_ASSIGN(cont->chunkno, unsigned, udata->cont_msg_info->nmsgs + 1, size_t); /* the next continuation message/chunk */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 8919ced..bbf233d 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -74,40 +74,43 @@ H5FL_DEFINE(H5O_cont_t); * Purpose: Decode the raw header continuation message. * * Return: Success: Ptr to the new native message - * * Failure: NULL - * - * Programmer: Robb Matzke - * Aug 6 1997 - * *------------------------------------------------------------------------- */ static void * H5O__cont_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) + unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { - H5O_cont_t *cont = NULL; - void *ret_value = NULL; /* Return value */ + H5O_cont_t *cont = NULL; + const uint8_t *p_end = p + p_size - 1; + void *ret_value = NULL; FUNC_ENTER_PACKAGE - /* check args */ HDassert(f); HDassert(p); /* Allocate space for the message */ if (NULL == (cont = H5FL_MALLOC(H5O_cont_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "memory allocation failed"); /* Decode */ + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_addr(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_addr_decode(f, &p, &(cont->addr)); + + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_DECODE_LENGTH(f, p, cont->size); + cont->chunkno = 0; /* Set return value */ ret_value = cont; done: + if (NULL == ret_value && NULL != cont) + H5FL_FREE(H5O_cont_t, cont); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cont_decode() */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 35e2d9f..824590f 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -10,11 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Robb Matzke - * Tuesday, November 25, 1997 - */ - #include "H5Omodule.h" /* This source code file is part of the H5O module */ #include "H5private.h" /* Generic Functions */ @@ -64,14 +59,14 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ /*------------------------------------------------------------------------- * Function: H5O__efl_decode * - * Purpose: Decode an external file list message and return a pointer to - * the message (and some other data). + * Purpose: Decode an external file list message and return a pointer to + * the message (and some other data). * - * We allow zero dimension size starting from the 1.8.7 release. - * The dataset size of external storage can be zero. + * We allow zero dimension size starting from the 1.8.7 release. + * The dataset size of external storage can be zero. * - * Return: Success: Pointer to a new message struct - * Failure: NULL + * Return: Success: Pointer to a new message struct + * Failure: NULL *------------------------------------------------------------------------- */ static void * @@ -96,30 +91,33 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "memory allocation failed") /* Version (1 byte) */ - if ((p + 1 - 1) > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "ran off end of input buffer while decoding") + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); version = *p++; if (version != H5O_EFL_VERSION) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for external file list message") /* Reserved (3 bytes) */ - if ((p + 3 - 1) > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "ran off end of input buffer while decoding") + if (H5_IS_BUFFER_OVERFLOW(p, 3, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); p += 3; /* Number of slots (2x 2 bytes) */ - if ((p + 4 - 1) > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "ran off end of input buffer while decoding") + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, mesg->nalloc); if (mesg->nalloc <= 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad number of allocated slots when parsing efl msg") + + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT16DECODE(p, mesg->nused); if (mesg->nused > mesg->nalloc) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad number of in-use slots when parsing efl msg") /* Heap address */ - if ((p + H5F_SIZEOF_ADDR(f) - 1) > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "ran off end of input buffer while decoding") + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_addr(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_addr_decode(f, &p, &(mesg->heap_addr)); if (H5F_addr_defined(mesg->heap_addr) == FALSE) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad local heap address when parsing efl msg") @@ -143,8 +141,8 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED for (size_t u = 0; u < mesg->nused; u++) { /* Name */ - if ((p + H5F_SIZEOF_SIZE(f) - 1) > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "ran off end of input buffer while decoding") + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_DECODE_LENGTH(f, p, mesg->slot[u].name_offset); if ((s = (const char *)H5HL_offset_into(heap, mesg->slot[u].name_offset)) == NULL) @@ -156,13 +154,13 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "string duplication failed") /* File offset */ - if ((p + H5F_SIZEOF_SIZE(f) - 1) > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "ran off end of input buffer while decoding") + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_DECODE_LENGTH(f, p, mesg->slot[u].offset); /* Size */ - if ((p + H5F_SIZEOF_SIZE(f) - 1) > p_end) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "ran off end of input buffer while decoding") + if (H5_IS_BUFFER_OVERFLOW(p, H5F_sizeof_size(f), p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); H5F_DECODE_LENGTH(f, p, mesg->slot[u].size); } @@ -173,7 +171,7 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED ret_value = mesg; done: - if (ret_value == NULL) + if (ret_value == NULL) { if (mesg != NULL) { if (mesg->slot != NULL) { for (size_t u = 0; u < mesg->nused; u++) @@ -182,6 +180,10 @@ done: } H5MM_xfree(mesg); } + if (heap != NULL) + if (H5HL_unprotect(heap) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect local heap") + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__efl_decode() */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 0f9628b..54d8b8b 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -89,7 +89,7 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); */ static void * H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) + unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ unsigned char flags; /* Flags for encoding group info */ @@ -100,7 +100,15 @@ H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign /* check args */ HDassert(p); + if (p_size == 0) + HGOTO_ERROR(H5E_OHDR, H5E_ARGS, NULL, "size of given ginfo was zero") + + /* Points at last valid byte in buffer */ + const uint8_t *p_end = p + p_size - 1; + /* Version of message */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") if (*p++ != H5O_GINFO_VERSION) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for message") @@ -109,6 +117,9 @@ H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Get the flags for the group */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") + flags = *p++; if (flags & ~H5O_GINFO_ALL_FLAGS) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad flag value for message") @@ -117,6 +128,8 @@ H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign /* Get the max. # of links to store compactly & the min. # of links to store densely */ if (ginfo->store_link_phase_change) { + if (H5_IS_BUFFER_OVERFLOW(p, 2 * 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") UINT16DECODE(p, ginfo->max_compact) UINT16DECODE(p, ginfo->min_dense) } /* end if */ @@ -127,6 +140,8 @@ H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign /* Get the estimated # of entries & name lengths */ if (ginfo->store_est_entry_info) { + if (H5_IS_BUFFER_OVERFLOW(p, 2 * 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") UINT16DECODE(p, ginfo->est_num_entries) UINT16DECODE(p, ginfo->est_name_len) } /* end if */ diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index d4ac3bb..11138df 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -105,11 +105,13 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); */ static void * H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) + unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, const uint8_t *p) { - H5O_linfo_t *linfo = NULL; /* Link info */ - unsigned char index_flags; /* Flags for encoding link index info */ - void *ret_value = NULL; /* Return value */ + const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */ + H5O_linfo_t *linfo = NULL; /* Link info */ + unsigned char index_flags; /* Flags for encoding link index info */ + uint8_t addr_size = H5F_SIZEOF_ADDR(f); /* Temp var */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -117,6 +119,10 @@ H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS HDassert(f); HDassert(p); + /* Check input buffer before decoding version and index flags */ + if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") + /* Version of message */ if (*p++ != H5O_LINFO_VERSION) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for message") @@ -136,11 +142,18 @@ H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS linfo->nlinks = HSIZET_MAX; /* Max. link creation order value for the group, if tracked */ - if (linfo->track_corder) + if (linfo->track_corder) { + if (H5_IS_BUFFER_OVERFLOW(p, 8, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") INT64DECODE(p, linfo->max_corder) + } else linfo->max_corder = 0; + /* Check input buffer before decoding the next two addresses */ + if (H5_IS_BUFFER_OVERFLOW(p, addr_size + addr_size, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") + /* Address of fractal heap to store "dense" links */ H5F_addr_decode(f, &p, &(linfo->fheap_addr)); @@ -148,8 +161,11 @@ H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS H5F_addr_decode(f, &p, &(linfo->name_bt2_addr)); /* Address of v2 B-tree to index creation order of links, if there is one */ - if (linfo->index_corder) + if (linfo->index_corder) { + if (H5_IS_BUFFER_OVERFLOW(p, addr_size, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") H5F_addr_decode(f, &p, &(linfo->corder_bt2_addr)); + } else linfo->corder_bt2_addr = HADDR_UNDEF; diff --git a/src/H5Omodule.h b/src/H5Omodule.h index afb005b..c3c3496 100644 --- a/src/H5Omodule.h +++ b/src/H5Omodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5O package. Including this header means that the source file - * is part of the H5O package. + * Purpose: This file contains declarations which define macros for the + * H5O package. Including this header means that the source file + * is part of the H5O package. */ #ifndef H5Omodule_H #define H5Omodule_H @@ -52,7 +49,7 @@ * * HDF5 objects are deleted as a side effect of rendering them unreachable * from the root group. The net effect is the diminution of the object's - * reference count to zero, which can (but should not usually) be effected + * reference count to zero, which can (but should not usually) be affected * by a function in this module. * * diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 5a491dd..8205a01 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -10,10 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Friday, July 24, 1998 - * - * Purpose: The object modification time message. +/* + * Purpose: The object modification time message */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ @@ -93,46 +91,49 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ H5FL_DEFINE(time_t); /*------------------------------------------------------------------------- - * Function: H5O__mtime_new_decode + * Function: H5O__mtime_new_decode * * Purpose: Decode a new modification time message and return a pointer to * a new time_t value. * + * This version of the modification time was used in HDF5 + * 1.6.1 and later. + * * The new modification time message format was added due to the * performance overhead of the old format. * - * Return: Success: Ptr to new message in native struct. - * - * Failure: NULL - * - * Programmer: Quincey Koziol - * Jan 3 2002 - * + * Return: Success: Pointer to new message in native struct + * Failure: NULL *------------------------------------------------------------------------- */ static void * -H5O__mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, - unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, - size_t H5_ATTR_UNUSED p_size, const uint8_t *p) +H5O__mtime_new_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, + const uint8_t *p) { - time_t *mesg; - uint32_t tmp_time; /* Temporary copy of the time */ - void *ret_value = NULL; /* Return value */ + const uint8_t *p_end = p + p_size - 1; /* End of input buffer */ + time_t *mesg = NULL; + uint32_t tmp_time; /* Temporary copy of the time */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE - /* check args */ HDassert(f); HDassert(p); - /* decode */ + if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); if (*p++ != H5O_MTIME_VERSION) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for mtime message"); /* Skip reserved bytes */ + if (H5_IS_BUFFER_OVERFLOW(p, 3, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); p += 3; /* Get the time_t from the file */ + if (H5_IS_BUFFER_OVERFLOW(p, 4, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); UINT32DECODE(p, tmp_time); /* The return value */ @@ -153,35 +154,36 @@ done: * Purpose: Decode a modification time message and return a pointer to a * new time_t value. * + * This version of the modification time was used in HDF5 + * 1.6.0 and earlier. + * * The new modification time message format was added due to the * performance overhead of the old format. * - * Return: Success: Ptr to new message in native struct. - * - * Failure: NULL - * - * Programmer: Robb Matzke - * Jul 24 1998 - * + * Return: Success: Pointer to new message in native struct + * Failure: NULL *------------------------------------------------------------------------- */ static void * -H5O__mtime_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) +H5O__mtime_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, + const uint8_t *p) { - time_t *mesg, the_time; - struct tm tm; - int i; /* Local index variable */ - void *ret_value = NULL; /* Return value */ + const uint8_t *p_end = p + p_size - 1; /* End of input buffer */ + time_t *mesg = NULL; + time_t the_time; + struct tm tm; + void *ret_value = NULL; FUNC_ENTER_PACKAGE - /* check args */ HDassert(f); HDassert(p); - /* decode */ - for (i = 0; i < 14; i++) + /* Buffer should have 14 message bytes and 2 reserved bytes */ + if (H5_IS_BUFFER_OVERFLOW(p, 16, p_end)) + HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding"); + for (int i = 0; i < 14; i++) if (!HDisdigit(p[i])) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") diff --git a/src/H5Oname.c b/src/H5Oname.c index a1e239b..10ea365 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -13,10 +13,8 @@ /*------------------------------------------------------------------------- * * Created: H5Oname.c - * Aug 12 1997 - * Robb Matzke * - * Purpose: Object name message. + * Purpose: Object name (comment) message * *------------------------------------------------------------------------- */ @@ -67,41 +65,37 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ * Purpose: Decode a name message and return a pointer to a new * native message struct. * - * Return: Success: Ptr to new message in native struct. - * - * Failure: NULL - * - * Programmer: Robb Matzke - * Aug 12 1997 - * + * Return: Success: Ptr to new message in native struct. + * Failure: NULL *------------------------------------------------------------------------- */ static void * -H5O__name_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, size_t H5_ATTR_UNUSED p_size, const uint8_t *p) +H5O__name_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, size_t p_size, + const uint8_t *p) { - H5O_name_t *mesg; - void *ret_value = NULL; /* Return value */ + H5O_name_t *mesg = NULL; + void *ret_value = NULL; FUNC_ENTER_PACKAGE - /* check args */ HDassert(f); HDassert(p); - /* decode */ if (NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if (NULL == (mesg->s = (char *)H5MM_strdup((const char *)p))) + + if (NULL == (mesg->s = (char *)H5MM_strndup((const char *)p, p_size - 1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Set return value */ ret_value = mesg; done: if (NULL == ret_value) - if (mesg) - mesg = (H5O_name_t *)H5MM_xfree(mesg); + if (mesg) { + H5MM_xfree(mesg->s); + H5MM_xfree(mesg); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__name_decode() */ diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 65e140f..6fba508 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -246,7 +246,7 @@ extern "C" { * * H5Oopen() cannot be used to open a dataspace, attribute, property list, or file. * - * Once an object of unknown type has been opened with H5Oopen(), + * Once an object of an unknown type has been opened with H5Oopen(), * the type of that object can be determined by means of an H5Iget_type() call. * * \p loc_id may be a file, group, dataset, named datatype, or attribute. @@ -384,7 +384,7 @@ H5_DLL hid_t H5Oopen_by_idx_async(hid_t loc_id, const char *group_name, H5_inde * the \p loc_id and \p name combination exists. * \return Returns 0 if the object pointed to by * the \p loc_id and \p name combination does not exist. - * \return Returns a negatvie value when the function fails. + * \return Returns a negative value when the function fails. * * \details H5Oexists_by_name() allows an application to determine whether * the link \p name in the group or file specified with \p loc_id @@ -408,22 +408,22 @@ H5_DLL hid_t H5Oopen_by_idx_async(hid_t loc_id, const char *group_name, H5_inde * where \c group1 is a member of the group specified by \c loc_id: * * \par - * - First use H5Lexists() to verify that a link named \c group1 exists. + * - First, use H5Lexists() to verify that a link named \c group1 exists. * - If \c group1 exists, use H5Oexists_by_name() to verify that the * link \c group1 resolves to an object. - * - If \c group1 exists, use H5Lexists() again, this time with name + * - If \c group1 exists, use H5Lexists() again, this time with the name * set to \c group1/group2, to verify that the link \c group2 exists * in \c group1. * - If the \c group2 link exists, use H5Oexists_by_name() to verify * that \c group1/group2 resolves to an object. - * - If \c group2 exists, use H5Lexists() again, this time with name + * - If \c group2 exists, use H5Lexists() again, this time with the name * set to \c group1/group2/softlink_to_group3, to verify that the * link \c softlink_to_group3 exists in \c group2. * - If the \c softlink_to_group3 link exists, use H5Oexists_by_name() * to verify that \c group1/group2/softlink_to_group3 resolves to * an object. * - If \c softlink_to_group3 exists, you can now safely use H5Lexists - * with name set to \c group1/group2/softlink_to_group3/datasetD to + * with the name set to \c group1/group2/softlink_to_group3/datasetD to * verify that the target link, \c datasetD, exists. * - And finally, if the link \c datasetD exists, use H5Oexists_by_name * to verify that \c group1/group2/softlink_to_group3/datasetD @@ -437,12 +437,12 @@ H5_DLL hid_t H5Oopen_by_idx_async(hid_t loc_id, const char *group_name, H5_inde * H5Lexists() would have name set to \c /group1. * * \par - * Note that this is an outline and does not include all necessary + * Note that this is an outline and does not include all the necessary * details. Depending on circumstances, for example, an application * may need to verify the type of an object also. * * \warning \Bold{Failure Modes:} - * \warning If \p loc_id and \p name both exist but the combination does not + * \warning If \p loc_id and \p name both exist, but the combination does not * resolve to an object, the function will return 0 (zero); * the function does not fail in this case. * \warning If either the location or the link specified by the \p loc_id @@ -492,7 +492,7 @@ H5_DLL htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id); * \note If you are iterating through a lot of different objects to * retrieve information via the H5Oget_info() family of routines, * you may see memory building up. This can be due to memory - * allocation for metadata such as object headers and messages + * allocation for metadata, such as object headers and messages, * when the iterated objects are put into the metadata cache. * \note * If the memory buildup is not desirable, you can configure a @@ -722,7 +722,7 @@ H5_DLL herr_t H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5 * * \details H5Olink() creates a new hard link to an object in an HDF5 file. * \p new_loc_id and \p \p new_link_name specify the location and name of the - * new link while \p object_id identifies the object that the link + * new link, while \p object_id identifies the object that the link * points to. * * H5Olink() is designed for two purposes: @@ -792,7 +792,7 @@ H5_DLL herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_ * An object’s reference count is the number of hard links in the * file that point to that object. See the “Programming Model” * section of the HDF5 Groups chapter in the -- \ref UG - * for a more complete discussion of reference counts. + * for a complete discussion of reference counts. * * If a user application needs to determine an object’s reference * count, an H5Oget_info() call is required; the reference count @@ -965,7 +965,7 @@ H5_DLL herr_t H5Ocopy_async(hid_t src_loc_id, const char *src_name, hid_t dst_lo * is overwritten. * * The target object is specified by an identifier, \p obj_id. - * If \p comment is the empty string or a null pointer, any existing + * If \p comment is an empty string or a null pointer, any existing * comment message is removed from the object. * * Comments should be relatively short, null-terminated, ASCII strings. @@ -1010,7 +1010,7 @@ H5_DLL herr_t H5Oset_comment(hid_t obj_id, const char *comment); * - An absolute name of the object, starting from \c /, the file’s root group * - A dot (\c .), if \p loc_id fully specifies the object * - * If \p comment is the empty string or a null pointer, any existing + * If \p comment is an empty string or a null pointer, any existing * comment message is removed from the object. * * Comments should be relatively short, null-terminated, ASCII strings. @@ -1064,7 +1064,7 @@ H5_DLL herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char * only \p bufsize bytes of the comment, without a \c NULL terminator, * are returned in \p comment. * - * If an object does not have a comment, the empty string is + * If an object does not have a comment, an empty string is * returned in \p comment. * * \version 1.8.11 Fortran subroutine introduced in this release. @@ -1112,7 +1112,7 @@ H5_DLL ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize); * only \p bufsize bytes of the comment, without a \c NULL terminator, * are returned in \p comment. * - * If an object does not have a comment, the empty string is + * If an object does not have a comment, an empty string is * returned in \p comment. * * \p lapl_id contains a link access property list identifier. A @@ -1259,7 +1259,7 @@ H5_DLL herr_t H5Ovisit3(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order * a file or an object in a file; if \p loc_id is an attribute identifier, * the object where the attribute is attached will be used. * \p obj_name specifies either an object in the file (with an absolute - * name based in the file’s root group) or an object name relative + * name based on the file’s root group) or an object name relative * to \p loc_id. If \p loc_id fully specifies the object that is to serve * as the root of the iteration, \p obj_name should be '\c .' (a dot). * (Note that when \p loc_id fully specifies the object that is to serve @@ -1374,7 +1374,7 @@ H5_DLL herr_t H5Oclose_async(hid_t object_id, hid_t es_id); * flushed to disk without removing the data from the cache. * * The object associated with \p object_id can be any named object in an - * HDF5 file including a dataset, a group, or a committed datatype. + * HDF5 file, including a dataset, a group, or a committed datatype. * * \warning H5Oflush doesn't work correctly with parallel. It causes an assertion * failure in metadata cache during H5Fclose(). @@ -1781,7 +1781,7 @@ typedef herr_t (*H5O_iterate1_t)(hid_t obj, const char *name, const H5O_info1_t * * The object’s address within the file, \p addr, is the byte offset of the first byte * of the object header from the beginning of the HDF5 file space, i.e., from the - * beginning of the super block (see the “HDF5 Storage Model” section of the The + * beginning of the superblock (see the “HDF5 Storage Model” section of the The * HDF5 Data Model and File Structure chapter of the HDF5 User's Guide.) * * \p addr can be obtained via either of two function calls. H5Gget_objinfo() returns @@ -1800,7 +1800,7 @@ typedef herr_t (*H5O_iterate1_t)(hid_t obj, const char *name, const H5O_info1_t * overcome by retrieving the object address with H5Gget_objinfo() or H5Lget_info() * immediately before calling H5Oopen_by_addr(). The immediacy of the operation can be * important; if time has elapsed and the object has been deleted from the file, - * the address will be invalid and file corruption can result. + * the address will be invalid, and file corruption can result. * * \version 1.8.4 Fortran subroutine added in this release. * @@ -1829,7 +1829,7 @@ H5_DLL hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr); * \note If you are iterating through a lot of different objects to * retrieve information via the H5Oget_info() family of routines, * you may see memory building up. This can be due to memory - * allocation for metadata such as object headers and messages + * allocation for metadata, such as object headers and messages, * when the iterated objects are put into the metadata cache. * \note * If the memory buildup is not desirable, you can configure a @@ -1967,7 +1967,7 @@ H5_DLL herr_t H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index * \note If you are iterating through a lot of different objects to * retrieve information via the H5Oget_info() family of routines, * you may see memory building up. This can be due to memory - * allocation for metadata such as object headers and messages + * allocation for metadata, such as object headers and messages, * when the iterated objects are put into the metadata cache. * \note * If the memory buildup is not desirable, you can configure a @@ -2197,7 +2197,7 @@ H5_DLL herr_t H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order * a file or an object in a file; if \p loc_id is an attribute identifier, * the object where the attribute is attached will be used. * \p obj_name specifies either an object in the file (with an absolute - * name based in the file’s root group) or an object name relative + * name based on the file’s root group) or an object name relative * to \p loc_id. If \p loc_id fully specifies the object that is to serve * as the root of the iteration, \p obj_name should be '\c .' (a dot). * (Note that when \p loc_id fully specifies the object that is to serve diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 07bc4a1..b7d2353 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -11,16 +11,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Friday, January 19, 2007 - * * Purpose: This file contains inline definitions for "generic" routines - * supporting a "shared message interface" (ala Java) for object - * header messages that can be shared. This interface is - * dependent on a bunch of macros being defined which define - * the name of the interface and "real" methods which need to - * be implemented for each message class that supports the - * shared message interface. + * supporting a "shared message interface" (ala Java) for object + * header messages that can be shared. This interface is + * dependent on a bunch of macros being defined which define + * the name of the interface and "real" methods which need to + * be implemented for each message class that supports the + * shared message interface. */ #ifndef H5Oshared_H @@ -31,16 +28,12 @@ * * Purpose: Decode an object header message that may be shared. * - * Note: The actual name of this routine can be different in each source - * file that this header file is included in, and must be defined - * prior to including this header file. - * - * Return: Success: Pointer to the new message in native form - * Failure: NULL - * - * Programmer: Quincey Koziol - * Friday, January 19, 2007 + * Note: The actual name of this routine can be different in each source + * file that this header file is included in, and must be defined + * prior to including this header file. * + * Return: Success: Pointer to the new message in native form + * Failure: NULL *------------------------------------------------------------------------- */ static inline void * @@ -90,16 +83,11 @@ done: * * Purpose: Encode an object header message that may be shared. * - * Note: The actual name of this routine can be different in each source - * file that this header file is included in, and must be defined - * prior to including this header file. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Friday, January 19, 2007 + * Note: The actual name of this routine can be different in each source + * file that this header file is included in, and must be defined + * prior to including this header file. * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static inline herr_t @@ -143,18 +131,14 @@ done: /*------------------------------------------------------------------------- * Function: H5O_SHARED_SIZE * - * Purpose: Returns the length of an encoded message. + * Purpose: Returns the length of an encoded message. * - * Note: The actual name of this routine can be different in each source - * file that this header file is included in, and must be defined - * prior to including this header file. - * - * Return: Success: Length - * Failure: 0 - * - * Programmer: Quincey Koziol - * Friday, January 19, 2007 + * Note: The actual name of this routine can be different in each source + * file that this header file is included in, and must be defined + * prior to including this header file. * + * Return: Success: Length + * Failure: 0 *------------------------------------------------------------------------- */ static inline size_t @@ -198,16 +182,11 @@ done: * Purpose: Decrement reference count on any objects referenced by * message * - * Note: The actual name of this routine can be different in each source - * file that this header file is included in, and must be defined - * prior to including this header file. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Friday, January 19, 2007 + * Note: The actual name of this routine can be different in each source + * file that this header file is included in, and must be defined + * prior to including this header file. * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static inline herr_t @@ -249,16 +228,11 @@ done: * Purpose: Increment reference count on any objects referenced by * message * - * Note: The actual name of this routine can be different in each source - * file that this header file is included in, and must be defined - * prior to including this header file. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Friday, January 19, 2007 + * Note: The actual name of this routine can be different in each source + * file that this header file is included in, and must be defined + * prior to including this header file. * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static inline herr_t @@ -299,16 +273,11 @@ done: * * Purpose: Copies a message from _SRC to _DEST in file * - * Note: The actual name of this routine can be different in each source - * file that this header file is included in, and must be defined - * prior to including this header file. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Friday, January 19, 2007 + * Note: The actual name of this routine can be different in each source + * file that this header file is included in, and must be defined + * prior to including this header file. * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static inline void * @@ -366,12 +335,7 @@ done: * file that this header file is included in, and must be defined * prior to including this header file. * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Peter Cao - * May 25, 2007 - * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static inline herr_t @@ -418,7 +382,7 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to update native message") #endif /* H5O_SHARED_POST_COPY_FILE_UPD */ - /* Make sure that if the the source or destination is committed, both are + /* Make sure that if the source or destination is committed, both are * committed */ HDassert((shared_src->type == H5O_SHARE_TYPE_COMMITTED) == (shared_dst->type == H5O_SHARE_TYPE_COMMITTED)); @@ -432,16 +396,11 @@ done: * * Purpose: Prints debugging info for a potentially shared message. * - * Note: The actual name of this routine can be different in each source - * file that this header file is included in, and must be defined - * prior to including this header file. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Saturday, February 3, 2007 + * Note: The actual name of this routine can be different in each source + * file that this header file is included in, and must be defined + * prior to including this header file. * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ static inline herr_t diff --git a/src/H5PBmodule.h b/src/H5PBmodule.h index 39db5d9..3a353db 100644 --- a/src/H5PBmodule.h +++ b/src/H5PBmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5PB package. Including this header means that the source file - * is part of the H5PB package. + * Purpose: This file contains declarations which define macros for the + * H5PB package. Including this header means that the source file + * is part of the H5PB package. */ #ifndef H5PBmodule_H #define H5PBmodule_H diff --git a/src/H5PLint.c b/src/H5PLint.c index 4995adb..62e0074 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -254,11 +254,17 @@ H5PL_load(H5PL_type_t type, const H5PL_key_t *key) /* If not found, try iterating through the path table to find an appropriate plugin */ if (!found) if (H5PL__find_plugin_in_path_table(&search_params, &found, &plugin_info) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in path table failed") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, + "can't find plugin in the paths either set by HDF5_PLUGIN_PATH, or default location, " + "or set by H5PLxxx functions") /* Set the return value we found the plugin */ if (found) ret_value = plugin_info; + else + HGOTO_ERROR(H5E_PLUGIN, H5E_NOTFOUND, NULL, + "can't find plugin. Check either HDF5_VOL_CONNECTOR, HDF5_PLUGIN_PATH, default location, " + "or path set by H5PLxxx functions") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index f868a30..9619b13 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -854,7 +854,8 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo /* Open the directory */ if (!(dirp = HDopendir(dir))) - HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory: %s", dir) + HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory (%s). Please verify its existence", + dir) /* Iterate through all entries in the directory */ while (NULL != (dp = HDreaddir(dirp))) { diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 4595d22..c53053b 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -95,9 +95,9 @@ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask); * \brief Queries the loadability of dynamic plugin types * * \param[out] plugin_control_mask List of dynamic plugin types that are enabled or disabled.\n - * A plugin bit set to 0 (zero) indicates that that the dynamic plugin type is + * A plugin bit set to 0 (zero) indicates that the dynamic plugin type is * disabled.\n - * A plugin bit set to 1 (one) indicates that that the dynamic plugin type is + * A plugin bit set to 1 (one) indicates that the dynamic plugin type is * enabled.\n * If the value of \p plugin_control_mask is negative, all dynamic plugin * types are enabled.\n @@ -105,7 +105,7 @@ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_control_mask); * are disabled. * \return \herr_t * - * \details H5PLget_loading_state() retrieves the bitmask that controls whether a certain type of plugins + * \details H5PLget_loading_state() retrieves the bitmask that controls whether a certain type of plugin * (e.g.: filters, VOL drivers) will be loaded by the HDF5 library. * * Bit positions allocated to date are specified in \ref H5PL_type_t as follows: diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 07d64bc..8e9b680 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -5957,7 +5957,7 @@ H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_perc, "Minimum metadata fractions must be between 0 and 100 inclusive") if (min_raw_perc > 100) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "Minimum rawdata fractions must be between 0 and 100 inclusive") + "Minimum raw data fractions must be between 0 and 100 inclusive") if (min_meta_perc + min_raw_perc > 100) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, @@ -5969,7 +5969,7 @@ H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_perc, if (H5P_set(plist, H5F_ACS_PAGE_BUFFER_MIN_META_PERC_NAME, &min_meta_perc) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set percentage of min metadata entries") if (H5P_set(plist, H5F_ACS_PAGE_BUFFER_MIN_RAW_PERC_NAME, &min_raw_perc) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set percentage of min rawdata entries") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set percentage of min raw data entries") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Pmodule.h b/src/H5Pmodule.h index f2a1e5a..ea6a5e4 100644 --- a/src/H5Pmodule.h +++ b/src/H5Pmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5P package. Including this header means that the source file - * is part of the H5P package. + * Purpose: This file contains declarations which define macros for the + * H5P package. Including this header means that the source file + * is part of the H5P package. */ #ifndef H5Pmodule_H #define H5Pmodule_H diff --git a/src/H5Ppkg.h b/src/H5Ppkg.h index 05cc6a8..9a58d00 100644 --- a/src/H5Ppkg.h +++ b/src/H5Ppkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Friday, November 16, 2001 - * - * Purpose: This file contains declarations which are visible only within - * the H5P package. Source files outside the H5P package should - * include H5Pprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5P package. Source files outside the H5P package should + * include H5Pprivate.h instead. */ #if !(defined H5P_FRIEND || defined H5P_MODULE) #error "Do not include this file outside the H5P package!" diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 24dc754..bb5d421 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -2419,7 +2419,7 @@ H5_DLL herr_t H5Pset_deflate(hid_t plist_id, unsigned level); * format. The filters will come into play only when dense storage * is used (see H5Pset_link_phase_change()) and will be applied to * the group’s fractal heap. The fractal heap will contain most of - * the the group’s link metadata, including link names. + * the group’s link metadata, including link names. * * \note When working with group creation property lists, if you are * adding a filter that is not in HDF5’s set of predefined filters, @@ -3268,7 +3268,7 @@ H5_DLL herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, /* out */ * after the call to H5Pset_fapl_core(). It is an error to use this * function with any other VFD. * - * \note This function only applies to the backing store write operation + * \note This function only applies to the backing store write operation, * which typically occurs when the file is flushed or closed. This * function has no relationship to the increment parameter passed * to H5Pset_fapl_core(). @@ -3315,7 +3315,7 @@ H5_DLL herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, siz * * * - * * @@ -3366,7 +3366,7 @@ H5_DLL herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, siz * * * * @@ -3947,7 +3947,7 @@ H5_DLL herr_t H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts); * for more information. * * The type of data returned in \p type will be one of those - * listed in the discussion of the \p type parameter in the the + * listed in the discussion of the \p type parameter in the * description of the function H5Pset_multi_type(). * * Use of this function is only appropriate for an HDF5 file @@ -4106,7 +4106,7 @@ H5_DLL herr_t H5Pget_vol_info(hid_t plist_id, void **vol_info); * \details H5Pset_alignment() sets the alignment properties of a * file access property list so that any file object greater * than or equal in size to \p threshold bytes will be aligned - * on an address which is a multiple of \p alignment. The + * on an address that is a multiple of \p alignment. The * addresses are relative to the end of the user block; the * alignment is calculated by subtracting the user block size * from the absolute file address and then adjusting the address @@ -4116,7 +4116,7 @@ H5_DLL herr_t H5Pget_vol_info(hid_t plist_id, void **vol_info); * implying no alignment. Generally the default values will * result in the best performance for single-process access to * the file. For MPI IO and other parallel systems, choose an - * alignment which is a multiple of the disk block size. + * alignment that is a multiple of the disk block size. * * If the file space handling strategy is set to * #H5F_FSPACE_STRATEGY_PAGE, then the alignment set via this @@ -4154,7 +4154,7 @@ H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignme * penalized when determining which chunks to flush * from cache. A value of 0 means fully read or * written chunks are treated no differently than - * other chunks (the preemption is strictly LRU) + * other chunks (the preemption is strictly LRU), * while a value of 1 means fully read or written * chunks are always preempted before other chunks. * If your application only reads or writes data once, @@ -4176,7 +4176,7 @@ H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignme * computing a hash value using the address of a chunk and then by * using that hash value as the chunk’s index into the table of * cached chunks. In other words, the size of this hash table and the - * number of possible hash values is determined by the \p rdcc_nslots + * number of possible hash values are determined by the \p rdcc_nslots * parameter. If a different chunk in the cache has the same hash value, * a collision will occur, which will reduce efficiency. If inserting * the chunk into the cache would cause the cache to be too big, then @@ -5341,7 +5341,7 @@ H5_DLL herr_t H5Pget_vol_cap_flags(hid_t plist_id, uint64_t *cap_flags); /** * \ingroup GAPL * - * \brief Sets metadata I/O mode for read operations to collective or independent (default) + * \brief Sets metadata I/O mode for read operations to be collective or independent (default) * * \gacpl_id * \param[in] is_collective Boolean value indicating whether metadata reads are collective @@ -5430,7 +5430,7 @@ H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collectiv /** * \ingroup FAPL * - * \brief Sets metadata write mode to collective or independent (default) + * \brief Sets metadata write mode to be collective or independent (default) * * \fapl_id{plist_id} * \param[out] is_collective Boolean value indicating whether metadata @@ -6699,7 +6699,7 @@ H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, * Specifically, a dataset with a datatype that is 8-, 16-, 32-, or * 64-bit signed or unsigned integer; char; or 32- or 64-bit float * can be compressed with SZIP. See Note, below, for further - * discussion of the the SZIP \p bits_per_pixel setting. + * discussion of the SZIP \p bits_per_pixel setting. * * SZIP options are passed in an options mask, \p options_mask, * as follows. diff --git a/src/H5RSmodule.h b/src/H5RSmodule.h index 8cd0333..ee6b7e8 100644 --- a/src/H5RSmodule.h +++ b/src/H5RSmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, October 10, 2020 - * * Purpose: This file contains declarations which define macros for the - * H5RS package. Including this header means that the source file - * is part of the H5RS package. + * H5RS package. Including this header means that the source file + * is part of the H5RS package. */ #ifndef H5RSmodule_H #define H5RSmodule_H diff --git a/src/H5RSprivate.h b/src/H5RSprivate.h index 0c8f3ea..a382140 100644 --- a/src/H5RSprivate.h +++ b/src/H5RSprivate.h @@ -19,9 +19,6 @@ /**************************************/ /* Public headers needed by this file */ /**************************************/ -#ifdef LATER -#include "H5RSpublic.h" -#endif /* LATER */ /***************************************/ /* Private headers needed by this file */ diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h index 856a445..dfeffda 100644 --- a/src/H5Rpublic.h +++ b/src/H5Rpublic.h @@ -259,7 +259,7 @@ H5_DLL herr_t H5Rdestroy(H5R_ref_t *ref_ptr); * \snippet this H5R_type_t_snip * * Note that #H5R_OBJECT1 and #H5R_DATASET_REGION1 can never be - * associated to an \ref H5R_ref_t reference and can therefore never be + * associated with an \ref H5R_ref_t reference and can, therefore, never be * returned through that function. * * \ref H5R_ref_t is defined in H5Rpublic.h as: @@ -302,7 +302,7 @@ H5_DLL htri_t H5Requal(const H5R_ref_t *ref1_ptr, const H5R_ref_t *ref2_ptr); * \return \herr_t * * \details H5Rcopy() creates a copy of an existing reference. - * \p src_ref_ptr points to the reference to copy and \p dst_ref_ptr is the + * \p src_ref_ptr points to the reference to copy, and \p dst_ref_ptr is the * pointer to the destination reference. * */ @@ -336,7 +336,7 @@ H5_DLL herr_t H5Rcopy(const H5R_ref_t *src_ref_ptr, H5R_ref_t *dst_ref_ptr); * * The object opened with this function should be closed when it * is no longer needed so that resource leaks will not develop. Use - * the appropriate close function such as H5Oclose() or H5Dclose() + * the appropriate close function, such as H5Oclose() or H5Dclose() * for datasets. * */ @@ -628,7 +628,7 @@ H5_DLL ssize_t H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *name, size_t siz * * A \Emph{reference type} is the type of reference, either an object * reference or a dataset region reference. An \Emph{object reference} - * points to an HDF5 object while a \Emph{dataset region reference} + * points to an HDF5 object, while a \Emph{dataset region reference} * points to a defined region within a dataset. * * The \Emph{referenced object} is the object the reference points @@ -700,7 +700,7 @@ H5_DLL H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref * * The object opened with this function should be closed when it is no * longer needed so that resource leaks will not develop. Use the - * appropriate close function such as H5Oclose() or H5Dclose() for + * appropriate close function, such as H5Oclose() or H5Dclose() for * datasets. * * \version 1.10.0 Function H5Rdereference() renamed to H5Rdereference1() and @@ -837,7 +837,7 @@ H5_DLL herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H * * The object opened with this function should be closed when it is no * longer needed so that resource leaks will not develop. Use the - * appropriate close function such as H5Oclose() or H5Dclose() for + * appropriate close function, such as H5Oclose() or H5Dclose() for * datasets. * * \since 1.10.0 diff --git a/src/H5SLmodule.h b/src/H5SLmodule.h index 606fa90..b0b3064 100644 --- a/src/H5SLmodule.h +++ b/src/H5SLmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5SL package. Including this header means that the source file - * is part of the H5SL package. + * Purpose: This file contains declarations which define macros for the + * H5SL package. Including this header means that the source file + * is part of the H5SL package. */ #ifndef H5SLmodule_H #define H5SLmodule_H diff --git a/src/H5SLprivate.h b/src/H5SLprivate.h index 6bd1b79..d7eb5be 100644 --- a/src/H5SLprivate.h +++ b/src/H5SLprivate.h @@ -19,9 +19,6 @@ /**************************************/ /* Public headers needed by this file */ /**************************************/ -#ifdef LATER -#include "H5SLpublic.h" -#endif /* LATER */ /***************************************/ /* Private headers needed by this file */ diff --git a/src/H5SMmodule.h b/src/H5SMmodule.h index 6308e14..1eaeea2 100644 --- a/src/H5SMmodule.h +++ b/src/H5SMmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5SM package. Including this header means that the source file - * is part of the H5SM package. + * Purpose: This file contains declarations which define macros for the + * H5SM package. Including this header means that the source file + * is part of the H5SM package. */ #ifndef H5SMmodule_H #define H5SMmodule_H diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 6e44601..64f5c76 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -11,9 +11,6 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird - * Thursday, March 30, 2006 - * * Purpose: This file contains declarations which are visible only within * the H5SM shared object header messages package. Source files * outside the H5SM package should include H5SMprivate.h instead. diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index 95f831e..f6496f3 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -11,11 +11,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: James Laird - * Thursday, March 2, 2006 - * - * Purpose: This file contains private declarations for the H5SM - * shared object header messages module. + * Purpose: This file contains private declarations for the H5SM + * shared object header messages module. */ #ifndef H5SMprivate_H #define H5SMprivate_H diff --git a/src/H5Sall.c b/src/H5Sall.c index eb9a4d7..20c9a20 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -1109,7 +1109,7 @@ done: NAME H5S_select_all PURPOSE - Specify the the entire extent is selected + Specify the entire extent is selected USAGE herr_t H5S_select_all(dsid) hid_t dsid; IN: Dataspace ID of selection to modify @@ -1152,7 +1152,7 @@ done: NAME H5Sselect_all PURPOSE - Specify the the entire extent is selected + Specify the entire extent is selected USAGE herr_t H5Sselect_all(dsid) hid_t dsid; IN: Dataspace ID of selection to modify diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 84cef80..6cc991a 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -9229,7 +9229,7 @@ done: owned by the result. If not, the 2nd span list has to be copied. hbool_t *span2_owned; OUT: Indicates if the 2nd span list is actually owned - H5S_t **result; OUT: The dataspace containing the the new selection. It + H5S_t **result; OUT: The dataspace containing the new selection. It could be same with the 1st dataspace. RETURNS Non-negative on success, negative on failure diff --git a/src/H5Smodule.h b/src/H5Smodule.h index 73f5953..c5081c7 100644 --- a/src/H5Smodule.h +++ b/src/H5Smodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5S package. Including this header means that the source file - * is part of the H5S package. + * Purpose: This file contains declarations which define macros for the + * H5S package. Including this header means that the source file + * is part of the H5S package. */ #ifndef H5Smodule_H #define H5Smodule_H diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 8cc00be..1163484 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Thursday, September 28, 2000 - * - * Purpose: This file contains declarations which are visible only within - * the H5S package. Source files outside the H5S package should - * include H5Sprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5S package. Source files outside the H5S package should + * include H5Sprivate.h instead. */ #if !(defined H5S_FRIEND || defined H5S_MODULE) #error "Do not include this file outside the H5S package!" diff --git a/src/H5Spublic.h b/src/H5Spublic.h index f8fed47..871a8e7 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -1006,7 +1006,7 @@ H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); * The \p coord parameter is a pointer to a buffer containing a * serialized 2-dimensional array of size \p num_elements by the * rank of the dataspace. The array lists dataset elements in the - * point selection; that is, it’s a list of of zero-based values + * point selection; that is, it’s a list of zero-based values * specifying the coordinates in the dataset of the selected * elements. The order of the element coordinates in the \p coord * array specifies the order in which the array elements are @@ -1048,7 +1048,7 @@ H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); * * In the 1D case, we will be selecting five points and a 1D * dataspace has rank 1, so the selection will be described in a - * 5-by-1 array. To select the 1st, 14th, 17th, 23rd, 8th elements + * 5-by-1 array. To select the 1st, 14th, 17th, 23rd and 8th elements * of the dataset, the selection array would be as follows * (remembering that point coordinates are zero-based): * \n 0 @@ -1320,9 +1320,9 @@ H5_DLL herr_t H5Sset_extent_none(hid_t space_id); * \details H5Sset_extent_simple() sets or resets the size of an existing * dataspace. * - * \p dims is an array of size \p rank which contains the new size + * \p dims is an array of size \p rank that contains the new size * of each dimension in the dataspace. \p max is an array of size - * \p rank which contains the maximum size of each dimension in + * \p rank that contains the maximum size of each dimension in * the dataspace. * * Any previous extent is removed from the dataspace, the dataspace diff --git a/src/H5Sselect.c b/src/H5Sselect.c index c2fb7fa..9d13cf2 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -49,12 +49,6 @@ /* Local Prototypes */ /********************/ -#ifdef LATER -static herr_t H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); -static htri_t H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter); -static herr_t H5S__select_iter_next_block(H5S_sel_iter_t *iter); -#endif /* LATER */ - /*****************************/ /* Library Private Variables */ /*****************************/ @@ -1191,50 +1185,6 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_iter_coords() */ -#ifdef LATER - -/*-------------------------------------------------------------------------- - NAME - H5S__select_iter_block - PURPOSE - Get the block of the current iterator position - USAGE - herr_t H5S__select_iter_block(sel_iter,start,end) - const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query - hsize_t *start; OUT: Array to place iterator start block coordinates - hsize_t *end; OUT: Array to place iterator end block coordinates - RETURNS - Non-negative on success, negative on failure. - DESCRIPTION - The current location of the iterator within the selection is placed in - the COORDS array. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - This routine participates in the "Inlining C function pointers" - pattern, don't call it directly, use the appropriate macro - defined in H5Sprivate.h. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5S__select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) -{ - herr_t ret_value; /* return value */ - - FUNC_ENTER_PACKAGE_NOERR - - /* Check args */ - HDassert(iter); - HDassert(start); - HDassert(end); - - /* Call iter_block routine for selection type */ - ret_value = (*iter->type->iter_block)(iter, start, end); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S__select_iter_block() */ -#endif /* LATER */ - /*-------------------------------------------------------------------------- NAME H5S_select_iter_nelmts @@ -1271,46 +1221,6 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_iter_nelmts() */ -#ifdef LATER - -/*-------------------------------------------------------------------------- - NAME - H5S__select_iter_has_next_block - PURPOSE - Check if there is another block available in the selection iterator - USAGE - htri_t H5S__select_iter_has_next_block(sel_iter) - const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query - RETURNS - Non-negative on success, negative on failure. - DESCRIPTION - Check if there is another block available to advance to in the selection - iterator. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - This routine participates in the "Inlining C function pointers" - pattern, don't call it directly, use the appropriate macro - defined in H5Sprivate.h. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static htri_t -H5S__select_iter_has_next_block(const H5S_sel_iter_t *iter) -{ - herr_t ret_value; /* return value */ - - FUNC_ENTER_PACKAGE_NOERR - - /* Check args */ - HDassert(iter); - - /* Call iter_has_next_block routine for selection type */ - ret_value = (*iter->type->iter_has_next_block)(iter); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S__select_iter_has_next_block() */ -#endif /* LATER */ - /*-------------------------------------------------------------------------- NAME H5S_select_iter_next @@ -1353,48 +1263,6 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_iter_next() */ -#ifdef LATER - -/*-------------------------------------------------------------------------- - NAME - H5S__select_iter_next_block - PURPOSE - Advance selection iterator to next block - USAGE - herr_t H5S__select_iter_next_block(iter) - H5S_sel_iter_t *iter; IN/OUT: Selection iterator to change - RETURNS - Non-negative on success, negative on failure. - DESCRIPTION - Move the current element for the selection iterator to the next - block in the selection. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Doesn't maintain the 'elmt_left' field of the selection iterator. - - This routine participates in the "Inlining C function pointers" - pattern, don't call it directly, use the appropriate macro - defined in H5Sprivate.h. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5S__select_iter_next_block(H5S_sel_iter_t *iter) -{ - herr_t ret_value; /* return value */ - - FUNC_ENTER_PACKAGE_NOERR - - /* Check args */ - HDassert(iter); - - /* Call iter_next_block routine for selection type */ - ret_value = (*iter->type->iter_next_block)(iter); - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S__select_iter_next_block() */ -#endif /* LATER */ - /*------------------------------------------------------------------------- * Function: H5S_select_iter_get_seq_list * diff --git a/src/H5Tenum.c b/src/H5Tenum.c index af5812d..bf9b671 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -333,7 +333,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T__enum_nameof * - * Purpose: Finds the symbol name that corresponds the the specified + * Purpose: Finds the symbol name that corresponds to the specified * VALUE of an enumeration data type DT. At most SIZE characters * of the symbol name are copied into the NAME buffer. If the * entire symbol name and null terminator do not fit in the NAME @@ -470,7 +470,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T__enum_valueof * - * Purpose: Finds the value that corresponds the the specified symbol + * Purpose: Finds the value that corresponds to the specified symbol * NAME of an enumeration data type DT and copy it to the VALUE * result buffer. The VALUE should be allocated by the caller to * be large enough for the result. diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index bc521f1..c059d6e 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5T package. Including this header means that the source file - * is part of the H5T package. + * Purpose: This file contains declarations which define macros for the + * H5T package. Including this header means that the source file + * is part of the H5T package. */ #ifndef H5Tmodule_H #define H5Tmodule_H diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 98288f3..504f756 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, December 8, 1997 - * - * Purpose: This file contains declarations which are visible only within - * the H5T package. Source files outside the H5T package should - * include H5Tprivate.h instead. + * Purpose: This file contains declarations which are visible only within + * the H5T package. Source files outside the H5T package should + * include H5Tprivate.h instead. */ #if !(defined H5T_FRIEND || defined H5T_MODULE) #error "Do not include this file outside the H5T package!" diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 16172a8..92ec134 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -1069,7 +1069,7 @@ H5_DLL hid_t H5Tcreate(H5T_class_t type, size_t size); * dataset's datatype. * * The returned datatype identifier should be released with H5Tclose() - * to prevent resource leak. + * to prevent resource leaks. * */ H5_DLL hid_t H5Tcopy(hid_t type_id); @@ -1158,7 +1158,7 @@ H5_DLL herr_t H5Tlock(hid_t type_id); * * \p loc_id may be a file identifier, or a group identifier within * that file. \p name may be either an absolute path in the file or - * a relative path from \p loc_id naming the newly-commited datatype. + * a relative path from \p loc_id naming the newly-committed datatype. * * The link creation property list, \p lcpl_id, governs creation of * the link(s) by which the new committed datatype is accessed and @@ -1235,7 +1235,7 @@ H5_DLL hid_t H5Topen_async(hid_t loc_id, const char *name, hid_t tapl_id, hid_t /** * \ingroup H5T * - * \brief Commits a transient datatype to a file, creating a new named + * \brief Commits a transient datatype to a file, creating a newly named * datatype, but does not link it into the file structure * * \fg_loc_id @@ -1365,7 +1365,7 @@ H5_DLL herr_t H5Tencode(hid_t obj_id, void *buf, size_t *nalloc); /** * \ingroup H5T * - * \brief Decodes a binary object description of datatype and return a new + * \brief Decodes a binary object description of datatype and returns a new * object handle * * \param[in] buf Buffer for the datatype object to be decoded @@ -1437,7 +1437,7 @@ H5_DLL herr_t H5Tflush(hid_t type_id); * contents from disk. * * This function essentially closes the datatype, evicts all - * metadata associated with it from the cache, and then re-opens the + * metadata associated with it from the cache, and then reopens the * datatype. The reopened datatype is automatically re-registered * with the same identifier. * @@ -2263,7 +2263,7 @@ H5_DLL htri_t H5Tis_variable_str(hid_t type_id); * \details H5Tget_native_type() returns the equivalent native datatype * identifier for the datatype specified by \p type_id. * - * H5Tget_native_type() is designed primarily to facilitate use of + * H5Tget_native_type() is designed primarily to facilitate the use of * the H5Dread() function, for which users otherwise must undertake a * multi-step process to determine the native datatype of a dataset * prior to reading it into memory. This function can be used for @@ -2321,7 +2321,7 @@ H5_DLL htri_t H5Tis_variable_str(hid_t type_id); * * \note Please note that a datatype is actually an object * identifier or handle returned from opening the datatype. It - * is not persistent and its value can be different from one HDF5 + * is not persistent, and its value can be different from one HDF5 * session to the next. * * \note H5Tequal() can be used to compare datatypes. @@ -2342,14 +2342,14 @@ H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); * \brief Sets size for a datatype. * * \type_id - * \param[in] size New datatype size is bytes or #H5T_VARIABLE + * \param[in] size New datatype size in bytes or #H5T_VARIABLE * * \return \herr_t * * \details H5Tset_size() sets the total size, \p size, in bytes, for a * datatype. * - * \p size must have a positive value, unless it is passed in as + * \p size must have a positive value unless it is passed in as * #H5T_VARIABLE and the datatype is a string datatype. * * \li Numeric datatypes: If the datatype is atomic and the size @@ -2361,7 +2361,7 @@ H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); * * \li String or character datatypes: The size set for a string * datatype should include space for the null-terminator character, - * otherwise it will not be stored on (or retrieved from) + * otherwise it will not be stored on (or retrieved from) the * disk. Adjusting the size of a string automatically sets the * precision to \p 8*size. * @@ -2767,7 +2767,7 @@ H5_DLL herr_t H5Treclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *bu /** * \ingroup H5T * - * \brief Commits a transient datatype to a file, creating a new named datatype + * \brief Commits a transient datatype to a file, creating a newly named datatype * * \fg_loc_id * \param[in] name Name given to committed datatype diff --git a/src/H5UCprivate.h b/src/H5UCprivate.h index 9a4aa2a..c6a6b7a 100644 --- a/src/H5UCprivate.h +++ b/src/H5UCprivate.h @@ -22,9 +22,6 @@ /**************************************/ /* Public headers needed by this file */ /**************************************/ -#ifdef LATER -#include "H5UCpublic.h" -#endif /* LATER */ /***************************************/ /* Private headers needed by this file */ diff --git a/src/H5VL.c b/src/H5VL.c index fb7af97..8ff5f26 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -967,7 +967,7 @@ H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, uint64_t /* Check args */ if (NULL == flags) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid 'flags' pointer") - if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(obj_id))) + if (NULL == (vol_obj = H5VL_vol_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") /* Query the connector */ diff --git a/src/H5VLint.c b/src/H5VLint.c index 07798c5..e1d7005 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -425,7 +425,7 @@ H5VL__set_def_conn(void) } /* end else */ /* Was there any connector info specified in the environment variable? */ - if (NULL != (tok = HDstrtok_r(NULL, " \t\n\r", &lasts))) + if (NULL != (tok = HDstrtok_r(NULL, "\n\r", &lasts))) if (H5VL__connector_str_to_info(tok, connector_id, &vol_info) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTDECODE, FAIL, "can't deserialize connector info") diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index d7e730a..4ceac7a 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -388,6 +388,7 @@ H5VL_pass_through_new_obj(void *under_obj, hid_t under_vol_id) new_obj = (H5VL_pass_through_t *)calloc(1, sizeof(H5VL_pass_through_t)); new_obj->under_object = under_obj; new_obj->under_vol_id = under_vol_id; + H5Iinc_ref(new_obj->under_vol_id); return new_obj; @@ -520,12 +521,27 @@ H5VL_pass_through_info_copy(const void *_info) printf("------- PASS THROUGH VOL INFO Copy\n"); #endif + /* Make sure the underneath VOL of this pass-through VOL is specified */ + if (!info) { + printf("\nH5VLpassthru.c line %d in %s: info for pass-through VOL can't be null\n", __LINE__, + __func__); + return NULL; + } + + if (H5Iis_valid(info->under_vol_id) <= 0) { + printf("\nH5VLpassthru.c line %d in %s: not a valid underneath VOL ID for pass-through VOL\n", + __LINE__, __func__); + return NULL; + } + /* Allocate new VOL info struct for the pass through connector */ new_info = (H5VL_pass_through_info_t *)calloc(1, sizeof(H5VL_pass_through_info_t)); /* Increment reference count on underlying VOL ID, and copy the VOL info */ new_info->under_vol_id = info->under_vol_id; + H5Iinc_ref(new_info->under_vol_id); + if (info->under_vol_info) H5VLcopy_connector_info(new_info->under_vol_id, &(new_info->under_vol_info), info->under_vol_info); @@ -753,7 +769,9 @@ H5VL_pass_through_get_wrap_ctx(const void *obj, void **wrap_ctx) /* Increment reference count on underlying VOL ID, and copy the VOL info */ new_wrap_ctx->under_vol_id = o->under_vol_id; + H5Iinc_ref(new_wrap_ctx->under_vol_id); + H5VLget_wrap_ctx(o->under_object, o->under_vol_id, &new_wrap_ctx->under_wrap_ctx); /* Set wrap context to return */ @@ -2605,6 +2623,19 @@ H5VL_pass_through_introspect_get_cap_flags(const void *_info, uint64_t *cap_flag printf("------- PASS THROUGH VOL INTROSPECT GetCapFlags\n"); #endif + /* Make sure the underneath VOL of this pass-through VOL is specified */ + if (!info) { + printf("\nH5VLpassthru.c line %d in %s: info for pass-through VOL can't be null\n", __LINE__, + __func__); + return -1; + } + + if (H5Iis_valid(info->under_vol_id) <= 0) { + printf("\nH5VLpassthru.c line %d in %s: not a valid underneath VOL ID for pass-through VOL\n", + __LINE__, __func__); + return -1; + } + /* Invoke the query on the underlying VOL connector */ ret_value = H5VLintrospect_get_cap_flags(info->under_vol_info, info->under_vol_id, cap_flags); diff --git a/src/H5VM.c b/src/H5VM.c index 3abe1d3..f67917d 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -35,11 +35,6 @@ static void H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size / const hsize_t *size, hsize_t *stride1); static void H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2); -#ifdef LATER -static void H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size, - const ssize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size, - const ssize_t *src_stride, const void *_src); -#endif /* LATER */ /*------------------------------------------------------------------------- * Function: H5VM__stride_optimize1 @@ -761,76 +756,6 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss FUNC_LEAVE_NOAPI(SUCCEED) } -#ifdef LATER - -/*------------------------------------------------------------------------- - * Function: H5VM__stride_copy2 - * - * Purpose: Similar to H5VM_stride_copy() except the source and - * destination each have their own dimensionality and size and - * we copy exactly NELMTS elements each of size ELMT_SIZE. The - * size counters wrap if NELMTS is more than a size counter. - * - * Return: void - * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 - * - *------------------------------------------------------------------------- - */ -static void -H5VM__stride_copy2(hsize_t nelmts, hsize_t elmt_size, unsigned dst_n, const hsize_t *dst_size, - const hsize_t *dst_stride, void *_dst, unsigned src_n, const hsize_t *src_size, - const hsize_t *src_stride, const void *_src) -{ - uint8_t *dst = (uint8_t *)_dst; - const uint8_t *src = (const uint8_t *)_src; - hsize_t dst_idx[H5VM_HYPER_NDIMS]; - hsize_t src_idx[H5VM_HYPER_NDIMS]; - hsize_t i; /* Local index variable */ - int j; /* Local index variable */ - hbool_t carry; - - FUNC_ENTER_PACKAGE_NOERR - - HDassert(elmt_size < SIZE_MAX); - HDassert(dst_n > 0); - HDassert(src_n > 0); - - H5VM_vector_cpy(dst_n, dst_idx, dst_size); - H5VM_vector_cpy(src_n, src_idx, src_size); - - for (i = 0; i < nelmts; i++) { - - /* Copy an element */ - H5_CHECK_OVERFLOW(elmt_size, hsize_t, size_t); - H5MM_memcpy(dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */ - - /* Decrement indices and advance pointers */ - for (j = (int)(dst_n - 1), carry = TRUE; j >= 0 && carry; --j) { - dst += dst_stride[j]; - if (--dst_idx[j]) - carry = FALSE; - else { - HDassert(dst_size); - dst_idx[j] = dst_size[j]; - } /* end else */ - } - for (j = (int)(src_n - 1), carry = TRUE; j >= 0 && carry; --j) { - src += src_stride[j]; - if (--src_idx[j]) - carry = FALSE; - else { - HDassert(src_size); - src_idx[j] = src_size[j]; - } /* end else */ - } - } - - FUNC_LEAVE_NOAPI_VOID -} -#endif /* LATER */ - /*------------------------------------------------------------------------- * Function: H5VM_array_fill * diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 1f94f0e..49bb53d 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -10,10 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Robb Matzke - * Friday, October 10, 1997 - */ #ifndef H5VMprivate_H #define H5VMprivate_H @@ -133,13 +129,8 @@ H5_DLL ssize_t H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_s * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Success: Product of elements - * - * Failure: 1 if N is zero - * - * Programmer: Robb Matzke - * Friday, October 10, 1997 - * + * Return: Success: Product of elements + * Failure: 1 if N is zero *------------------------------------------------------------------------- */ static inline hsize_t H5_ATTR_UNUSED @@ -168,14 +159,8 @@ done: * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Success: TRUE if all elements are zero, - * FALSE otherwise - * - * Failure: TRUE if N is zero - * - * Programmer: Robb Matzke - * Friday, October 10, 1997 - * + * Return: Success: TRUE if all elements are zero, + * Failure: TRUE if N is zero *------------------------------------------------------------------------- */ static inline htri_t H5_ATTR_UNUSED @@ -205,14 +190,9 @@ done: * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Success: TRUE if all elements are zero, - * FALSE otherwise - * - * Failure: TRUE if N is zero - * - * Programmer: Robb Matzke - * Friday, October 10, 1997 - * + * Return: Success: TRUE if all elements are zero, + * FALSE otherwise + * Failure: TRUE if N is zero *------------------------------------------------------------------------- */ static inline htri_t H5_ATTR_UNUSED @@ -243,15 +223,11 @@ done: * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Success: -1 if V1 is less than V2 - * 0 if they are equal - * 1 if V1 is greater than V2 - * - * Failure: 0 if N is zero - * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Return: Success: -1 if V1 is less than V2 + * 0 if they are equal + * 1 if V1 is greater than V2 * + * Failure: 0 if N is zero *------------------------------------------------------------------------- */ static inline int H5_ATTR_UNUSED @@ -291,15 +267,11 @@ done: * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Success: -1 if V1 is less than V2 - * 0 if they are equal - * 1 if V1 is greater than V2 - * - * Failure: 0 if N is zero - * - * Programmer: Robb Matzke - * Wednesday, April 8, 1998 + * Return: Success: -1 if V1 is less than V2 + * 0 if they are equal + * 1 if V1 is greater than V2 * + * Failure: 0 if N is zero *------------------------------------------------------------------------- */ static inline int H5_ATTR_UNUSED @@ -339,10 +311,6 @@ done: * reflects its inclusion in a "private" header file. * * Return: void - * - * Programmer: Robb Matzke - * Monday, October 13, 1997 - * *------------------------------------------------------------------------- */ static inline void H5_ATTR_UNUSED @@ -383,10 +351,6 @@ static const unsigned char LogTable256[] = { * reflects its inclusion in a "private" header file. * * Return: log2(n) (always - no failure condition) - * - * Programmer: Quincey Koziol - * Monday, March 6, 2006 - * *------------------------------------------------------------------------- */ static inline unsigned H5_ATTR_UNUSED @@ -432,10 +396,6 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = {0, 1, 28, 2, 29, 14, * reflects its inclusion in a "private" header file. * * Return: log2(n) (always - no failure condition) - * - * Programmer: Quincey Koziol - * Monday, February 27, 2006 - * *------------------------------------------------------------------------- */ static inline H5_ATTR_PURE unsigned @@ -450,16 +410,13 @@ H5VM_log2_of2(uint32_t n) /*------------------------------------------------------------------------- * Function: H5VM_power2up * - * Purpose: Round up a number to the next power of 2 + * Purpose: Round up a number to the next power of 2 * * Note: Although this routine is 'static' in this file, that's intended * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Return the number which is a power of 2 - * - * Programmer: Vailin Choi; Nov 2014 - * + * Return: Return the number which is a power of 2 *------------------------------------------------------------------------- */ static inline H5_ATTR_CONST hsize_t @@ -488,10 +445,6 @@ H5VM_power2up(hsize_t n) * reflects its inclusion in a "private" header file. * * Return: Number of bytes needed - * - * Programmer: Quincey Koziol - * Thursday, March 13, 2008 - * *------------------------------------------------------------------------- */ static inline unsigned H5_ATTR_UNUSED @@ -520,10 +473,6 @@ static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, * reflects its inclusion in a "private" header file. * * Return: TRUE/FALSE - * - * Programmer: Quincey Koziol - * Tuesday, November 25, 2008 - * *------------------------------------------------------------------------- */ static inline hbool_t H5_ATTR_UNUSED @@ -549,11 +498,7 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: None - * - * Programmer: Quincey Koziol - * Tuesday, November 25, 2008 - * + * Return: void *------------------------------------------------------------------------- */ static inline void H5_ATTR_UNUSED diff --git a/src/H5Z.c b/src/H5Z.c index 8ac9b9c..8631b04 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -104,9 +104,15 @@ H5Z_init(void) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP - H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_register(H5Z_SZIP) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") + { + int encoder_enabled = SZ_encoder_enabled(); + if (encoder_enabled < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "check for szip encoder failed") + + H5Z_SZIP->encoder_present = (unsigned)encoder_enabled; + if (H5Z_register(H5Z_SZIP) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") + } #endif /* H5_HAVE_FILTER_SZIP */ done: diff --git a/src/H5Zdevelop.h b/src/H5Zdevelop.h index 346eb0e..cc53824 100644 --- a/src/H5Zdevelop.h +++ b/src/H5Zdevelop.h @@ -227,12 +227,12 @@ extern "C" { * descriptive name for the filter, and may be the null pointer. * * \c can_apply, described in detail below, is a user-defined callback - * function which determines whether the combination of the dataset + * function that determines whether the combination of the dataset * creation property list values, the datatype, and the dataspace * represent a valid combination to apply this filter to. * * \c set_local, described in detail below, is a user-defined callback - * function which sets any parameters that are specific to this + * function that sets any parameters that are specific to this * dataset, based on the combination of the dataset creation property * list values, the datatype, and the dataspace. * @@ -242,9 +242,9 @@ extern "C" { * The statistics associated with a filter are not reset by this * function; they accumulate over the life of the library. * - * #H5Z_class_t is a macro which maps to either H5Z_class1_t or + * #H5Z_class_t is a macro that maps to either H5Z_class1_t or * H5Z_class2_t, depending on the needs of the application. To affect - * only this macro, H5Z_class_t_vers may be defined to either 1 or 2. + * only this macro, H5Z_class_t_vers may be defined as either 1 or 2. * Otherwise, it will behave in the same manner as other API * compatibility macros. See API Compatibility Macros in HDF5 for more * information. H5Z_class1_t matches the #H5Z_class_t structure that is @@ -261,15 +261,15 @@ extern "C" { * defined as described in the HDF5 library header file H5Zpublic.h. * * When a filter is applied to the fractal heap for a group (e.g., - * when compressing group metadata) and if the can apply and set local - * callback functions have been defined for that filter, HDF5 passes + * when compressing group metadata) and if they can apply and set local + * callback functions that have been defined for that filter, HDF5 passes * the value -1 for all parameters for those callback functions. This * is done to ensure that the filter will not be applied to groups if * it relies on these parameters, as they are not applicable to group * fractal heaps; to operate on group fractal heaps, a filter must be * capable of operating on an opaque block of binary data. * - * The \Emph{can apply} callback function must return a positive value + * The \Emph{can-apply} callback function must return a positive value * for a valid combination, zero for an invalid combination, and a * negative value for an error. * \snippet this H5Z_can_apply_func_t_snip @@ -302,9 +302,9 @@ extern "C" { * \Emph{set local} callback functions for any filters used in the * dataset creation property list are called. These callbacks receive * \c dcpl_id, the dataset's private copy of the dataset creation - * property list passed in to H5Dcreate() (i.e. not the actual - * property list passed in to H5Dcreate()); \c type_id, the datatype - * identifier passed in to H5Dcreate(), which is not copied and should + * property list passed into H5Dcreate() (i.e. not the actual + * property list passed into H5Dcreate()); \c type_id, the datatype + * identifier passed into H5Dcreate(), which is not copied and should * not be modified; and \c space_id, a dataspace describing the chunk * (for chunked dataset storage), which should also not be modified. * @@ -345,13 +345,13 @@ extern "C" { * will work in many cases, but if there is a mismatch between the * memory allocators used in the library and any filter that * reallocates a buffer, there could be problems. This is most often - * the case with Windows and/or when debug memory allocators are being + * the case with Windows and/or when debugging memory allocators are being * used. In both cases, the "state" of the memory allocator lies in * different libraries and will get corrupted if you allocate in one * library and free in another. Windows adds the C standard library - * via dlls that can vary with Visual Studio version and debug vs + * via dlls that can vary with Visual Studio version and debug vs. * release builds. Static links to the MSVC CRT can also introduce - * new memory allocator state. + * a new memory allocator state. * * The library does provide H5allocate_memory() and H5free_memory() * functions that will use the library's allocation and free functions, @@ -398,7 +398,7 @@ H5_DLL herr_t H5Zregister(const void *cls); * sure that all cached data that may use this filter are written out. * * If the application is a parallel program, all processes that - * participate in collective data write should call this function to + * participate in collective data writing should call this function to * ensure that all data is flushed. * * After a call to H5Zunregister(), the filter specified in filter diff --git a/src/H5Zmodule.h b/src/H5Zmodule.h index ec21e50..8b1a0de 100644 --- a/src/H5Zmodule.h +++ b/src/H5Zmodule.h @@ -11,12 +11,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol - * Saturday, September 12, 2015 - * - * Purpose: This file contains declarations which define macros for the - * H5Z package. Including this header means that the source file - * is part of the H5Z package. + * Purpose: This file contains declarations which define macros for the + * H5Z package. Including this header means that the source file + * is part of the H5Z package. */ #ifndef H5Zmodule_H #define H5Zmodule_H @@ -84,7 +81,7 @@ * * The HDF5 library does not support filters for contiguous datasets because of * the difficulty of implementing random access for partial I/O. Compact dataset - * filters are not supported because it would not produce significant results. + * filters are not supported because they would not produce significant results. * * Filter identifiers for the filters distributed with the HDF5 * Library are as follows: diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 7b70022..1662738 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -10,10 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Thursday, April 16, 1998 - */ - #ifndef H5Zprivate_H #define H5Zprivate_H diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index ce67cd7..8a05987 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -10,10 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Thursday, April 16, 1998 - */ - #ifndef H5Zpublic_H #define H5Zpublic_H @@ -268,7 +264,7 @@ H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id); * \details H5Zget_filter_info() retrieves information about a filter. At * present, this means that the function retrieves a filter's * configuration flags, indicating whether the filter is configured to - * decode data, to encode data, neither, or both. + * decode data, encode data, neither, or both. * * If \p filter_config_flags is not set to NULL prior to the function * call, the returned parameter contains a bit field specifying the @@ -305,8 +301,8 @@ H5_DLL htri_t H5Zfilter_avail(H5Z_filter_t id); * to read an existing file encoded with that filter. * * This function should be called, and the returned \p - * filter_config_flags analyzed, before calling any other function, - * such as H5Pset_szip() , that might require a particular filter + * filter_config_flags should be analyzed, before calling any other function, + * such as H5Pset_szip(), that might require a particular filter * configuration. * * \since 1.6.3 diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 18ae248..b03ca38 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -72,7 +72,7 @@ static htri_t H5Z__can_apply_szip(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { const H5T_t *type; /* Datatype */ - unsigned dtype_size; /* Datatype's size (in bits) */ + size_t dtype_size; /* Datatype's size (in bits) */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ @@ -130,7 +130,7 @@ H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5T_order_t dtype_order; /* Datatype's endianness order */ size_t dtype_size; /* Datatype's size (in bits) */ size_t dtype_precision; /* Datatype's precision (in bits) */ - size_t dtype_offset; /* Datatype's offset (in bits) */ + int dtype_offset; /* Datatype's offset (in bits) */ hsize_t scanline; /* Size of dataspace's fastest changing dimension */ herr_t ret_value = SUCCEED; /* Return value */ @@ -160,16 +160,16 @@ H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) dtype_offset = H5T_get_offset(type); if (dtype_offset != 0) dtype_precision = dtype_size; - } /* end if */ + } if (dtype_precision > 24) { if (dtype_precision <= 32) dtype_precision = 32; else if (dtype_precision <= 64) dtype_precision = 64; - } /* end if */ + } /* Set "local" parameter for this dataset's "bits-per-pixel" */ - cd_values[H5Z_SZIP_PARM_BPP] = dtype_precision; + cd_values[H5Z_SZIP_PARM_BPP] = (unsigned)dtype_precision; /* Get dataspace */ if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -199,7 +199,7 @@ H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) if (npoints < cd_values[H5Z_SZIP_PARM_PPB]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pixels per block greater than total number of elements in the chunk") - scanline = MIN((cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE), npoints); + scanline = (hsize_t)MIN((cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE), npoints); } else { if (scanline <= SZ_MAX_PIXELS_PER_SCANLINE) @@ -217,7 +217,7 @@ H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Set the correct endianness flag for szip */ /* (Note: this may not handle non-atomic datatypes well) */ - cd_values[H5Z_SZIP_PARM_MASK] &= ~(SZ_LSB_OPTION_MASK | SZ_MSB_OPTION_MASK); + cd_values[H5Z_SZIP_PARM_MASK] &= ~((unsigned)SZ_LSB_OPTION_MASK | (unsigned)SZ_MSB_OPTION_MASK); switch (dtype_order) { case H5T_ORDER_LE: /* Little-endian byte order */ cd_values[H5Z_SZIP_PARM_MASK] |= SZ_LSB_OPTION_MASK; diff --git a/src/H5detect.c b/src/H5detect.c index a491343..daf7708 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -839,7 +839,7 @@ bit.\n"; fprintf(rawoutstream, " *\t\t\t"); } - fprintf(rawoutstream, " *\n * Modifications:\n *\n"); + fprintf(rawoutstream, " *\n"); fprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n"); fprintf(rawoutstream, " *\tIt was generated by code in `H5detect.c'.\n"); diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c index a428062..88a6d7d 100644 --- a/src/H5make_libsettings.c +++ b/src/H5make_libsettings.c @@ -230,7 +230,7 @@ information about the library build configuration\n"; HDfprintf(rawoutstream, " *\t\t\t"); } - HDfprintf(rawoutstream, " *\n * Modifications:\n *\n"); + HDfprintf(rawoutstream, " *\n"); HDfprintf(rawoutstream, " *\tDO NOT MAKE MODIFICATIONS TO THIS FILE!\n"); HDfprintf(rawoutstream, " *\tIt was generated by code in `H5make_libsettings.c'.\n"); diff --git a/src/H5private.h b/src/H5private.h index 45cf9ae..70aed8f 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -10,14 +10,11 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Friday, October 30, 1998 - * - * Purpose: This file is included by all HDF5 library source files to - * define common things which are not defined in the HDF5 API. - * The configuration constants like H5_HAVE_UNISTD_H etc. are - * defined in H5config.h which is included by H5public.h. - * +/* + * Purpose: This file is included by all HDF5 library source files to + * define common things which are not defined in the HDF5 API. + * The configuration constants like H5_HAVE_UNISTD_H etc. are + * defined in H5config.h which is included by H5public.h. */ #ifndef H5private_H @@ -125,6 +122,7 @@ #include /* For _getcwd() */ #include /* POSIX I/O */ #include /* For GetUserName() */ +#include /* For StrStrIA */ #ifdef H5_HAVE_THREADSAFE #include /* For _beginthread() */ @@ -1865,9 +1863,6 @@ H5_DLL herr_t H5_trace_args(struct H5RS_str_t *rs, const char *type, va_list ap) * use initializers that require special cleanup code to * execute if FUNC_ENTER() fails since a failing FUNC_ENTER() * returns immediately without branching to the `done' label. - * - * Programmer: Quincey Koziol - * *------------------------------------------------------------------------- */ @@ -1936,7 +1931,7 @@ typedef struct H5_api_struct { #define H5_FIRST_THREAD_INIT pthread_once(&H5TS_first_init_g, H5TS_pthread_first_thread_init); #endif -/* Macros for threadsafe HDF-5 Phase I locks */ +/* Macros for threadsafe HDF5 Phase I locks */ #define H5_API_LOCK H5TS_mutex_lock(&H5_g.init_lock); #define H5_API_UNLOCK H5TS_mutex_unlock(&H5_g.init_lock); @@ -2293,11 +2288,8 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); /*------------------------------------------------------------------------- - * Purpose: Register function exit for code profiling. This should be - * the last statement executed by a function. - * - * Programmer: Quincey Koziol - * + * Purpose: Register function exit for code profiling. This should be + * the last statement executed by a function. *------------------------------------------------------------------------- */ /* Threadsafety termination code for API routines */ diff --git a/src/H5public.h b/src/H5public.h index 8e5646d..185deb0 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -421,7 +421,7 @@ extern "C" { * issued. If one finds that an HDF5 library function is failing * inexplicably, H5open() can be called first. It is safe to call * H5open() before an application issues any other function calls to - * the HDF5 library as there are no damaging side effects in calling + * the HDF5 library, as there are no damaging side effects in calling * it more than once. */ H5_DLL herr_t H5open(void); @@ -434,13 +434,13 @@ H5_DLL herr_t H5open(void); * * \details H5atclose() registers a callback that the HDF5 library will invoke * when closing. The full capabilities of the HDF5 library are - * available to callbacks invoked through this mechanism, library + * available to callbacks invoked through this mechanism, and library * shutdown will only begin in earnest when all callbacks have been * invoked and have returned. * * Registered callbacks are invoked in LIFO order, similar to the * Standard C 'atexit' routine. For example, if 'func1' is registered, - * then 'func2', when the library is closing 'func2' will + * then 'func2', when the library is closing 'func2', will * be invoked first, then 'func1'. * * The \p ctx pointer will be passed to \p func when it's invoked. @@ -474,13 +474,13 @@ H5_DLL herr_t H5close(void); * function is in situations where the library is dynamically linked * into an application and is un-linked from the application before * exit() gets called. In those situations, a routine installed with - * atexit() would jump to a routine which was no longer in memory, + * atexit() would jump to a routine that was no longer in memory, * causing errors. * * \attention In order to be effective, this routine \Emph{must} be called * before any other HDF5 function calls, and must be called each * time the library is loaded/linked into the application (the first - * time and after it's been un-loaded). + * time and after it's been unloaded). */ H5_DLL herr_t H5dont_atexit(void); /** @@ -492,7 +492,7 @@ H5_DLL herr_t H5dont_atexit(void); * of the library, freeing any unused memory. * * It is not required that H5garbage_collect() be called at any - * particular time; it is only necessary in certain situations where + * particular time; it is only necessary for certain situations where * the application has performed actions that cause the library to * allocate many objects. The application should call * H5garbage_collect() if it eventually releases those objects and @@ -678,7 +678,7 @@ H5_DLL herr_t H5is_library_threadsafe(hbool_t *is_ts); * \param[in] mem Buffer to be freed. Can be NULL * \return \herr_t * - * \details H5free_memory() frees memory that has been allocated by the caller + * \details H5free_memory() frees the memory that has been allocated by the caller * with H5allocate_memory() or by the HDF5 library on behalf of the * caller. * @@ -728,7 +728,7 @@ H5_DLL herr_t H5free_memory(void *mem); * initialized. * * This function is intended to have the semantics of malloc() and - * calloc(). However, unlike malloc() and calloc() which allow for a + * calloc(). However, unlike malloc() and calloc(), which allow for a * "special" pointer to be returned instead of NULL, this function * always returns NULL on failure or when size is set to 0 (zero). * @@ -740,7 +740,7 @@ H5_DLL herr_t H5free_memory(void *mem); * the same library that initially allocated it. In most cases, the * HDF5 API uses resources that are allocated and freed either * entirely by the user or entirely by the library, so this is not a - * problem. In rare cases, however, HDF5 API calls will free memory + * problem. In rare cases, however, HDF5 API calls will free the memory * that the user allocated. This function allows the user to safely * allocate this memory.\n * It is particularly important to use this function to allocate diff --git a/test/Makefile.am b/test/Makefile.am index 73cb96e..bad52c8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -35,9 +35,9 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src # test_vds_swmr.sh: vds_swmr* # test_use_cases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes TEST_SCRIPT = test_abort_fail.sh test_check_version.sh test_error.sh \ - test_flush_refresh.sh test_external_env.sh test_libinfo.sh \ - test_links_env.sh test_swmr.sh test_vds_env.sh test_vds_swmr.sh \ - test_use_cases.sh + test_flush_refresh.sh test_external_env.sh test_libinfo.sh \ + test_links_env.sh test_swmr.sh test_vds_env.sh test_vds_swmr.sh \ + test_use_cases.sh SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ external_env$(EXEEXT) filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \ flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ @@ -241,8 +241,11 @@ use_append_mchunks_SOURCES=use_append_mchunks.c use_common.c use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c # Temporary files. -DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \ - testexternal_env.sh testswmr.sh testvds_env.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh \ - testabort_fail.sh test_vol_plugin.sh test_mirror.sh +DISTCLEANFILES=test_abort_fail.sh test_check_version.sh test_error.sh test_external_env.sh \ + test_flush_refresh.sh test_libinfo.sh test_links_env.sh test_plugin.sh \ + test_swmr.sh test_use_cases.sh test_vds_env.sh test_vds_swmr.sh +if MIRROR_VFD_CONDITIONAL + DISTCLEANFILES+= test_mirror.sh +endif include $(top_srcdir)/config/conclude.am diff --git a/test/accum.c b/test/accum.c index 16f3511..816d9c0 100644 --- a/test/accum.c +++ b/test/accum.c @@ -8,7 +8,6 @@ * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * - * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Mike McGreevy diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index 957ab14..1269c5a 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -8,7 +8,6 @@ * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * - * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5test.h" diff --git a/test/big.c b/test/big.c index 8185a41..a008cef 100644 --- a/test/big.c +++ b/test/big.c @@ -105,8 +105,6 @@ static hsize_t values_used[WRT_N]; * Programmer: Robb Matzke * Tuesday, November 24, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static hsize_t @@ -153,8 +151,6 @@ randll(hsize_t limit, int current_index) * Programmer: Robb Matzke * Wednesday, July 15, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -196,8 +192,6 @@ is_sparse(void) * Programmer: Raymond Lu * Wednesday, April 18, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static fsizes_t @@ -266,8 +260,6 @@ error: * Programmer: Robb Matzke * Thursday, August 6, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ /* Disable warning for "format not a string literal" here -QAK */ @@ -332,10 +324,6 @@ H5_GCC_CLANG_DIAG_ON("format-nonliteral") * Programmer: Robb Matzke * Wednesday, April 8, 1998 * - * Modifications: - * Robb Matzke, 15 Jul 1998 - * Addresses are written to the file DNAME instead of stdout. - * *------------------------------------------------------------------------- */ static int @@ -485,8 +473,6 @@ error: * Programmer: Robb Matzke * Friday, April 10, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -591,8 +577,6 @@ error: * Programmer: Albert Chent * Mar 28, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -757,15 +741,6 @@ error: * Programmer: Robb Matzke * Friday, April 10, 1998 * - * Modifications: - * Albert Cheng, 2002/03/28 - * Added command option -fsize. - * Albert Cheng, 2002/04/19 - * Added command option -c. - * - * Raymond Lu, 2007/05/25 - * Added similar tests for SEC2 and STDIO drivers. - * *------------------------------------------------------------------------- */ int diff --git a/test/bittests.c b/test/bittests.c index 3fbd096..285f404 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -37,8 +37,6 @@ * Programmer: Robb Matzke * Tuesday, June 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -154,8 +152,6 @@ failed: * Programmer: Robb Matzke * Tuesday, June 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -280,8 +276,6 @@ failed: * Programmer: Raymond Lu * Monday, April 12, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -419,8 +413,6 @@ failed: * Programmer: Raymond Lu * Monday, April 12, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -510,8 +502,6 @@ failed: * Programmer: Raymond Lu * Monday, April 12, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -584,8 +574,6 @@ failed: * Programmer: Raymond Lu * Monday, April 12, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -688,8 +676,6 @@ failed: * Programmer: Robb Matzke * Tuesday, June 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -808,8 +794,6 @@ failed: * Programmer: Robb Matzke * Tuesday, June 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t diff --git a/test/cache.c b/test/cache.c index 666615b..517c0b5 100644 --- a/test/cache.c +++ b/test/cache.c @@ -1052,11 +1052,7 @@ smoke_check_5(int express_test, unsigned paged) H5C_t *cache_ptr = NULL; H5C_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, -#if 1 /* H5C_auto_resize_report_fcn rpt_fcn = */ NULL, -#else - /* H5C_auto_resize_report_fcn rpt_fcn = */ H5C_def_auto_resize_rpt_fcn, -#endif /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), @@ -1093,8 +1089,7 @@ smoke_check_5(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.5 - }; + /* double empty_reserve = */ 0.5}; if (paged) TESTING("smoke check #5P -- all clean, ins, prot, unprot, AR cache 1"); @@ -1284,11 +1279,7 @@ smoke_check_6(int express_test, unsigned paged) H5C_t *cache_ptr = NULL; H5C_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, -#if 1 /* H5C_auto_resize_report_fcn rpt_fcn = */ NULL, -#else - /* H5C_auto_resize_report_fcn rpt_fcn = */ H5C_def_auto_resize_rpt_fcn, -#endif /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), @@ -1325,8 +1316,7 @@ smoke_check_6(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.05 - }; + /* double empty_reserve = */ 0.05}; if (paged) TESTING("smoke check #6P -- ~1/2 dirty, ins, prot, unprot, AR cache 1"); @@ -1516,11 +1506,7 @@ smoke_check_7(int express_test, unsigned paged) H5C_t *cache_ptr = NULL; H5C_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, -#if 1 /* H5C_auto_resize_report_fcn rpt_fcn = */ NULL, -#else - /* H5C_auto_resize_report_fcn rpt_fcn = */ H5C_def_auto_resize_rpt_fcn, -#endif /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), @@ -1558,8 +1544,7 @@ smoke_check_7(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1 - }; + /* double empty_reserve = */ 0.1}; if (paged) TESTING("smoke check #7P -- all clean, ins, prot, unprot, AR cache 2"); @@ -1749,11 +1734,7 @@ smoke_check_8(int express_test, unsigned paged) H5C_t *cache_ptr = NULL; H5C_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, -#if 1 /* H5C_auto_resize_report_fcn rpt_fcn = */ NULL, -#else - /* H5C_auto_resize_report_fcn rpt_fcn = */ H5C_def_auto_resize_rpt_fcn, -#endif /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (2 * 1024 * 1024), @@ -1791,8 +1772,7 @@ smoke_check_8(int express_test, unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1 - }; + /* double empty_reserve = */ 0.1}; if (paged) TESTING("smoke check #8P -- ~1/2 dirty, ins, prot, unprot, AR cache 2"); @@ -1969,10 +1949,6 @@ smoke_check_8(int express_test, unsigned paged) * Programmer: John Mainzer * 8/1/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2287,10 +2263,6 @@ smoke_check_9(int express_test, unsigned paged) * Programmer: John Mainzer * 8/1/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2600,8 +2572,6 @@ smoke_check_10(int express_test, unsigned paged) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * *------------------------------------------------------------------------- */ static unsigned @@ -2812,12 +2782,6 @@ write_permitted_check(int * Programmer: John Mainzer * 8/10/06 * - * Modifications: - * - * Updated tests to accommodate the case in which the - * slist is disabled. - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -3093,8 +3057,6 @@ check_insert_entry(unsigned paged) * Programmer: John Mainzer * 1/10/05 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -3183,14 +3145,6 @@ check_flush_cache(unsigned paged) * Programmer: John Mainzer * 1/12/05 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -3252,11 +3206,6 @@ check_flush_cache__empty_cache(H5F_t *file_ptr) * Programmer: John Mainzer * 1/14/05 * - * Modifications: - * - * JRM -- 4/5/06 - * Added pinned entry tests. - * *------------------------------------------------------------------------- */ @@ -4452,14 +4401,6 @@ check_flush_cache__multi_entry(H5F_t *file_ptr) * Programmer: John Mainzer * 1/13/05 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -4474,13 +4415,6 @@ check_flush_cache__multi_entry_test(H5F_t *file_ptr, int test_num, unsigned int test_entry_t *base_addr; test_entry_t *entry_ptr; -#if 0 /* JRM */ - /* This gets used a lot, so lets leave it in. */ - - HDfprintf(stdout, "check_flush_cache__multi_entry_test: test %d\n", - test_num); -#endif /* JRM */ - if (cache_ptr == NULL) { pass = FALSE; @@ -4556,19 +4490,6 @@ check_flush_cache__multi_entry_test(H5F_t *file_ptr, int test_num, unsigned int (entry_ptr->serialized != spec[u].expected_serialized) || (entry_ptr->destroyed != spec[u].expected_destroyed)) { -#if 0 /* This is useful debugging code. Lets keep it around. */ - - HDfprintf(stdout, - "deslzd = %d(%d), slzd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->deserialized), - (int)(spec[u].expected_deserialized), - (int)(entry_ptr->serialized), - (int)(spec[u].expected_serialized), - (int)(entry_ptr->destroyed), - (int)(spec[u].expected_destroyed)); - -#endif - pass = FALSE; HDsnprintf(msg, (size_t)128, "Bad status on entry %u after flush in multi entry test #%d.", u, test_num); @@ -4637,14 +4558,6 @@ check_flush_cache__multi_entry_test(H5F_t *file_ptr, int test_num, unsigned int * Programmer: John Mainzer * 4/5/06 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/16/20 - * *------------------------------------------------------------------------- */ @@ -4660,13 +4573,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t *file_ptr, int test_num, unsigned i test_entry_t *base_addr; test_entry_t *entry_ptr; -#if 0 /* JRM */ - /* This is useful debugging code. Leave it in for now. */ - - HDfprintf(stdout, "check_flush_cache__pe_multi_entry_test: test %d\n", - test_num); -#endif /* JRM */ - if (cache_ptr == NULL) { pass = FALSE; @@ -4749,19 +4655,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t *file_ptr, int test_num, unsigned i (entry_ptr->serialized != spec[u].expected_serialized) || (entry_ptr->destroyed != spec[u].expected_destroyed)) { -#if 0 /* This is useful debugging code. Lets keep it around. */ - - HDfprintf(stdout, - "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->deserialized), - (int)(spec[u].expected_deserialized), - (int)(entry_ptr->serialized), - (int)(spec[u].expected_serialized), - (int)(entry_ptr->destroyed), - (int)(spec[u].expected_destroyed)); - -#endif - pass = FALSE; HDsnprintf(msg, (size_t)128, "Bad status on entry %u after flush in pe multi entry test #%d.", u, test_num); @@ -4835,8 +4728,6 @@ check_flush_cache__pe_multi_entry_test(H5F_t *file_ptr, int test_num, unsigned i * Programmer: John Mainzer * 9/3/06 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -8202,14 +8093,6 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) * Programmer: John Mainzer * 9/3/06 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/16/20 - * *------------------------------------------------------------------------- */ @@ -8227,11 +8110,6 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu test_entry_t *base_addr; test_entry_t *entry_ptr; -#if 0 /* This is useful debugging code -- lets keep it around. */ - HDfprintf(stdout, "check_flush_cache__flush_op_test: test %d\n", - test_num); -#endif - if (cache_ptr == NULL) { pass = FALSE; @@ -8350,21 +8228,6 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu (entry_ptr->serialized != spec[i].expected_serialized) || (entry_ptr->destroyed != spec[i].expected_destroyed)) { -#if 0 /* This is useful debugging code. Lets keep it around. */ - - HDfprintf(stdout, - "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->deserialized), - (int)(spec[i].expected_deserialized), - (int)(entry_ptr->serialized), - (int)(spec[i].expected_serialized), - (int)(entry_ptr->destroyed), - (int)(spec[i].expected_destroyed)); - - HDfprintf(stdout, "entry_ptr->header.is_dirty = %d\n", - (int)(entry_ptr->header.is_dirty)); -#endif - pass = FALSE; HDsnprintf(msg, (size_t)128, "Bad status on entry %d after flush op test #%d.", i, test_num); failure_mssg = msg; @@ -8402,107 +8265,6 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu (entry_ptr->serialized != check[i].expected_serialized) || (entry_ptr->destroyed != check[i].expected_destroyed)) { -#if 0 /* This is useful debugging code. Lets keep it around for a while. */ - - if ( entry_ptr->size != check[i].expected_size ) { - - HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n", - (int)(entry_ptr->size), - (int)(check[i].expected_size)); - } - - if ( ( ! entry_ptr->header.destroy_in_progress ) && - ( check[i].in_cache ) && - ( entry_ptr->header.size != check[i].expected_size ) ) { - - HDfprintf(stdout, - "(!destroy in progress and in cache and size (expected) = %d (%d).\n", - (int)(entry_ptr->header.size), - (int)(check[i].expected_size)); - } - - if ( entry_ptr->at_main_addr != check[i].at_main_addr ) { - - HDfprintf(stdout, - "(%d,%d) at main addr (expected) = %d (%d).\n", - (int)(check[i].entry_type), - (int)(check[i].entry_index), - (int)(entry_ptr->at_main_addr), - (int)(check[i].at_main_addr)); - } - - if ( entry_ptr->is_dirty != check[i].is_dirty ) { - - HDfprintf(stdout, - "entry_ptr->is_dirty (expected) = %d (%d).\n", - (int)(entry_ptr->is_dirty), - (int)(check[i].is_dirty)); - } - - if ( entry_ptr->header.is_dirty != check[i].is_dirty ) { - - HDfprintf(stdout, - "entry_ptr->header.is_dirty (expected) = %d (%d).\n", - (int)(entry_ptr->header.is_dirty), - (int)(check[i].is_dirty)); - } - - if ( entry_ptr->is_protected != check[i].is_protected ) { - - HDfprintf(stdout, - "entry_ptr->is_protected (expected) = %d (%d).\n", - (int)(entry_ptr->is_protected), - (int)(check[i].is_protected)); - } - - if ( entry_ptr->header.is_protected != check[i].is_protected ) { - - HDfprintf(stdout, - "entry_ptr->header.is_protected (expected) = %d (%d).\n", - (int)(entry_ptr->is_protected), - (int)(check[i].is_protected)); - } - - if ( entry_ptr->is_pinned != check[i].is_pinned ) { - - HDfprintf(stdout, - "entry_ptr->is_pinned (expected) = %d (%d).\n", - (int)(entry_ptr->is_pinned), - (int)(check[i].is_pinned)); - } - - if ( entry_ptr->header.is_pinned != check[i].is_pinned ) { - - HDfprintf(stdout, - "entry_ptr->header.is_pinned (expected) = %d (%d).\n", - (int)(entry_ptr->header.is_pinned), - (int)(check[i].is_pinned)); - } - - if ( entry_ptr->deserialized != check[i].expected_deserialized ) { - - HDfprintf(stdout, - "entry_ptr->deserialized (expected) = %d (%d).\n", - (int)(entry_ptr->deserialized), - (int)(check[i].expected_deserialized)); - } - - if ( entry_ptr->serialized != check[i].expected_serialized ) { - - HDfprintf(stdout, - "entry_ptr->serialized (expected) = %d (%d).\n", - (int)(entry_ptr->serialized), - (int)(check[i].expected_serialized)); - } - - if ( entry_ptr->destroyed != check[i].expected_destroyed ) { - - HDfprintf(stdout, \ - "entry_ptr->destroyed (expected) = %d (%d).\n", - (int)(entry_ptr->destroyed), - (int)(check[i].expected_destroyed)); - } -#endif pass = FALSE; HDsnprintf(msg, (size_t)128, "Check2 failed on entry %d after flush op test #%d.", i, test_num); @@ -8592,19 +8354,6 @@ check_flush_cache__flush_op_test(H5F_t *file_ptr, int test_num, unsigned int flu * Programmer: John Mainzer * 10/3/06 * - * Modifications: - * - * Updated test for minor changes in the behaviour - * of H5C__flush_single_entry(). - * - * JRM -- 2/16/15 - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/16/20 - * *------------------------------------------------------------------------- */ @@ -9854,15 +9603,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr) * Programmer: John Mainzer * 1/12/05 * - * Modifications: - * - * JRM -- 3/29/06 - * Added tests for pinned entries. - * - * JRM -- 5/17/06 - * Complete rewrite of pinned entry tests to accommodate - * the new H5C_mark_entry_dirty() call. - * *------------------------------------------------------------------------- */ @@ -11047,14 +10787,6 @@ check_flush_cache__single_entry(H5F_t *file_ptr) * Programmer: John Mainzer * 1/12/05 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -11121,17 +10853,6 @@ check_flush_cache__single_entry_test(H5F_t *file_ptr, int test_num, int entry_ty (entry_ptr->serialized != expected_serialized) || (entry_ptr->destroyed != expected_destroyed)) { -#if 0 /* This is useful debugging code -- lets keep it for a while */ - - HDfprintf(stdout, - "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->deserialized), - (int)expected_deserialized, - (int)(entry_ptr->serialized), - (int)expected_serialized, - (int)(entry_ptr->destroyed), - (int)expected_destroyed); -#endif pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry status after flush in single entry test #%d.", test_num); @@ -11186,21 +10907,6 @@ check_flush_cache__single_entry_test(H5F_t *file_ptr, int test_num, int entry_ty * Programmer: John Mainzer * 3/28/06 * - * Modifications: - * - * JRM -- 5/17/06 - * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned - * flags and supporting code to allow us to test the - * H5C_mark_entry_dirty() call. Use the - * call to mark the entry dirty while the entry is protected - * if pop_mark_dirty_prot is TRUE, and to mark the entry - * dirty while it is pinned if pop_mark_dirty_pinned is TRUE. - * - * JRM -- 5/14/20 - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * *------------------------------------------------------------------------- */ @@ -11280,16 +10986,6 @@ check_flush_cache__pinned_single_entry_test(H5F_t *file_ptr, int test_num, int e (entry_ptr->serialized != expected_serialized) || (entry_ptr->destroyed != expected_destroyed)) { -#if 0 /* this is useful debugging code -- keep it around */ - HDfprintf(stdout, - "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->deserialized), - (int)expected_deserialized, - (int)(entry_ptr->serialized), - (int)expected_serialized, - (int)(entry_ptr->destroyed), - (int)expected_destroyed); -#endif pass = FALSE; HDsnprintf(msg, (size_t)128, "Unexpected entry status after flush in pinned single entry test #%d.", test_num); @@ -11361,8 +11057,6 @@ check_flush_cache__pinned_single_entry_test(H5F_t *file_ptr, int test_num, int e * Programmer: John Mainzer * 4/28/06 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -11581,9 +11275,6 @@ check_get_entry_status(unsigned paged) * Programmer: John Mainzer * 7/5/06 * - * Modifications: - * - * *------------------------------------------------------------------------- */ @@ -11863,10 +11554,6 @@ check_expunge_entry(unsigned paged) * Programmer: John Mainzer * 4/1/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ static unsigned @@ -12353,10 +12040,6 @@ check_move_entry(unsigned paged) * Programmer: John Mainzer * 4/27/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -12509,8 +12192,6 @@ check_move_entry__run_test(H5F_t *file_ptr, unsigned test_num, struct move_entry * Programmer: John Mainzer * 4/28/06 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -12612,12 +12293,6 @@ check_pin_protected_entry(unsigned paged) * Programmer: John Mainzer * 7/7/06 * - * Modifications: - * - * Updated function to allow for disabling of the slist. - * - * JRM -- 5/18/20 - * *------------------------------------------------------------------------- */ @@ -13480,12 +13155,6 @@ check_resize_entry(unsigned paged) * Programmer: John Mainzer * 8/2/07 * - * Modifications: - * - * Updated function to allow for disabling of the slist. - * - * JRM -- 5/18/20 - * *------------------------------------------------------------------------- */ @@ -14130,13 +13799,6 @@ check_evictions_enabled(unsigned paged) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -14229,9 +13891,6 @@ check_flush_protected_err(unsigned paged) * Programmer: John Mainzer * 4/7/06 * - * Modifications: - * - * *------------------------------------------------------------------------- */ static unsigned @@ -14316,8 +13975,6 @@ check_destroy_pinned_err(unsigned paged) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -14412,8 +14069,6 @@ check_destroy_protected_err(unsigned paged) * Programmer: John Mainzer * 6/24/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -14494,10 +14149,6 @@ check_duplicate_insert_err(unsigned paged) * Programmer: John Mainzer * 4/24/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -14583,10 +14234,6 @@ check_double_pin_err(unsigned paged) * Programmer: John Mainzer * 4/24/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -14681,10 +14328,6 @@ check_double_unpin_err(unsigned paged) * Programmer: John Mainzer * 4/24/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -15035,10 +14678,6 @@ check_mark_entry_dirty_errs(unsigned paged) * Programmer: John Mainzer * 7/6/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -15490,10 +15129,6 @@ check_unprotect_ro_dirty_err(unsigned paged) * Programmer: John Mainzer * 4/9/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -15706,10 +15341,6 @@ check_protect_retries(unsigned paged) * Programmer: John Mainzer * 8/3/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -19710,12 +19341,6 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) * Programmer: John Mainzer * 12/16/04 * - * Modifications: - * - * Added code to include the flash cache size increment - * code in this test. - * JRM -- 1/10/08 - * *------------------------------------------------------------------------- */ @@ -22312,8 +21937,6 @@ check_auto_cache_resize_disable(unsigned paged) * Programmer: John Mainzer * 12/16/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -22999,13 +22622,6 @@ check_auto_cache_resize_epoch_markers(unsigned paged) * Programmer: John Mainzer * 10/29/04 * - * Modifications: - * - * Added code to verify that errors in the flash cache size - * increment related fields are caught as well. - * - * JRM -- 1/17/08 - * *------------------------------------------------------------------------- */ @@ -25236,8 +24852,6 @@ check_auto_cache_resize_input_errs(unsigned paged) * Programmer: John Mainzer * 11/4/04 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -25255,11 +24869,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) uint32_t cur_num_entries; H5C_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C__CURR_AUTO_SIZE_CTL_VER, -#if 1 /* H5C_auto_resize_report_fcn rpt_fcn = */ NULL, -#else - /* H5C_auto_resize_report_fcn rpt_fcn = */ H5C_def_auto_resize_rpt_fcn, -#endif /* hbool_t set_initial_size = */ TRUE, /* size_t initial_size = */ (1 * 1024 * 1024), @@ -25296,8 +24906,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) /* int32_t epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.5 - }; + /* double empty_reserve = */ 0.5}; if (paged) TESTING("automatic cache resize auxiliary functions (paged aggregation)"); @@ -25738,8 +25347,6 @@ check_auto_cache_resize_aux_fcns(unsigned paged) * Programmer: Mike McGreevy * 12/16/08 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -28650,14 +28257,6 @@ done: * Programmer: Quincey Koziol * 3/17/09 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -32207,10 +31806,6 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) * Programmer: John Mainzer * 4/3/15 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ static unsigned @@ -32304,14 +31899,6 @@ check_entry_deletions_during_scans(unsigned paged) * Programmer: John Mainzer * 4/4/15 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -32544,14 +32131,6 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t *file_ptr) * Programmer: John Mainzer * 4/4/15 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -32906,14 +32485,6 @@ cedds__H5C_make_space_in_cache(H5F_t *file_ptr) * Programmer: John Mainzer * 4/4/15 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -33366,14 +32937,6 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr) * Programmer: John Mainzer * 4/9/15 * - * Modifications: - * - * Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -33673,8 +33236,6 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t *file_ptr) * Programmer: John Mainzer * 4/12/15 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -33755,18 +33316,6 @@ check_stats(unsigned paged) * Programmer: John Mainzer * 4/22/15 * - * Modifications: - * - * Modified slist stats checks to allow for the case that - * the slist is disabled. - * - * Also added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via the - * H5C_FLUSH_CACHE macro. - * - * JRM -- 5/14/20 - * - * *------------------------------------------------------------------------- */ #if H5C_COLLECT_CACHE_STATS diff --git a/test/cache_api.c b/test/cache_api.c index e325069..a34a6ca 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -759,14 +759,6 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) pass = FALSE; failure_mssg = "H5Fget_mdc_hit_rate() returned unexpected hit rate.\n"; } -#if 0 /* this may be useful now and then -- keep it around */ - else { - - HDfprintf(stdout, - "H5Fget_mdc_hit_rate() reports hit_rate = %lf:\n", - hit_rate); - } -#endif } if (pass) { @@ -782,16 +774,6 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) pass = FALSE; failure_mssg = "H5Fget_mdc_size() returned unexpected value(s).\n"; } -#if 0 /* this may be useful now and then -- keep it around */ - else { - - HDfprintf(stdout, "H5Fget_mdc_size() reports:\n"); - HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n", - (long)max_size, (long)min_clean_size); - HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n", - (long)cur_size, cur_num_entries); - } -#endif } /* close the file and delete it */ @@ -1254,27 +1236,13 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) if (data_chunk[k][l] != ((DSET_SIZE * DSET_SIZE * m) + (DSET_SIZE * (i + k)) + j + l)) { valid_chunk = FALSE; -#if 0 /* this will be useful from time to time -- lets keep it*/ - HDfprintf(stdout, - "data_chunk[%0d][%0d] = %0d, expect %0d.\n", - k, l, data_chunk[k][l], - ((DSET_SIZE * DSET_SIZE * m) + - (DSET_SIZE * (i + k)) + j + l)); - HDfprintf(stdout, - "m = %d, i = %d, j = %d, k = %d, l = %d\n", - m, i, j, k, l); -#endif } } } if (!valid_chunk) { -#if 1 pass = FALSE; failure_mssg = "slab validation failed."; -#else /* as above */ - HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", i, j, m); -#endif } } @@ -1366,12 +1334,6 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) valid_chunk = FALSE; } -#if 0 /* this will be useful from time to time -- lets keep it */ - HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", - k, l, data_chunk[k][l], - ((DSET_SIZE * DSET_SIZE * m) + - (DSET_SIZE * (i + k)) + j + l)); -#endif } } @@ -1379,10 +1341,6 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) pass = FALSE; failure_mssg = "slab validation failed."; -#if 0 /* as above */ - HDfprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n", - i, j, m); -#endif } } diff --git a/test/cache_common.c b/test/cache_common.c index df08e25..d4bab3b 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -2664,11 +2664,6 @@ verify_unprotected(void) * Programmer: John Mainzer * 7/6/06 * - * Changes: Added code to set entry_ptr->expunged to TRUE if - * H5C_expunge_entry() returns without error. - * - * JRM -- 8/21/14 - * *------------------------------------------------------------------------- */ @@ -2727,19 +2722,6 @@ expunge_entry(H5F_t *file_ptr, int32_t type, int32_t idx) * Programmer: John Mainzer * 6/23/04 * - * Changes: Added code to setup and take down the skip list before - * and after calls to H5C_flush_cache(). Do this via calls - * to the H5C_FLUSH_CACHE macro. - * - * This is necessary, as H5C_flush() is called repeatedly - * during file flush. If we setup and took down the - * skip list on H5C_flush_cache(), we would find ourselves - * doing this repeatedly -- which is contrary to the - * objective of the exercise (avoiding as many skip list - * operations as possible). - * - * JRM -- 5/14/20 - * *------------------------------------------------------------------------- */ @@ -3512,11 +3494,6 @@ unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags) * Programmer: John Mainzer * 6/12/04 * - * Changes: Updated slist size == dirty index size checks to - * bypass the test if cache_ptr->slist_enabled is FALSE. - * - * JRM -- 5/8/20 - * *------------------------------------------------------------------------- */ void diff --git a/test/cache_common.h b/test/cache_common.h index 28d3a65..bdeeded 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -141,8 +141,6 @@ * Programmer: John Mainzer * 5/14/20 * - * Changes: None. - * ***********************************************************************/ #define H5C_FLUSH_CACHE(file, flags, fail_mssg) \ diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 9f4072e..73d0459 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -127,13 +127,6 @@ typedef struct { * Programmer: Robb Matzke * Friday, January 23, 1998 * - * Modifications: - * Robb Matzke, 1999-06-23 - * If the command line switch `--noopt' is present then the fast - * compound datatype conversion is turned off. - * - * Raymond Lu, 15 June 2007 - * Moved this part of code from MAIN to TEST_COMPOUND function. *------------------------------------------------------------------------- */ static unsigned @@ -820,7 +813,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static void @@ -862,7 +854,6 @@ initialize_stype1(unsigned char *buf, size_t num) * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static void @@ -908,7 +899,6 @@ initialize_stype2(unsigned char *buf, size_t num) * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static void @@ -938,7 +928,6 @@ initialize_stype3(unsigned char *buf, size_t num) * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static void @@ -990,7 +979,6 @@ initialize_stype4(unsigned char *buf, size_t num) * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static hid_t @@ -1045,7 +1033,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static hid_t @@ -1103,7 +1090,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static hid_t @@ -1145,7 +1131,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static hid_t @@ -1206,7 +1191,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static int @@ -1289,7 +1273,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static unsigned @@ -1496,7 +1479,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ static unsigned @@ -1705,7 +1687,6 @@ error: * Programmer: Neil Fortner * Thursday, 22 January 2009 * - * Modifications: *------------------------------------------------------------------------- */ static unsigned @@ -1981,7 +1962,6 @@ error: * Programmer: Neil Fortner * Monday, 19 October 2009 * - * Modifications: *------------------------------------------------------------------------- */ static unsigned @@ -2222,7 +2202,6 @@ error: * Programmer: Raymond Lu * Friday, 15 June 2007 * - * Modifications: *------------------------------------------------------------------------- */ int diff --git a/test/dangle.c b/test/dangle.c index 660b54f..36984b8 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -39,8 +39,6 @@ const char *FILENAME[] = {"dangle", NULL}; * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -138,8 +136,6 @@ error: * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -233,8 +229,6 @@ error: * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -331,8 +325,6 @@ error: * Programmer: Quincey Koziol * Thursday, August 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -418,8 +410,6 @@ error: * Programmer: Quincey Koziol * Wednesday, June 18, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -652,8 +642,6 @@ error: * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/dsets.c b/test/dsets.c index 6592d17..fc3de08 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -2495,11 +2495,7 @@ error: *------------------------------------------------------------------------- */ static herr_t -test_filters(hid_t file, hid_t -#ifndef H5_HAVE_FILTER_SZIP - H5_ATTR_UNUSED -#endif /* H5_HAVE_FILTER_SZIP */ - fapl) +test_filters(hid_t file) { hid_t dc; /* Dataset creation property list ID */ const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ @@ -15728,7 +15724,7 @@ main(void) nerrors += (test_compact_open_close_dirty(my_fapl) < 0 ? 1 : 0); nerrors += (test_conv_buffer(file) < 0 ? 1 : 0); nerrors += (test_tconv(file) < 0 ? 1 : 0); - nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); + nerrors += (test_filters(file) < 0 ? 1 : 0); nerrors += (test_onebyte_shuffle(file) < 0 ? 1 : 0); nerrors += (test_nbit_int(file) < 0 ? 1 : 0); nerrors += (test_nbit_float(file) < 0 ? 1 : 0); diff --git a/test/dt_arith.c b/test/dt_arith.c index 6d6cb4c..c006c49 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -403,8 +403,6 @@ static int my_isinf(int endian, const unsigned char *val, size_t size, size_t mp * Programmer: Robb Matzke * Monday, July 6, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -430,8 +428,6 @@ fpe_handler(int H5_ATTR_UNUSED signo) * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -472,8 +468,6 @@ reset_hdf5(void) * Programmer: Raymond Lu * April 19, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5T_conv_ret_t @@ -518,8 +512,6 @@ except_func(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 * Programmer: Raymond Lu * Friday, Sept 2, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -582,8 +574,6 @@ error: * Programmer: Raymond Lu * Sept 7, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5T_conv_ret_t @@ -803,8 +793,6 @@ error: * Programmer: Raymond Lu * Thursday, Jan 6, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1254,8 +1242,6 @@ error: * Programmer: Raymond Lu * Saturday, Jan 29, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1575,8 +1561,6 @@ error: * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2628,8 +2612,6 @@ error: * Programmer: Robb Matzke * Friday, April 30, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2680,8 +2662,6 @@ test_conv_int_2(void) * Programmer: Robb Matzke * Monday, July 6, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2756,8 +2736,6 @@ my_isnan(dtype_t type, void *val) * Programmer: Raymond Lu * Monday, June 20, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2796,13 +2774,6 @@ my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t * Programmer: Robb Matzke * Tuesday, June 23, 1998 * - * Modifications: - * Albert Cheng, Apr 16, 2004 - * Check for underflow condition. If the src number is - * smaller than the dst MIN float number, consider it okay - * if the converted sw and hw dst are both less than or - * equal to the dst MIN float number. - * *------------------------------------------------------------------------- */ static int @@ -2828,7 +2799,6 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) unsigned char *hw = NULL; /*ptr to hardware-conv'd*/ int underflow; /*underflow occurred */ int overflow = 0; /*overflow occurred */ - int uflow = 0; /*underflow debug counters*/ size_t j, k; /*counters */ int sendian; /* source type endianness */ int dendian; /* Destination type endianness */ @@ -3118,9 +3088,6 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) } #endif } - if (underflow) { - uflow++; - } /* For Intel machines, the size of "long double" is 12 bytes, precision * is 80 bits; for Intel IA64 and AMD processors, the size of "long double" @@ -3404,8 +3371,6 @@ error: * Programmer: Raymond Lu * Thursday, November 6, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4606,8 +4571,6 @@ error: * Programmer: Raymond Lu * Monday, Nov 17, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static hbool_t @@ -4692,8 +4655,6 @@ done: * Programmer: Robb Matzke * Tuesday, November 24, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4854,8 +4815,6 @@ run_integer_tests(const char *name) * Programmer: Raymond Lu * Tuesday, March 22, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4939,8 +4898,6 @@ done: * Programmer: Raymond Lu * Monday, November 10, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -5047,8 +5004,6 @@ run_int_fp_conv(const char *name) * Programmer: Raymond Lu * Monday, November 10, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -5195,12 +5150,6 @@ run_fp_int_conv(const char *name) * Programmer: Robb Matzke * Tuesday, December 9, 1997 * - * Modifications: - * Raymond Lu - * Monday, April 4, 2005 - * These tests were split from dtypes.c because dtypes.c - * has grown too big. - * *------------------------------------------------------------------------- */ int diff --git a/test/dtypes.c b/test/dtypes.c index cffc08f..37fc8c7 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -341,11 +341,6 @@ error: * Programmer: Quincey Koziol * Saturday, August 30, 2003 * - * Modifications: - * Raymond Lu - * 8 December 2009 - * I added a field of VL string in the compound type to test - * H5Tdetect_class correctly detect it as string type. *------------------------------------------------------------------------- */ static int @@ -1347,11 +1342,6 @@ error: * Programmer: Quincey Koziol * Tuesday, December 18, 2001 * - * Modifications: - * The size of compound datatype can be expanded now. - * Raymond Lu - * Wednesday, September 10, 2003 - * *------------------------------------------------------------------------- */ static int @@ -1496,11 +1486,6 @@ error: * Programmer: Robb Matzke * Wednesday, January 7, 1998 * - * Modifications: - * Raymond Lu - * 27 June 2008 - * Added verification of compound type size for H5Tpack and - * test for array of nested compound type. *------------------------------------------------------------------------- */ static int @@ -2019,8 +2004,6 @@ error: * Programmer: Raymond Lu * Tuesday, June 15, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2233,8 +2216,6 @@ error: * Programmer: Quincey Koziol * Saturday, August 7, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2516,8 +2497,6 @@ error: * Programmer: Raymond Lu * Wednesday, September 29, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2737,9 +2716,9 @@ error: * Function: test_compound_14 * * Purpose: Tests compound type conversions where a vlen string will - be misaligned in the conversion buffer and the file. The - two compound types are meant to trigger two different - conversion routines. + * be misaligned in the conversion buffer and the file. The + * two compound types are meant to trigger two different + * conversion routines. * * Return: Success: 0 * @@ -2748,8 +2727,6 @@ error: * Programmer: Neil Fortner * Monday, August 25, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3204,8 +3181,6 @@ error: * Programmer: Neil Fortner * Friday, September 19, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3379,8 +3354,6 @@ error: * Programmer: Ray Lu * 14 July 2022 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3507,8 +3480,6 @@ error: * Programmer: Neil Fortner * Friday, October 3, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3621,8 +3592,6 @@ error: * Programmer: Neil Fortner * Tuesday, January 13, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3927,11 +3896,6 @@ error: * Programmer: Raymond Lu * Thursday, April 4, 2002 * - * Modifications: - * Raymond Lu - * Wednesday, February 9, 2005 - * Added test for H5Tenum_valueof, H5Tenum_nameof, and - * H5Tget_member_value. *------------------------------------------------------------------------- */ static int @@ -4174,8 +4138,6 @@ error: * Programmer: Robb Matzke * Thursday, June 4, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4331,8 +4293,6 @@ error: * Programmer: Robb Matzke * Monday, June 1, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -5285,8 +5245,6 @@ error: * Programmer: Robb Matzke * Tuesday, January 5, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -6014,13 +5972,6 @@ error: * Programmer: Raymond Lu * July 14, 2004 * - * Modifications: Raymond Lu - * July 13, 2009 - * Added the test for VL string types. - * - * Raymond Lu - * 17 February 2011 - * I added the test of reference count for decoded datatypes. *------------------------------------------------------------------------- */ static int @@ -6810,8 +6761,6 @@ conv_except(H5T_conv_except_t except_type, hid_t H5_ATTR_UNUSED src_id, hid_t H5 * make it portable to other architectures, but further * input and changes are welcome. -QAK * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -8695,9 +8644,9 @@ test_versionbounds(void) H5T_t *dtypep = NULL; /* Pointer to internal structure of a datatype */ hsize_t arr_dim[] = {ARRAY_LEN}; /* Length of the array */ int low, high; /* Indices for iterating over versions */ - H5F_libver_t versions[] = {H5F_LIBVER_EARLIEST, H5F_LIBVER_V18, H5F_LIBVER_V110, H5F_LIBVER_V112, - H5F_LIBVER_V114}; - int versions_count = 5; /* Number of version bounds in the array */ + H5F_libver_t versions[] = {H5F_LIBVER_EARLIEST, H5F_LIBVER_V18, H5F_LIBVER_V110, + H5F_LIBVER_V112, H5F_LIBVER_V114, H5F_LIBVER_V114}; + int versions_count = 6; /* Number of version bounds in the array */ unsigned highest_version; /* Highest version in nested datatypes */ color_t enum_val; /* Enum type index */ herr_t ret = 0; /* Generic return value */ diff --git a/test/efc.c b/test/efc.c index 7bddb6c..9045075 100644 --- a/test/efc.c +++ b/test/efc.c @@ -8,7 +8,6 @@ * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * - * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Neil Fortner diff --git a/test/enum.c b/test/enum.c index 780da74..592236a 100644 --- a/test/enum.c +++ b/test/enum.c @@ -33,8 +33,6 @@ typedef enum { E1_RED, E1_GREEN, E1_BLUE, E1_WHITE, E1_BLACK } c_e1; * Programmer: Robb Matzke * Wednesday, December 23, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -315,8 +313,6 @@ error: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -419,8 +415,6 @@ error: * Programmer: Robb Matzke * Tuesday, January 5, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -530,8 +524,6 @@ error: * Programmer: Elena Pourmal * Wednesday, June 7, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -622,8 +614,6 @@ error: * Programmer: Raymond Lu * Tuesday, April 4, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -757,8 +747,6 @@ error: * Programmer: Robb Matzke * Tuesday, December 22, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/file_image.c b/test/file_image.c index 0398c15..e9f50c3 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -699,10 +699,6 @@ error: * Programmer: John Mainzer * Tuesday, November 15, 2011 * - * Modifications: - * Vailin Choi; July 2013 - * Add the creation of user block to the file as indicated by the parameter "user". - * ****************************************************************************** */ /* Disable warning for "format not a string literal" here -QAK */ @@ -1343,10 +1339,6 @@ error: return 1; } /* test_get_file_image_error_rejection() */ -/* - * Modifications: - * Add testing for file image with or without user block in the file. - */ int main(void) { diff --git a/test/fillval.c b/test/fillval.c index 008833d..489aa76 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -62,8 +62,6 @@ typedef struct { * Programmer: Raymond Lu * Monday, Jan 26, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ static hid_t @@ -159,8 +157,6 @@ error: * Programmer: Robb Matzke * Thursday, October 1, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -404,10 +400,6 @@ error: * Programmer: Robb Matzke * Thursday, October 1, 1998 * - * Modifications: - * Many new cases have been added to this test since - * the fill value design has been modified. - * *------------------------------------------------------------------------- */ static int @@ -866,10 +858,6 @@ error: * Programmer: Robb Matzke * Thursday, October 1, 1998 * - * Modifications: - * This function is called by test_rdwr to write and read - * dataset for different cases. - * *------------------------------------------------------------------------- */ static int @@ -1207,10 +1195,6 @@ error: * Programmer: Robb Matzke * Thursday, October 1, 1998 * - * Modifications: - * Many new cases have been added to this test since the - * fill value design is modified. - * *------------------------------------------------------------------------- */ static int @@ -2060,8 +2044,6 @@ error: * Programmer: Robb Matzke * Monday, October 5, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2224,8 +2206,6 @@ skip: * Programmer: Raymond Lu * Feb 27, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2379,11 +2359,6 @@ error: * Programmer: Joel Plutchak * April 15, 2013 * - * Modifications: - * This function is called by test_rdwr to write and read - * dataset for different cases of chunked datasets with - * unallocated chunks. - * *------------------------------------------------------------------------- */ diff --git a/test/filter_fail.c b/test/filter_fail.c index d413b07..172027c 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -97,11 +97,6 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, const unsigned * Programmer: Raymond Lu * 25 August 2010 * - * Modifications: - * Raymond Lu - * 5 Oct 2010 - * Test when the chunk cache is enable and disabled to make - * sure the library behaves properly. *------------------------------------------------------------------------- */ static herr_t @@ -237,8 +232,6 @@ error: * Programmer: Raymond Lu * 25 August 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t diff --git a/test/gen_cross.c b/test/gen_cross.c index 98c6fd7..c468039 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -88,8 +88,6 @@ int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid); * Programmer: Raymond Lu * Some time ago * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -194,8 +192,6 @@ error: * Programmer: Neil Fortner * 27 January 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -284,8 +280,6 @@ error: * Programmer: Raymond Lu * 21 January 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -374,8 +368,6 @@ error: * Programmer: Neil Fortner * 27 January 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -472,8 +464,6 @@ error: * Programmer: Neil Fortner * 27 January 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -570,8 +560,6 @@ error: * Programmer: Raymond Lu * 21 January 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -669,8 +657,6 @@ error: * Programmer: Neil Fortner * 27 January 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -767,8 +753,6 @@ error: * Programmer: Raymond Lu * 29 March 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -857,8 +841,6 @@ error: * Programmer: Raymond Lu * 29 March 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -958,8 +940,6 @@ error: * Programmer: Raymond Lu * 29 March 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1049,8 +1029,6 @@ error: * Programmer: Raymond Lu * 29 March 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1139,8 +1117,6 @@ error: * Programmer: Raymond Lu * 29 March 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_filters.c b/test/gen_filters.c index d82a3eb..c171538 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -228,8 +228,6 @@ error: * * Return: Success: * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_new_array.c b/test/gen_new_array.c index e04b71a..1db1c69 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -50,8 +50,6 @@ * Programmer: Robb Matzke * Monday, October 26, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index 7632769..87a104a 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -39,8 +39,6 @@ * Programmer: Quincey Koziol * Friday, January 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_noencoder.c b/test/gen_noencoder.c index fe9cea6..a0be0ef 100644 --- a/test/gen_noencoder.c +++ b/test/gen_noencoder.c @@ -24,8 +24,6 @@ * Programmer: James Laird and Nat Furrer * Thursday, July 1, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_old_array.c b/test/gen_old_array.c index ab0ea20..2e6e953 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -49,8 +49,6 @@ * Programmer: Robb Matzke * Monday, October 26, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index b7a9b3d..a18e7fb 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -45,8 +45,6 @@ * Programmer: Quincey Koziol * Friday, January 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index 9645a5e..d67d018 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -39,8 +39,6 @@ * Programmer: Quincey Koziol * Friday, January 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/gen_sizes_lheap.c b/test/gen_sizes_lheap.c index dc55d81..c30b811 100644 --- a/test/gen_sizes_lheap.c +++ b/test/gen_sizes_lheap.c @@ -36,8 +36,6 @@ * Programmer: Neil Fortner * Thursday, July 15, 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/h5test.c b/test/h5test.c index b4bf102..1797df9 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -131,8 +131,6 @@ static char *h5_fixname_real(const char *base_name, hid_t fapl, const char *_su * Programmer: Robb Matzke * Wednesday, March 4, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -917,8 +915,6 @@ error: * Programmer: Robb Matzke * Friday, November 20, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -937,8 +933,6 @@ h5_no_hwconv(void) * Programmer: Albert Cheng * 2002/04/22 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -1009,12 +1003,6 @@ h5_show_hostname(void) * object. * Return: 0 if all is fine; otherwise non-zero. * Programmer: Albert Cheng, 2002/05/21. - * Modifications: - * Bill Wendling, 2002/05/31 - * Modified so that the HDF5_MPI_INFO environment variable can - * be a semicolon separated list of "key=value" pairings. Most - * of the code is to remove any whitespaces which might be - * surrounding the "key=value" pairs. */ int h5_set_info_object(void) @@ -1108,7 +1096,6 @@ h5_set_info_object(void) * Purpose: Display content of an MPI Info object * Return: void * Programmer: Albert Cheng 2002/05/21 - * Modifications: */ void h5_dump_info_object(MPI_Info info) @@ -1338,8 +1325,6 @@ print_func(const char *format, ...) * * Programmer: * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -1390,11 +1375,6 @@ h5_szip_can_encode(void) * Programmer: Leon Arber * 4/4/05 * - * Modifications: - * Use original getenv if MPI is not initialized. This happens - * one uses the PHDF5 library to build a serial nature code. - * Albert 2006/04/07 - * *------------------------------------------------------------------------- */ char * @@ -1552,7 +1532,7 @@ h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name, const H5O_ /*------------------------------------------------------------------------- * Function: h5_verify_cached_stabs * - * Purpose: Verify that all groups in every file in base_name have + * Purpose: Verifies that all groups in every file in base_name have * their symbol table information cached (if present, and if * the parent group also uses a symbol table). Does not * check that the root group's symbol table information is @@ -1565,8 +1545,6 @@ h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name, const H5O_ * Programmer: Neil Fortner * Tuesday, April 12, 2011 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/test/hdfs.c b/test/hdfs.c index 06cd7cc..bf8e840 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -404,8 +404,6 @@ static H5FD_hdfs_fapl_t default_fa = { * Programmer: Jacob Smith * 2018-04-25 * - * Changes: None. - * *--------------------------------------------------------------------------- */ static int @@ -614,8 +612,6 @@ error: * Programmer: Jacob Smith * 2018-04-25 * - * Changes: None. - * *------------------------------------------------------------------------- */ static int @@ -1383,10 +1379,6 @@ error: * Programmer: Jacob Smith * 2017-11-06 * - * Changes: - * + modify from S3VFD codebase to HDFS; Minor changes, mostly. - * + Jacob Smith 2018-06-08 - * *--------------------------------------------------------------------------- */ static int @@ -1529,10 +1521,6 @@ test_cmp(void) * Programmer: Jacob Smith * 2017-11-07 * - * Changes: - * + modify from S3VFD codebase to HDFS; Minor changes, mostly. - * + Jacob Smith 2018-06-08 - * *--------------------------------------------------------------------------- */ static int diff --git a/test/istore.c b/test/istore.c index 916cf67..b688acd 100644 --- a/test/istore.c +++ b/test/istore.c @@ -94,8 +94,6 @@ is_sparse(void) * Programmer: Robb Matzke * Friday, October 10, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -137,13 +135,6 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) * Programmer: Robb Matzke * Wednesday, October 15, 1997 * - * Modifications: - * Converted to use datasets instead of directly messing with - * the istore routines, etc. since the new raw data architecture - * performs hyperslab operations at a higher level than the - * istore routines did and the new istore routines can't handle - * I/O on more than one chunk at a time. QAK - 2003/04/16 - * *------------------------------------------------------------------------- */ static hid_t @@ -198,8 +189,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 15, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -246,8 +235,6 @@ test_create(hid_t f, const char *prefix) * Programmer: Robb Matzke * Wednesday, October 15, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -445,8 +432,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 22, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t diff --git a/test/links.c b/test/links.c index 0b815e2..9e4d2e3 100644 --- a/test/links.c +++ b/test/links.c @@ -7815,8 +7815,6 @@ error: * Programmer: Quincey Koziol * Tuesday, July 26, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -13717,6 +13715,112 @@ error: } /* end external_link_with_committed_datatype() */ /*------------------------------------------------------------------------- + * Function: external_link_public_macros + * + * Purpose: Test public macros for external links + * + * Return: Success: 0 + * Failure: -1 + *------------------------------------------------------------------------- + */ +static int +external_link_public_macros(hid_t fapl, hbool_t new_format) +{ + hid_t fid = -1; /* File ID */ + H5L_info2_t linfo; /* Link information */ + char objname[NAME_BUF_SIZE]; /* Object name */ + char filename1[NAME_BUF_SIZE]; + char filename2[NAME_BUF_SIZE]; + unsigned flags; /* External link flags, packed as a bitmap */ + const char *file; /* File from external link */ + const char *path; /* Path from external link */ + + if (new_format) + TESTING("external link public macros (w/new group format)"); + else + TESTING("external link public macros"); + + /* Set up filenames */ + h5_fixname(FILENAME[3], fapl, filename1, sizeof filename1); + h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2); + + /* Create file to point to */ + if ((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR; + + /* Close file */ + if (H5Fclose(fid) < 0) + TEST_ERROR; + + /* Check that external links are registered with the library */ + if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) + TEST_ERROR; + + /* Create file with link to first file */ + if ((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR; + + /* Create external link to object in first file */ + if (H5Lcreate_external(filename1, "/", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) + TEST_ERROR; + + /* Check information for external link */ + if (H5Lget_info2(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) + goto error; + + if (H5L_TYPE_EXTERNAL != linfo.type) { + H5_FAILED(); + HDputs(" Unexpected object type - should have been an external link"); + goto error; + } + + if (H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) + TEST_ERROR; + + if (H5Lunpack_elink_val(objname, linfo.u.val_size, &flags, &file, &path) < 0) + TEST_ERROR; + + if (HDstrcmp(file, filename1) != 0) { + H5_FAILED(); + HDputs(" External link file name incorrect"); + goto error; + } + + if (HDstrcmp(path, "/") != 0) { + H5_FAILED(); + HDputs(" External link path incorrect"); + goto error; + } + + /* External link version & flags */ + if (flags != ((H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL)) { + H5_FAILED(); + HDputs(" External link version or flags are incorrect"); + goto error; + } + + /* Close first file */ + if (H5Fclose(fid) < 0) + TEST_ERROR; + + /* Check that all file IDs have been closed */ + if (H5I_nmembers(H5I_FILE) != 0) + TEST_ERROR; + H5F_sfile_assert_num(0); + + PASSED(); + return SUCCEED; + +error: + H5E_BEGIN_TRY + { + H5Fclose(fid); + } + H5E_END_TRY; + return FAIL; +} /* end external_link_public_macros() */ + +/*------------------------------------------------------------------------- * Function: ud_hard_links * * Purpose: Check that the functionality of hard links can be duplicated @@ -22717,6 +22821,7 @@ main(void) nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_link_with_committed_datatype(my_fapl, new_format) < 0 ? 1 : 0; + nerrors += external_link_public_macros(my_fapl, new_format) < 0 ? 1 : 0; } /* with/without external file cache */ } diff --git a/test/links_env.c b/test/links_env.c index 0bd2add..27e29ea 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -48,8 +48,6 @@ static int external_link_env(hid_t fapl, hbool_t new_format); * Programmer: Vailin Choi * Feb. 20, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int diff --git a/test/mount.c b/test/mount.c index c5a04b5..6807f36 100644 --- a/test/mount.c +++ b/test/mount.c @@ -41,8 +41,6 @@ int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */ * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -116,8 +114,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -172,8 +168,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -461,8 +455,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -561,8 +553,6 @@ error: * Programmer: Robb Matzke * Tuesday, October 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -650,8 +640,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -720,8 +708,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -790,8 +776,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -859,8 +843,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -934,8 +916,6 @@ error: * Programmer: Robb Matzke * Tuesday, October 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1088,8 +1068,6 @@ error: * Programmer: Robb Matzke * Tuesday, October 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1151,8 +1129,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1273,8 +1249,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1352,8 +1326,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1442,8 +1414,6 @@ error: * Programmer: Quincey Koziol * Wednesday, May 4, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1677,8 +1647,6 @@ error: * Programmer: Quincey Koziol * Monday, June 6, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1946,8 +1914,6 @@ error: * Programmer: Quincey Koziol * Thursday, June 30, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2098,8 +2064,6 @@ error: * Programmer: Quincey Koziol * Tuesday, July 5, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2228,8 +2192,6 @@ error: * Programmer: Quincey Koziol * Thursday, July 14, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2384,8 +2346,6 @@ error: * Programmer: Quincey Koziol * Tuesday, July 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2528,8 +2488,6 @@ error: * Programmer: Quincey Koziol * Tuesday, July 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2671,8 +2629,6 @@ error: * Programmer: Quincey Koziol * Tuesday, July 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2813,8 +2769,6 @@ error: * Programmer: Quincey Koziol * Tuesday, July 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3017,8 +2971,6 @@ error: * Programmer: Quincey Koziol * Monday, July 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3240,8 +3192,6 @@ error: * Programmer: Quincey Koziol * Monday, July 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3453,8 +3403,6 @@ error: * Programmer: Quincey Koziol * Monday, July 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3624,8 +3572,6 @@ error: * Programmer: Quincey Koziol * Monday, July 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4016,8 +3962,6 @@ error: * Programmer: Quincey Koziol * Monday, July 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4181,8 +4125,6 @@ error: * Programmer: Neil Fortner * Friday, August 1, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4287,8 +4229,6 @@ error: * Programmer: Neil Fortner * Friday, August 6, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4446,8 +4386,6 @@ error: * Programmer: Neil Fortner * Friday, November 14, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -4600,8 +4538,6 @@ error: * Programmer: Robb Matzke * Wednesday, October 7, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/mtime.c b/test/mtime.c index 8391def..882189e 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -39,13 +39,6 @@ const char *FILENAME[] = {"mtime", NULL}; * Programmer: Robb Matzke * Thursday, July 30, 1998 * - * Modifications: - * Added checks for old and new modification time messages - * in pre-created datafiles (generated with gen_old_mtime.c and - * gen_new_mtime.c). - * Quincey Koziol - * Friday, January 3, 2003 - * *------------------------------------------------------------------------- */ int diff --git a/test/ntypes.c b/test/ntypes.c index b825ecd..92b2896 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -63,8 +63,6 @@ const char *FILENAME[] = {"ntypes", NULL}; * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -314,8 +312,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -644,8 +640,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -857,8 +851,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1098,8 +1090,6 @@ error: * Programmer: Quincey Koziol * January 31, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1325,8 +1315,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1484,8 +1472,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1672,8 +1658,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1824,8 +1808,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2030,8 +2012,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2170,8 +2150,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2292,8 +2270,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2465,8 +2441,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2679,8 +2653,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2778,11 +2750,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * Raymond Lu - * 1 December 2009 - * I added the support for bitfield and changed the test to - * compare the data being read back. *------------------------------------------------------------------------- */ static herr_t @@ -2937,8 +2904,6 @@ error: * Programmer: Pedro Vicente * September 3, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -3145,8 +3110,6 @@ error: * Programmer: Raymond Lu * October 15, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/page_buffer.c b/test/page_buffer.c index d588d30..a6f7f0a 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -554,21 +554,8 @@ error: * Programmer: unknown * ?? / ?? / ?? * - * Changes: Added base_page_cnt field as supporting code. This allows - * the test to adjust to the number of page buffer pages - * accessed during file open / create. - * - * The test for the value of base_page_cnt just after file - * open exists detect changes in library behavior. Assuming - * any such change is not indicative of other issues, these - * tests can be modified to reflect the change. - * - * JRM -- 2/23/17 - * *------------------------------------------------------------------------- */ - -/* Changes due to file space page size has a minimum size of 512 */ static unsigned test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) { @@ -832,18 +819,6 @@ error: * Programmer: unknown * ?? / ?? / ?? * - * Changes: Added base_page_cnt field as supporting code. This allows - * the test to adjust to the number of page buffer pages - * accessed during file open / create. - * - * The test for the value of base_page_cnt just after file - * open exists detect changes in library behavior. Assuming - * any such change is not indicative of other issues, these - * tests can be modified to reflect the change. - * - * JRM -- 2/23/17 - * - * *------------------------------------------------------------------------- */ @@ -1086,19 +1061,6 @@ error: * Programmer: unknown * ?? / ?? / ?? * - * Changes: Added the base_raw_cnt and base_meta_cnt fields and - * supporting code. This allows the test to adjust to the - * number of page buffer pages accessed during file open / - * create. - * - * The tests for the values of base_raw_cnt and base_meta_cnt - * just after file open exist detect changes in library - * behavior. Assuming any such change is not indicative of - * other issues, these tests can be modified to reflect the - * change. - * - * JRM -- 2/23/17 - * *------------------------------------------------------------------------- */ @@ -1721,19 +1683,6 @@ error: * Programmer: unknown * ?? / ?? / ?? * - * Changes: Added the base_raw_cnt and base_meta_cnt fields and - * supporting code. This allows the test to adjust to the - * number of page buffer pages accessed during file open / - * create. - * - * The tests for the values of base_raw_cnt and base_meta_cnt - * just after file open exist detect changes in library - * behavior. Assuming any such change is not indicative of - * other issues, these tests can be modified to reflect the - * change. - * - * JRM -- 2/23/17 - * *------------------------------------------------------------------------- */ static unsigned @@ -2024,8 +1973,6 @@ error: * Programmer: John Mainzer * 03/21/17 * - * Changes: None. - * *------------------------------------------------------------------------- */ diff --git a/test/reserved.c b/test/reserved.c index d0e0c85..a820344 100644 --- a/test/reserved.c +++ b/test/reserved.c @@ -30,8 +30,6 @@ const char *FILENAME[] = {"rsrv_heap", "rsrv_ohdr", "rsrv_vlen", NULL}; * Nat Furrer * Friday, May 28, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -165,8 +163,6 @@ error: * Nat Furrer * Friday, May 28, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -309,8 +305,6 @@ error: * Nat Furrer * Thursday, July 1, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -471,8 +465,6 @@ error: * Programmer: Nat Furrer and James Laird * Thursday, July 1, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/s3comms.c b/test/s3comms.c index d68cc84..45978fb 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -1759,8 +1759,6 @@ error: * * Programmer: Jacob Smith 2018-01-24 * - * Changes: None - * *--------------------------------------------------------------------------- */ static herr_t @@ -1813,8 +1811,6 @@ error: * * Programmer: Jacob Smith 2018-01-?? * - * Changes: None - * *--------------------------------------------------------------------------- */ static herr_t diff --git a/test/space_overflow.c b/test/space_overflow.c index 41530fd..d31b52d 100644 --- a/test/space_overflow.c +++ b/test/space_overflow.c @@ -37,8 +37,6 @@ * Programmer: Robb Matzke * Monday, October 26, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/stab.c b/test/stab.c index 26cb015..697bce0 100644 --- a/test/stab.c +++ b/test/stab.c @@ -191,7 +191,6 @@ error: * * Programmer: Robb Matzke 2002-03-28 * - * Modifications: *------------------------------------------------------------------------- */ static int @@ -1405,8 +1404,6 @@ error: * Programmer: Robb Matzke * Tuesday, November 24, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/test/tarray.c b/test/tarray.c index c2cc279..06eac90 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -2244,5 +2244,9 @@ test_array(void) void cleanup_array(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } /* end cleanup_array() */ diff --git a/test/tattr.c b/test/tattr.c index f77f793..5dd5736 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -247,7 +247,11 @@ test_attr_basic_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret_id = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write attribute information */ @@ -388,7 +392,11 @@ test_attr_basic_write(hid_t fapl) VERIFY(attr_size, (ATTR2_DIM1 * ATTR2_DIM2 * sizeof(int)), "H5Aget_storage_size"); /* Try to create the same attribute again (should fail) */ - ret_id = H5Acreate2(group, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Acreate2(group, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write attribute information */ @@ -541,7 +549,7 @@ test_attr_flush(hid_t fapl) CHECK(att, FAIL, "H5Acreate2"); ret = H5Aread(att, H5T_NATIVE_DOUBLE, &rdata); - CHECK(ret, FAIL, "H5Awrite"); + CHECK(ret, FAIL, "H5Aread"); if (!H5_DBL_ABS_EQUAL(rdata, 0.0)) TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n", rdata, 0.0); @@ -757,7 +765,11 @@ test_attr_compound_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret_id = H5Acreate2(dataset, ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Acreate2(dataset, ATTR4_NAME, tid1, sid2, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write complex attribute data */ @@ -978,7 +990,11 @@ test_attr_scalar_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret_id = H5Acreate2(dataset, ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Acreate2(dataset, ATTR5_NAME, H5T_NATIVE_FLOAT, sid2, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write attribute information */ @@ -1121,7 +1137,11 @@ test_attr_mult_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret_id = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write 1st attribute data */ @@ -1145,7 +1165,11 @@ test_attr_mult_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret_id = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write 2nd attribute information */ @@ -1169,7 +1193,11 @@ test_attr_mult_write(hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Try to create the same attribute again (should fail) */ - ret_id = H5Acreate2(dataset, ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Acreate2(dataset, ATTR3_NAME, H5T_NATIVE_DOUBLE, sid2, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Acreate2"); /* Write 3rd attribute information */ @@ -1547,7 +1575,7 @@ test_attr_delete(hid_t fapl) herr_t ret; /* Generic return value */ /* Output message about test being performed */ - MESSAGE(5, ("Testing Basic Attribute Functions\n")); + MESSAGE(5, ("Testing Basic Attribute Deletion Functions\n")); /* Open file */ fid1 = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); @@ -1563,7 +1591,11 @@ test_attr_delete(hid_t fapl) VERIFY(oinfo.num_attrs, 3, "H5Oget_info3"); /* Try to delete bogus attribute */ - ret = H5Adelete(dataset, "Bogus"); + H5E_BEGIN_TRY + { + ret = H5Adelete(dataset, "Bogus"); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Adelete"); /* Verify the correct number of attributes */ @@ -2254,7 +2286,11 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Aclose"); /* Attempt to add attribute again, which should fail */ - attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(attr, FAIL, "H5Acreate2"); /* Close dataspace */ @@ -4200,7 +4236,11 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) CHECK(dataset, FAIL, "H5Dopen2"); /* Get number of attributes with bad ID */ - ret = H5Aget_num_attrs((hid_t)-1); + H5E_BEGIN_TRY + { + ret = H5Aget_num_attrs((hid_t)-1); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_num_attrs"); /* Get number of attributes */ @@ -4408,7 +4448,11 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) VERIFY(crt_order_flags, 0, "H5Pget_attr_creation_order"); /* Setting invalid combination of a attribute order creation order indexing on should fail */ - ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_INDEXED); + H5E_BEGIN_TRY + { + ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_INDEXED); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_attr_creation_order"); ret = H5Pget_attr_creation_order(dcpl, &crt_order_flags); CHECK(ret, FAIL, "H5Pget_attr_creation_order"); @@ -5459,13 +5503,9 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) hsize_t corder_count; /* # of records in creation order index */ unsigned reopen_file; /* Whether to re-open the file before deleting group */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ -#ifdef LATER - h5_stat_size_t empty_size; /* Size of empty file */ - h5_stat_size_t file_size; /* Size of file after operating on it */ -#endif /* LATER */ - unsigned curr_dset; /* Current dataset to work on */ - unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + unsigned curr_dset; /* Current dataset to work on */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Object w/Dense Attribute Storage and Creation Order Info\n")); @@ -5492,24 +5532,6 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense); CHECK(ret, FAIL, "H5Pget_attr_phase_change"); -/* XXX: Try to find a way to resize dataset's object header so that the object - * header can have one chunk, then retrieve "empty" file size and check - * that size after everything is deleted -QAK - */ -#ifdef LATER - /* Create empty file */ - fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Close file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); - - /* Get the size of an empty file */ - empty_size = h5_get_file_size(FILENAME); - CHECK(empty_size, FAIL, "h5_get_file_size"); -#endif /* LATER */ - /* Loop to leave file open when deleting dataset, or to close & re-open file * before deleting dataset */ for (reopen_file = FALSE; reopen_file <= TRUE; reopen_file++) { @@ -5622,13 +5644,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* end if */ -#ifdef LATER - /* Get the size of the file now */ - file_size = h5_get_file_size(FILENAME); - CHECK(file_size, FAIL, "h5_get_file_size"); - VERIFY(file_size, empty_size, "h5_get_file_size"); -#endif /* LATER */ - } /* end for */ + } /* end for */ /* Close property list */ ret = H5Pclose(dcpl); @@ -5886,11 +5902,19 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for query on non-existent attribute */ - ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &ainfo, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &ainfo, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_info_by_idx"); - ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, - tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, + tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_name_by_idx"); /* Create attributes, up to limit of compact form */ @@ -5923,14 +5947,26 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for out of bound offset queries */ - ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_info_by_idx"); - ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &ainfo, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &ainfo, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_info_by_idx"); - ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, - tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, + tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_name_by_idx"); /* Create more attributes, to push into dense form */ @@ -5976,14 +6012,26 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Check for out of bound offset queries */ - ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_info_by_idx"); - ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &ainfo, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &ainfo, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_info_by_idx"); - ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, - tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = (herr_t)H5Aget_name_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, + tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aget_name_by_idx"); } /* end for */ @@ -6267,6 +6315,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) unsigned u; /* Local index variable */ herr_t ret; /* Generic return value */ + MESSAGE(5, ("Testing Deleting Attribute By Index\n")) + /* Create dataspace for dataset & attributes */ sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); @@ -6374,7 +6424,11 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for deleting non-existent attribute */ - ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Adelete_by_idx"); /* Create attributes, up to limit of compact form */ @@ -6408,7 +6462,11 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for out of bound deletions */ - ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Adelete_by_idx"); } /* end for */ @@ -6536,7 +6594,11 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Check for out of bound deletion */ - ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Adelete_by_idx"); } /* end for */ @@ -6600,7 +6662,11 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test"); /* Check for deletion on empty attribute storage again */ - ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Adelete_by_idx"); } /* end for */ @@ -6767,7 +6833,11 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test"); /* Check for deletion on empty attribute storage again */ - ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Adelete_by_idx"); } /* end for */ @@ -7012,7 +7082,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx if (iter_info->visited[v] == TRUE) nvisit++; - VERIFY(skip, (max_attrs / 2), "H5Aiterate2"); + VERIFY(nvisit, max_attrs, "H5Aiterate2"); } /* end else */ /* Skip over some attributes on object */ @@ -7043,7 +7113,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx if (iter_info->visited[v] == TRUE) nvisit++; - VERIFY(skip, (max_attrs / 2), "H5Aiterate_by_name"); + VERIFY(nvisit, max_attrs, "H5Aiterate_by_name"); } /* end else */ /* Skip over some attributes on object */ @@ -7074,7 +7144,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx if (iter_info->visited[v] == TRUE) nvisit++; - VERIFY(skip, (max_attrs / 2), "H5Aiterate_by_name"); + VERIFY(nvisit, max_attrs, "H5Aiterate_by_name"); } /* end else */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -7106,7 +7176,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx if (iter_info->visited[v] == TRUE) nvisit++; - VERIFY(skip, (max_attrs / 2), "H5Aiterate1"); + VERIFY(nvisit, max_attrs, "H5Aiterate1"); } /* end else */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -7162,15 +7232,29 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx /* Check for iteration routine indicating failure */ skip = 0; - ret = H5Aiterate2(obj_id, idx_type, order, &skip, attr_iterate2_fail_cb, NULL); + H5E_BEGIN_TRY + { + ret = H5Aiterate2(obj_id, idx_type, order, &skip, attr_iterate2_fail_cb, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate2"); skip = 0; - ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &skip, attr_iterate2_fail_cb, NULL, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &skip, attr_iterate2_fail_cb, NULL, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate_by_name"); skip = 0; - ret = H5Aiterate_by_name(obj_id, ".", idx_type, order, &skip, attr_iterate2_fail_cb, NULL, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = + H5Aiterate_by_name(obj_id, ".", idx_type, order, &skip, attr_iterate2_fail_cb, NULL, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate_by_name"); /* Retrieve current # of errors */ @@ -7373,17 +7457,29 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Check for out of bound iteration */ idx = u; - ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); + H5E_BEGIN_TRY + { + ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate2"); idx = u; - ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, NULL, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, NULL, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate_by_name"); idx = u; - ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, NULL, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, + NULL, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate_by_name"); /* Test iteration over attributes stored compactly */ @@ -7460,17 +7556,29 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Check for out of bound iteration */ idx = u; - ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); + H5E_BEGIN_TRY + { + ret = H5Aiterate2(my_dataset, idx_type, order, &idx, attr_iterate2_cb, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate2"); idx = u; - ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, NULL, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(fid, dsetname, idx_type, order, &idx, attr_iterate2_cb, NULL, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate_by_name"); idx = u; - ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, NULL, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret = H5Aiterate_by_name(my_dataset, ".", idx_type, order, &idx, attr_iterate2_cb, + NULL, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Aiterate_by_name"); /* Test iteration over attributes stored densely */ @@ -7701,8 +7809,12 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for opening an attribute on an object with no attributes */ - ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_idx"); /* Create attributes, up to limit of compact form */ @@ -7736,8 +7848,12 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for out of bound opening an attribute on an object */ - ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_idx"); /* Test opening attributes by index stored compactly */ @@ -7810,8 +7926,12 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Check for out of bound opening an attribute on an object */ - ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, - H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, + H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_idx"); /* Test opening attributes by index stored compactly */ @@ -8029,13 +8149,25 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for opening a non-existent attribute on an object with no attributes */ - ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen"); - ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_name"); - ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_name"); /* Create attributes, up to limit of compact form */ @@ -8068,13 +8200,25 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test"); /* Check for opening a non-existent attribute on an object with compact attribute storage */ - ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen"); - ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_name"); - ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_name"); /* Test opening attributes stored compactly */ @@ -8149,13 +8293,25 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) } /* end if */ /* Check for opening a non-existent attribute on an object with dense attribute storage */ - ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen"); - ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_name(my_dataset, ".", "foo", H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_name"); - ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + ret_id = H5Aopen_by_name(fid, dsetname, "foo", H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Aopen_by_name"); /* Test opening attributes stored compactly */ @@ -10898,8 +11054,8 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) hsize_t dims = 256; /* Attribute dimensions */ H5O_info2_t oinfo; /* Object info */ H5A_info_t ainfo; /* Attribute info */ - haddr_t root_addr; /* Root group address */ - haddr_t link_addr; /* Link (to root group) address */ + H5O_token_t root_token; /* Root group token */ + int cmp_value; /* Result from H5Otoken_cmp */ herr_t ret; /* Generic return status */ /* Output message about test being performed */ @@ -10913,11 +11069,10 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) gid = H5Gcreate2(fid, GROUP1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid, FAIL, "H5Gcreate2"); - /* Get root group address */ + /* Get root group token */ ret = H5Oget_info3(fid, &oinfo, H5O_INFO_BASIC); CHECK(ret, FAIL, "H5Oget_info"); - ret = H5VLnative_token_to_addr(fid, oinfo.token, &root_addr); - CHECK(ret, FAIL, "H5VLnative_token_to_addr"); + root_token = oinfo.token; /* * Create link to root group @@ -10942,11 +11097,9 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) CHECK(oid, FAIL, "H5Oopen"); ret = H5Oget_info3(oid, &oinfo, H5O_INFO_BASIC); CHECK(ret, FAIL, "H5Oget_info"); - ret = H5VLnative_token_to_addr(fid, oinfo.token, &link_addr); - CHECK(ret, FAIL, "H5VLnative_token_to_addr"); - if (link_addr != root_addr) - TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", - (long long unsigned)link_addr, (long long unsigned)root_addr); + ret = H5Otoken_cmp(oid, &oinfo.token, &root_token, &cmp_value); + CHECK(ret, FAIL, "H5Otoken_cmp"); + VERIFY(cmp_value, 0, "H5Otoken_cmp"); /* Close file */ ret = H5Fclose(fid); @@ -10990,11 +11143,9 @@ test_attr_bug8(hid_t fcpl, hid_t fapl) CHECK(oid, FAIL, "H5Oopen"); ret = H5Oget_info3(oid, &oinfo, H5O_INFO_BASIC); CHECK(ret, FAIL, "H5Oget_info"); - ret = H5VLnative_token_to_addr(fid, oinfo.token, &link_addr); - CHECK(ret, FAIL, "H5VLnative_token_to_addr"); - if (link_addr != root_addr) - TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", - (long long unsigned)link_addr, (long long unsigned)root_addr); + ret = H5Otoken_cmp(oid, &oinfo.token, &root_token, &cmp_value); + CHECK(ret, FAIL, "H5Otoken_cmp"); + VERIFY(cmp_value, 0, "H5Otoken_cmp"); ret = H5Aget_info_by_name(gid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Aget_info_by_name"); if (ainfo.data_size != dims) @@ -11504,12 +11655,14 @@ test_attr(void) * Programmer: Albert Cheng * July 2, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_attr(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/tcheck_version.c b/test/tcheck_version.c index a528f5e..2d5c239 100644 --- a/test/tcheck_version.c +++ b/test/tcheck_version.c @@ -22,8 +22,6 @@ * * Programmer: Albert Cheng * September 20, 2009 - * Modifications: - * Added abort signal intercept. AKC - 2009/10/16 - */ #include "h5test.h" diff --git a/test/tconfig.c b/test/tconfig.c index fdab5ef..ec6bb2c 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -75,8 +75,6 @@ test_configure(void) * Programmer: Albert Cheng * September 25, 2001 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -95,10 +93,6 @@ cleanup_configure(void) * Programmer: Albert Cheng * September 25, 2001 * - * Modifications: - * Albert Cheng, 2004/10/14 - * Verified both signed and unsigned int types. - * *------------------------------------------------------------------------- */ void @@ -183,8 +177,6 @@ test_config_ctypes(void) * Programmer: Albert Cheng * October 12, 2009 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/test/tcoords.c b/test/tcoords.c index cf84aba..230db60 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -713,12 +713,14 @@ test_coords(void) * Programmer: Raymond Lu * 20 Dec. 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_coords(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 02ac21f..1d04760 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -109,7 +109,7 @@ if [ $? != 0 ]; then fi # Set plugin path -ENVCMD="env HDF5_PLUGIN_PATH=${TEMP_PLUGIN_DIR}:${TEMP_FILTER_DIR1}:${TEMP_FILTER_DIR2}" +ENVCMD="env HDF5_PLUGIN_PATH=${TEMP_PLUGIN_DIR}:${TEMP_FILTER_DIR1}:${TEMP_FILTER_DIR2}:${HDF5_PLUGIN_PATH}" # Run the tests $ENVCMD $FILTER_TEST_BIN diff --git a/test/test_swmr.pwsh.in b/test/test_swmr.pwsh.in index de7a57a..8f09740 100644 --- a/test/test_swmr.pwsh.in +++ b/test/test_swmr.pwsh.in @@ -85,13 +85,6 @@ function Wait-Message { ############################################################################### ## Main ## -## Modifications: -## Vailin Choi; July 2013 -## Add waiting of message file before launching the reader(s). -## Due to the implementation of file locking, coordination -## is needed in file opening for the writer/reader tests -## to proceed as expected. -## ############################################################################### # Check to see if the VFD specified by the HDF5_DRIVER environment variable diff --git a/test/test_swmr.sh.in b/test/test_swmr.sh.in index aacd575..e4c7546 100644 --- a/test/test_swmr.sh.in +++ b/test/test_swmr.sh.in @@ -83,13 +83,6 @@ WAIT_MESSAGE() { ############################################################################### ## Main ## -## Modifications: -## Vailin Choi; July 2013 -## Add waiting of message file before launching the reader(s). -## Due to the implementation of file locking, coordination -## is needed in file opening for the writer/reader tests -## to proceed as expected. -## ############################################################################### # Check to see if the VFD specified by the HDF5_DRIVER environment variable diff --git a/test/testframe.c b/test/testframe.c index 9bcccd1..f3cf781 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -126,9 +126,6 @@ AddTest(const char *TheName, void (*TheCall)(void), void (*Cleanup)(void), const * private_parser: Optional routine provided by test program to parse the * private options. Default to NULL which means none is provided. * - * Modifications: - * Albert Cheng 2004/08/17 - * Added the ProgName, private_usage and private_parser arguments. */ void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[])) diff --git a/test/tfile.c b/test/tfile.c index 16e55c6..0556b81 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -213,11 +213,13 @@ static void test_rw_noupdate(void); static void test_file_create(void) { - hid_t fid1, fid2, fid3; /* HDF5 File IDs */ - hid_t tmpl1, tmpl2; /* file creation templates */ - hsize_t ublock; /* sizeof userblock */ - size_t parm; /* file-creation parameters */ - size_t parm2; /* file-creation parameters */ + hid_t fid1 = H5I_INVALID_HID; + hid_t fid2 = H5I_INVALID_HID; + hid_t fid3 = H5I_INVALID_HID; /* HDF5 File IDs */ + hid_t tmpl1, tmpl2; /* file creation templates */ + hsize_t ublock; /* sizeof userblock */ + size_t parm; /* file-creation parameters */ + size_t parm2; /* file-creation parameters */ unsigned iparm; unsigned iparm2; herr_t ret; /*generic return value */ @@ -226,10 +228,18 @@ test_file_create(void) MESSAGE(5, ("Testing Low-Level File Creation I/O\n")); /* First ensure the file does not exist */ - HDremove(FILE1); + H5E_BEGIN_TRY + { + H5Fdelete(FILE1, H5P_DEFAULT); + } + H5E_END_TRY; /* Try opening a non-existent file */ - fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + H5E_BEGIN_TRY + { + fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(fid1, FAIL, "H5Fopen"); /* Test create with various sequences of H5F_ACC_EXCL and */ @@ -243,21 +253,33 @@ test_file_create(void) * try to create the same file with H5F_ACC_TRUNC. This should fail * because fid1 is the same file and is currently open. */ - fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fcreate"); /* Close all files */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - ret = H5Fclose(fid2); + H5E_BEGIN_TRY + { + ret = H5Fclose(fid2); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Fclose"); /*file should not have been open */ /* * Try again with H5F_ACC_EXCL. This should fail because the file already * exists from the previous steps. */ - fid1 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + fid1 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(fid1, FAIL, "H5Fcreate"); /* Test create with H5F_ACC_TRUNC. This will truncate the existing file. */ @@ -268,14 +290,22 @@ test_file_create(void) * Try to truncate first file again. This should fail because fid1 is the * same file and is currently open. */ - fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + fid2 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fcreate"); /* * Try with H5F_ACC_EXCL. This should fail too because the file already * exists. */ - fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); + H5E_BEGIN_TRY + { + fid2 = H5Fcreate(FILE1, H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fcreate"); /* Get the file-creation template */ @@ -301,12 +331,6 @@ test_file_create(void) ret = H5Pclose(tmpl1); CHECK(ret, FAIL, "H5Pclose"); -#ifdef LATER - /* Double-check that the atom has been vaporized */ - ret = H5Pclose(tmpl1); - VERIFY(ret, FAIL, "H5Pclose"); -#endif - if (h5_using_default_driver(NULL)) { /* Create a new file with a non-standard file-creation template */ @@ -598,11 +622,19 @@ test_file_open(const char *env_h5_drvr) CHECK(ret, FAIL, "H5Fclose"); /* Open file for second time, which should fail. */ - fid2 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl_id); + H5E_BEGIN_TRY + { + fid2 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl_id); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); /* Check that the intent fails for an invalid ID */ - ret = H5Fget_intent(fid1, &intent); + H5E_BEGIN_TRY + { + ret = H5Fget_intent(fid1, &intent); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Fget_intent"); /* Close dataset from first open */ @@ -662,7 +694,12 @@ test_file_reopen(void) CHECK(ret, FAIL, "H5Fclose"); ret = H5Fclose(rfid); CHECK(ret, FAIL, "H5Fclose"); - HDremove(REOPEN_FILE); + + H5E_BEGIN_TRY + { + H5Fdelete(REOPEN_FILE, H5P_DEFAULT); + } + H5E_END_TRY; } /* test_file_reopen() */ @@ -681,6 +718,9 @@ test_file_close(void) H5F_close_degree_t fc_degree; herr_t ret; + /* Output message about test being performed */ + MESSAGE(5, ("Testing File Closing with file close degrees\n")); + /* Test behavior while opening file multiple times with different * file close degree value */ @@ -697,7 +737,11 @@ test_file_close(void) VERIFY(fc_degree, H5F_CLOSE_STRONG, "H5Pget_fclose_degree"); /* should fail */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + H5E_BEGIN_TRY + { + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT); @@ -751,7 +795,11 @@ test_file_close(void) CHECK(ret, FAIL, "H5Pset_fclose_degree"); /* should fail */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + H5E_BEGIN_TRY + { + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG); @@ -784,7 +832,11 @@ test_file_close(void) CHECK(ret, FAIL, "H5Pset_fclose_degree"); /* should fail */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + H5E_BEGIN_TRY + { + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI); @@ -799,12 +851,20 @@ test_file_close(void) /* Close first open, should fail since it is SEMI and objects are * still open. */ - ret = H5Fclose(fid1); + H5E_BEGIN_TRY + { + ret = H5Fclose(fid1); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Fclose"); /* Close second open, should fail since it is SEMI and objects are * still open. */ - ret = H5Fclose(fid2); + H5E_BEGIN_TRY + { + ret = H5Fclose(fid2); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Fclose"); ret = H5Dclose(dataset_id); @@ -822,11 +882,19 @@ test_file_close(void) /* Close second open, should fail since it is SEMI and one group ID is * still open. */ - ret = H5Fclose(fid2); + H5E_BEGIN_TRY + { + ret = H5Fclose(fid2); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Fclose"); /* Same check with H5Idec_ref() (should fail also) */ - ret = H5Idec_ref(fid2); + H5E_BEGIN_TRY + { + ret = H5Idec_ref(fid2); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Idec_ref"); ret = H5Gclose(group_id3); @@ -848,7 +916,11 @@ test_file_close(void) CHECK(ret, FAIL, "H5Pset_fclose_degree"); /* should fail */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + H5E_BEGIN_TRY + { + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT); @@ -897,7 +969,11 @@ test_file_close(void) CHECK(ret, FAIL, "H5Pset_fclose_degree"); /* should fail */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + H5E_BEGIN_TRY + { + fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, fapl_id); + } + H5E_END_TRY; VERIFY(fid2, FAIL, "H5Fopen"); ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT); @@ -1101,6 +1177,8 @@ test_get_obj_ids(void) ssize_t oid_list_size = NDSETS; char gname[64], dname[64]; + MESSAGE(5, ("Testing retrieval of object IDs\n")); + /* Create a new file */ fid = H5Fcreate(FILE7, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); @@ -1196,11 +1274,15 @@ test_get_obj_ids(void) /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); - VERIFY(ret_count, NDSETS, "H5Fget_obj_count"); + VERIFY(ret_count, NDSETS, "H5Fget_obj_ids"); - /* Close all open objects with H5Oclose */ - for (n = 0; n < oid_count; n++) - H5Oclose(oid_list[n]); + H5E_BEGIN_TRY + { + /* Close all open objects with H5Oclose */ + for (n = 0; n < oid_count; n++) + H5Oclose(oid_list[n]); + } + H5E_END_TRY; HDfree(oid_list); } @@ -1220,6 +1302,8 @@ test_get_file_id(void) unsigned intent; herr_t ret; + MESSAGE(5, ("Testing H5Iget_file_id\n")); + /* Create a file */ fid = H5Fcreate(FILE4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); @@ -2870,7 +2954,7 @@ test_file_double_datatype_open(void) herr_t ret; /* Generic return value */ /* Output message about test being performed */ - MESSAGE(5, ("Testing double dataset open\n")); + MESSAGE(5, ("Testing double datatype open\n")); file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file1_id, FAIL, "H5Fcreate"); @@ -5587,7 +5671,11 @@ test_libver_bounds_copy(void) CHECK(ret, FAIL, "H5Fclose"); /* Remove the destination file */ - HDremove(DST_FILE); + H5E_BEGIN_TRY + { + H5Fdelete(DST_FILE, H5P_DEFAULT); + } + H5E_END_TRY; } /* end test_libver_bounds_copy() */ @@ -8137,8 +8225,6 @@ test_file(void) * Programmer: Albert Cheng * July 2, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/test/tgenprop.c b/test/tgenprop.c index 9c4495b..5751ce7 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -194,8 +194,12 @@ test_genprop_basic_class_prop(void) CHECK_I(ret, "H5Pregister2"); /* Try to insert the first property again (should fail) */ - ret = - H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + H5E_BEGIN_TRY + { + ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, + NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Pregister2"); /* Check the existence of the first property */ @@ -218,8 +222,12 @@ test_genprop_basic_class_prop(void) CHECK_I(ret, "H5Pregister2"); /* Try to insert the second property again (should fail) */ - ret = - H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + H5E_BEGIN_TRY + { + ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, + NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Pregister2"); /* Check the existence of the second property */ @@ -260,7 +268,11 @@ test_genprop_basic_class_prop(void) CHECK_I(ret, "H5Punregister"); /* Try to check the size of the first property (should fail) */ - ret = H5Pget_size(cid1, PROP1_NAME, &size); + H5E_BEGIN_TRY + { + ret = H5Pget_size(cid1, PROP1_NAME, &size); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Pget_size"); /* Check the number of properties in class */ @@ -1950,7 +1962,11 @@ test_genprop_deprec_class(void) CHECK_I(ret, "H5Pregister1"); /* Try to insert the first property again (should fail) */ - ret = H5Pregister1(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + H5E_BEGIN_TRY + { + ret = H5Pregister1(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Pregister1"); /* Check the existence of the first property */ @@ -1972,7 +1988,11 @@ test_genprop_deprec_class(void) CHECK_I(ret, "H5Pregister1"); /* Try to insert the second property again (should fail) */ - ret = H5Pregister1(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + H5E_BEGIN_TRY + { + ret = H5Pregister1(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Pregister1"); /* Check the existence of the second property */ @@ -2012,7 +2032,11 @@ test_genprop_deprec_class(void) CHECK_I(ret, "H5Punregister"); /* Try to check the size of the first property (should fail) */ - ret = H5Pget_size(cid1, PROP1_NAME, &size); + H5E_BEGIN_TRY + { + ret = H5Pget_size(cid1, PROP1_NAME, &size); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Pget_size"); /* Check the number of properties in class */ @@ -2164,12 +2188,14 @@ test_genprop(void) * Programmer: Quincey Koziol * June 8, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_genprop(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/th5o.c b/test/th5o.c index 3e7c80a..027445e 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -49,6 +49,9 @@ test_h5o_open(void) H5T_class_t type_class; /* Class of the datatype */ herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing H5Oopen\n")); + h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); /* Create a new HDF5 file */ @@ -161,6 +164,9 @@ test_h5o_close(void) hsize_t dims[RANK]; herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing H5Oclose\n")); + h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); /* Create a new HDF5 file */ @@ -413,6 +419,9 @@ test_h5o_open_by_token(void) H5T_class_t type_class; /* Class of the datatype */ herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing H5Oopen_by_token\n")); + h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); /* Create a new HDF5 file */ @@ -531,6 +540,9 @@ test_h5o_refcount(void) hsize_t dims[RANK]; herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing retrieval of object reference count with H5Oget_info\n")); + h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); /* Create a new HDF5 file */ @@ -732,6 +744,9 @@ test_h5o_plist(void) unsigned max_compact, min_dense; /* Actual phase change parameters */ herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing Object creation properties\n")); + /* Make a FAPL that uses the "use the latest version of the format" flag */ fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); @@ -935,6 +950,9 @@ test_h5o_link(void) int i, n; herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing H5Olink\n")); + h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); /* Allocate memory buffers */ @@ -1422,6 +1440,9 @@ test_h5o_getinfo_same_file(void) H5O_info2_t oinfo1, oinfo2; /* Object info structs */ herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing H5Oget_info on objects in same file\n")); + h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); /* Create a new HDF5 file */ @@ -1720,6 +1741,9 @@ test_h5o_getinfo_visit(void) int j; /* Local index variable */ herr_t ret; /* Value returned from API calls */ + /* Output message about test being performed */ + MESSAGE(5, ("Testing info returned by H5Oget_info vs H5Ovisit\n")); + h5_fixname(TEST_FILENAME, H5P_DEFAULT, filename, sizeof filename); /* Create an HDF5 file */ diff --git a/test/th5s.c b/test/th5s.c index 77116a6..40d8b06 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -214,14 +214,22 @@ test_h5s_basic(void) /* Verify that incorrect dimensions don't work */ dims1[0] = H5S_UNLIMITED; - sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); + H5E_BEGIN_TRY + { + sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); + } + H5E_END_TRY; VERIFY(sid1, FAIL, "H5Screate_simple"); dims1[0] = H5S_UNLIMITED; sid1 = H5Screate(H5S_SIMPLE); CHECK(sid1, FAIL, "H5Screate"); - ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL); + H5E_BEGIN_TRY + { + ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Sset_extent_simple"); ret = H5Sclose(sid1); @@ -1626,7 +1634,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, /* Allocate the buffer for encoding */ buf = (char *)HDmalloc(buf_size); - CHECK_PTR(buf, "H5Dmalloc"); + CHECK_PTR(buf, "HDmalloc"); /* Encode according to the setting in in_fapl */ ret = H5Sencode2(in_sid, buf, &buf_size, in_fapl); @@ -3499,16 +3507,18 @@ test_h5s(void) * Programmer: Albert Cheng * July 2, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_h5s(void) { - HDremove(DATAFILE); - HDremove(NULLFILE); - HDremove(BASICFILE); - HDremove(ZEROFILE); - HDremove(VERBFNAME); + H5E_BEGIN_TRY + { + H5Fdelete(DATAFILE, H5P_DEFAULT); + H5Fdelete(NULLFILE, H5P_DEFAULT); + H5Fdelete(BASICFILE, H5P_DEFAULT); + H5Fdelete(ZEROFILE, H5P_DEFAULT); + H5Fdelete(VERBFNAME, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/titerate.c b/test/titerate.c index 48e0aa9..82d8e9f 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -491,7 +491,7 @@ test_iter_attr(hid_t fapl, hbool_t new_format) if ((ret = H5Aiterate2(dataset, H5_INDEX_NAME, H5_ITER_INC, &idx, aiter_cb, &info)) > 0) TestErrPrintf("Attribute iteration function didn't return zero correctly!\n"); - /* Test all attributes on dataset, when callback always returns 1 */ + /* Test all attributes on dataset, when callback always returns 2 */ /* This also tests the "restarting" ability, because the index changes */ info.command = RET_TWO; i = 0; @@ -1011,8 +1011,11 @@ test_corrupted_attnamelen(void) hbool_t driver_is_default_compatible; const char *testfile = H5_get_srcdir_filename(CORRUPTED_ATNAMELEN_FILE); /* Corrected test file name */ - const char *err_message = "attribute name has different length than stored length"; - /* the error message produced when the failure occurs */ + /* The error message produced when the failure occurs + * + * FIXME: This is incredibly fragile! + */ + const char *err_message = "ran off end of input buffer while decoding"; /* Output message about test being performed */ MESSAGE(5, ("Testing the Handling of Corrupted Attribute's Name Length\n")); @@ -1203,12 +1206,14 @@ test_iterate(void) * Programmer: Quincey Koziol * April 5, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_iterate(void) { - HDremove(DATAFILE); + H5E_BEGIN_TRY + { + H5Fdelete(DATAFILE, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/tmeta.c b/test/tmeta.c index f5c5fc1..d55882d 100644 --- a/test/tmeta.c +++ b/test/tmeta.c @@ -121,8 +121,6 @@ test_metadata(void) * Programmer: Albert Cheng * July 2, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/test/tmisc.c b/test/tmisc.c index 5fb44d4..0b04b2c 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -666,7 +666,7 @@ test_misc4(void) herr_t ret; /* Output message about test being performed */ - MESSAGE(5, ("Testing fileno working in H5O_info_t\n")); + MESSAGE(5, ("Testing fileno working in H5O_info2_t\n")); file1 = H5Fcreate(MISC4_FILE_1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file1, FAIL, "H5Fcreate"); @@ -1412,7 +1412,11 @@ test_misc8(void) /* Create a contiguous dataset, with space allocation late */ /* Should fail */ - did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5E_BEGIN_TRY + { + did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(did, FAIL, "H5Dcreate2"); /* Set the space allocation time to incremental */ @@ -1421,7 +1425,11 @@ test_misc8(void) /* Create a contiguous dataset, with space allocation incremental */ /* Should fail */ - did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5E_BEGIN_TRY + { + did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); + } + H5E_END_TRY; VERIFY(did, FAIL, "H5Dcreate2"); /* Set the space allocation time to early */ @@ -1762,7 +1770,11 @@ test_misc9(void) ret = H5Pset_fapl_core(fapl, (size_t)1024, 0); CHECK(ret, FAIL, "H5Pset_fapl_core"); - fid = H5Fopen(MISC9_FILE, H5F_ACC_RDWR, fapl); + H5E_BEGIN_TRY + { + fid = H5Fopen(MISC9_FILE, H5F_ACC_RDWR, fapl); + } + H5E_END_TRY; VERIFY(fid, FAIL, "H5Fopen"); ret = H5Pclose(fapl); @@ -3948,7 +3960,7 @@ test_misc22(void) unsigned int flags; size_t cd_nelmts = 32; unsigned int cd_values[32]; - unsigned correct; + size_t correct; if (h5_szip_can_encode() != 1) return; @@ -4042,7 +4054,7 @@ test_misc22(void) NULL); CHECK(ret, FAIL, "H5Pget_filter_by_id2"); - VERIFY(cd_values[2], correct, "SZIP filter returned value for precision"); + VERIFY(cd_values[2], (unsigned)correct, "SZIP filter returned value for precision"); ret = H5Dclose(dsid); CHECK(ret, FAIL, "H5Dclose"); @@ -6175,42 +6187,46 @@ test_misc(void) void cleanup_misc(void) { - HDremove(MISC1_FILE); - HDremove(MISC2_FILE_1); - HDremove(MISC2_FILE_2); - HDremove(MISC3_FILE); - HDremove(MISC4_FILE_1); - HDremove(MISC4_FILE_2); - HDremove(MISC5_FILE); - HDremove(MISC6_FILE); - HDremove(MISC7_FILE); - HDremove(MISC8_FILE); - HDremove(MISC9_FILE); - HDremove(MISC10_FILE_NEW); - HDremove(MISC11_FILE); - HDremove(MISC12_FILE); - HDremove(MISC13_FILE_1); - HDremove(MISC13_FILE_2); - HDremove(MISC14_FILE); - HDremove(MISC15_FILE); - HDremove(MISC16_FILE); - HDremove(MISC17_FILE); - HDremove(MISC18_FILE); - HDremove(MISC19_FILE); - HDremove(MISC20_FILE); + H5E_BEGIN_TRY + { + H5Fdelete(MISC1_FILE, H5P_DEFAULT); + H5Fdelete(MISC2_FILE_1, H5P_DEFAULT); + H5Fdelete(MISC2_FILE_2, H5P_DEFAULT); + H5Fdelete(MISC3_FILE, H5P_DEFAULT); + H5Fdelete(MISC4_FILE_1, H5P_DEFAULT); + H5Fdelete(MISC4_FILE_2, H5P_DEFAULT); + H5Fdelete(MISC5_FILE, H5P_DEFAULT); + H5Fdelete(MISC6_FILE, H5P_DEFAULT); + H5Fdelete(MISC7_FILE, H5P_DEFAULT); + H5Fdelete(MISC8_FILE, H5P_DEFAULT); + H5Fdelete(MISC9_FILE, H5P_DEFAULT); + H5Fdelete(MISC10_FILE_NEW, H5P_DEFAULT); + H5Fdelete(MISC11_FILE, H5P_DEFAULT); + H5Fdelete(MISC12_FILE, H5P_DEFAULT); + H5Fdelete(MISC13_FILE_1, H5P_DEFAULT); + H5Fdelete(MISC13_FILE_2, H5P_DEFAULT); + H5Fdelete(MISC14_FILE, H5P_DEFAULT); + H5Fdelete(MISC15_FILE, H5P_DEFAULT); + H5Fdelete(MISC16_FILE, H5P_DEFAULT); + H5Fdelete(MISC17_FILE, H5P_DEFAULT); + H5Fdelete(MISC18_FILE, H5P_DEFAULT); + H5Fdelete(MISC19_FILE, H5P_DEFAULT); + H5Fdelete(MISC20_FILE, H5P_DEFAULT); #ifdef H5_HAVE_FILTER_SZIP - HDremove(MISC21_FILE); - HDremove(MISC22_FILE); + H5Fdelete(MISC21_FILE, H5P_DEFAULT); + H5Fdelete(MISC22_FILE, H5P_DEFAULT); #endif /* H5_HAVE_FILTER_SZIP */ - HDremove(MISC23_FILE); - HDremove(MISC24_FILE); - HDremove(MISC25A_FILE); - HDremove(MISC25C_FILE); - HDremove(MISC26_FILE); - HDremove(MISC28_FILE); - HDremove(MISC29_COPY_FILE); - HDremove(MISC30_FILE); + H5Fdelete(MISC23_FILE, H5P_DEFAULT); + H5Fdelete(MISC24_FILE, H5P_DEFAULT); + H5Fdelete(MISC25A_FILE, H5P_DEFAULT); + H5Fdelete(MISC25C_FILE, H5P_DEFAULT); + H5Fdelete(MISC26_FILE, H5P_DEFAULT); + H5Fdelete(MISC28_FILE, H5P_DEFAULT); + H5Fdelete(MISC29_COPY_FILE, H5P_DEFAULT); + H5Fdelete(MISC30_FILE, H5P_DEFAULT); #ifndef H5_NO_DEPRECATED_SYMBOLS - HDremove(MISC31_FILE); + H5Fdelete(MISC31_FILE, H5P_DEFAULT); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + } + H5E_END_TRY; } /* end cleanup_misc() */ diff --git a/test/trefer.c b/test/trefer.c index cc0ee2c..2c62234 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -205,83 +205,187 @@ test_reference_params(void) CHECK(ret, H5I_INVALID_HID, "H5Dcreate2"); /* Test parameters to H5Rcreate_object */ - ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, NULL); + H5E_BEGIN_TRY + { + ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_object ref"); - ret = H5Rcreate_object(H5I_INVALID_HID, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_object(H5I_INVALID_HID, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_object loc_id"); - ret = H5Rcreate_object(fid1, NULL, H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_object(fid1, NULL, H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_object name"); - ret = H5Rcreate_object(fid1, "", H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_object(fid1, "", H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_object null name"); /* Test parameters to H5Rcreate_region */ - ret = H5Rcreate_region(fid1, "/Group1/Dataset1", sid1, H5P_DEFAULT, NULL); + H5E_BEGIN_TRY + { + ret = H5Rcreate_region(fid1, "/Group1/Dataset1", sid1, H5P_DEFAULT, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_region ref"); - ret = H5Rcreate_region(H5I_INVALID_HID, "/Group1/Dataset1", sid1, H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_region(H5I_INVALID_HID, "/Group1/Dataset1", sid1, H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_region loc_id"); - ret = H5Rcreate_region(fid1, NULL, sid1, H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_region(fid1, NULL, sid1, H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_region name"); - ret = H5Rcreate_region(fid1, "/Group1/Dataset1", H5I_INVALID_HID, H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_region(fid1, "/Group1/Dataset1", H5I_INVALID_HID, H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_region dataspace"); /* Test parameters to H5Rcreate_attr */ - ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", "Attr", H5P_DEFAULT, NULL); + H5E_BEGIN_TRY + { + ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", "Attr", H5P_DEFAULT, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_attr ref"); - ret = H5Rcreate_attr(H5I_INVALID_HID, "/Group1/Dataset2", "Attr", H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_attr(H5I_INVALID_HID, "/Group1/Dataset2", "Attr", H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_attr loc_id"); - ret = H5Rcreate_attr(fid1, NULL, "Attr", H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_attr(fid1, NULL, "Attr", H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_attr name"); - ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", NULL, H5P_DEFAULT, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", NULL, H5P_DEFAULT, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcreate_attr attr_name"); /* Test parameters to H5Rdestroy */ - ret = H5Rdestroy(NULL); + H5E_BEGIN_TRY + { + ret = H5Rdestroy(NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rdestroy"); /* Test parameters to H5Rget_type */ - type = H5Rget_type(NULL); + H5E_BEGIN_TRY + { + type = H5Rget_type(NULL); + } + H5E_END_TRY; VERIFY(type, H5R_BADTYPE, "H5Rget_type ref"); /* Test parameters to H5Requal */ - ret = H5Requal(NULL, &rbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Requal(NULL, &rbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Requal ref1"); - ret = H5Requal(&rbuf[0], NULL); + H5E_BEGIN_TRY + { + ret = H5Requal(&rbuf[0], NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Requal ref2"); /* Test parameters to H5Rcopy */ - ret = H5Rcopy(NULL, &wbuf[0]); + H5E_BEGIN_TRY + { + ret = H5Rcopy(NULL, &wbuf[0]); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcopy src_ref"); - ret = H5Rcopy(&rbuf[0], NULL); + H5E_BEGIN_TRY + { + ret = H5Rcopy(&rbuf[0], NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rcopy dest_ref"); /* Test parameters to H5Ropen_object */ - dset2 = H5Ropen_object(&rbuf[0], H5I_INVALID_HID, H5I_INVALID_HID); + H5E_BEGIN_TRY + { + dset2 = H5Ropen_object(&rbuf[0], H5I_INVALID_HID, H5I_INVALID_HID); + } + H5E_END_TRY; VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object oapl_id"); - dset2 = H5Ropen_object(NULL, H5P_DEFAULT, dapl_id); + H5E_BEGIN_TRY + { + dset2 = H5Ropen_object(NULL, H5P_DEFAULT, dapl_id); + } + H5E_END_TRY; VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object ref"); /* Test parameters to H5Ropen_region */ - ret_id = H5Ropen_region(NULL, H5I_INVALID_HID, H5I_INVALID_HID); + H5E_BEGIN_TRY + { + ret_id = H5Ropen_region(NULL, H5I_INVALID_HID, H5I_INVALID_HID); + } + H5E_END_TRY; VERIFY(ret_id, H5I_INVALID_HID, "H5Ropen_region ref"); /* Test parameters to H5Ropen_attr */ - ret_id = H5Ropen_attr(NULL, H5P_DEFAULT, aapl_id); + H5E_BEGIN_TRY + { + ret_id = H5Ropen_attr(NULL, H5P_DEFAULT, aapl_id); + } + H5E_END_TRY; VERIFY(ret_id, H5I_INVALID_HID, "H5Ropen_attr ref"); /* Test parameters to H5Rget_obj_type3 */ - ret = H5Rget_obj_type3(NULL, H5P_DEFAULT, NULL); + H5E_BEGIN_TRY + { + ret = H5Rget_obj_type3(NULL, H5P_DEFAULT, NULL); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rget_obj_type3 ref"); /* Test parameters to H5Rget_file_name */ - name_size = H5Rget_file_name(NULL, NULL, 0); + H5E_BEGIN_TRY + { + name_size = H5Rget_file_name(NULL, NULL, 0); + } + H5E_END_TRY; VERIFY(name_size, (-1), "H5Rget_file_name ref"); /* Test parameters to H5Rget_obj_name */ - name_size = H5Rget_obj_name(NULL, H5P_DEFAULT, NULL, 0); + H5E_BEGIN_TRY + { + name_size = H5Rget_obj_name(NULL, H5P_DEFAULT, NULL, 0); + } + H5E_END_TRY; VERIFY(name_size, (-1), "H5Rget_obj_name ref"); /* Test parameters to H5Rget_attr_name */ - name_size = H5Rget_attr_name(NULL, NULL, 0); + H5E_BEGIN_TRY + { + name_size = H5Rget_attr_name(NULL, NULL, 0); + } + H5E_END_TRY; VERIFY(name_size, (-1), "H5Rget_attr_name ref"); /* Close disk dataspace */ @@ -1920,6 +2024,8 @@ test_reference_obj_deleted(void) H5O_type_t obj_type; /* Object type */ herr_t ret; /* Generic return value */ + MESSAGE(5, ("Testing References to Deleted Objects\n")); + /* Create file */ fid1 = H5Fcreate(FILE_REF_OBJ_DEL, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid1, H5I_INVALID_HID, "H5Fcreate"); @@ -3505,23 +3611,25 @@ test_reference(void) * Programmer: Quincey Koziol * September 8, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_reference(void) { - HDremove(FILE_REF_PARAM); - HDremove(FILE_REF_OBJ); - HDremove(FILE_REF_VL_OBJ); - HDremove(FILE_REF_CMPND_OBJ); - HDremove(FILE_REF_REG); - HDremove(FILE_REF_REG_1D); - HDremove(FILE_REF_OBJ_DEL); - HDremove(FILE_REF_GRP); - HDremove(FILE_REF_ATTR); - HDremove(FILE_REF_EXT1); - HDremove(FILE_REF_EXT2); - HDremove(FILE_REF_COMPAT); + H5E_BEGIN_TRY + { + H5Fdelete(FILE_REF_PARAM, H5P_DEFAULT); + H5Fdelete(FILE_REF_OBJ, H5P_DEFAULT); + H5Fdelete(FILE_REF_VL_OBJ, H5P_DEFAULT); + H5Fdelete(FILE_REF_CMPND_OBJ, H5P_DEFAULT); + H5Fdelete(FILE_REF_REG, H5P_DEFAULT); + H5Fdelete(FILE_REF_REG_1D, H5P_DEFAULT); + H5Fdelete(FILE_REF_OBJ_DEL, H5P_DEFAULT); + H5Fdelete(FILE_REF_GRP, H5P_DEFAULT); + H5Fdelete(FILE_REF_ATTR, H5P_DEFAULT); + H5Fdelete(FILE_REF_EXT1, H5P_DEFAULT); + H5Fdelete(FILE_REF_EXT2, H5P_DEFAULT); + H5Fdelete(FILE_REF_COMPAT, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index 75d441d..8d75fed 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -1853,8 +1853,6 @@ test_reference_deprec(void) * Programmer: Quincey Koziol * September 8, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/test/tselect.c b/test/tselect.c index 6b63d2b..3dd739c 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -1025,7 +1025,11 @@ test_select_all_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Sselect_none"); /* Read selection from disk (should fail with no selection defined) */ - ret = H5Dread(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, rbuf); + H5E_BEGIN_TRY + { + ret = H5Dread(dataset, H5T_NATIVE_UCHAR, sid2, sid1, xfer_plist, rbuf); + } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Dread"); /* Select entire 15x26 extent for disk dataset */ @@ -5605,31 +5609,63 @@ test_select_hyper_valid_combination(void) /* Test all the selections created */ /* Test the invalid combinations between point and hyperslab */ - tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_pt_sid, H5S_SELECT_AND, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Test the invalid combination between two hyperslab but of different dimension size */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, regular_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Test invalid operation inputs to the two functions */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_SET, single_hyper_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Test inputs in case of non-existent space ids */ - tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Scombine_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Scombine_select"); - tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + H5E_BEGIN_TRY + { + tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid); + } + H5E_END_TRY; VERIFY(tmp_sid, FAIL, "H5Smodify_select"); /* Close dataspaces */ @@ -6891,10 +6927,18 @@ test_select_valid(void) MESSAGE(8, ("Case 1 : sub_space is not a valid dataspace\n")); dims[0] = dims[1] = H5S_UNLIMITED; - sub_space = H5Screate_simple(2, dims, NULL); + H5E_BEGIN_TRY + { + sub_space = H5Screate_simple(2, dims, NULL); + } + H5E_END_TRY; VERIFY(sub_space, FAIL, "H5Screate_simple"); - valid = H5Sselect_valid(sub_space); + H5E_BEGIN_TRY + { + valid = H5Sselect_valid(sub_space); + } + H5E_END_TRY; VERIFY(valid, FAIL, "H5Sselect_valid"); /* Set arrays and dataspace for the rest of the cases */ @@ -6911,7 +6955,11 @@ test_select_valid(void) error = H5Sclose(sub_space); CHECK(error, FAIL, "H5Sclose"); - valid = H5Sselect_valid(sub_space); + H5E_BEGIN_TRY + { + valid = H5Sselect_valid(sub_space); + } + H5E_END_TRY; VERIFY(valid, FAIL, "H5Sselect_valid"); MESSAGE(8, ("Case 3 : in the dimensions\nTry offset (4,4) and size(6,6), the original space is of size " @@ -13867,7 +13915,7 @@ test_select_bounds(void) ret = H5Sget_select_bounds(sid, low_bounds, high_bounds); } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Sget_select_bo unds"); + VERIFY(ret, FAIL, "H5Sget_select_bounds"); /* Set point selection */ coord[0][0] = 3; @@ -14650,7 +14698,11 @@ test_hyper_unlim(void) VERIFY(ssize_out, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints"); /* Test H5Sget_select_hyper_nblocks() */ - ssize_out = H5Sget_select_hyper_nblocks(sid); + H5E_BEGIN_TRY + { + ssize_out = H5Sget_select_hyper_nblocks(sid); + } + H5E_END_TRY; VERIFY(ssize_out, (hssize_t)H5S_UNLIMITED, "H5Sget_select_hyper_nblocks"); /* Test H5Sget_select_bounds() */ @@ -16211,5 +16263,9 @@ test_select(void) void cleanup_select(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/tsohm.c b/test/tsohm.c index d923efb..7d9964f 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -480,8 +480,6 @@ error: * Programmer: James Laird * Saturday, August 26, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static hid_t @@ -555,8 +553,6 @@ error: * Programmer: James Laird * Wednesday, October 4, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static hid_t @@ -1521,8 +1517,6 @@ size2_verify_plist2(hid_t plist) * Programmer: James Laird * Friday, January 26, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -1565,8 +1559,6 @@ size2_dump_struct(const char *name, size2_helper_struct *sizes) * Programmer: James Laird * Friday, November 17, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2724,8 +2716,6 @@ test_sohm_size2(int close_reopen) * Programmer: James Laird * Tuesday, December 19, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -2763,8 +2753,6 @@ delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, int x) * Programmer: James Laird * Tuesday, December 19, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -2812,8 +2800,6 @@ delete_helper_read(hid_t file_id, hid_t *dspace_id, int x) * Programmer: James Laird * Tuesday, December 19, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -2896,8 +2882,6 @@ delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id) * Programmer: James Laird * Tuesday, December 19, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -3036,8 +3020,6 @@ test_sohm_delete(void) * Programmer: James Laird * Wednesday, January 3, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3137,8 +3119,6 @@ verify_dset_create_and_delete_does_not_grow_file(hid_t fcpl_id) * Programmer: James Laird * Wednesday, January 3, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -3217,8 +3197,6 @@ test_sohm_delete_revert(void) * Programmer: James Laird * Friday, December 22, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -3285,8 +3263,6 @@ verify_dset_create_and_open_through_extlink_with_sohm(hid_t src_fcpl_id, hid_t d * Programmer: James Laird * Friday, December 22, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -3333,8 +3309,6 @@ test_sohm_extlink(void) * Programmer: James Laird * Wednesday, January 10, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -3600,8 +3574,6 @@ verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen) * Programmer: James Laird * Wednesday, January 10, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -3682,8 +3654,6 @@ test_sohm_extend_dset(void) * Programmer: Raymond Lu * 13 October, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -3875,8 +3845,6 @@ test_sohm(void) * Programmer: James Laird * October 9, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/test/ttime.c b/test/ttime.c index 99f38bc..81c5015 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -220,12 +220,14 @@ test_time(void) * Programmer: Quincey Koziol * October 19, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_time(void) { - HDremove(DATAFILE); + H5E_BEGIN_TRY + { + H5Fdelete(DATAFILE, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/tunicode.c b/test/tunicode.c index bf5f64f..27df42d 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -859,5 +859,9 @@ test_unicode(void) void cleanup_unicode(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/tvlstr.c b/test/tvlstr.c index c9204a5..3fcc57d 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -880,6 +880,8 @@ test_write_same_element(void) hsize_t coord[SPACE1_RANK][NUMP]; herr_t ret; + MESSAGE(5, ("Testing writing to same element of VL string dataset twice\n")); + file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file1, FAIL, "H5Fcreate"); @@ -993,14 +995,16 @@ test_vlstrings(void) * Programmer: Quincey Koziol * September 10, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_vlstrings(void) { - HDremove(DATAFILE); - HDremove(DATAFILE2); - HDremove(DATAFILE3); + H5E_BEGIN_TRY + { + H5Fdelete(DATAFILE, H5P_DEFAULT); + H5Fdelete(DATAFILE2, H5P_DEFAULT); + H5Fdelete(DATAFILE3, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/tvltypes.c b/test/tvltypes.c index c791350..1e0de1c 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -3254,12 +3254,14 @@ test_vltypes(void) * Programmer: Quincey Koziol * June 8, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ void cleanup_vltypes(void) { - HDremove(FILENAME); + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME, H5P_DEFAULT); + } + H5E_END_TRY; } diff --git a/test/twriteorder.c b/test/twriteorder.c index c7984e7..165abcf 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -273,9 +273,6 @@ write_wo_file(void) HDmemset(&buffer[4], i & 0xff, (size_t)(BLOCKSIZE_DFT - 4)); /* write the block */ -#ifdef DEBUG - HDprintf("writing block at %d\n", blkaddr); -#endif HDlseek(write_fd_g, (HDoff_t)blkaddr, SEEK_SET); if ((bytes_wrote = HDwrite(write_fd_g, buffer, (size_t)blocksize_g)) != blocksize_g) { HDprintf("blkaddr write failed in partition %d\n", i); @@ -295,9 +292,6 @@ write_wo_file(void) } /* all writes done. return success. */ -#ifdef DEBUG - HDprintf("wrote %d blocks\n", nlinkedblock_g); -#endif return 0; } @@ -305,9 +299,8 @@ int read_wo_file(void) { int read_fd; - int blkaddr = 0; - h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ - int linkedblocks_read = 0; + int blkaddr = 0; + h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ char buffer[BLOCKSIZE_DFT]; /* Open the data file */ @@ -324,30 +317,19 @@ read_wo_file(void) return -1; } } - linkedblocks_read++; /* got a non-zero blkaddr. Proceed down the linked blocks. */ -#ifdef DEBUG - HDprintf("got initial block address=%d\n", blkaddr); -#endif while (blkaddr != 0) { HDlseek(read_fd, (HDoff_t)blkaddr, SEEK_SET); if ((bytes_read = HDread(read_fd, buffer, (size_t)blocksize_g)) != blocksize_g) { HDprintf("blkaddr read failed in partition %d\n", 0); return -1; } - linkedblocks_read++; /* retrieve the block address in byte 0-3 */ HDmemcpy(&blkaddr, &buffer[0], sizeof(blkaddr)); -#ifdef DEBUG - HDprintf("got next block address=%d\n", blkaddr); -#endif } -#ifdef DEBUG - HDprintf("read %d blocks\n", linkedblocks_read); -#endif return 0; } @@ -426,9 +408,6 @@ main(int argc, char *argv[]) /* launch writer */ /* ============= */ /* this process continues to launch the writer */ -#ifdef DEBUG - HDprintf("%d: continue as the writer process\n", mypid); -#endif if (write_wo_file() < 0) { HDfprintf(stderr, "write_wo_file encountered error\n"); Hgoto_error(1); diff --git a/test/unlink.c b/test/unlink.c index e2cf67f..e18ae73 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -78,8 +78,6 @@ const char *FILENAME[] = {"unlink", "new_move_a", "new_move_b", * Programmer: Robb Matzke * Friday, September 25, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -155,8 +153,6 @@ error: * Programmer: Robb Matzke * Friday, September 25, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -309,8 +305,6 @@ error: * Programmer: Robb Matzke * Friday, September 25, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -375,8 +369,6 @@ error: * Programmer: Raymond Lu * Thursday, April 25, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -478,8 +470,6 @@ error: * Programmer: Raymond Lu * Thursday, April 25, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -540,8 +530,6 @@ error: * Programmer: Quincey Koziol * Saturday, March 22, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1480,8 +1468,6 @@ error: * Programmer: Quincey Koziol * Friday, April 11, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1546,8 +1532,6 @@ error: * Programmer: Quincey Koziol * Saturday, August 16, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1627,8 +1611,6 @@ error: * Programmer: Quincey Koziol * Saturday, August 16, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1740,8 +1722,6 @@ delete_node(hid_t pid, hid_t id) * Programmer: Quincey Koziol * Monday, January 19, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1829,8 +1809,6 @@ error: * Programmer: Quincey Koziol * Monday, January 19, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -1921,8 +1899,6 @@ error: * Programmer: Quincey Koziol * Monday, January 19, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2299,8 +2275,6 @@ error: * Programmer: Quincey Koziol * Wednesday, July 14, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2384,8 +2358,6 @@ error: * Programmer: James Laird * Wednesday, July 28, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2466,8 +2438,6 @@ error: * Programmer: James Laird * Wednesday, July 28, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -2545,8 +2515,6 @@ error: * Programmer: Quincey Koziol * Monday, September 27, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static int diff --git a/test/vfd.c b/test/vfd.c index 3be299c..4a5351b 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -4043,10 +4043,6 @@ error: * Programmer: John Mainzer * 6/21/20 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -4149,10 +4145,6 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz * Programmer: John Mainzer * 3/10/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -4286,10 +4278,6 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a * Programmer: John Mainzer * 6/21/20 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -4341,10 +4329,6 @@ test_vector_io__read_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], had * Programmer: John Mainzer * 6/21/20 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -4394,8 +4378,6 @@ test_vector_io__write_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], ha * Programmer: John Mainzer * 6/21/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ @@ -4465,8 +4447,6 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], con * Programmer: John Mainzer * 6/21/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ @@ -4541,8 +4521,6 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad * Programmer: John Mainzer * 6/20/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ #define VECTOR_LEN 16 @@ -4983,8 +4961,6 @@ error: * Programmer: Neil Fortner * 7/1/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ /* Array dimensions, used for all selection I/O tests. Currently both must be @@ -5030,8 +5006,6 @@ error: * Programmer: Neil Fortner * 7/1/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t @@ -5106,8 +5080,6 @@ error: * Programmer: Neil Fortner * 7/1/21 * - * Changes: None. - * *------------------------------------------------------------------------- */ static herr_t diff --git a/test/vol.c b/test/vol.c index d369669..27ffdcd 100644 --- a/test/vol.c +++ b/test/vol.c @@ -28,7 +28,7 @@ #include "H5VLpkg.h" /* Virtual Object Layer */ /* Filename */ -const char *FILENAME[] = {"native_vol_test", NULL}; +const char *FILENAME[] = {"vol_test_file", NULL}; #define NATIVE_VOL_TEST_GROUP_NAME "test_group" #define NATIVE_VOL_TEST_DATASET_NAME "test_dataset" @@ -174,6 +174,9 @@ static const H5VL_class_t reg_opt_vol_g = { }; static herr_t fake_get_cap_flags(const void *info, uint64_t *cap_flags); +static herr_t fake_vol_info_to_str(const void *info, char **str); +static herr_t fake_vol_str_to_info(const char *str, void **info); +static herr_t fake_vol_free_info(void *info); #define FAKE_VOL_NAME "fake" #define FAKE_VOL_VALUE ((H5VL_class_value_t)501) @@ -193,12 +196,12 @@ static const H5VL_class_t fake_vol_g = { NULL, /* terminate */ { /* info_cls */ - (size_t)0, /* size */ - NULL, /* copy */ - NULL, /* compare */ - NULL, /* free */ - NULL, /* to_str */ - NULL, /* from_str */ + (size_t)0, /* size */ + NULL, /* copy */ + NULL, /* compare */ + fake_vol_free_info, /* free */ + fake_vol_info_to_str, /* to_str */ + fake_vol_str_to_info, /* from_str */ }, { /* wrap_cls */ @@ -559,6 +562,77 @@ reg_opt_datatype_get(void H5_ATTR_UNUSED *obj, H5VL_datatype_get_args_t *args, h } /* end reg_opt_datatype_get() */ /*------------------------------------------------------------------------- + * Function: fake_vol_info_to_str + * + * Purpose: Convert the fake VOL info to a string + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +fake_vol_info_to_str(const void *info, char **str) +{ + herr_t ret_value = SUCCEED; /* Return value */ + const int val = *(const int *)info; + const int str_size = 16; /* The size of the string */ + + /* Verify the info is correct before continuing */ + if (val != INT_MAX) { + HDprintf("The value of info (%d) is incorrect\n", val); + return FAIL; + } + + /* Allocate the string long enough for the info */ + *str = (char *)malloc(str_size); + + HDsnprintf(*str, str_size, "%d", *((const int *)info)); + + return ret_value; +} /* end fake_vol_info_to_str() */ + +/*------------------------------------------------------------------------- + * Function: fake_vol_str_to_info + * + * Purpose: Convert a string to a VOL info + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +fake_vol_str_to_info(const char *str, void **info /*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + *((int **)info) = (int *)malloc(sizeof(int)); + + **((int **)info) = atoi(str); + + return ret_value; +} /* end fake_vol_str_to_info() */ + +/*------------------------------------------------------------------------- + * Function: fake_vol_free_info + * + * Purpose: Free the memory of a VOL info + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +fake_vol_free_info(void *info) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + if (info) + HDfree(info); + + return ret_value; +} /* end fake_vol_free_info() */ + +/*------------------------------------------------------------------------- * Function: fake_get_cap_flags * * Purpose: Return the capability flags for the 'fake' connector @@ -1664,7 +1738,7 @@ exercise_reg_opt_oper(hid_t fake_vol_id, hid_t reg_opt_vol_id, H5VL_subclass_t s /* Verify that the reserved amount of optional operations is obeyed */ /* (The first optional operation registered should be at the lower limit) */ - if (op_val != H5VL_RESERVED_NATIVE_OPTIONAL) + if (op_val < H5VL_RESERVED_NATIVE_OPTIONAL) TEST_ERROR; /* Look up 1st registered optional operation */ @@ -1683,7 +1757,7 @@ exercise_reg_opt_oper(hid_t fake_vol_id, hid_t reg_opt_vol_id, H5VL_subclass_t s /* Verify that the reserved amount of optional operations is obeyed */ /* (The 2nd optional operation registered should be at the lower limit + 1) */ - if (op_val2 != (H5VL_RESERVED_NATIVE_OPTIONAL + 1)) + if (op_val2 < (H5VL_RESERVED_NATIVE_OPTIONAL + 1)) TEST_ERROR; /* Look up 2nd registered optional operation */ @@ -2242,10 +2316,9 @@ test_get_vol_name(void) conn_env_str = "native"; /* Skip the connectors other than the native and pass_through connector */ - if (HDstrcmp(conn_env_str, "native") && - HDstrncmp(conn_env_str, "pass_through", HDstrlen("pass_through"))) { + if (HDstrcmp(conn_env_str, "native") && HDstrcmp(conn_env_str, "pass_through")) { SKIPPED(); - HDprintf(" only test the native or pass_through connector\n"); + HDprintf(" only test the native or internal pass_through connector\n"); return SUCCEED; } @@ -2262,8 +2335,7 @@ test_get_vol_name(void) /* When comparing the pass_through connector, ignore the rest information (under_vol=0;under_info={}) */ if ((!HDstrcmp(conn_env_str, "native") && HDstrcmp(vol_name, "native")) || - (!HDstrncmp(conn_env_str, "pass_through", HDstrlen("pass_through")) && - HDstrcmp(vol_name, "pass_through"))) + (!HDstrcmp(conn_env_str, "pass_through") && HDstrcmp(vol_name, "pass_through"))) TEST_ERROR; if (H5Fclose(file_id) < 0) @@ -2287,7 +2359,7 @@ error: H5E_END_TRY; return FAIL; -} /* end test_vol_cap_flags() */ +} /* end test_get_vol_name() */ /*------------------------------------------------------------------------- * Function: test_wrap_register() @@ -2365,6 +2437,156 @@ error: } /* end test_wrap_register() */ /*------------------------------------------------------------------------- + * Function: test_info_to_str() + * + * Purpose: Tests the conversion between a VOL info and a string + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_info_to_str(void) +{ + hid_t fapl_id = H5I_INVALID_HID; + hid_t vol_id = H5I_INVALID_HID; + int info = INT_MAX; + char *ret_str = NULL; + int *ret_info = NULL; + + TESTING("conversion between a VOL info and a string"); + + /* Register a fake VOL */ + if ((vol_id = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; + + if (H5Pset_vol(fapl_id, vol_id, NULL) < 0) + TEST_ERROR; + + /* Serialize the VOL info into a string */ + if (H5VLconnector_info_to_str(&info, vol_id, &ret_str) < 0) + TEST_ERROR; + + /* Parse the string and construct it into a VOL info */ + if (H5VLconnector_str_to_info(ret_str, vol_id, (void **)(&ret_info)) < 0) + TEST_ERROR; + + if (*ret_info != info) + FAIL_PUTS_ERROR("the returned VOL info doesn't match the original info"); + + /* Free the VOL info being returned */ + if (H5VLfree_connector_info(vol_id, ret_info) < 0) + TEST_ERROR; + + /* Free the string being returned */ + if (ret_str) + HDfree(ret_str); + + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; + + /* Unregister the fake VOL ID */ + if (H5VLunregister_connector(vol_id) < 0) + TEST_ERROR; + + PASSED(); + + return SUCCEED; + +error: + H5E_BEGIN_TRY + { + H5VLunregister_connector(vol_id); + H5Pclose(fapl_id); + } + H5E_END_TRY; + + return FAIL; +} /* end test_info_to_str() */ + +/*------------------------------------------------------------------------- + * Function: test_query_optional + * + * Purpose: Tests the bug fix (HDFFV-11208) that a committed datatype + * triggered an assertion failure in H5VLquery_optional + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +test_query_optional(void) +{ + hid_t fapl_id = H5I_INVALID_HID; + hid_t file_id = H5I_INVALID_HID; + hid_t group_id = H5I_INVALID_HID; + hid_t dtype_id = H5I_INVALID_HID; + char filename[NAME_LEN]; + uint64_t supported = 0; + + TESTING("H5VLquery_optional"); + + /* Retrieve the file access property for testing */ + fapl_id = h5_fileaccess(); + + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + + if ((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + TEST_ERROR; + + if ((group_id = H5Gcreate2(file_id, "test_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Test H5VLquery_optional with a group */ + if (H5VLquery_optional(group_id, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_GET_COMMENT, &supported) < 0) + TEST_ERROR; + + if ((dtype_id = H5Tcopy(H5T_NATIVE_INT)) < 0) + TEST_ERROR; + + /* Commit the datatype into the file */ + if (H5Tcommit2(file_id, "test_dtype", dtype_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + TEST_ERROR; + + /* Test H5VLquery_optional with a committed datatype where the assertion failure happened in the past */ + if (H5VLquery_optional(dtype_id, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_GET_COMMENT, &supported) < 0) + TEST_ERROR; + + if (H5Gclose(group_id) < 0) + TEST_ERROR; + + if (H5Tclose(dtype_id) < 0) + TEST_ERROR; + + if (H5Fclose(file_id) < 0) + TEST_ERROR; + + h5_delete_test_file(FILENAME[0], fapl_id); + + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; + + PASSED(); + + return SUCCEED; + +error: + H5E_BEGIN_TRY + { + H5Gclose(group_id); + H5Tclose(dtype_id); + H5Fclose(file_id); + H5Pclose(fapl_id); + } + H5E_END_TRY; + + return FAIL; +} /* end test_query_optional() */ + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Tests the virtual object layer interface (H5VL) @@ -2402,6 +2624,8 @@ main(void) nerrors += test_vol_cap_flags() < 0 ? 1 : 0; nerrors += test_get_vol_name() < 0 ? 1 : 0; nerrors += test_wrap_register() < 0 ? 1 : 0; + nerrors += test_info_to_str() < 0 ? 1 : 0; + nerrors += test_query_optional() < 0 ? 1 : 0; if (nerrors) { HDprintf("***** %d Virtual Object Layer TEST%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : ""); diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 4ecb09e..ad669d8 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -26,7 +26,7 @@ const char *FILENAME[3] = {"bigio_test.h5", "single_rank_independent_io.h5", NUL #define DATASET4 "DSET4" #define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/ #define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */ -#define DXFER_BIGCOUNT (1 < 29) +#define DXFER_BIGCOUNT (1 << 29) #define HYPER 1 #define POINT 2 @@ -1165,9 +1165,16 @@ single_rank_independent_io(void) free(data); H5Sclose(fspace_id); - H5Pclose(fapl_id); H5Dclose(dset_id); H5Fclose(file_id); + + H5E_BEGIN_TRY + { + H5Fdelete(FILENAME[1], fapl_id); + } + H5E_END_TRY; + + H5Pclose(fapl_id); } MPI_Barrier(MPI_COMM_WORLD); } @@ -1289,8 +1296,6 @@ coll_chunk1(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index ae47a6f..4d3aff5 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -475,10 +475,6 @@ static hbool_t trace_file_check(int metadata_write_strategy); * * Programmer: JRM -- 4/17/06 * - * Modifications: - * - * None. - * *****************************************************************************/ static void @@ -507,10 +503,6 @@ print_stats(void) * * Programmer: JRM -- 4/17/06 * - * Modifications: - * - * None. - * *****************************************************************************/ static void @@ -547,10 +539,6 @@ reset_stats(void) * * Programmer: JRM -- 11/16/05 * - * Modifications: - * - * None. - * *****************************************************************************/ static hbool_t @@ -964,10 +952,6 @@ get_max_nerrors(void) * * Programmer: JRM -- 12/22/05 * - * Modifications: - * - * JRM -- 5/10/06 - * Added mssg_tag_offset parameter and supporting code. * *****************************************************************************/ @@ -1043,11 +1027,6 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset) * * Programmer: JRM -- 12/22/05 * - * Modifications: - * - * JRM -- 5/10/06 - * Added the add_req_to_tag parameter and supporting code. - * *****************************************************************************/ static hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag) @@ -1300,11 +1279,6 @@ reset_server_counters(void) * * Programmer: JRM -- 12/22/05 * - * Modifications: - * - * JRM -- 5/10/06 - * Updated for sync message. - * *****************************************************************************/ static hbool_t server_main(void) @@ -2876,13 +2850,6 @@ expunge_entry(H5F_t *file_ptr, int32_t idx) * Programmer: John Mainzer * 01/04/06 * - * Modifications: - * - * JRM -- 8/11/06 - * Updated code to reflect the fact that entries can now be - * inserted pinned. Note that since all inserts are dirty, - * any pins must be global pins. - * *****************************************************************************/ static void insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags) @@ -3245,12 +3212,6 @@ lock_and_unlock_random_entry(H5F_t *file_ptr, int min_idx, int max_idx) * Programmer: John Mainzer * 1/4/06 * - * Modifications: - * - * JRM -- 7/11/06 - * Modified asserts to handle the new local_len field in - * datum. - * *****************************************************************************/ static void lock_entry(H5F_t *file_ptr, int32_t idx) @@ -4089,11 +4050,6 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) * * Programmer: JRM -- 1/12/06 * - * Modifications: - * - * JRM -- 5/9/06 - * Modified function to facilitate setting predefined seeds. - * *****************************************************************************/ static void setup_rand(void) @@ -4617,11 +4573,6 @@ verify_total_writes(unsigned expected_total_writes) * Programmer: John Mainzer * 1/4/06 * - * Modifications: - * - * 7/11/06 - * Updated for the new local_len field in datum. - * *****************************************************************************/ static void unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags) @@ -4692,11 +4643,6 @@ unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags) * Programmer: John Mainzer * 4/12/06 * - * Modifications: - * - * JRM -- 8/15/06 - * Added assertion that entry is pinned on entry. - * *****************************************************************************/ static void unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t via_unprotect) diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 65c892d..1e556d9 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -125,10 +125,6 @@ static hbool_t smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, * Programmer: John Mainzer * 1/25/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -390,13 +386,6 @@ construct_test_file(int test_file_index) * Programmer: John Mainzer * 7/15/15 * - * Modifications: - * - * Added min_dset and max_dset parameters and supporting - * code. This allows the caller to specify a range of - * datasets to create. - * JRM -- 8/20/15 - * *------------------------------------------------------------------------- */ @@ -723,11 +712,6 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) * Programmer: John Mainzer * 10/31/16 * - * Modifications: - * - * None. - * JRM -- 8/20/15 - * *------------------------------------------------------------------------- */ #if 0 @@ -823,14 +807,6 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) * Programmer: John Mainzer * 7/14/15 * - * Modifications: - * - * Modified function to handle parallel file creates / opens. - * - * JRM -- 2/1/17 - * - * Modified function to handle - * *------------------------------------------------------------------------- */ @@ -1300,10 +1276,6 @@ open_hdf5_file(const hbool_t create_file, const hbool_t mdci_sbem_expected, cons * Programmer: John Mainzer * 3/4/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -1689,10 +1661,6 @@ par_create_dataset(int dset_num, hid_t file_id, int mpi_rank, int mpi_size) * Programmer: John Mainzer * 3/6/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -1760,10 +1728,6 @@ par_delete_dataset(int dset_num, hid_t file_id, int mpi_rank) * Programmer: John Mainzer * 3/8/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -1809,10 +1773,6 @@ par_insert_cache_image(int file_name_idx, int mpi_rank, int mpi_size) * Programmer: John Mainzer * 3/6/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2067,10 +2027,6 @@ par_verify_dataset(int dset_num, hid_t file_id, int mpi_rank) * Programmer: John Mainzer * 3/8/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2181,10 +2137,6 @@ serial_insert_cache_image(int file_name_idx, int mpi_size) * Programmer: John Mainzer * 3/6/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2413,13 +2365,6 @@ serial_verify_dataset(int dset_num, hid_t file_id, int mpi_size) * Programmer: John Mainzer * 7/15/15 * - * Modifications: - * - * Added min_dset and max_dset parameters and supporting - * code. This allows the caller to specify a range of - * datasets to verify. - * JRM -- 8/20/15 - * *------------------------------------------------------------------------- */ @@ -2677,10 +2622,6 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) * Programmer: John Mainzer * 3/11/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2944,10 +2885,6 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) * Programmer: John Mainzer * 1/25/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -3614,8 +3551,6 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) * Programmer: John Mainzer * 1/25/17 * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index c6ed9b1..5f853e3 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -46,8 +46,6 @@ static void coll_chunktest(const char *filename, int chunk_factor, int select_fa * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -97,8 +95,6 @@ coll_chunk1(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -148,8 +144,6 @@ coll_chunk2(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -202,8 +196,6 @@ coll_chunk3(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -254,8 +246,6 @@ coll_chunk4(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -308,8 +298,6 @@ coll_chunk5(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -360,8 +348,6 @@ coll_chunk6(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -412,8 +398,6 @@ coll_chunk7(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -464,8 +448,6 @@ coll_chunk8(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -516,8 +498,6 @@ coll_chunk9(void) * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -559,26 +539,16 @@ coll_chunk10(void) * Function: coll_chunktest * * Purpose: The real testing routine for regular selection of collective - chunking storage - testing both write and read, - If anything fails, it may be read or write. There is no - separation test between read and write. + * chunking storage testing both write and read, + * If anything fails, it may be read or write. There is no + * separation test between read and write. * * Return: Success: 0 - * * Failure: -1 * - * Modifications: - * Remove invalid temporary property checkings for API_LINK_HARD and - * API_LINK_TRUE cases. - * Programmer: Jonathan Kim - * Date: 2012-10-10 - * * Programmer: Unknown * July 12th, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 5002fb8..34c4d97 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -3427,9 +3427,6 @@ actual_io_mode_tests(void) * Programmer: Jonathan Kim * Date: Aug, 2012 */ -#ifdef LATER -#define DSET_NOCOLCAUSE "nocolcause" -#endif #define FILE_EXTERNAL "nocolcause_extern.data" static void test_no_collective_cause_mode(int selection_mode) diff --git a/testpar/t_file.c b/testpar/t_file.c index 99ad13c..90ae22d 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -95,19 +95,21 @@ test_split_comm_access(void) fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); VRFY((fid >= 0), "H5Fcreate succeeded"); - /* Release file-access template */ - ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), ""); - /* close the file */ ret = H5Fclose(fid); VRFY((ret >= 0), ""); /* delete the test file */ - if (sub_mpi_rank == 0) { - mrc = MPI_File_delete(filename, info); - /*VRFY((mrc==MPI_SUCCESS), ""); */ + H5E_BEGIN_TRY + { + ret = H5Fdelete(filename, acc_tpl); } + H5E_END_TRY; + VRFY((ret >= 0), "H5Fdelete succeeded"); + + /* Release file-access template */ + ret = H5Pclose(acc_tpl); + VRFY((ret >= 0), ""); } mrc = MPI_Comm_free(&comm); VRFY((mrc == MPI_SUCCESS), "MPI_Comm_free succeeded"); diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index 0781594..8895c15 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -192,8 +192,6 @@ filter_read_internal(const char *filename, hid_t dcpl, hsize_t *dset_size) * Programmer: Christian Chilan * Tuesday, May 15, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/testpar/t_pread.c b/testpar/t_pread.c index 9a2493d..d05ec46 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -77,8 +77,6 @@ static char *test_argv0 = NULL; * Programmer: Richard Warren * 10/1/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -483,8 +481,6 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) * Programmer: Richard Warren * 10/1/17 * - * Modifications: - * *------------------------------------------------------------------------- */ static int diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index cbae5e1..c11f95c 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -4305,7 +4305,8 @@ main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0) { - HDprintf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank); + if (MAINPROCESS) + HDprintf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank); }; H5open(); h5_show_hostname(); diff --git a/testpar/t_vfd.c b/testpar/t_vfd.c index 512aa5b..86cfe2f 100644 --- a/testpar/t_vfd.c +++ b/testpar/t_vfd.c @@ -117,10 +117,6 @@ static unsigned vector_write_test_7(int file_name_id, int mpi_rank, int mpi_size * Programmer: John Mainzer * 3/25/26 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -199,10 +195,6 @@ alloc_and_init_file_images(int mpi_size) * Programmer: John Mainzer * 1/25/17 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -261,10 +253,6 @@ free_file_images(void) * Programmer: John Mainzer * 3/25/26 * - * Modifications: - * - * Updated for subfiling VFD 9/29/30 - * *------------------------------------------------------------------------- */ @@ -535,10 +523,6 @@ setup_vfd_test_file(int file_name_id, char *file_name, int mpi_size, H5FD_mpio_x * Programmer: John Mainzer * 3/25/26 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -658,10 +642,6 @@ takedown_vfd_test_file(int mpi_rank, char *filename, H5FD_t **lf_ptr, hid_t *fap * Programmer: John Mainzer * 3/26/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -895,10 +875,6 @@ vector_read_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ * Programmer: John Mainzer * 3/26/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -1199,10 +1175,6 @@ vector_read_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ * Programmer: John Mainzer * 3/26/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -1559,10 +1531,6 @@ vector_read_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ * Programmer: John Mainzer * 3/26/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -1994,10 +1962,6 @@ vector_read_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ * Programmer: John Mainzer * 3/26/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2240,10 +2204,6 @@ vector_read_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ * Programmer: John Mainzer * 3/26/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2433,10 +2393,6 @@ vector_write_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer * Programmer: John Mainzer * 3/28/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2689,10 +2645,6 @@ vector_write_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer * Programmer: John Mainzer * 3/31/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -2956,10 +2908,6 @@ vector_write_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer * Programmer: John Mainzer * 3/31/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -3261,10 +3209,6 @@ vector_write_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer * Programmer: John Mainzer * 3/31/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -3704,10 +3648,6 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer * Programmer: John Mainzer * 3/26/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -3965,10 +3905,6 @@ vector_write_test_6(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer * Programmer: John Mainzer * 10/10/21 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ @@ -4190,8 +4126,6 @@ vector_write_test_7(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer * Programmer: John Mainzer * 3/2621/ * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 1ab9236..ea268f3 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1105,10 +1105,6 @@ done: * * Return: Number of differences found * - * Modifications: Compare the graph and make h5diff return 1 for difference if - * 1) the number of objects in file1 is not the same as in file2 - * 2) the graph does not match, i.e same names (absolute path) - * 3) objects with the same name are not of the same type *------------------------------------------------------------------------- */ hsize_t diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 078ae5a..189aafd 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -817,10 +817,11 @@ done: *------------------------------------------------------------------------- */ herr_t -h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size) +h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t drivername_size) { - hid_t fapl_vol_id = H5I_INVALID_HID; - herr_t ret_value = SUCCEED; + hid_t fapl_vol_id = H5I_INVALID_HID; + hbool_t is_native = FALSE; + herr_t ret_value = SUCCEED; if (fapl_id < 0) H5TOOLS_GOTO_ERROR(FAIL, "invalid FAPL"); @@ -839,9 +840,11 @@ h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size) if (H5Pget_vol_id(fapl_id, &fapl_vol_id) < 0) H5TOOLS_ERROR(FAIL, "failed to retrieve VOL ID from FAPL"); - /* TODO: For now, we have no way of determining if an arbitrary - * VOL connector is native-terminal. */ - if (fapl_vol_id == H5VL_NATIVE || fapl_vol_id == H5VL_PASSTHRU) { + /* Query if the file ID is native-terminal */ + if (H5VLobject_is_native(fid, &is_native) < 0) + H5TOOLS_ERROR(FAIL, "failed to determine if file ID is native-terminal"); + + if (is_native) { const char *driver_name; hid_t driver_id; @@ -1072,7 +1075,8 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec done: /* Save the driver name if using a native-terminal VOL connector */ if (drivername && drivername_size && ret_value >= 0) - if (used_fapl_id >= 0 && h5tools_get_vfd_name(used_fapl_id, drivername, drivername_size) < 0) + if (used_fapl_id >= 0 && + h5tools_get_vfd_name(ret_value, used_fapl_id, drivername, drivername_size) < 0) H5TOOLS_ERROR(H5I_INVALID_HID, "failed to retrieve name of VFD used to open file"); if (tmp_fapl_id >= 0) diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 2082f2d..753a83b 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -667,7 +667,7 @@ H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); H5TOOLS_DLL hid_t h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, h5tools_vfd_info_t *vfd_info); -H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fapl_id, char *drivername, size_t drivername_size); +H5TOOLS_DLL herr_t h5tools_get_vfd_name(hid_t fid, hid_t fapl_id, char *drivername, size_t drivername_size); H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, hbool_t use_specific_driver, char *drivername, size_t drivername_size); H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index d80ef1f..435ca87 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -232,24 +232,7 @@ h5tools_dump_init(void) * Failure: FAIL * Programmer: * Robb Matzke, Monday, April 26, 1999 - * Modifications: - * Robb Matzke, 1999-06-04 - * The `container' argument is the optional dataset for reference types. * - * Robb Matzke, 1999-09-29 - * Understands the `per_line' property which indicates that every Nth - * element should begin a new line. - * - * Robb Matzke, LLNL, 2003-06-05 - * Do not dereference the memory for a variable-length string here. - * Deref in h5tools_str_sprint() instead so recursive types are - * handled correctly. - * - * Pedro Vicente Nunes, The HDF Group, 2005-10-19 - * pass to the prefix in h5tools_simple_prefix the total position - * instead of the current stripmine position i; this is necessary - * to print the array indices - * new field sm_pos in h5tools_context_t, the current stripmine element position *------------------------------------------------------------------------- */ int diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index d5c1cf9..9f12367 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -51,8 +51,6 @@ static int ref_path_table_put(const char *, const H5O_token_t *token); * * Programmer: Quincey Koziol * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -160,8 +158,6 @@ init_ref_path_table(void) * * Programmer: Quincey Koziol * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -187,8 +183,6 @@ term_ref_path_table(void) * * Programmer: REMcG * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -237,8 +231,6 @@ ref_path_table_lookup(const char *thepath, H5O_token_t *token) * * Programmer: REMcG * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -322,8 +314,6 @@ ref_path_table_gen_fake(const char *path, H5O_token_t *token) * * Programmer: REMcG * - * Modifications: - * *------------------------------------------------------------------------- */ const char * diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index d9e26e7..223eb61 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1336,22 +1336,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai if (i) h5tools_str_append(str, "%s", OPT(info->vlen_sep, "," OPTIONAL_LINE_BREAK)); -#ifdef LATER - /* Need to fix so VL data breaks at correct location on end of line -QAK */ - if (info->arr_linebreak && h5tools_str_len(str) >= info->line_ncols) { - int x; - - h5tools_str_append(str, "%s", "\n"); - - /* need to indent some more here */ - if (ctx->indent_level >= 0) - h5tools_str_append(str, "%s", OPT(info->line_pre, "")); - - for (x = 0; x < ctx->indent_level + 1; x++) - h5tools_str_append(str, "%s", OPT(info->line_indent, "")); - } /* end if */ -#endif /* LATER */ - ctx->indent_level++; /* Dump the array element */ diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index ce21b3e..49a4a20 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -57,7 +57,6 @@ sub_time(struct timeval *a, struct timeval *b) * SYS_CLOCK for system time). * Return: Pointer to io_time object * Programmer: Bill Wendling, 01. October 2001 - * Modifications: */ io_time_t * io_time_new(clock_type type) @@ -78,7 +77,6 @@ io_time_new(clock_type type) * function. * Return: Nothing * Programmer: Bill Wendling, 01. October 2001 - * Modifications: */ void io_time_destroy(io_time_t *pt) @@ -97,7 +95,6 @@ io_time_destroy(io_time_t *pt) * timer with the pio_timer_new function (shame!). * Return: Nothing * Programmer: Bill Wendling, 04. October 2001 - * Modifications: */ void set_timer_type(io_time_t *pt, clock_type type) @@ -110,7 +107,6 @@ set_timer_type(io_time_t *pt, clock_type type) * Purpose: Get the type of the timer. * Return: MPI_CLOCK or SYS_CLOCK. * Programmer: Bill Wendling, 04. October 2001 - * Modifications: */ clock_type get_timer_type(io_time_t *pt) @@ -124,7 +120,6 @@ get_timer_type(io_time_t *pt) * Purpose: Set the time in a ``io_time_t'' object. * Return: Pointer to the passed in ``io_time_t'' object if SUCCEED; Null otherwise. * Programmer: Bill Wendling, 01. October 2001 - * Modifications: */ io_time_t * io_time_set(io_time_t *pt, timer_type t, int start_stop) @@ -214,7 +209,6 @@ io_time_set(io_time_t *pt, timer_type t, int start_stop) * Purpose: Get the time from a ``io_time_t'' object. * Return: The number of seconds as a DOUBLE. * Programmer: Bill Wendling, 01. October 2001 - * Modifications: */ H5_ATTR_PURE double io_time_get(io_time_t *pt, timer_type t) diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index 9bc3f76..f060e2c 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -372,8 +372,6 @@ H5_GCC_CLANG_DIAG_OFF("format") * Programmer: Jacob Smith * 2017-11-11 * - * Changes: None. - * *---------------------------------------------------------------------------- */ static unsigned @@ -595,8 +593,6 @@ error: * Programmer: Jacob Smith * 2017-11-13 * - * Changes: None - * *---------------------------------------------------------------------------- */ static unsigned @@ -975,8 +971,6 @@ error: * Programmer: Jacob Smith * 2018-07-12 * - * Changes: None - * *---------------------------------------------------------------------------- */ static unsigned @@ -1229,8 +1223,6 @@ H5_GCC_CLANG_DIAG_ON("format") * Programmer: Jacob Smith * 2017-11-10 * - * Changes: None. - * *---------------------------------------------------------------------------- */ int diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 3f8f8cf..9756d11 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -46,8 +46,6 @@ char *str_flag = NULL; * Programmer: Quincey Koziol * Saturday, 31. January 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -77,8 +75,6 @@ leave(int ret) * * Programmer: Pedro Vicente Nunes, 7/8/2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -159,8 +155,6 @@ usage(void) * * Programmer: Pedro Vicente Nunes, 7/8/2006 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -207,8 +201,6 @@ parse_flag(const char *s_flag, unsigned *flag) * * Programmer: Pedro Vicente Nunes * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 9aa0cdd..561f139 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -30,36 +30,6 @@ * * Comments: * - * Modifications: July 2004 - * Introduced the four modes: - * Normal mode: print the number of differences found and where they occurred - * Report mode: print the above plus the differences - * Verbose mode: print the above plus a list of objects and warnings - * Quiet mode: do not print output - * - * November 2004: Leon Arber (larber@uiuc.edu) - * Additions that allow h5diff to be run in parallel - * - * February 2005: Leon Arber (larber@uiuc.edu) - * h5diff and ph5diff split into two files, one that is used - * to build a serial h5diff and one used to build a parallel h5diff - * Common functions have been moved to h5diff_common.c - * - * October 2005 - * Introduced a new field 'not_cmp' to 'diff_opt_t' that detects - * if some objects are not comparable and prints the message - * "Some objects are not comparable" - * - * February 2007 - * Added comparison for dataset regions. - * Added support for reading and comparing by hyperslabs for large files. - * Inclusion of a relative error formula to compare floating - * point numbers in order to deal with floating point uncertainty. - * Printing of dataset dimensions along with dataset name - * - * November 19, 2007 - * adopted the syntax h5diff [OPTIONS] file1 file2 [obj1[obj2]] - * *------------------------------------------------------------------------- */ @@ -147,8 +117,6 @@ main(int argc, char *argv[]) * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ H5_ATTR_NORETURN void diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index ee8669f..64b1f28 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -116,10 +116,6 @@ main(int argc, char *argv[]) * Programmer: Leon Arber * Date: January 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -286,10 +282,6 @@ print_manager_output(void) * Programmer: Albert Cheng * Date: Feb 6, 2005 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ void diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 0bdd6d0..e63b6a8 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -346,9 +346,6 @@ gtoken(char *s) * * Programmer: pkmat * - * Modifications: pvn - * 7/23/2007. Added support for STR type, extra parameter FILE_ID - * *------------------------------------------------------------------------- */ diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c index 26968e3..2238aac 100644 --- a/tools/src/h5perf/pio_engine.c +++ b/tools/src/h5perf/pio_engine.c @@ -133,8 +133,6 @@ static off_t sqrto(off_t); * Purpose: PIO Engine where Parallel IO are executed. * Return: results * Programmer: Albert Cheng, Bill Wendling 2001/12/12 - * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) */ results do_pio(parameters param) @@ -382,7 +380,6 @@ done: * USER or LOGIN are specified in the environment. * Return: Pointer to filename or NULL * Programmer: Bill Wendling, 21. November 2001 - * Modifications: */ static char * pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size) @@ -497,26 +494,24 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si * Purpose: Write the required amount of data to the file. * Return: SUCCESS or FAIL * Programmer: Albert Cheng, Bill Wendling, 2001/12/13 - * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) */ static herr_t do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbytes, size_t buf_size, void *buffer) { int ret_code = SUCCESS; - int rc; /*routine return code */ + int rc; /* Return code */ long ndset; size_t blk_size; /* The block size to subdivide the xfer buffer into */ off_t nbytes_xfer; /* Total number of bytes transferred so far */ size_t nbytes_xfer_advance; /* Number of bytes transferred in a single I/O operation */ size_t nbytes_toxfer; /* Number of bytes to transfer a particular time */ char dname[64]; - off_t dset_offset = 0; /*dataset offset in a file */ - off_t bytes_begin[2]; /*first elmt this process transfer */ - off_t bytes_count; /*number of elmts this process transfer */ - off_t snbytes = 0; /*size of a side of the dataset square */ - unsigned char *buf_p; /* Current buffer pointer */ + off_t dset_offset = 0; /* Dataset offset in a file */ + off_t bytes_begin[2] = {0, 0}; /* First elmt this process transfer */ + off_t bytes_count; /* Number of elmts this process transfer */ + off_t snbytes = 0; /* Size of a side of the dataset square */ + unsigned char *buf_p; /* Current buffer pointer */ /* POSIX variables */ off_t file_offset; /* File offset of the next transfer */ @@ -1514,8 +1509,6 @@ sqrto(off_t x) * Purpose: read the required amount of data from the file. * Return: SUCCESS or FAIL * Programmer: Albert Cheng 2001/12/13 - * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) */ static herr_t do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbytes, size_t buf_size, @@ -1530,11 +1523,11 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt size_t nbytes_xfer_advance; /* Number of bytes transferred in a single I/O operation */ size_t nbytes_toxfer; /* Number of bytes to transfer a particular time */ char dname[64]; - off_t dset_offset = 0; /*dataset offset in a file */ - off_t bytes_begin[2]; /*first elmt this process transfer */ - off_t bytes_count; /*number of elmts this process transfer */ - off_t snbytes = 0; /*size of a side of the dataset square */ - unsigned char *buf_p; /* Current buffer pointer */ + off_t dset_offset = 0; /* Dataset offset in a file */ + off_t bytes_begin[2] = {0, 0}; /* First elmt this process transfer */ + off_t bytes_count; /* Number of elmts this process transfer */ + off_t snbytes = 0; /* Size of a side of the dataset square */ + unsigned char *buf_p; /* Current buffer pointer */ /* POSIX variables */ off_t file_offset; /* File offset of the next transfer */ @@ -2497,7 +2490,6 @@ done: * Purpose: Open the specified file. * Return: SUCCESS or FAIL * Programmer: Albert Cheng, Bill Wendling, 2001/12/13 - * Modifications: */ static herr_t do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) @@ -2607,7 +2599,6 @@ done: * Purpose: Close the specified file descriptor. * Return: SUCCESS or FAIL * Programmer: Albert Cheng, Bill Wendling, 2001/12/13 - * Modifications: */ static herr_t do_fclose(iotype iot, file_descr *fd /*out*/) @@ -2664,7 +2655,6 @@ done: * Other processes just return. * Return: void * Programmer: Albert Cheng 2001/12/12 - * Modifications: */ static void do_cleanupfile(iotype iot, char *fname) diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index 1460772..d4b302e 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -206,7 +206,6 @@ static off_t squareo(off_t); * function. * Return: EXIT_SUCCESS or EXIT_FAILURE * Programmer: Bill Wendling, 30. October 2001 - * Modifications: */ int main(int argc, char *argv[]) @@ -303,15 +302,13 @@ squareo(off_t x) * * Return: Nothing * Programmer: Bill Wendling, 30. October 2001 - * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) */ static void run_test_loop(struct options *opts) { parameters parms; int num_procs; - int doing_pio; /* if this process is doing PIO */ + int doing_pio = 0; /* if this process is doing parallel IO */ parms.num_files = opts->num_files; parms.num_dsets = opts->num_dsets; @@ -399,7 +396,6 @@ run_test_loop(struct options *opts) * Purpose: Inner loop call to actually run the I/O test. * Return: Nothing * Programmer: Bill Wendling, 18. December 2001 - * Modifications: */ static int run_test(iotype iot, parameters parms, struct options *opts) @@ -715,7 +711,6 @@ run_test(iotype iot, parameters parms, struct options *opts) * Purpose: * Return: Nothing * Programmer: Bill Wendling, 29. January 2002 - * Modifications: */ static void output_all_info(minmax *mm, int count, int indent_level) @@ -738,12 +733,6 @@ output_all_info(minmax *mm, int count, int indent_level) * object. * Return: 0 if all is fine; otherwise non-zero. * Programmer: Albert Cheng, 2002/05/21. - * Modifications: - * Bill Wendling, 2002/05/31 - * Modified so that the HDF5_MPI_INFO environment variable can - * be a semicolon separated list of "key=value" pairings. Most - * of the code is to remove any whitespaces which might be - * surrounding the "key=value" pairs. */ int h5_set_info_object(void) @@ -836,7 +825,6 @@ h5_set_info_object(void) * Purpose: Display content of an MPI Info object * Return: void * Programmer: Albert Cheng 2002/05/21 - * Modifications: */ void h5_dump_info_object(MPI_Info info) @@ -866,8 +854,6 @@ h5_dump_info_object(MPI_Info info) * Purpose: Gather all the min, max and total of val. * Return: Nothing * Programmer: Bill Wendling, 21. December 2001 - * Modifications: - * Use MPI_Allreduce to do it. -akc, 2002/01/11 */ static void get_minmax(minmax *mm, double val) @@ -888,8 +874,6 @@ get_minmax(minmax *mm, double val) * across all processes. * Return: TOTAL_MM - the total of all of these. * Programmer: Bill Wendling, 21. December 2001 - * Modifications: - * Changed to use seconds instead of MB/s - QAK, 5/9/02 */ static minmax accumulate_minmax_stuff(minmax *mm, int count) @@ -924,7 +908,6 @@ accumulate_minmax_stuff(minmax *mm, int count) * Return: SUCCESS on success. * FAIL otherwise. * Programmer: Bill Wendling, 19. December 2001 - * Modifications: */ static int create_comm_world(int num_procs, int *doing_pio) @@ -983,7 +966,6 @@ error_done: * Return: SUCCESS on success. * FAIL otherwise. * Programmer: Bill Wendling, 19. December 2001 - * Modifications: */ static int destroy_comm_world(void) @@ -1003,7 +985,6 @@ destroy_comm_world(void) * minmax & # of iterations. * Return: Nothing * Programmer: Quincey Koziol, 9. May 2002 - * Modifications: */ static void output_results(const struct options *opts, const char *name, minmax *table, int table_size, off_t data_size) @@ -1067,7 +1048,6 @@ output_times(const struct options *opts, const char *name, minmax *table, int ta * Purpose: Print a line of the report. Only do so if I'm the 0 process. * Return: Nothing * Programmer: Bill Wendling, 19. December 2001 - * Modifications: */ static void output_report(const char *fmt, ...) @@ -1266,8 +1246,6 @@ report_parameters(struct options *opts) * structure which will need to be freed by the calling function. * Return: Pointer to an OPTIONS structure * Programmer: Bill Wendling, 31. October 2001 - * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) */ static struct options * parse_command_line(int argc, const char *const *argv) @@ -1518,7 +1496,6 @@ parse_command_line(int argc, const char *const *argv) * If an unknown size indicator is used, then the program will * exit with EXIT_FAILURE as the return value. * Programmer: Bill Wendling, 18. December 2001 - * Modifications: */ static off_t parse_size_directive(const char *size) @@ -1559,8 +1536,6 @@ parse_size_directive(const char *size) * Purpose: Print a usage message and then exit. * Return: Nothing * Programmer: Bill Wendling, 31. October 2001 - * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) */ static void usage(const char *prog) diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index 376fc0b..b80189b 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -282,7 +282,6 @@ done: * USER or LOGIN are specified in the environment. * Return: Pointer to filename or NULL * Programmer: Bill Wendling, 21. November 2001 - * Modifications: Support for file drivers. Christian Chilan, April, 2008 */ static char * sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size, parameters *param) @@ -403,7 +402,6 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si * Purpose: Write the required amount of data to the file. * Return: SUCCESS or FAIL * Programmer: Christian Chilan, April, 2008 - * Modifications: */ static herr_t do_write(results *res, file_descr *fd, parameters *parms, void *buffer) @@ -618,7 +616,6 @@ done: * Purpose: Write buffer into the dataset. * Return: SUCCESS or FAIL * Programmer: Christian Chilan, April, 2008 - * Modifications: */ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) @@ -701,7 +698,6 @@ done: * Purpose: Write buffer into the POSIX file considering contiguity. * Return: SUCCESS or FAIL * Programmer: Christian Chilan, April, 2008 - * Modifications: */ static herr_t @@ -762,7 +758,6 @@ done: * Purpose: Read the required amount of data to the file. * Return: SUCCESS or FAIL * Programmer: Christian Chilan, April, 2008 - * Modifications: */ static herr_t do_read(results *res, file_descr *fd, parameters *parms, void *buffer) @@ -940,7 +935,6 @@ done: * Purpose: Read buffer into the dataset. * Return: SUCCESS or FAIL * Programmer: Christian Chilan, April, 2008 - * Modifications: */ static herr_t @@ -1002,7 +996,6 @@ done: * Purpose: Read buffer into the POSIX file considering contiguity. * Return: SUCCESS or FAIL * Programmer: Christian Chilan, April, 2008 - * Modifications: */ static herr_t @@ -1057,7 +1050,6 @@ done: * Purpose: Open the specified file. * Return: SUCCESS or FAIL * Programmer: Albert Cheng, Bill Wendling, 2001/12/13 - * Modifications: Support for file drivers, Christian Chilan, April, 2008 */ static herr_t do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) @@ -1223,7 +1215,6 @@ set_vfd(parameters *param) * Purpose: Close the specified file descriptor. * Return: SUCCESS or FAIL * Programmer: Albert Cheng, Bill Wendling, 2001/12/13 - * Modifications: */ static herr_t do_fclose(iotype iot, file_descr *fd /*out*/) diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index fc300fb..ef9e7db 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -182,7 +182,6 @@ static void report_parameters(struct options *opts); * Purpose: Start things up. * Return: EXIT_SUCCESS or EXIT_FAILURE * Programmer: Bill Wendling, 30. October 2001 - * Modifications: */ int main(int argc, char *argv[]) @@ -237,8 +236,6 @@ finish: * * Return: Nothing * Programmer: Bill Wendling, 30. October 2001 - * Modifications: - * Added multidimensional testing (Christian Chilan, April, 2008) */ static void run_test_loop(struct options *opts) @@ -292,7 +289,6 @@ run_test_loop(struct options *opts) * Purpose: Inner loop call to actually run the I/O test. * Return: Nothing * Programmer: Bill Wendling, 18. December 2001 - * Modifications: */ static int run_test(iotype iot, parameters parms, struct options *opts) @@ -524,7 +520,6 @@ run_test(iotype iot, parameters parms, struct options *opts) * Purpose: * Return: Nothing * Programmer: Bill Wendling, 29. January 2002 - * Modifications: */ static void output_all_info(minmax *mm, int count, int indent_level) @@ -546,8 +541,6 @@ output_all_info(minmax *mm, int count, int indent_level) * Purpose: Gather all the min, max and total of val. * Return: Nothing * Programmer: Bill Wendling, 21. December 2001 - * Modifications: - * Use MPI_Allreduce to do it. -akc, 2002/01/11 */ static void @@ -564,8 +557,6 @@ get_minmax(minmax *mm, double val) * across all processes. * Return: TOTAL_MM - the total of all of these. * Programmer: Bill Wendling, 21. December 2001 - * Modifications: - * Changed to use seconds instead of MB/s - QAK, 5/9/02 */ static void accumulate_minmax_stuff(const minmax *mm, int count, minmax *total_mm) @@ -596,7 +587,6 @@ accumulate_minmax_stuff(const minmax *mm, int count, minmax *total_mm) * minmax & # of iterations. * Return: Nothing * Programmer: Quincey Koziol, 9. May 2002 - * Modifications: */ static void output_results(const struct options *opts, const char *name, minmax *table, int table_size, off_t data_size) @@ -637,7 +627,6 @@ output_results(const struct options *opts, const char *name, minmax *table, int * Purpose: Print a line of the report. Only do so if I'm the 0 process. * Return: Nothing * Programmer: Bill Wendling, 19. December 2001 - * Modifications: */ static void output_report(const char *fmt, ...) @@ -812,8 +801,6 @@ report_parameters(struct options *opts) * structure which will need to be freed by the calling function. * Return: Pointer to an OPTIONS structure * Programmer: Bill Wendling, 31. October 2001 - * Modifications: - * Added multidimensional testing (Christian Chilan, April, 2008) */ static struct options * parse_command_line(int argc, const char *const *argv) @@ -1180,7 +1167,6 @@ parse_command_line(int argc, const char *const *argv) * If an unknown size indicator is used, then the program will * exit with EXIT_FAILURE as the return value. * Programmer: Bill Wendling, 18. December 2001 - * Modifications: */ static hsize_t @@ -1225,7 +1211,6 @@ parse_size_directive(const char *size) * Purpose: Print a usage message and then exit. * Return: Nothing * Programmer: Bill Wendling, 31. October 2001 - * Modifications: */ static void usage(const char *prog) diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index d29c6e4..04d1723 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -335,18 +335,6 @@ attribute_stats(iter_t *iter, const H5O_info2_t *oi, const H5O_native_info_t *na * Programmer: Quincey Koziol * Tuesday, August 16, 2005 * - * Modifications: Refactored code from the walk_function - * EIP, Wednesday, August 16, 2006 - * - * Vailin Choi 12 July 2007 - * 1. Gathered storage info for btree and heap - * (groups and attributes) - * 2. Gathered info for attributes - * - * Vailin Choi 14 July 2007 - * Cast "num_objs" and "num_attrs" to size_t - * Due to the -Mbounds problem for the pgi-32 bit compiler on indexing - * *------------------------------------------------------------------------- */ static herr_t @@ -1103,8 +1091,6 @@ iter_free(iter_t *iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1190,11 +1176,6 @@ print_file_metadata(const iter_t *iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * bug #1253; Oct 6th 2008; Vailin Choi - * Fixed segmentation fault: print iter->group_bins[0] when - * there is iter->group_nbins - * *------------------------------------------------------------------------- */ static herr_t @@ -1636,8 +1617,6 @@ print_file_statistics(const iter_t *iter) * Programmer: Elena Pourmal * Thursday, August 17, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -1658,8 +1637,6 @@ print_object_statistics(const char *name) * Programmer: Elena Pourmal * Thursday, August 17, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -1674,10 +1651,6 @@ print_statistics(const char *name, const iter_t *iter) /*------------------------------------------------------------------------- * Function: main * - * Modifications: - * 2/2010; Vailin Choi - * Get the size of user block - * *------------------------------------------------------------------------- */ int diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index ac10944..c01ec0f 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -45,8 +45,6 @@ * Programmer: Robb Matzke * Wednesday, May 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -146,8 +144,6 @@ get_size(const char *progname, int *argno, int argc, char *argv[]) * Programmer: Robb Matzke * Wednesday, May 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ H5_GCC_CLANG_DIAG_OFF("format-nonliteral") diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in index ee7bc8b..e3f0f01 100644 --- a/tools/test/h5diff/h5diff_plugin.sh.in +++ b/tools/test/h5diff/h5diff_plugin.sh.in @@ -82,7 +82,7 @@ if [ $? != 0 ]; then fi # setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}:${HDF5_PLUGIN_PATH}" # # copy test files and expected output files from source dirs to test dir diff --git a/tools/test/h5dump/binread.c b/tools/test/h5dump/binread.c index 484e354..2315e85 100644 --- a/tools/test/h5dump/binread.c +++ b/tools/test/h5dump/binread.c @@ -39,8 +39,6 @@ * * Programmer: Pedro Vicente Nunes * - * Modifications: - * *------------------------------------------------------------------------- */ static void diff --git a/tools/test/h5dump/h5dump_plugin.sh.in b/tools/test/h5dump/h5dump_plugin.sh.in index b2f9f31..d9b77ee 100644 --- a/tools/test/h5dump/h5dump_plugin.sh.in +++ b/tools/test/h5dump/h5dump_plugin.sh.in @@ -88,7 +88,7 @@ if [ $? != 0 ]; then fi # setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}:${HDF5_PLUGIN_PATH}" # # copy test files and expected output files from source dirs to test dir diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 7e8e19b..1fd512c 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -7175,10 +7175,6 @@ gent_fs_strategy_threshold(void) * Create one dataset with (set_chunk, fixed dims, fixed max. dims) * so that Fixed Array indexing will be used. * - * Modifications: - * Fixed Array indexing will be used for chunked dataset - * with fixed max. dims setting. - * */ static void gent_dataset_idx(void) diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in index 48f6e1e..02e0cf7 100644 --- a/tools/test/h5ls/h5ls_plugin.sh.in +++ b/tools/test/h5ls/h5ls_plugin.sh.in @@ -88,7 +88,7 @@ if [ $? != 0 ]; then fi # setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}:${HDF5_PLUGIN_PATH}" # # copy test files and expected output files from source dirs to test dir diff --git a/tools/test/h5repack/h5repack_plugin.sh.in b/tools/test/h5repack/h5repack_plugin.sh.in index 14bcbbf..bd7c3a1 100644 --- a/tools/test/h5repack/h5repack_plugin.sh.in +++ b/tools/test/h5repack/h5repack_plugin.sh.in @@ -98,7 +98,7 @@ if [ $? != 0 ]; then fi # setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}" +ENVCMD="env HDF5_PLUGIN_PATH=../${PLUGIN_LIBDIR}:${HDF5_PLUGIN_PATH}" COPY_TESTFILES_TO_TESTDIR() { diff --git a/tools/test/h5repack/testh5repack_detect_szip.c b/tools/test/h5repack/testh5repack_detect_szip.c index f4e4aec..b2be484 100644 --- a/tools/test/h5repack/testh5repack_detect_szip.c +++ b/tools/test/h5repack/testh5repack_detect_szip.c @@ -30,10 +30,6 @@ * * Date: * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in index 9cbedce..65e40c4 100644 --- a/tools/test/h5stat/testh5stat.sh.in +++ b/tools/test/h5stat/testh5stat.sh.in @@ -12,10 +12,6 @@ # # Tests for the h5stat tool # -# Modifications: -# Vailin Choi; July 2013 -# Add tests for -l, -m, -a options -# srcdir=@srcdir@ diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c index 27ada87..3f4b3d7 100644 --- a/tools/test/perform/chunk.c +++ b/tools/test/perform/chunk.c @@ -97,8 +97,6 @@ const H5Z_class2_t H5Z_COUNTER[1] = {{ * Programmer: Robb Matzke * Thursday, May 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t @@ -123,8 +121,6 @@ counter(unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, * Programmer: Robb Matzke * Thursday, May 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -175,8 +171,6 @@ create_dataset(void) * Programmer: Robb Matzke * Thursday, May 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static double @@ -247,8 +241,6 @@ test_rowmaj(int op, size_t cache_size, size_t io_size) * Programmer: Robb Matzke * Friday, May 15, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static double @@ -318,8 +310,6 @@ test_diag(int op, size_t cache_size, size_t io_size, size_t offset) * Programmer: Robb Matzke * Thursday, May 14, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 69a8251..257d3ec 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -62,8 +62,6 @@ typedef enum fill_t { FILL_ALL, FILL_FORWARD, FILL_REVERSE, FILL_INWARD, FILL_OU * Programmer: Robb Matzke * Wednesday, September 30, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -111,8 +109,6 @@ usage(const char *prog) * Programmer: Robb Matzke * Thursday, June 4, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -135,8 +131,6 @@ cleanup(void) * Programmer: Robb Matzke * Wednesday, March 4, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -160,8 +154,6 @@ display_error_cb(hid_t estack, void H5_ATTR_UNUSED *client_data) * Programmer: Robb Matzke * Wednesday, September 30, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -333,8 +325,6 @@ error: * Programmer: Robb Matzke * Monday, September 28, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index 94fe849..6e62f6a 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -68,13 +68,11 @@ void print_perf(p_time, p_time, p_time); /*------------------------------------------------------------------------- * Function: parse_options * - Purpose: Parse command line options + * Purpose: Parse command line options * * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static int @@ -188,13 +186,11 @@ parse_options(int argc, char **argv) /*------------------------------------------------------------------------- * Function: usage * - Purpose: Prints help page + * Purpose: Prints help page * * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static void @@ -248,8 +244,6 @@ usage(void) * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -288,8 +282,6 @@ error: * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -330,8 +322,6 @@ error: * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -435,8 +425,6 @@ error: * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -538,8 +526,6 @@ error: * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -644,8 +630,6 @@ error: * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ double @@ -674,8 +658,6 @@ retrieve_time(void) * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -728,8 +710,6 @@ perf(p_time *perf_t, double start_t, double end_t) * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -756,8 +736,6 @@ print_perf(p_time open_t, p_time close_t, p_time attr_t) * Programmer: Raymond Lu * Friday, Oct 3, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ int diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 1265c30..256289c 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -77,7 +77,6 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, * Function: error * Purpose: Display error message and exit. * Programmer: Bill Wendling, 05. June 2002 - * Modifications: */ static void error(const char *fmt, ...) @@ -99,7 +98,6 @@ error(const char *fmt, ...) * Purpose: Cleanup the output file. * Returns: Nothing * Programmer: Bill Wendling, 06. June 2002 - * Modifications: */ static void cleanup(void) @@ -164,7 +162,6 @@ write_file(Bytef *source, uLongf sourceLen) * Z_BUF_ERROR - not enough room in the output buffer * Z_STREAM_ERROR - level parameter is invalid * Programmer: Bill Wendling, 05. June 2002 - * Modifications: */ static void compress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) @@ -192,33 +189,12 @@ compress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceL } } -#ifdef LATER -/* - * Function: uncompress_buffer - * Purpose: Uncompress the buffer. - * Returns: Z_OK - success - * Z_MEM_ERROR - not enough memory - * Z_BUF_ERROR - not enough room in the output buffer - * Z_DATA_ERROR - the input data was corrupted - * Programmer: Bill Wendling, 05. June 2002 - * Modifications: - */ -static int -uncompress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) -{ - int rc = uncompress(dest, destLen, source, sourceLen); - - return rc; -} -#endif /* LATER */ - /* * Function: get_unique_name * Purpose: Create a new file who's name doesn't conflict with * pre-existing files. * Returns: Nothing * Programmer: Bill Wendling, 06. June 2002 - * Modifications: */ #define ZIP_PERF_FILE "zip_perf.data" static void @@ -255,7 +231,6 @@ get_unique_name(void) * Purpose: Print a usage message and then exit. * Return: Nothing * Programmer: Bill Wendling, 05. June 2002 - * Modifications: */ static void usage(void) @@ -298,7 +273,6 @@ usage(void) * If an unknown size indicator is used, then the program will * exit with EXIT_FAILURE as the return value. * Programmer: Bill Wendling, 05. June 2002 - * Modifications: */ static unsigned long parse_size_directive(const char *size) @@ -487,7 +461,6 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long * Purpose: Run the program * Return: EXIT_SUCCESS or EXIT_FAILURE * Programmer: Bill Wendling, 05. June 2002 - * Modifications: */ int main(int argc, char *argv[]) @@ -575,7 +548,6 @@ main(int argc, char *argv[]) * zlib stuff. * Return: EXIT_SUCCESS * Programmer: Bill Wendling, 10. June 2002 - * Modifications: */ int main(void) diff --git a/utils/tools/h5dwalk/h5dwalk.c b/utils/tools/h5dwalk/h5dwalk.c index e91fd19..acb1724 100644 --- a/utils/tools/h5dwalk/h5dwalk.c +++ b/utils/tools/h5dwalk/h5dwalk.c @@ -1694,8 +1694,6 @@ main(int argc, char *argv[]) * * Comments: * - * Modifications: - * *------------------------------------------------------------------------- */ H5_ATTR_NORETURN void -- cgit v0.12
Direct#H5FD_DIRECTThis is the #H5FD_SEC2 driver except data is written to or + * This is the #H5FD_SEC2 driver, except data is written to or * read from the file synchronously without being cached by the * system.H5Pset_fapl_direct()Multi#H5FD_MULTIWith this driver, data can be stored in multiple files - * according to the type of the data. I/O might work better if + * according to the type of data. I/O might work better if * data is stored in separate files based on the type of data. * The Split driver is a special case of this driver.H5Pset_fapl_multi()