mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
Merge branch 'develop' into c_stdlib_posix_call_cleanup
This commit is contained in:
commit
32ea4e72f1
@ -27,7 +27,15 @@ if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MAT
|
||||
set (TGZPATH ${HDF5_SOURCE_DIR})
|
||||
endif ()
|
||||
set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME})
|
||||
if (NOT EXISTS "${ZLIB_URL}")
|
||||
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
|
||||
message (STATUS "Filter ZLIB file ${ZLIB_URL} not found")
|
||||
endif ()
|
||||
set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME})
|
||||
if (NOT EXISTS "${SZIP_URL}")
|
||||
set (HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
|
||||
message (STATUS "Filter SZIP file ${SZIP_URL} not found")
|
||||
endif ()
|
||||
else ()
|
||||
set (ZLIB_USE_EXTERNAL 0)
|
||||
set (SZIP_USE_EXTERNAL 0)
|
||||
|
@ -104,6 +104,12 @@ endif ()
|
||||
# Configure the hdf5-config-version .cmake file for the install directory
|
||||
#-----------------------------------------------------------------------------
|
||||
if (NOT HDF5_EXTERNALLY_CONFIGURED)
|
||||
# 3.11 or greater
|
||||
#write_basic_package_version_file (
|
||||
# ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake
|
||||
# VERSION ${HDF5_PACKAGE_VERSION}
|
||||
# COMPATIBILITY SameMinorVersion
|
||||
#)
|
||||
configure_file (
|
||||
${HDF_RESOURCES_DIR}/hdf5-config-version.cmake.in
|
||||
${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY
|
||||
@ -134,7 +140,7 @@ install (
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure the HDF518_Examples.cmake file and the examples
|
||||
# Configure the HDF5_Examples.cmake file and the examples
|
||||
#-----------------------------------------------------------------------------
|
||||
option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF)
|
||||
if (HDF5_PACK_EXAMPLES)
|
||||
|
@ -10,7 +10,7 @@ project (HDF5 C)
|
||||
# set CMAKE_INSTALL_PREFIX to the required install path.
|
||||
# Make install can be used to install all components for system-wide use.
|
||||
#
|
||||
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||
MESSAGE(FATAL_ERROR "\nERROR! ${PROJECT_NAME} DOES NOT SUPPORT IN SOURCE BUILDS!\n"
|
||||
"CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
" == CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}\n"
|
||||
@ -314,7 +314,7 @@ set (HDF5_PACKAGE_NAME "HDF5")
|
||||
set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}")
|
||||
set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}")
|
||||
set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}")
|
||||
if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "")
|
||||
if (H5_VERS_SUBRELEASE)
|
||||
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}")
|
||||
else ()
|
||||
set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}")
|
||||
@ -481,6 +481,15 @@ if (HDF5_MEMORY_ALLOC_SANITY_CHECK)
|
||||
set (H5_MEMORY_ALLOC_SANITY_CHECK 1)
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to enable/disable using pread/pwrite for VFDs
|
||||
#-----------------------------------------------------------------------------
|
||||
option (HDF5_ENABLE_PREADWRITE "Use pread/pwrite in sec2/log/core VFDs in place of read/write (when available)" ON)
|
||||
mark_as_advanced (HDF5_ENABLE_PREADWRITE)
|
||||
if (HDF5_ENABLE_PREADWRITE AND H5_HAVE_PREAD AND H5_HAVE_PWRITE)
|
||||
set (H5_HAVE_PREADWRITE 1)
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Option to use deprecated public API symbols
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -749,6 +758,11 @@ if (BUILD_TESTING)
|
||||
"Timeout in seconds for each test (default 1200=20minutes)"
|
||||
)
|
||||
|
||||
# Generate a list of timeouts based on DART_TESTING_TIMEOUT
|
||||
math (EXPR CTEST_SHORT_TIMEOUT "${DART_TESTING_TIMEOUT} / 2")
|
||||
math (EXPR CTEST_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 2")
|
||||
math (EXPR CTEST_VERY_LONG_TIMEOUT "${DART_TESTING_TIMEOUT} * 3")
|
||||
|
||||
option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF)
|
||||
mark_as_advanced (HDF5_TEST_VFD)
|
||||
if (HDF5_TEST_VFD)
|
||||
@ -826,25 +840,20 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _")
|
||||
if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran")
|
||||
option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF)
|
||||
if (HDF5_BUILD_FORTRAN)
|
||||
|
||||
option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON)
|
||||
|
||||
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
|
||||
|
||||
message (STATUS "Fortran compiler ID is ${CMAKE_Fortran_COMPILER_ID}")
|
||||
# Building with PGI requires CMake 3.3 or greater because previous versions
|
||||
# of CMake add the wrong compiler flag for the PGI Fortran compiler.
|
||||
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "PGI" AND "${CMAKE_VERSION}" VERSION_LESS "3.3")
|
||||
if (CMAKE_Fortran_COMPILER_ID MATCHES "PGI" AND CMAKE_VERSION VERSION_LESS "3.3")
|
||||
message (FATAL_ERROR " **** PGI FORTRAN REQUIRES CMAKE VERSION 3.3 OR GREATER **** ")
|
||||
endif ()
|
||||
|
||||
include (${HDF_RESOURCES_DIR}/HDF5UseFortran.cmake)
|
||||
set (LINK_Fortran_LIBS ${LINK_LIBS})
|
||||
|
||||
if (HDF5_ENABLE_F2003)
|
||||
if (NOT FORTRAN_HAVE_ISO_C_BINDING)
|
||||
set (HDF5_ENABLE_F2003 OFF)
|
||||
endif ()
|
||||
if (NOT H5_FORTRAN_HAVE_ISO_C_BINDING)
|
||||
message (FATAL_ERROR " **** Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, disable HDF5_BUILD_FORTRAN **** ")
|
||||
endif ()
|
||||
|
||||
# Parallel IO usage requires MPI to be Linked and Included
|
||||
|
@ -45,9 +45,9 @@ set (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=
|
||||
set (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
|
||||
set (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
|
||||
|
||||
set (CTEST_TEST_TIMEOUT 600 CACHE STRING
|
||||
set (CTEST_TEST_TIMEOUT 1200 CACHE STRING
|
||||
"Maximum time allowed before CTest will kill the test.")
|
||||
set (DART_TESTING_TIMEOUT 600 CACHE STRING
|
||||
set (DART_TESTING_TIMEOUT 1200 CACHE STRING
|
||||
"Maximum time allowed before CTest will kill the test." FORCE)
|
||||
|
||||
SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING
|
||||
|
41
MANIFEST
41
MANIFEST
@ -92,6 +92,10 @@
|
||||
./bin/timekeeper _DO_NOT_DISTRIBUTE_
|
||||
./bin/trace
|
||||
./bin/yodconfigure
|
||||
./bin/batch/cori_ctestP.sl.in.cmake
|
||||
./bin/batch/cori_ctestS.sl.in.cmake
|
||||
./bin/batch/cori_knl_ctestP.sl.in.cmake
|
||||
./bin/batch/cori_knl_ctestS.sl.in.cmake
|
||||
./bin/batch/ctestP.lsf.in.cmake
|
||||
./bin/batch/ctestP.sl.in.cmake
|
||||
./bin/batch/ctestS.lsf.in.cmake
|
||||
@ -99,6 +103,9 @@
|
||||
./bin/batch/knl_ctestP.sl.in.cmake
|
||||
./bin/batch/knl_ctestS.sl.in.cmake
|
||||
./bin/batch/knl_H5detect.sl.in.cmake
|
||||
./bin/batch/ray_ctestP.lsf.in.cmake
|
||||
./bin/batch/ray_ctestS.lsf.in.cmake
|
||||
./bin/batch/raybsub
|
||||
./bin/pkgscrpts/h5rmflags _DO_NOT_DISTRIBUTE_
|
||||
./bin/pkgscrpts/makeHDF5BinaryTarfiles.pl _DO_NOT_DISTRIBUTE_
|
||||
./bin/pkgscrpts/makeInternalREADME.pl _DO_NOT_DISTRIBUTE_
|
||||
@ -455,6 +462,7 @@
|
||||
./release_docs/INSTALL_Warnings.txt
|
||||
./release_docs/INSTALL_Windows.txt
|
||||
./release_docs/RELEASE.txt
|
||||
./release_docs/README_HPC
|
||||
./release_docs/USING_HDF5_CMake.txt
|
||||
./release_docs/USING_HDF5_VS.txt
|
||||
|
||||
@ -1057,6 +1065,7 @@
|
||||
./test/le_extlink2.h5
|
||||
./test/lheap.c
|
||||
./test/links.c
|
||||
./test/memleak_H5O_dtype_decode_helper_H5Odtype.h5
|
||||
./test/mergemsg.h5
|
||||
./test/mf.c
|
||||
./test/mount.c
|
||||
@ -2891,6 +2900,32 @@
|
||||
./java/src/jni/h5oImp.h
|
||||
./java/src/jni/h5pImp.c
|
||||
./java/src/jni/h5pImp.h
|
||||
./java/src/jni/h5pACPLImp.c
|
||||
./java/src/jni/h5pACPLImp.h
|
||||
./java/src/jni/h5pDAPLImp.c
|
||||
./java/src/jni/h5pDAPLImp.h
|
||||
./java/src/jni/h5pDCPLImp.c
|
||||
./java/src/jni/h5pDCPLImp.h
|
||||
./java/src/jni/h5pDXPLImp.c
|
||||
./java/src/jni/h5pDXPLImp.h
|
||||
./java/src/jni/h5pFAPLImp.c
|
||||
./java/src/jni/h5pFAPLImp.h
|
||||
./java/src/jni/h5pFCPLImp.c
|
||||
./java/src/jni/h5pFCPLImp.h
|
||||
./java/src/jni/h5pGAPLImp.c
|
||||
./java/src/jni/h5pGAPLImp.h
|
||||
./java/src/jni/h5pGCPLImp.c
|
||||
./java/src/jni/h5pGCPLImp.h
|
||||
./java/src/jni/h5pLAPLImp.c
|
||||
./java/src/jni/h5pLAPLImp.h
|
||||
./java/src/jni/h5pLCPLImp.c
|
||||
./java/src/jni/h5pLCPLImp.h
|
||||
./java/src/jni/h5pOCPLImp.c
|
||||
./java/src/jni/h5pOCPLImp.h
|
||||
./java/src/jni/h5pOCpyPLImp.c
|
||||
./java/src/jni/h5pOCpyPLImp.h
|
||||
./java/src/jni/h5pStrCPLImp.c
|
||||
./java/src/jni/h5pStrCPLImp.h
|
||||
./java/src/jni/h5plImp.c
|
||||
./java/src/jni/h5plImp.h
|
||||
./java/src/jni/h5rImp.c
|
||||
@ -3250,7 +3285,6 @@
|
||||
|
||||
# CMake-specific Examples Files
|
||||
./config/cmake/HDF5_Examples.cmake.in
|
||||
./config/cmake/HDF518_Examples.cmake.in
|
||||
./release_docs/USING_CMake_Examples.txt
|
||||
|
||||
./CMakeLists.txt
|
||||
@ -3362,6 +3396,11 @@
|
||||
./config/cmake/scripts/HDF5config.cmake
|
||||
./config/cmake/scripts/HDF5options.cmake
|
||||
|
||||
# CMake-specific HPC Scripts
|
||||
./config/cmake/scripts/HPC/sbatch-HDF5options.cmake
|
||||
./config/cmake/scripts/HPC/bsub-HDF5options.cmake
|
||||
./config/cmake/scripts/HPC/raybsub-HDF5options.cmake
|
||||
|
||||
# Files generated by autogen
|
||||
./aclocal.m4
|
||||
./bin/compile
|
||||
|
17
bin/batch/cori_ctestP.sl.in.cmake
Normal file
17
bin/batch/cori_ctestP.sl.in.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SBATCH -C haswell
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH -t 00:30:00
|
||||
#SBATCH --mail-type=BEGIN,END,FAIL
|
||||
##SBATCH --mail-user=<username>@sandia.gov
|
||||
#SBATCH --export=ALL
|
||||
#SBATCH --job-name=h5_ctestP
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestP.out"
|
||||
$CMD >& ctestP.out
|
||||
echo "Done running $CMD"
|
||||
|
16
bin/batch/cori_ctestS.sl.in.cmake
Normal file
16
bin/batch/cori_ctestS.sl.in.cmake
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SBATCH -C haswell
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH -t 00:30:00
|
||||
#SBATCH --mail-type=BEGIN,END,FAIL
|
||||
##SBATCH --mail-user=<username>@sandia.gov
|
||||
#SBATCH --export=ALL
|
||||
#SBATCH --job-name=h5_ctestS
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
CMD="ctest . -E MPI_TEST_ -C Release -j 32 -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestS.out"
|
||||
$CMD >& ctestS.out
|
||||
echo "Done running $CMD"
|
17
bin/batch/cori_knl_ctestP.sl.in.cmake
Normal file
17
bin/batch/cori_knl_ctestP.sl.in.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SBATCH -C knl,quad,cache
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH -t 00:30:00
|
||||
#SBATCH --mail-type=BEGIN,END,FAIL
|
||||
##SBATCH --mail-user=<username>@sandia.gov
|
||||
#SBATCH --export=ALL
|
||||
#SBATCH --job-name=h5_ctestP
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestP.out"
|
||||
$CMD >& ctestP.out
|
||||
echo "Done running $CMD"
|
||||
|
16
bin/batch/cori_knl_ctestS.sl.in.cmake
Normal file
16
bin/batch/cori_knl_ctestS.sl.in.cmake
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SBATCH -C knl,quad,cache
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH -t 00:30:00
|
||||
#SBATCH --mail-type=BEGIN,END,FAIL
|
||||
##SBATCH --mail-user=<username>@sandia.gov
|
||||
#SBATCH --export=ALL
|
||||
#SBATCH --job-name=h5_ctestS
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
CMD="ctest . -E MPI_TEST_ -C Release -j 32 -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestS.out"
|
||||
$CMD >& ctestS.out
|
||||
echo "Done running $CMD"
|
@ -5,10 +5,10 @@
|
||||
#SBATCH --mail-type=BEGIN,END,FAIL
|
||||
##SBATCH --mail-user=<username>@sandia.gov
|
||||
#SBATCH --export=ALL
|
||||
#SBATCH --job-name=h5_ctestS
|
||||
#SBATCH --job-name=h5_ctestP
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
CMD="ctest . -R TEST_PAR|PH5DIFF|PERFORM -E t_cache_image -C Release -T test"
|
||||
CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestP.out"
|
||||
$CMD >& ctestP.out
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
echo "Run command. Test output will be in build/ctestS.out"
|
||||
ctest . -E 'TEST_PAR|H5DIFF|PERFORM' -C Release -j 32 -T test >& ctestS.out
|
||||
ctest . -E 'TEST_PAR|PH5DIFF|PERFORM' -C Release -j 32 -T test >& ctestS.out
|
||||
|
||||
##$CMD >& ctestS.out
|
||||
echo "Done running command."
|
||||
|
@ -8,7 +8,7 @@
|
||||
#SBATCH --job-name=h5_ctestS
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
CMD="ctest . -E TEST_PAR|H5DIFF|PERFORM -C Release -j 32 -T test"
|
||||
CMD="ctest . -E MPI_TEST_ -C Release -j 32 -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestS.out"
|
||||
$CMD >& ctestS.out
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SBATCH -C knl,quad,cache
|
||||
#SBATCH -p knl -C quad,cache
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH -t 00:30:00
|
||||
#SBATCH --mail-type=BEGIN,END,FAIL
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
#run parallel tests except t_cache_image test
|
||||
CMD="ctest . -R TEST_PAR|PH5DIFF|PERFORM -E t_cache_image -C Release -T test"
|
||||
CMD="ctest . -R MPI_TEST_ -E t_cache_image -C Release -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestP.out"
|
||||
$CMD >& ctestP.out
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
#SBATCH -C knl,quad,cache
|
||||
#SBATCH -p knl -C quad,cache
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH -t 00:30:00
|
||||
#SBATCH --mail-type=BEGIN,END,FAIL
|
||||
@ -9,7 +9,7 @@
|
||||
#SBATCH --job-name=h5_ctestS
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
CMD="ctest . -E TEST_PAR|H5DIFF|PERFORM -C Release -j 32 -T test"
|
||||
CMD="ctest . -E MPI_TEST_ -C Release -j 32 -T test"
|
||||
|
||||
echo "Run $CMD. Test output will be in build/ctestS.out"
|
||||
$CMD >& ctestS.out
|
||||
|
20
bin/batch/ray_ctestP.lsf.in.cmake
Normal file
20
bin/batch/ray_ctestP.lsf.in.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/tcsh
|
||||
### LSF syntax
|
||||
#BSUB -n 6 #number of nodes
|
||||
#BSUB -R "span[ptile=6]"
|
||||
#BSUB -W 30 #walltime in minutes
|
||||
#BSUB -G guests #account
|
||||
#BSUB -e ctestPerrors.txt #stderr
|
||||
#BSUB -o ctestPoutput.txt #stdout
|
||||
#BSUB -J hdf5_ctestP #job
|
||||
##BSUB -q pbatch #queue to use
|
||||
#BSUB -q pdebug
|
||||
|
||||
##date; hostname
|
||||
##echo -n 'JobID is '; echo $LSB_JOBID
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
echo "Run parallel test command. Test output will be in build/ctestP.out"
|
||||
ctest . -R 'MPI_TEST_' -E t_cache_image -C Release -T test >& ctestP.out
|
||||
|
||||
echo "Done running ctest parallel command."
|
18
bin/batch/ray_ctestS.lsf.in.cmake
Normal file
18
bin/batch/ray_ctestS.lsf.in.cmake
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/tcsh
|
||||
### LSF syntax
|
||||
#BSUB -n 1 #number of nodes
|
||||
#BSUB -W 29 #walltime in minutes
|
||||
#BSUB -G guests #account
|
||||
#BSUB -e ctestSerrors.txt #stderr
|
||||
#BSUB -o ctestSoutput.txt #stdout
|
||||
#BSUB -J hdf5_ctestS #job
|
||||
##BSUB -q pbatch #queue to use
|
||||
#BSUB -q pdebug
|
||||
|
||||
cd @HDF5_BINARY_DIR@
|
||||
echo "Run command. Test output will be in build/ctestS.out"
|
||||
ctest . -E 'MPI_TEST_' -C Release -j 32 -T test >& ctestS.out
|
||||
|
||||
##$CMD >& ctestS.out
|
||||
echo "Done running command."
|
||||
|
7
bin/batch/raybsub
Executable file
7
bin/batch/raybsub
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/tcsh
|
||||
|
||||
# ray.llnl.gov requires a '<' with bsub for submitting .lsf batch jobs.
|
||||
# CMake is reluctant to pass the '<', so we put it in this script and use
|
||||
# the script to submit the bsub command on ray.
|
||||
|
||||
bsub < $1
|
110
bin/release
110
bin/release
@ -55,13 +55,21 @@ for compressing the resulting tar archive (if none are given then
|
||||
|
||||
tar -- use tar and don't do any compressing.
|
||||
gzip -- use gzip with "-9" and append ".gz" to the output name.
|
||||
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
|
||||
zip -- convert all text files to DOS style and form a zip file for Windows use.
|
||||
cmake-tgz -- create a tar file using the gzip default level with a build-unix.sh
|
||||
command file and all other CMake files needed to build HDF5 source
|
||||
using CMake on unix machines.
|
||||
bzip2 -- use bzip2 with "-9" and append ".bz2" to the output name.
|
||||
zip -- convert all text files to DOS style and form a zip file for Windows use.
|
||||
cmake-zip -- convert all text files to DOS style and create a zip file inluding cmake
|
||||
scripts and .bat files to build HDF5 source using CMake on Windows.
|
||||
hpc-cmake-tgz
|
||||
-- create a tar file using the gzip default level with a build-unix.sh
|
||||
command file and all other CMake files needed to build HDF5 source
|
||||
using CMake on unix machines, with HDF5options.cmake files for serial
|
||||
and parallel builds on machines requiring batch jobs to run tests.
|
||||
The default is for parallel build, with serial only build by changing
|
||||
the HDF5options.cmake symlink to ser-HDF5options.cmake. More
|
||||
information is available in the README_HPC file.
|
||||
doc -- produce the latest doc tree in addition to the archive.
|
||||
|
||||
An md5 checksum is produced for each archive created and stored in the md5 file.
|
||||
@ -225,7 +233,7 @@ tar2cmakezip()
|
||||
# step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmziptmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmziptmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.10.10-Source.tar.gz $cmziptmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.12.4-Source.zip $cmziptmpsubdir
|
||||
cp $cmziptmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmziptmpsubdir
|
||||
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmziptmpsubdir
|
||||
cp $cmziptmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmziptmpsubdir
|
||||
@ -256,7 +264,7 @@ tar2cmakezip()
|
||||
}
|
||||
|
||||
# Function name: tar2cmaketgz
|
||||
# Convert the release tarball to a Windows zipball with files to run CMake build.
|
||||
# Convert the release tarball to a gzipped tar file with files to run CMake build.
|
||||
#
|
||||
# Programmer: Larry Knox
|
||||
# Creation date: 2017-02-20
|
||||
@ -320,7 +328,7 @@ tar2cmaketgz()
|
||||
# step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.10.10-Source.tar.gz $cmgztmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.12.4-Source.tar.gz $cmgztmpsubdir
|
||||
cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir
|
||||
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir
|
||||
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5options.cmake $cmgztmpsubdir
|
||||
@ -330,6 +338,93 @@ tar2cmaketgz()
|
||||
rm -rf $cmgztmpdir
|
||||
}
|
||||
|
||||
# Function name: tar2hpccmaketgz
|
||||
# Convert the release tarball to a gzipped tarfile with files to run CMake build
|
||||
# and HDF5options.cmake files for parallel or serial only builds where build
|
||||
# tests are run on compute nodes using batch scripts.
|
||||
#
|
||||
# Programmer: Larry Knox
|
||||
# Creation date: 2019-01-28
|
||||
#
|
||||
# Modifications
|
||||
#
|
||||
# Steps:
|
||||
# 1. untar the tarball in a temporary directory;
|
||||
# Note: do this in a temporary directory to avoid changing
|
||||
# the original source directory which may be around.
|
||||
# 2. add build-unix.sh script.
|
||||
# 3. add SZIP.tar.gz, ZLib.tar.gz and cmake files to top level directory.
|
||||
# 4. create gzipped tar file with these contents:
|
||||
# build-unix.sh script
|
||||
# hdf5-<version> source code directory extracted from tar file
|
||||
# CTestScript.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
||||
# HDF5config.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
||||
# HDF5options.cmake cmake file copied from <hdf5 source code>/config/cmake/scripts
|
||||
# SZip.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
|
||||
# ZLib.tar.gz copied from /mnt/scr1/pre-release/hdf5/CMake
|
||||
#
|
||||
# 5. For HPC-CMake tgz file the following are also needed in the top-level directory:
|
||||
# README_HPC copied from release_docs
|
||||
# ser-HDF5options.cmake copied from <hdf5 source code>/config/cmake/scripts/HPC
|
||||
# par-HDF5options.cmake copied from <hdf5 source code>/config/cmake/scripts/HPC
|
||||
# HDF5options.cmake symlink to par-HDF5options.cmake
|
||||
#
|
||||
|
||||
# Parameters:
|
||||
# $1 version
|
||||
# $2 release tarball
|
||||
# $3 output zipball file name
|
||||
#
|
||||
# Returns 0 if successful; 1 otherwise
|
||||
#
|
||||
# need function to create another temporary directory, extract the
|
||||
# $tmpdir/$HDF5_VERS.tar into it, create build-unix.sh,
|
||||
# add CTestScript.cmake, HDF5config.cmake, SZIP.tar.gz
|
||||
# ZLib.tar.gz, HDF5 examples, and then tar.gz it.
|
||||
tar2hpccmaketgz()
|
||||
{
|
||||
if [ $# -ne 3 ]; then
|
||||
echo "usage: tar2hpccmaketgz <tarfilename> <tgzfilename>"
|
||||
return 1
|
||||
fi
|
||||
cmgztmpdir=/tmp/cmgztmpdir$$
|
||||
cmgztmpsubdir=$cmgztmpdir/HPC-CMake-$HDF5_VERS
|
||||
mkdir -p $cmgztmpsubdir
|
||||
version=$1
|
||||
tarfile=$2
|
||||
tgzfile=$3
|
||||
|
||||
# step 1: untar tarball in cmgztmpdir
|
||||
(cd $cmgztmpsubdir; tar xf -) < $tarfile
|
||||
# sanity check
|
||||
if [ ! -d $cmgztmpsubdir/$version ]; then
|
||||
echo "untar did not create $cmgztmpsubdir/$version source dir"
|
||||
# cleanup
|
||||
rm -rf $cmgztmpdir
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# step 2: add build-unix.sh script
|
||||
(cd $cmgztmpsubdir; echo "ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log" > build-unix.sh; chmod 755 build-unix.sh)
|
||||
|
||||
# step 3: add SZIP.tar.gz, ZLib.tar.gz and cmake files
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/SZip.tar.gz $cmgztmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/ZLib.tar.gz $cmgztmpsubdir
|
||||
cp /mnt/scr1/pre-release/hdf5/CMake/HDF5Examples-1.12.4-Source.tar.gz $cmgztmpsubdir
|
||||
cp $cmgztmpsubdir/$version/config/cmake/scripts/CTestScript.cmake $cmgztmpsubdir
|
||||
cp $cmgztmpsubdir/$version/config/cmake/scripts/HDF5config.cmake $cmgztmpsubdir
|
||||
|
||||
cp $cmgztmpsubdir/$version/release_docs/README_HPC $cmgztmpsubdir
|
||||
cp $cmgztmpsubdir/$version/config/cmake/scripts/HPC/ser-HDF5options.cmake $cmgztmpsubdir
|
||||
cp $cmgztmpsubdir/$version/config/cmake/scripts/HPC/par-HDF5options.cmake $cmgztmpsubdir
|
||||
(cd $cmgztmpsubdir; ln -s par-HDF5options.cmake HDF5options.cmake)
|
||||
tar czf $DEST/HPC-CMake-$HDF5_VERS.tar.gz -C $cmgztmpdir . || exit 1
|
||||
|
||||
# cleanup
|
||||
rm -rf $cmgztmpdir
|
||||
}
|
||||
|
||||
# This command must be run at the top level of the hdf5 source directory.
|
||||
# Verify this requirement.
|
||||
if [ ! \( -f configure.ac -a -f bin/release \) ]; then
|
||||
@ -514,6 +609,11 @@ for comp in $methods; do
|
||||
tar2cmaketgz $HDF5_VERS $tmpdir/$HDF5_VERS.tar $DEST/CMake-$HDF5_VERS.tar.gz 1>&2
|
||||
(cd $DEST; md5sum CMake-$HDF5_VERS.tar.gz >> $MD5file)
|
||||
;;
|
||||
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; md5sum HPC-CMake-$HDF5_VERS.tar.gz >> $MD5file)
|
||||
;;
|
||||
bzip2)
|
||||
test "$verbose" && echo " Running bzip2..." 1>&2
|
||||
bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2
|
||||
|
@ -26,7 +26,7 @@
|
||||
SDSextendible.h5
|
||||
Select.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (CPP_ex-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "CPP_ex-clear-objects")
|
||||
@ -46,7 +46,7 @@
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "CPP_ex_${example}")
|
||||
@ -66,7 +66,7 @@
|
||||
h5tutr_groups.h5
|
||||
h5tutr_subset.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "CPP_ex_tutr-clear-objects")
|
||||
@ -86,7 +86,7 @@
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (CPP_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "CPP_ex_${example}")
|
||||
|
@ -12,9 +12,6 @@
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class LinkAccPropList represents the HDF5 file access property list and
|
||||
// inherits from DataType.
|
||||
|
||||
#ifndef __H5LinkAccPropList_H
|
||||
#define __H5LinkAccPropList_H
|
||||
|
||||
@ -22,15 +19,15 @@ namespace H5 {
|
||||
|
||||
/*! \class LinkAccPropList
|
||||
\brief Class LinkAccPropList inherits from PropList and provides
|
||||
wrappers for the HDF5 file access property list.
|
||||
wrappers for the HDF5 link access property list.
|
||||
*/
|
||||
// Inheritance: PropList -> IdComponent
|
||||
class H5_DLLCPP LinkAccPropList : public PropList {
|
||||
public:
|
||||
///\brief Default file access property list.
|
||||
///\brief Default link access property list.
|
||||
static const LinkAccPropList& DEFAULT;
|
||||
|
||||
// Creates a file access property list.
|
||||
// Creates a link access property list.
|
||||
LinkAccPropList();
|
||||
|
||||
///\brief Returns this class name.
|
||||
@ -39,7 +36,7 @@ class H5_DLLCPP LinkAccPropList : public PropList {
|
||||
// Copy constructor: same as the original LinkAccPropList.
|
||||
LinkAccPropList(const LinkAccPropList& original);
|
||||
|
||||
// Creates a copy of an existing file access property list
|
||||
// Creates a copy of an existing link access property list
|
||||
// using the property list id.
|
||||
LinkAccPropList (const hid_t plist_id);
|
||||
|
||||
|
@ -12,9 +12,6 @@
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
// Class LinkCreatPropList represents the HDF5 file access property list and
|
||||
// inherits from DataType.
|
||||
|
||||
#ifndef __H5LinkCreatPropList_H
|
||||
#define __H5LinkCreatPropList_H
|
||||
|
||||
@ -22,15 +19,15 @@ namespace H5 {
|
||||
|
||||
/*! \class LinkCreatPropList
|
||||
\brief Class LinkCreatPropList inherits from PropList and provides
|
||||
wrappers for the HDF5 file access property list.
|
||||
wrappers for the HDF5 link creation property list.
|
||||
*/
|
||||
// Inheritance: PropList -> IdComponent
|
||||
class H5_DLLCPP LinkCreatPropList : public PropList {
|
||||
public:
|
||||
///\brief Default file access property list.
|
||||
///\brief Default link creation property list.
|
||||
static const LinkCreatPropList& DEFAULT;
|
||||
|
||||
// Creates a file access property list.
|
||||
// Creates a link creation property list.
|
||||
LinkCreatPropList();
|
||||
|
||||
///\brief Returns this class name.
|
||||
@ -39,7 +36,7 @@ class H5_DLLCPP LinkCreatPropList : public PropList {
|
||||
// Copy constructor: same as the original LinkCreatPropList.
|
||||
LinkCreatPropList(const LinkCreatPropList& original);
|
||||
|
||||
// Creates a copy of an existing file access property list
|
||||
// Creates a copy of an existing link creation property list
|
||||
// using the property list id.
|
||||
LinkCreatPropList (const hid_t plist_id);
|
||||
|
||||
|
@ -40,9 +40,8 @@
|
||||
namespace H5 {
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
// userAttrOpWrpr simply interfaces between the user's function and the
|
||||
// C library function H5Aiterate2; used to resolve the different prototype
|
||||
// problem. May be moved to Iterator later.
|
||||
// userAttrOpWrpr interfaces between the user's function and the
|
||||
// C library function H5Aiterate2
|
||||
extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
|
||||
const H5A_info_t *ainfo, void *op_data)
|
||||
{
|
||||
@ -52,6 +51,17 @@ extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// userVisitOpWrpr interfaces between the user's function and the
|
||||
// C library function H5Ovisit2
|
||||
extern "C" herr_t userVisitOpWrpr(hid_t obj_id, const char *attr_name,
|
||||
const H5O_info_t *obj_info, void *op_data)
|
||||
{
|
||||
H5std_string s_attr_name = H5std_string(attr_name);
|
||||
UserData4Visit* myData = reinterpret_cast<UserData4Visit *> (op_data);
|
||||
int status = myData->op(*myData->obj, s_attr_name, obj_info, myData->opData);
|
||||
return status;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object default constructor (protected)
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
@ -197,8 +207,6 @@ Attribute H5Object::openAttribute(const unsigned int idx) const
|
||||
///\par Description
|
||||
/// The signature of user_op is
|
||||
/// void (*)(H5::H5Location&, H5std_string, void*).
|
||||
/// For information, please refer to the H5Aiterate2 API in
|
||||
/// the HDF5 C Reference Manual.
|
||||
// Programmer Binh-Minh Ribler - 2000
|
||||
//--------------------------------------------------------------------------
|
||||
int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data)
|
||||
@ -227,6 +235,61 @@ int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_dat
|
||||
throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::visit
|
||||
///\brief Recursively visits all HDF5 objects accessible from this object.
|
||||
///\param idx_type - IN: Type of index; valid values include:
|
||||
/// \li \c H5_INDEX_NAME
|
||||
/// \li \c H5_INDEX_CRT_ORDER
|
||||
///\param order - IN: Order in which index is traversed; valid values include:
|
||||
/// \li \c H5_ITER_DEC
|
||||
/// \li \c H5_ITER_INC
|
||||
/// \li \c H5_ITER_NATIVE
|
||||
///\param user_op - IN: Callback function passing data regarding the
|
||||
/// object to the calling application
|
||||
///\param *op_data - IN: User-defined pointer to data required by the
|
||||
/// application for its processing of the object
|
||||
///\param fields - IN: Flags specifying the fields to be retrieved
|
||||
/// to the callback op via the H5O_info_t argument.
|
||||
/// \li \c H5O_INFO_BASIC fileno, addr, type, and rc fields
|
||||
/// \li \c H5O_INFO_TIME atime, mtime, ctime, and btime fields
|
||||
/// \li \c H5O_INFO_NUM_ATTRS num_attrs field
|
||||
/// \li \c H5O_INFO_HDR hdr field
|
||||
/// \li \c H5O_INFO_META_SIZE meta_size field
|
||||
/// \li \c H5O_INFO_ALL H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS | H5O_INFO_HDR | H5O_INFO_META_SIZE
|
||||
///\return
|
||||
/// \li On success:
|
||||
/// \li the return value of the first operator that returns a positive value
|
||||
/// \li zero if all members were processed with no operator returning non-zero
|
||||
/// \li On failure:
|
||||
/// \li an exception Exception will be thrown if something went
|
||||
/// wrong within the library or the operator failed
|
||||
///\exception H5::Exception
|
||||
///\par Description
|
||||
/// For information, please refer to the H5Ovisit2 API in the HDF5
|
||||
/// C Reference Manual.
|
||||
// Programmer Binh-Minh Ribler - Feb, 2019
|
||||
//--------------------------------------------------------------------------
|
||||
void H5Object::visit(H5_index_t idx_type, H5_iter_order_t order, visit_operator_t user_op, void *op_data, unsigned int fields)
|
||||
{
|
||||
// Store the user's function and data
|
||||
UserData4Visit* userData = new UserData4Visit;
|
||||
userData->opData = op_data;
|
||||
userData->op = user_op;
|
||||
userData->obj = this;
|
||||
|
||||
// Call the C API passing in op wrapper and info
|
||||
herr_t ret_value = H5Ovisit2(getId(), idx_type, order, userVisitOpWrpr, static_cast<void *>(userData), fields);
|
||||
|
||||
// Release memory
|
||||
delete userData;
|
||||
|
||||
// Throw exception if H5Ovisit2 failed, which could be a failure in
|
||||
// the library or in the call back operator
|
||||
if (ret_value < 0)
|
||||
throw Exception(inMemFunc("visit"), "H5Ovisit2 failed");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: H5Object::objVersion
|
||||
///\brief Returns the header version of this HDF5 object.
|
||||
|
@ -40,16 +40,30 @@ namespace H5 {
|
||||
// Inheritance: H5Location -> IdComponent
|
||||
|
||||
// Define the operator function pointer for H5Aiterate().
|
||||
typedef void (*attr_operator_t)(H5Object& loc/*in*/,
|
||||
const H5std_string attr_name/*in*/,
|
||||
void *operator_data/*in,out*/);
|
||||
typedef void (*attr_operator_t)(H5Object& loc,
|
||||
const H5std_string attr_name,
|
||||
void *operator_data);
|
||||
|
||||
// Define the operator function pointer for H5Ovisit2().
|
||||
typedef int (*visit_operator_t)(H5Object& obj,
|
||||
const H5std_string attr_name,
|
||||
const H5O_info_t *oinfo,
|
||||
void *operator_data);
|
||||
|
||||
// User data for attribute iteration
|
||||
class UserData4Aiterate {
|
||||
public:
|
||||
attr_operator_t op;
|
||||
void* opData;
|
||||
H5Object* location;
|
||||
H5Object* location; // Consider changing to H5Location
|
||||
};
|
||||
|
||||
// User data for visit iteration
|
||||
class UserData4Visit {
|
||||
public:
|
||||
visit_operator_t op;
|
||||
void* opData;
|
||||
H5Object* obj;
|
||||
};
|
||||
|
||||
class H5_DLLCPP H5Object : public H5Location {
|
||||
@ -71,6 +85,9 @@ class H5_DLLCPP H5Object : public H5Location {
|
||||
// Iterate user's function over the attributes of this object.
|
||||
int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL);
|
||||
|
||||
// Recursively visit elements reachable from this object.
|
||||
void visit(H5_index_t idx_type, H5_iter_order_t order, visit_operator_t user_op, void *op_data, unsigned int fields);
|
||||
|
||||
// Returns the object header version of an object
|
||||
unsigned objVersion() const;
|
||||
|
||||
@ -98,6 +115,7 @@ class H5_DLLCPP H5Object : public H5Location {
|
||||
ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const;
|
||||
H5std_string getObjName() const;
|
||||
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
|
||||
protected:
|
||||
|
@ -55,7 +55,7 @@
|
||||
-P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
|
||||
)
|
||||
set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects)
|
||||
set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30)
|
||||
set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
@ -286,7 +286,7 @@ H5::DataType getArr()
|
||||
*dims = 5;
|
||||
H5::ArrayType ret;
|
||||
ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims);
|
||||
delete[] dims;
|
||||
delete dims;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -371,7 +371,6 @@ static void test_array_info()
|
||||
s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; // Information read in
|
||||
hsize_t sdims1[] = {SPACE1_DIM1};
|
||||
hsize_t tdims1[] = {ARRAY1_DIM1};
|
||||
int nmemb; // Number of compound members
|
||||
int ii; // counting variables
|
||||
hsize_t idxi, idxj, idxk; // dimension indicing variables
|
||||
H5T_class_t mclass; // Datatype class for field
|
||||
|
@ -31,288 +31,27 @@ using namespace H5;
|
||||
#include "h5test.h"
|
||||
#include "h5cpputil.h" // C++ utilility header file
|
||||
|
||||
// A lot of the definition inherited from C test links.c is left here until
|
||||
// the H5L API is implemented and tests are completed - BMR 10/19/2009
|
||||
/*
|
||||
* This file needs to access private information from the H5G package.
|
||||
* This file also needs to access the group testing code.
|
||||
*/
|
||||
//#define H5G_FRIEND
|
||||
//#define H5G_TESTING
|
||||
|
||||
//#include "h5test.h"
|
||||
//#include "H5Gpkg.h" /* Groups */
|
||||
//#include "H5Iprivate.h" /* IDs */
|
||||
//#include "H5Lprivate.h" /* Links */
|
||||
|
||||
/* File for external link test. Created with gen_udlinks.c */
|
||||
#define LINKED_FILE "be_extlink2.h5"
|
||||
|
||||
#if 0
|
||||
const char *FILENAME[] = {
|
||||
"links0",
|
||||
"links1",
|
||||
"links2",
|
||||
"links3",
|
||||
"links4a", /* 4 */
|
||||
"links4b", /* 5 */
|
||||
"links4c", /* 6 */
|
||||
"links4d", /* 7 */
|
||||
"links5", /* 8 */
|
||||
"links6", /* 9 */
|
||||
"links7", /* 10 */
|
||||
"links8", /* 11 */
|
||||
"extlinks0", /* 12: main files */
|
||||
"tmp/extlinks0", /* 13: */
|
||||
"extlinks1", /* 14: target files */
|
||||
"tmp/extlinks1", /* 15: */
|
||||
"extlinks2", /* 16: */
|
||||
"tmp/extlinks2", /* 17: */
|
||||
"extlinks3", /* 18: */
|
||||
"tmp/extlinks3", /* 19: */
|
||||
"extlinks4", /* 20: */
|
||||
"tmp/extlinks4", /* 21: */
|
||||
"extlinks5", /* 22: */
|
||||
"tmp/extlinks6", /* 23: */
|
||||
"extlinks7", /* 24: */
|
||||
"tmp/extlinks7", /* 25: */
|
||||
"tmp/extlinks8", /* 26: */
|
||||
"extlinks9", /* 27: */
|
||||
"tmp/extlinks9", /* 28: */
|
||||
"extlinks10", /* 29: */ /* TESTS for windows */
|
||||
"tmp/extlinks10", /* 30: */
|
||||
"tmp/extlinks11", /* 31: */
|
||||
"tmp/extlinks12", /* 32: */
|
||||
"extlinks13", /* 33: */
|
||||
"tmp/extlinks13", /* 34: */
|
||||
"tmp/extlinks14", /* 35: */
|
||||
"tmp/extlinks15", /* 36: */
|
||||
"extlinks16A", /* 37: */ /* TESTS for H5P_set_elink_fapl */
|
||||
"extlinks16B", /* 38: */
|
||||
"extlinks17", /* 39: */
|
||||
"extlinks18A", /* 40: */
|
||||
"extlinks18B", /* 41: */
|
||||
"extlinks19A", /* 42: */
|
||||
"extlinks19B", /* 43: */
|
||||
"extlinks20", /* 44: */
|
||||
NULL
|
||||
};
|
||||
|
||||
#endif // 0
|
||||
|
||||
#define TMPDIR "tmp"
|
||||
|
||||
#define FAMILY_SIZE 1024
|
||||
#define CORE_INCREMENT 1024
|
||||
#define NUM400 400
|
||||
|
||||
/* do not do check_all_closed() for "ext*" files and "tmp/ext*" */
|
||||
#define EXTSTOP 12
|
||||
|
||||
#define LINK_BUF_SIZE 1024
|
||||
#define NAME_BUF_SIZE 1024
|
||||
#define MAX_NAME_LEN ((64*1024)+1024)
|
||||
|
||||
/* Link type IDs */
|
||||
#define UD_HARD_TYPE 201
|
||||
#define UD_CB_TYPE H5L_TYPE_MAX
|
||||
#define UD_PLIST_TYPE 128
|
||||
#define UD_CBFAIL_TYPE UD_PLIST_TYPE
|
||||
#define UD_ERROR_TYPE 189
|
||||
#define UD_BAD_TYPE1 H5L_TYPE_HARD
|
||||
#define UD_BAD_TYPE2 (H5L_TYPE_UD_MIN - 5)
|
||||
#define UD_BAD_VERS (H5L_LINK_CLASS_T_VERS + 1)
|
||||
|
||||
#define DEST_PROP_NAME "destination_group"
|
||||
#define REREG_TARGET_NAME "rereg_target"
|
||||
|
||||
#define UD_CB_LINK_NAME "ud_callback_link"
|
||||
#define NEW_UD_CB_LINK_NAME "ud_callback_link2"
|
||||
#define UD_CB_TARGET "ud_target"
|
||||
#define UD_CB_TARGET_LEN 10
|
||||
|
||||
#define LE_FILENAME "le_extlink1.h5"
|
||||
#define BE_FILENAME "be_extlink1.h5"
|
||||
|
||||
#define ELINK_CB_FAM_SIZE (hsize_t) 100
|
||||
|
||||
#define H5L_DIM1 100
|
||||
#define H5L_DIM2 100
|
||||
|
||||
/* Creation order macros */
|
||||
#define CORDER_SOFT_GROUP_NAME "corder_soft_group"
|
||||
#define CORDER_NLINKS 18
|
||||
|
||||
/* Timestamp macros */
|
||||
#define TIMESTAMP_GROUP_1 "timestamp1"
|
||||
#define TIMESTAMP_GROUP_2 "timestamp2"
|
||||
|
||||
/* Link iteration struct */
|
||||
typedef struct {
|
||||
H5_iter_order_t order; /* Direction of iteration */
|
||||
unsigned ncalled; /* # of times callback is entered */
|
||||
unsigned nskipped; /* # of links skipped */
|
||||
int stop; /* # of iterations to stop after */
|
||||
int64_t curr; /* Current creation order value */
|
||||
size_t max_visit; /* Size of "visited link" flag array */
|
||||
hbool_t *visited; /* Pointer to array of "visited link" flags */
|
||||
} link_iter_info_t;
|
||||
|
||||
#if 0
|
||||
/* Link visit structs */
|
||||
typedef struct {
|
||||
const char *path; /* Path to link */
|
||||
H5L_type_t type; /* Type of link */
|
||||
} link_visit_t;
|
||||
static const link_visit_t lvisit0[] = {
|
||||
{"Dataset_zero", H5L_TYPE_HARD},
|
||||
{"Group1", H5L_TYPE_HARD},
|
||||
{"Group1/Dataset_one", H5L_TYPE_HARD},
|
||||
{"Group1/Group2", H5L_TYPE_HARD},
|
||||
{"Group1/Group2/Dataset_two", H5L_TYPE_HARD},
|
||||
{"Group1/Group2/Type_two", H5L_TYPE_HARD},
|
||||
{"Group1/Group2/hard_zero", H5L_TYPE_HARD},
|
||||
{"Group1/Type_one", H5L_TYPE_HARD},
|
||||
{"Group1/hard_one", H5L_TYPE_HARD},
|
||||
{"Type_zero", H5L_TYPE_HARD},
|
||||
{"ext_dangle", H5L_TYPE_EXTERNAL},
|
||||
{"ext_one", H5L_TYPE_EXTERNAL},
|
||||
{"hard_one", H5L_TYPE_HARD},
|
||||
{"hard_two", H5L_TYPE_HARD},
|
||||
{"hard_zero", H5L_TYPE_HARD},
|
||||
{"soft_dangle", H5L_TYPE_SOFT},
|
||||
{"soft_one", H5L_TYPE_SOFT},
|
||||
{"soft_two", H5L_TYPE_SOFT}
|
||||
};
|
||||
static const link_visit_t lvisit1[] = {
|
||||
{"Dataset_one", H5L_TYPE_HARD},
|
||||
{"Group2", H5L_TYPE_HARD},
|
||||
{"Group2/Dataset_two", H5L_TYPE_HARD},
|
||||
{"Group2/Type_two", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero/Dataset_zero", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero/Group1", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero/Type_zero", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero/ext_dangle", H5L_TYPE_EXTERNAL},
|
||||
{"Group2/hard_zero/ext_one", H5L_TYPE_EXTERNAL},
|
||||
{"Group2/hard_zero/hard_one", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero/hard_two", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero/hard_zero", H5L_TYPE_HARD},
|
||||
{"Group2/hard_zero/soft_dangle", H5L_TYPE_SOFT},
|
||||
{"Group2/hard_zero/soft_one", H5L_TYPE_SOFT},
|
||||
{"Group2/hard_zero/soft_two", H5L_TYPE_SOFT},
|
||||
{"Type_one", H5L_TYPE_HARD},
|
||||
{"hard_one", H5L_TYPE_HARD}
|
||||
};
|
||||
static const link_visit_t lvisit2[] = {
|
||||
{"Dataset_two", H5L_TYPE_HARD},
|
||||
{"Type_two", H5L_TYPE_HARD},
|
||||
{"hard_zero", H5L_TYPE_HARD},
|
||||
{"hard_zero/Dataset_zero", H5L_TYPE_HARD},
|
||||
{"hard_zero/Group1", H5L_TYPE_HARD},
|
||||
{"hard_zero/Group1/Dataset_one", H5L_TYPE_HARD},
|
||||
{"hard_zero/Group1/Group2", H5L_TYPE_HARD},
|
||||
{"hard_zero/Group1/Type_one", H5L_TYPE_HARD},
|
||||
{"hard_zero/Group1/hard_one", H5L_TYPE_HARD},
|
||||
{"hard_zero/Type_zero", H5L_TYPE_HARD},
|
||||
{"hard_zero/ext_dangle", H5L_TYPE_EXTERNAL},
|
||||
{"hard_zero/ext_one", H5L_TYPE_EXTERNAL},
|
||||
{"hard_zero/hard_one", H5L_TYPE_HARD},
|
||||
{"hard_zero/hard_two", H5L_TYPE_HARD},
|
||||
{"hard_zero/hard_zero", H5L_TYPE_HARD},
|
||||
{"hard_zero/soft_dangle", H5L_TYPE_SOFT},
|
||||
{"hard_zero/soft_one", H5L_TYPE_SOFT},
|
||||
{"hard_zero/soft_two", H5L_TYPE_SOFT}
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned idx; /* Index in link visit structure */
|
||||
const link_visit_t *info; /* Pointer to the link visit structure to use */
|
||||
} lvisit_ud_t;
|
||||
|
||||
|
||||
/* Object visit structs */
|
||||
// Object visit structs
|
||||
typedef struct {
|
||||
const char *path; /* Path to object */
|
||||
H5O_type_t type; /* Type of object */
|
||||
} obj_visit_t;
|
||||
static const obj_visit_t ovisit0_old[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Dataset_zero", H5O_TYPE_DATASET},
|
||||
{"Group1", H5O_TYPE_GROUP},
|
||||
{"Group1/Dataset_one", H5O_TYPE_DATASET},
|
||||
{"Group1/Group2", H5O_TYPE_GROUP},
|
||||
{"Group1/Group2/Dataset_two", H5O_TYPE_DATASET},
|
||||
{"Group1/Group2/Type_two", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Group1/Type_one", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Type_zero", H5O_TYPE_NAMED_DATATYPE}
|
||||
};
|
||||
static const obj_visit_t ovisit0_new[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Dataset_zero", H5O_TYPE_DATASET},
|
||||
{"Group1", H5O_TYPE_GROUP},
|
||||
{"Group1/Dataset_one", H5O_TYPE_DATASET},
|
||||
{"Group1/Group2", H5O_TYPE_GROUP},
|
||||
{"Group1/Group2/Dataset_two", H5O_TYPE_DATASET},
|
||||
{"Group1/Group2/Type_two", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Group1/Type_one", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Type_zero", H5O_TYPE_NAMED_DATATYPE}
|
||||
};
|
||||
static const obj_visit_t ovisit1_old[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Dataset_one", H5O_TYPE_DATASET},
|
||||
{"Group2", H5O_TYPE_GROUP},
|
||||
{"Group2/Dataset_two", H5O_TYPE_DATASET},
|
||||
{"Group2/Type_two", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Group2/hard_zero", H5O_TYPE_GROUP},
|
||||
{"Group2/hard_zero/Dataset_zero", H5O_TYPE_DATASET},
|
||||
{"Group2/hard_zero/Type_zero", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Type_one", H5O_TYPE_NAMED_DATATYPE}
|
||||
};
|
||||
static const obj_visit_t ovisit1_new[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Dataset_one", H5O_TYPE_DATASET},
|
||||
{"Group2", H5O_TYPE_GROUP},
|
||||
{"Group2/Dataset_two", H5O_TYPE_DATASET},
|
||||
{"Group2/Type_two", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Group2/hard_zero", H5O_TYPE_GROUP},
|
||||
{"Group2/hard_zero/Dataset_zero", H5O_TYPE_DATASET},
|
||||
{"Group2/hard_zero/Type_zero", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"Type_one", H5O_TYPE_NAMED_DATATYPE}
|
||||
};
|
||||
static const obj_visit_t ovisit2_old[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Dataset_two", H5O_TYPE_DATASET},
|
||||
{"Type_two", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"hard_zero", H5O_TYPE_GROUP},
|
||||
{"hard_zero/Dataset_zero", H5O_TYPE_DATASET},
|
||||
{"hard_zero/Group1", H5O_TYPE_GROUP},
|
||||
{"hard_zero/Group1/Dataset_one", H5O_TYPE_DATASET},
|
||||
{"hard_zero/Group1/Type_one", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"hard_zero/Type_zero", H5O_TYPE_NAMED_DATATYPE}
|
||||
};
|
||||
static const obj_visit_t ovisit2_new[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Dataset_two", H5O_TYPE_DATASET},
|
||||
{"Type_two", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"hard_zero", H5O_TYPE_GROUP},
|
||||
{"hard_zero/Dataset_zero", H5O_TYPE_DATASET},
|
||||
{"hard_zero/Group1", H5O_TYPE_GROUP},
|
||||
{"hard_zero/Group1/Dataset_one", H5O_TYPE_DATASET},
|
||||
{"hard_zero/Group1/Type_one", H5O_TYPE_NAMED_DATATYPE},
|
||||
{"hard_zero/Type_zero", H5O_TYPE_NAMED_DATATYPE}
|
||||
};
|
||||
|
||||
// User data for callback function
|
||||
typedef struct {
|
||||
unsigned idx; /* Index in object visit structure */
|
||||
const obj_visit_t *info; /* Pointer to the object visit structure to use */
|
||||
} ovisit_ud_t;
|
||||
#endif
|
||||
|
||||
static const char *FILENAME[] = {
|
||||
"link0",
|
||||
"link1.h5",
|
||||
"link2.h5",
|
||||
"visit",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -841,6 +580,140 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format)
|
||||
}
|
||||
} // test_num_links
|
||||
|
||||
|
||||
// Data for visit on the file
|
||||
static const obj_visit_t file_visit[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Data", H5O_TYPE_GROUP},
|
||||
{"Data/Compressed_Data", H5O_TYPE_DATASET},
|
||||
{"Data/Float_Data", H5O_TYPE_DATASET},
|
||||
};
|
||||
|
||||
// Data for visit on the group
|
||||
static const obj_visit_t group_visit[] = {
|
||||
{".", H5O_TYPE_GROUP},
|
||||
{"Compressed_Data", H5O_TYPE_DATASET},
|
||||
{"Float_Data", H5O_TYPE_DATASET},
|
||||
};
|
||||
|
||||
const H5std_string FILE_NAME("tvisit.h5");
|
||||
const H5std_string GROUP_NAME("/Data");
|
||||
const H5std_string DSET1_NAME("/Data/Compressed_Data");
|
||||
const H5std_string DSET2_NAME("/Data/Float_Data");
|
||||
const int RANK = 2;
|
||||
const int DIM1 = 2;
|
||||
|
||||
// Operator function
|
||||
static int visit_obj_cb(H5Object& obj, const H5std_string name, const H5O_info_t *oinfo, void *_op_data)
|
||||
{
|
||||
ovisit_ud_t *op_data = static_cast <ovisit_ud_t *>(_op_data);
|
||||
|
||||
// Check for correct object information
|
||||
if(strcmp(op_data->info[op_data->idx].path, name.c_str())) return(H5_ITER_ERROR);
|
||||
if(op_data->info[op_data->idx].type != oinfo->type) return(H5_ITER_ERROR);
|
||||
|
||||
// Advance to next location
|
||||
op_data->idx++;
|
||||
|
||||
return(H5_ITER_CONT);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_visit
|
||||
*
|
||||
* Purpose Test H5Object::visit
|
||||
*
|
||||
* Return None
|
||||
*
|
||||
* February 8, 2019
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void test_visit(hid_t fapl_id, hbool_t new_format)
|
||||
{
|
||||
hsize_t dims[2];
|
||||
hsize_t cdims[2];
|
||||
char filename[NAME_BUF_SIZE];
|
||||
|
||||
if(new_format)
|
||||
SUBTEST("H5Object::visit (w/new group format)")
|
||||
else
|
||||
SUBTEST("H5Object::visit")
|
||||
|
||||
try
|
||||
{
|
||||
// Use the file access template id to create a file access prop. list
|
||||
FileAccPropList fapl(fapl_id);
|
||||
|
||||
// Build the hdf5 file name and create the file
|
||||
h5_fixname(FILENAME[3], fapl_id, filename, sizeof filename);
|
||||
H5File *file = new H5File(filename, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl);
|
||||
|
||||
// Create a group
|
||||
Group* group = new Group(file->createGroup(GROUP_NAME));
|
||||
|
||||
// Create a chunked/compressed dataset within this group specified by path
|
||||
dims[0] = 20;
|
||||
dims[1] = 2;
|
||||
cdims[0] = 2;
|
||||
cdims[1] = 2;
|
||||
DataSpace *dataspace = new DataSpace(RANK, dims); // create new dspace
|
||||
DSetCreatPropList ds_creatplist; // create dataset creation prop list
|
||||
ds_creatplist.setChunk(2, cdims); // then modify it for compression
|
||||
ds_creatplist.setDeflate(6);
|
||||
|
||||
DataSet* dataset = new DataSet(file->createDataSet(DSET1_NAME,
|
||||
PredType::NATIVE_INT, *dataspace, ds_creatplist));
|
||||
|
||||
delete dataset;
|
||||
delete dataspace;
|
||||
|
||||
// Create another dataset
|
||||
dims[0] = 5;
|
||||
dims[1] = 2;
|
||||
dataspace = new DataSpace(RANK, dims); // create second dspace
|
||||
dataset = new DataSet(file->createDataSet(DSET2_NAME,
|
||||
PredType::NATIVE_FLOAT, *dataspace));
|
||||
|
||||
// Close everything
|
||||
delete dataset;
|
||||
delete dataspace;
|
||||
delete group;
|
||||
delete file;
|
||||
|
||||
// Reopen the file and group in the file.
|
||||
file = new H5File(filename, H5F_ACC_RDWR);
|
||||
group = new Group(file->openGroup("Data"));
|
||||
|
||||
// Open the group
|
||||
dataset = new DataSet(group->openDataSet(DSET2_NAME));
|
||||
delete dataset;
|
||||
|
||||
// Visit objects in the file
|
||||
ovisit_ud_t udata; /* User-data for visiting */
|
||||
udata.idx = 0;
|
||||
udata.info = file_visit;
|
||||
|
||||
file->visit(H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC);
|
||||
|
||||
// Visit objects in the group
|
||||
udata.idx = 0;
|
||||
udata.info = group_visit;
|
||||
|
||||
group->visit(H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC);
|
||||
|
||||
// Close the group and file.
|
||||
delete group;
|
||||
delete file;
|
||||
|
||||
PASSED();
|
||||
} // end of try block
|
||||
catch (Exception& E)
|
||||
{
|
||||
cerr << "in catch" << endl;
|
||||
issue_fail_msg("test_visit()", __LINE__, __FILE__, E.getCDetailMsg());
|
||||
}
|
||||
} // test_visit()
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: test_links
|
||||
@ -858,7 +731,8 @@ void test_links()
|
||||
hid_t fapl_id, fapl2_id; /* File access property lists */
|
||||
unsigned new_format; /* Whether to use the new format or not */
|
||||
|
||||
fapl_id = h5_fileaccess();
|
||||
if((fapl_id = h5_fileaccess()) < 0)
|
||||
throw Exception("test_links", "Unable to get file access property list");
|
||||
|
||||
// Output message about test being performed
|
||||
MESSAGE(5, ("Testing Various Links\n"));
|
||||
@ -891,24 +765,18 @@ void test_links()
|
||||
test_move(my_fapl_id, new_format);
|
||||
test_copy(my_fapl_id, new_format);
|
||||
test_lcpl(my_fapl_id, new_format);
|
||||
test_visit(my_fapl_id, new_format);
|
||||
} /* end for */
|
||||
|
||||
/* Close 2nd FAPL */
|
||||
H5Pclose(fapl2_id);
|
||||
|
||||
h5_clean_files(FILENAME, fapl_id);
|
||||
|
||||
/* Test that external links can be used after a library reset. MUST be
|
||||
* called last so the reset doesn't interfere with the property lists. This
|
||||
* routine will delete its own file. */
|
||||
/* nerrors += external_reset_register() < 0 ? 1 : 0;
|
||||
*/
|
||||
}
|
||||
catch (Exception& E)
|
||||
{
|
||||
issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -926,7 +794,3 @@ void cleanup_links()
|
||||
HDremove(FILENAME[0]);
|
||||
HDremove(FILENAME[1]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -41,16 +41,20 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
|
||||
H5TEST-err_compat #uses runTest.cmake
|
||||
H5TEST-links_env #uses runTest.cmake
|
||||
H5TEST-testlibinfo #uses grepTest.cmake
|
||||
H5TEST-clear-testhdf5-objects
|
||||
#########
|
||||
H5TEST-clear-objects
|
||||
H5TEST-clear-cache-objects
|
||||
H5TEST-clear-cache_api-objects
|
||||
H5TEST-clear-cache_image-objects
|
||||
H5TEST-clear-cache_tagging-objects
|
||||
H5TEST-clear-del_many_dense_attrs-objects
|
||||
H5TEST-clear-err_compat-objects
|
||||
H5TEST-clear-error_test-objects
|
||||
H5TEST-clear-filenotclosed-objects
|
||||
H5TEST-clear-flush-objects
|
||||
H5TEST-clear-links_env-objects
|
||||
H5TEST-clear-testflushrefresh-objects
|
||||
H5TEST-clear-testhdf5-objects
|
||||
H5TEST-clear-ttsafe-objects
|
||||
PERFORM_h5perform-clear-objects
|
||||
HL_TOOLS-clear-objects
|
||||
@ -60,11 +64,19 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
|
||||
CPP_testhdf5-clear-objects
|
||||
######### tools/h5clear #########
|
||||
H5CLEAR-clearall-objects
|
||||
H5CLEAR-copy_h5clear_fsm_persist_equal.h5
|
||||
H5CLEAR-copy_h5clear_fsm_persist_greater.h5
|
||||
H5CLEAR-copy_h5clear_fsm_persist_less.h5
|
||||
H5CLEAR-copy_h5clear_fsm_persist_noclose.h5
|
||||
H5CLEAR-copy_h5clear_fsm_persist_user_equal.h5
|
||||
H5CLEAR-copy_h5clear_fsm_persist_user_greater.h5
|
||||
H5CLEAR-copy_h5clear_fsm_persist_user_less.h5
|
||||
H5CLEAR-copy_h5clear_log_v3.h5
|
||||
H5CLEAR-copy_h5clear_mdc_image.h5
|
||||
H5CLEAR-copy_h5clear_sec2_v0.h5
|
||||
H5CLEAR-copy_h5clear_sec2_v2.h5
|
||||
H5CLEAR-copy_h5clear_sec2_v3.h5
|
||||
H5CLEAR-copy_h5clear_status_noclear.h5
|
||||
H5CLEAR-copy_latest_h5clear_log_v3.h5
|
||||
H5CLEAR-copy_latest_h5clear_sec2_v3.h5
|
||||
H5CLEAR-copy_mod_h5clear_mdc_image.h5
|
||||
@ -307,6 +319,11 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE
|
||||
H5REPACK_VERIFY_LAYOUT_ALL-layout_short_switches #uses grepTest.cmake
|
||||
H5REPACK-plugin
|
||||
H5REPACK_CMP-plugin_zero
|
||||
#########
|
||||
ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-latest_latest_invalid-clear-objects
|
||||
H5REPACK_VERIFY_SUPERBLOCK-SB_IS_0-clear-objects
|
||||
H5REPACK_VERIFY_SUPERBLOCK-SB_IS_2-clear-objects
|
||||
H5REPACK_VERIFY_SUPERBLOCK-SB_IS_3-clear-objects
|
||||
######### tools/h5stat #########
|
||||
H5STAT-clearall-objects
|
||||
######### tools/misc #########
|
||||
|
@ -267,6 +267,9 @@
|
||||
/* Define if we have parallel support */
|
||||
#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
|
||||
|
||||
/* Define if both pread and pwrite exist. */
|
||||
#cmakedefine H5_HAVE_PREADWRITE @H5_HAVE_PREADWRITE@
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@
|
||||
|
||||
|
@ -1,106 +0,0 @@
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
cmake_minimum_required (VERSION 3.10)
|
||||
###############################################################################################################
|
||||
# This script will build and run the examples from a folder
|
||||
# Execute from a command line:
|
||||
# ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log
|
||||
###############################################################################################################
|
||||
|
||||
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
|
||||
if("@CMAKE_GENERATOR_TOOLSET@")
|
||||
set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
|
||||
endif()
|
||||
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
|
||||
|
||||
# handle input parameters to script.
|
||||
#INSTALLDIR - HDF5-1.8 root folder
|
||||
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
|
||||
#CTEST_SOURCE_NAME - name of source folder; HDF5Examples
|
||||
if(DEFINED CTEST_SCRIPT_ARG)
|
||||
# transform ctest script arguments of the form
|
||||
# script.ctest,var1=value1,var2=value2
|
||||
# to variables with the respective names set to the respective values
|
||||
string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
|
||||
foreach(current_var ${script_args})
|
||||
if("${current_var}" MATCHES "^([^=]+)=(.+)$")
|
||||
set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
###################################################################
|
||||
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
|
||||
set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
|
||||
if(NOT DEFINED CTEST_CONFIGURATION_TYPE)
|
||||
set(CTEST_CONFIGURATION_TYPE "Release")
|
||||
endif()
|
||||
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}")
|
||||
##################################################################
|
||||
|
||||
if(NOT DEFINED INSTALLDIR)
|
||||
set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CTEST_SOURCE_NAME)
|
||||
set(CTEST_SOURCE_NAME "HDF5Examples")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED HDF_LOCAL)
|
||||
set(CDASH_LOCAL "NO")
|
||||
else()
|
||||
set(CDASH_LOCAL "YES")
|
||||
endif()
|
||||
if(NOT DEFINED CTEST_SITE)
|
||||
set(CTEST_SITE "local")
|
||||
endif()
|
||||
if(NOT DEFINED CTEST_BUILD_NAME)
|
||||
set(CTEST_BUILD_NAME "examples")
|
||||
endif()
|
||||
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
|
||||
|
||||
#TAR_SOURCE - name of tarfile
|
||||
#if(NOT DEFINED TAR_SOURCE)
|
||||
# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source")
|
||||
#endif()
|
||||
|
||||
###############################################################################################################
|
||||
if(WIN32)
|
||||
set(SITE_OS_NAME "Windows")
|
||||
set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
|
||||
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
|
||||
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
|
||||
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
|
||||
else()
|
||||
set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
|
||||
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
|
||||
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
|
||||
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
|
||||
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
|
||||
endif()
|
||||
if(${CDASH_LOCAL})
|
||||
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON")
|
||||
endif()
|
||||
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
|
||||
|
||||
###############################################################################################################
|
||||
# For any comments please contact cdashhelp@hdfgroup.org
|
||||
#
|
||||
###############################################################################################################
|
||||
|
||||
if(WIN32)
|
||||
include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake)
|
||||
include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
|
||||
else()
|
||||
include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake)
|
||||
include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
|
||||
endif()
|
@ -15,6 +15,8 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage)
|
||||
# SOVERSION passed in ARGN when shared
|
||||
if (${libtype} MATCHES "SHARED")
|
||||
set (PACKAGE_SOVERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION})
|
||||
set (PACKAGE_COMPATIBILITY ${H5_${libpackage}_SOVERS_INTERFACE}.0.0)
|
||||
set (PACKAGE_CURRENT ${H5_${libpackage}_SOVERS_INTERFACE}.${H5_${libpackage}_SOVERS_MINOR}.0)
|
||||
if (WIN32)
|
||||
set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR})
|
||||
else ()
|
||||
@ -26,6 +28,11 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage)
|
||||
else ()
|
||||
set_target_properties (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION})
|
||||
endif ()
|
||||
if (CMAKE_C_OSX_CURRENT_VERSION_FLAG)
|
||||
set_property(TARGET ${libtarget} APPEND PROPERTY
|
||||
LINK_FLAGS "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}${PACKAGE_CURRENT} ${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}${PACKAGE_COMPATIBILITY}"
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype})
|
||||
|
||||
@ -33,9 +40,6 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage)
|
||||
if (APPLE)
|
||||
option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF)
|
||||
if (HDF5_BUILD_WITH_INSTALL_NAME)
|
||||
set_property(TARGET ${libtarget} APPEND PROPERTY
|
||||
LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}"
|
||||
)
|
||||
set_target_properties (${libtarget} PROPERTIES
|
||||
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME}
|
||||
|
@ -57,8 +57,8 @@ endmacro ()
|
||||
|
||||
# Read source line beginning at the line matching Input:"START" and ending at the line matching Input:"END"
|
||||
macro (READ_SOURCE SOURCE_START SOURCE_END RETURN_VAR)
|
||||
file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_CODE)
|
||||
string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_CODE})
|
||||
file (READ "${HDF5_SOURCE_DIR}/m4/aclocal_fc.f90" SOURCE_MASTER)
|
||||
string (REGEX MATCH "${SOURCE_START}[\\\t\\\n\\\r[].+]*${SOURCE_END}" SOURCE_CODE ${SOURCE_MASTER})
|
||||
set (RETURN_VAR "${SOURCE_CODE}")
|
||||
endmacro ()
|
||||
|
||||
@ -234,7 +234,7 @@ foreach (KIND ${VAR} )
|
||||
set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},")
|
||||
endforeach ()
|
||||
|
||||
if (pack_int_sizeof STREQUAL "")
|
||||
if (pack_real_sizeof STREQUAL "")
|
||||
message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran")
|
||||
endif ()
|
||||
|
||||
|
@ -48,7 +48,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${
|
||||
##################################################################
|
||||
|
||||
if(NOT DEFINED INSTALLDIR)
|
||||
set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@")
|
||||
if(WIN32)
|
||||
set(INSTALLDIR "C:/Program Files/HDF_Group/@HDF5_PACKAGE_NAME@/@HDF5_PACKAGE_VERSION@")
|
||||
else()
|
||||
set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED CTEST_SOURCE_NAME)
|
||||
@ -70,7 +74,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDN
|
||||
|
||||
#TAR_SOURCE - name of tarfile
|
||||
#if(NOT DEFINED TAR_SOURCE)
|
||||
# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.10-Source")
|
||||
# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.12.4-Source")
|
||||
#endif()
|
||||
|
||||
###############################################################################################################
|
||||
|
@ -21,38 +21,38 @@
|
||||
|
||||
set (PACKAGE_VERSION "@HDF5_VERSION_STRING@")
|
||||
|
||||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else ()
|
||||
if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@")
|
||||
else()
|
||||
if("@H5_VERS_MAJOR@.@H5_VERS_MINOR@" MATCHES "^([0-9]+)\\.([0-9]+)")
|
||||
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||
else()
|
||||
set(CVF_VERSION_MAJOR "@HDF5_VERSION_STRING@")
|
||||
set(CVF_VERSION_MINOR "")
|
||||
endif()
|
||||
|
||||
# exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@
|
||||
if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@")
|
||||
if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
|
||||
(PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
endif()
|
||||
|
||||
# compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x
|
||||
set (PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@")
|
||||
set (PACKAGE_VERSION_EXACT TRUE)
|
||||
|
||||
if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@")
|
||||
# not using this yet
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
set (PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
|
||||
return()
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||
if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@")
|
||||
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
|
||||
math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif ()
|
||||
endif()
|
||||
|
@ -38,6 +38,7 @@ set (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
|
||||
set (${HDF5_PACKAGE_NAME}_BUILD_JAVA @HDF5_BUILD_JAVA@)
|
||||
set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
|
||||
set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
|
||||
set (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE @HDF5_ENABLE_THREADSAFE@)
|
||||
set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@)
|
||||
set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@)
|
||||
set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@)
|
||||
@ -45,6 +46,8 @@ set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
|
||||
set (${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@)
|
||||
set (${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES @HDF5_LIBRARIES_TO_EXPORT@)
|
||||
set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
|
||||
set (${HDF5_PACKAGE_NAME}_DEFAULT_API_VERSION "@DEFAULT_API_VERSION@")
|
||||
set (${HDF5_PACKAGE_NAME}_PARALLEL_FILTERED_WRITES "@PARALLEL_FILTERED_WRITES@")
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Dependencies
|
||||
@ -124,14 +127,14 @@ endif ()
|
||||
# Handle requested components:
|
||||
list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
|
||||
foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
|
||||
if (${comp} STREQUAL "shared")
|
||||
if (comp STREQUAL "shared")
|
||||
list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp})
|
||||
set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp})
|
||||
|
||||
if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN)
|
||||
set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@/shared")
|
||||
endif ()
|
||||
elseif (${comp} STREQUAL "static")
|
||||
elseif (comp STREQUAL "static")
|
||||
list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp})
|
||||
set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp})
|
||||
|
||||
@ -143,32 +146,32 @@ endforeach ()
|
||||
foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
|
||||
foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS)
|
||||
set (hdf5_comp2)
|
||||
if (${comp} STREQUAL "C")
|
||||
if (comp STREQUAL "C")
|
||||
set (hdf5_comp "hdf5")
|
||||
elseif (${comp} STREQUAL "CXX")
|
||||
elseif (comp STREQUAL "CXX")
|
||||
set (hdf5_comp "hdf5_cpp")
|
||||
elseif (${comp} STREQUAL "HL")
|
||||
elseif (comp STREQUAL "HL")
|
||||
set (hdf5_comp "hdf5_hl")
|
||||
elseif (${comp} STREQUAL "CXX_HL")
|
||||
elseif (comp STREQUAL "CXX_HL")
|
||||
set (hdf5_comp "hdf5_hl_cpp")
|
||||
elseif (${comp} STREQUAL "Java")
|
||||
elseif (comp STREQUAL "Java")
|
||||
set (hdf5_comp "hdf5_java")
|
||||
elseif (${comp} STREQUAL "Tools")
|
||||
elseif (comp STREQUAL "Tools")
|
||||
set (hdf5_comp "hdf5_tools")
|
||||
elseif (${comp} STREQUAL "Fortran")
|
||||
elseif (comp STREQUAL "Fortran")
|
||||
set (hdf5_comp2 "hdf5_f90cstub")
|
||||
set (hdf5_comp "hdf5_fortran")
|
||||
elseif (${comp} STREQUAL "Fortran_HL")
|
||||
elseif (comp STREQUAL "Fortran_HL")
|
||||
set (hdf5_comp2 "hdf5_hl_f90cstub")
|
||||
set (hdf5_comp "hdf5_hl_fortran")
|
||||
endif ()
|
||||
if (${comp} STREQUAL "Java")
|
||||
if (comp STREQUAL "Java")
|
||||
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP)
|
||||
else ()
|
||||
list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP)
|
||||
endif ()
|
||||
if (${HAVE_COMP} LESS 0)
|
||||
if (${comp} STREQUAL "Java")
|
||||
if (comp STREQUAL "Java")
|
||||
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0)
|
||||
else ()
|
||||
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0)
|
||||
@ -183,7 +186,7 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
|
||||
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
|
||||
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
|
||||
endif ()
|
||||
elseif (${comp} STREQUAL "Java")
|
||||
elseif (comp STREQUAL "Java")
|
||||
set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1)
|
||||
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY)
|
||||
set (${COMP_LIBRARY} ${${COMP_LIBRARY}} hdf5::${hdf5_comp})
|
||||
|
@ -77,10 +77,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
|
||||
endif ()
|
||||
|
||||
if (NOT ERROR_APPEND)
|
||||
# append error output to the stdout output file
|
||||
# write back to original .err file
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
|
||||
else ()
|
||||
# write back to original .err file
|
||||
# append error output to the stdout output file
|
||||
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -110,8 +110,8 @@ if (TEST_MASK_ERROR)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# if the return value is !=0 bail out
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
|
||||
# if the return value is !=expected bail out
|
||||
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
|
||||
message (STATUS "ERROR OUTPUT: ${TEST_STREAM}")
|
||||
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}")
|
||||
endif ()
|
||||
@ -131,33 +131,33 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT "${str_act}" STREQUAL "${str_ref}")
|
||||
if (NOT "${str_act}" STREQUAL "")
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -165,7 +165,7 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -182,34 +182,34 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT "${str_act}" STREQUAL "${str_ref}")
|
||||
if (NOT "${str_act}" STREQUAL "")
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -217,7 +217,7 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -230,15 +230,15 @@ if (TEST_GREP_COMPARE)
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if ("${TEST_RESULT}" STREQUAL "0")
|
||||
if (NOT TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if ("${TEST_EXPECT}" STREQUAL "1")
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -1,5 +1,5 @@
|
||||
<CPackWiXPatch>
|
||||
<CPackWiXFragment Id="CM_CP_libraries.bin.hdf5.dll">
|
||||
<CPackWiXFragment Id="CM_CP_libraries.bin.hdf5.dll">
|
||||
<Environment Id="PATH"
|
||||
Name="PATH"
|
||||
Value="[CM_DP_libraries.bin]"
|
||||
@ -7,5 +7,5 @@
|
||||
Part="last"
|
||||
Action="set"
|
||||
System="yes"/>
|
||||
</CPackWiXFragment>
|
||||
</CPackWiXFragment>
|
||||
</CPackWiXPatch>
|
||||
|
@ -257,7 +257,7 @@ message (STATUS "Dashboard script configuration:\n${vars}\n")
|
||||
# On Cray XC40, configuring fails in the Fortran section when using the craype-mic-knl module.
|
||||
# When the configure phase is done with the craype-haswell module and the build phase is done
|
||||
# with the craype-mic-knl module, configure succeeds and tests pass on the knl compute nodes
|
||||
# for Intel, Cray, GCC and Clang compilers. If the variables aren't set or if not
|
||||
# for Intel, Cray, GCC and Clang compilers. If the variables aren't set or if not
|
||||
# cross compiling, the module switch will not occur.
|
||||
if (CMAKE_CROSSCOMPILING AND COMPILENODE_HWCOMPILE_MODULE AND COMPUTENODE_HWCOMPILE_MODULE)
|
||||
execute_process (COMMAND module switch ${COMPILENODE_HWCOMPILE_MODULE} ${COMPUTENODE_HWCOMPILE_MODULE})
|
||||
@ -277,7 +277,11 @@ message (STATUS "Dashboard script configuration:\n${vars}\n")
|
||||
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
|
||||
else ()
|
||||
file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG TAG_CONTENTS REGEX "^2([0-9]+)[-]([0-9]+)$")
|
||||
execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME})
|
||||
if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub")
|
||||
execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME})
|
||||
else ()
|
||||
execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME})
|
||||
endif ()
|
||||
message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml")
|
||||
execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
|
||||
while(result)
|
||||
@ -292,7 +296,11 @@ message (STATUS "Dashboard script configuration:\n${vars}\n")
|
||||
file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml)
|
||||
file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}.log ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}_Serial.log)
|
||||
unset(result CACHE)
|
||||
execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME})
|
||||
if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub")
|
||||
execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME})
|
||||
else ()
|
||||
execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME})
|
||||
endif ()
|
||||
message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml")
|
||||
execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
|
||||
while(result)
|
||||
|
@ -43,6 +43,9 @@ set (CTEST_SOURCE_VERSEXT "")
|
||||
#INSTALLDIR - HDF5-1.10.0 root folder
|
||||
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
|
||||
#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0
|
||||
#MODEL - CDash group name
|
||||
#HPC - run alternate configurations for HPC machines; sbatch, bsub, raybsub
|
||||
#MPI - enable MPI;
|
||||
if (DEFINED CTEST_SCRIPT_ARG)
|
||||
# transform ctest script arguments of the form
|
||||
# script.ctest,var1=value1,var2=value2
|
||||
@ -55,6 +58,11 @@ if (DEFINED CTEST_SCRIPT_ARG)
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
#HPC - run alternate configurations for HPC machines
|
||||
if (DEFINED HPC)
|
||||
set (BUILD_GENERATOR "Unix")
|
||||
endif ()
|
||||
|
||||
# build generator must be defined
|
||||
if (NOT DEFINED BUILD_GENERATOR)
|
||||
message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
|
||||
@ -92,84 +100,95 @@ endif ()
|
||||
|
||||
###################################################################
|
||||
######### Following describes compiler ############
|
||||
if (WIN32)
|
||||
set (SITE_OS_NAME "Windows")
|
||||
set (SITE_OS_VERSION "WIN7")
|
||||
if (${BUILD_GENERATOR} STREQUAL "VS201764")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2017")
|
||||
set (SITE_COMPILER_VERSION "15")
|
||||
elseif (${BUILD_GENERATOR} STREQUAL "VS2017")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2017")
|
||||
set (SITE_COMPILER_VERSION "15")
|
||||
elseif (${BUILD_GENERATOR} STREQUAL "VS201564")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2015")
|
||||
set (SITE_COMPILER_VERSION "14")
|
||||
elseif (${BUILD_GENERATOR} STREQUAL "VS2015")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2015")
|
||||
set (SITE_COMPILER_VERSION "14")
|
||||
elseif (${BUILD_GENERATOR} STREQUAL "VS201364")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2013")
|
||||
set (SITE_COMPILER_VERSION "12")
|
||||
elseif (${BUILD_GENERATOR} STREQUAL "VS2013")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2013")
|
||||
set (SITE_COMPILER_VERSION "12")
|
||||
elseif (${BUILD_GENERATOR} STREQUAL "VS201264")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2012")
|
||||
set (SITE_COMPILER_VERSION "11")
|
||||
elseif (${BUILD_GENERATOR} STREQUAL "VS2012")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2012")
|
||||
set (SITE_COMPILER_VERSION "11")
|
||||
else ()
|
||||
message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
|
||||
if (NOT DEFINED HPC)
|
||||
if (NOT DEFINED BUILD_GENERATOR)
|
||||
message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
|
||||
endif ()
|
||||
if (WIN32)
|
||||
set (SITE_OS_NAME "Windows")
|
||||
set (SITE_OS_VERSION "WIN7")
|
||||
if (BUILD_GENERATOR STREQUAL "VS201764")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2017")
|
||||
set (SITE_COMPILER_VERSION "15")
|
||||
elseif (BUILD_GENERATOR STREQUAL "VS2017")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2017")
|
||||
set (SITE_COMPILER_VERSION "15")
|
||||
elseif (BUILD_GENERATOR STREQUAL "VS201564")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2015")
|
||||
set (SITE_COMPILER_VERSION "14")
|
||||
elseif (BUILD_GENERATOR STREQUAL "VS2015")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2015")
|
||||
set (SITE_COMPILER_VERSION "14")
|
||||
elseif (BUILD_GENERATOR STREQUAL "VS201364")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2013")
|
||||
set (SITE_COMPILER_VERSION "12")
|
||||
elseif (BUILD_GENERATOR STREQUAL "VS2013")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2013")
|
||||
set (SITE_COMPILER_VERSION "12")
|
||||
elseif (BUILD_GENERATOR STREQUAL "VS201264")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
|
||||
set (SITE_OS_BITS "64")
|
||||
set (SITE_COMPILER_NAME "vs2012")
|
||||
set (SITE_COMPILER_VERSION "11")
|
||||
elseif (BUILD_GENERATOR STREQUAL "VS2012")
|
||||
set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012")
|
||||
set (SITE_OS_BITS "32")
|
||||
set (SITE_COMPILER_NAME "vs2012")
|
||||
set (SITE_COMPILER_VERSION "11")
|
||||
else ()
|
||||
message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
|
||||
endif ()
|
||||
## Set the following to unique id your computer ##
|
||||
set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX")
|
||||
else ()
|
||||
set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
## Set the following to unique id your computer ##
|
||||
if (APPLE)
|
||||
set (CTEST_SITE "MAC.XXXX")
|
||||
else ()
|
||||
set (CTEST_SITE "LINUX.XXXX")
|
||||
endif ()
|
||||
if (APPLE)
|
||||
execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set (ENV{CC} "${XCODE_CC}")
|
||||
set (ENV{CXX} "${XCODE_CXX}")
|
||||
set (CTEST_USE_LAUNCHERS 1)
|
||||
set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare")
|
||||
set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized")
|
||||
set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat")
|
||||
set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2")
|
||||
set (RR_FLAGS_C "${RR_FLAGS_COMMON}")
|
||||
set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}")
|
||||
set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}")
|
||||
set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}")
|
||||
endif ()
|
||||
endif ()
|
||||
## Set the following to unique id your computer ##
|
||||
set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX")
|
||||
else ()
|
||||
set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
|
||||
## Set the following to unique id your computer ##
|
||||
if (APPLE)
|
||||
set (CTEST_SITE "MAC.XXXX")
|
||||
else ()
|
||||
set (CTEST_SITE "LINUX.XXXX")
|
||||
endif ()
|
||||
if (APPLE)
|
||||
execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set (ENV{CC} "${XCODE_CC}")
|
||||
set (ENV{CXX} "${XCODE_CXX}")
|
||||
set (CTEST_USE_LAUNCHERS 1)
|
||||
set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare")
|
||||
set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized")
|
||||
set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat")
|
||||
set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2")
|
||||
set (RR_FLAGS_C "${RR_FLAGS_COMMON}")
|
||||
set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}")
|
||||
set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}")
|
||||
set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}")
|
||||
endif ()
|
||||
include (${CTEST_SOURCE_DIRECTORY}/config/cmake/scripts/HPC/${HPC}-HDF5options.cmake)
|
||||
endif ()
|
||||
###################################################################
|
||||
|
||||
###################################################################
|
||||
######### Following is for submission to CDash ############
|
||||
###################################################################
|
||||
set (MODEL "Experimental")
|
||||
if (NOT DEFINED MODEL)
|
||||
set (MODEL "Experimental")
|
||||
endif ()
|
||||
|
||||
###################################################################
|
||||
|
||||
###################################################################
|
||||
|
@ -33,12 +33,8 @@
|
||||
#############################################################################################
|
||||
#### fortran enabled ####
|
||||
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
|
||||
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
|
||||
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
|
||||
#### fortran disabled ####
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
|
||||
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
|
||||
|
||||
#############################################################################################
|
||||
#### java enabled ####
|
||||
@ -69,7 +65,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-1.10.9-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-1.12.4-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}")
|
||||
|
||||
#############################################################################################
|
||||
### enable parallel builds
|
||||
|
40
config/cmake/scripts/HPC/bsub-HDF5options.cmake
Normal file
40
config/cmake/scripts/HPC/bsub-HDF5options.cmake
Normal file
@ -0,0 +1,40 @@
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
#############################################################################################
|
||||
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
|
||||
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
|
||||
#############################################################################################
|
||||
|
||||
### uncomment/comment and change the following lines for other configuration options
|
||||
|
||||
#############################################################################################
|
||||
### enable parallel builds
|
||||
if (DEFINED MPI)
|
||||
# maximum parallel processor count for build and test ####
|
||||
set (MAX_PROC_COUNT 8)
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
|
||||
endif ()
|
||||
#############################################################################################
|
||||
### options to run test scripts in batch commands
|
||||
set (LOCAL_BATCH_SCRIPT_COMMAND "bsub")
|
||||
set (LOCAL_BATCH_TEST "TRUE")
|
||||
set (LOCAL_BATCH_SCRIPT_NAME "ctestS.lsf")
|
||||
set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctestP.lsf")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=srun")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6")
|
41
config/cmake/scripts/HPC/raybsub-HDF5options.cmake
Normal file
41
config/cmake/scripts/HPC/raybsub-HDF5options.cmake
Normal file
@ -0,0 +1,41 @@
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
#############################################################################################
|
||||
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
|
||||
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
|
||||
#############################################################################################
|
||||
|
||||
### uncomment/comment and change the following lines for other configuration options
|
||||
|
||||
#############################################################################################
|
||||
### enable parallel builds
|
||||
if (DEFINED MPI)
|
||||
# maximum parallel processor count for build and test ####
|
||||
set (MAX_PROC_COUNT 8)
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
|
||||
endif ()
|
||||
#############################################################################################
|
||||
### options to run test scripts in batch commands
|
||||
set (LOCAL_BATCH_SCRIPT_COMMAND "raybsub")
|
||||
set (LOCAL_BATCH_TEST "TRUE")
|
||||
set (LOCAL_BATCH_SCRIPT_NAME "ray_ctestS.lsf")
|
||||
set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ray_ctestP.lsf")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_COMMAND:STRING=${LOCAL_BATCH_SCRIPT_COMMAND}")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=mpirun")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-np")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6")
|
52
config/cmake/scripts/HPC/sbatch-HDF5options.cmake
Normal file
52
config/cmake/scripts/HPC/sbatch-HDF5options.cmake
Normal file
@ -0,0 +1,52 @@
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
#############################################################################################
|
||||
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
|
||||
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
|
||||
#############################################################################################
|
||||
|
||||
### uncomment/comment and change the following lines for other configuration options
|
||||
|
||||
#############################################################################################
|
||||
### enable parallel builds
|
||||
if (DEFINED MPI)
|
||||
# maximum parallel processor count for build and test ####
|
||||
set (MAX_PROC_COUNT 8)
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF")
|
||||
endif ()
|
||||
#############################################################################################
|
||||
### options to run test scripts in batch commands
|
||||
if (DEFINED KNL)
|
||||
### some additions and alternatives to cross compile on haswell for knl
|
||||
set (COMPILENODE_HWCOMPILE_MODULE "craype-haswell")
|
||||
set (COMPUTENODE_HWCOMPILE_MODULE "craype-mic-knl")
|
||||
set (LOCAL_BATCH_SCRIPT_NAME "knl_ctestS.sl")
|
||||
set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "knl_ctestP.sl")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake")
|
||||
else ()
|
||||
set (LOCAL_BATCH_SCRIPT_NAME "ctestS.sl")
|
||||
set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctestP.sl")
|
||||
endif ()
|
||||
set (LOCAL_BATCH_SCRIPT_COMMAND "sbatch")
|
||||
set (LOCAL_BATCH_TEST "TRUE")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=srun")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n")
|
||||
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6")
|
||||
|
||||
#############################################################################################
|
||||
#############################################################################################
|
@ -62,7 +62,7 @@ if (TEST_CHECKUB STREQUAL "YES")
|
||||
OUTPUT_VARIABLE TEST_OUT
|
||||
ERROR_VARIABLE TEST_ERROR
|
||||
)
|
||||
if (NOT ${TEST_RESULT} STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}")
|
||||
endif ()
|
||||
file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN)
|
||||
@ -70,7 +70,7 @@ if (TEST_CHECKUB STREQUAL "YES")
|
||||
|
||||
math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" )
|
||||
|
||||
if (NOT TEST_O_STRING_LEN STREQUAL "0")
|
||||
if (TEST_O_STRING_LEN)
|
||||
#$JAM_BIN/getub -c $s2 $origfile > $cmpfile
|
||||
EXECUTE_PROCESS (
|
||||
COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE}
|
||||
@ -108,7 +108,7 @@ if (TEST_CHECKUB STREQUAL "YES")
|
||||
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}")
|
||||
# if the return value is !=${TEST_EXPECT} bail out
|
||||
if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
|
||||
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}")
|
||||
endif ()
|
||||
else ()
|
||||
@ -121,7 +121,7 @@ else ()
|
||||
OUTPUT_VARIABLE TEST_OUT
|
||||
ERROR_VARIABLE TEST_ERROR
|
||||
)
|
||||
if (NOT TEST_H_STRING_LEN STREQUAL "0")
|
||||
if (TEST_H_STRING_LEN)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -60,7 +60,7 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err)
|
||||
endif ()
|
||||
|
||||
# if the return value is !=${TEST_EXPECT} bail out
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
|
||||
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
|
||||
if (NOT TEST_NOERRDISPLAY)
|
||||
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM)
|
||||
|
@ -60,7 +60,7 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
|
||||
endif ()
|
||||
|
||||
# if the return value is !=${TEST_EXPECT} bail out
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
|
||||
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
|
||||
if (NOT TEST_NOERRDISPLAY)
|
||||
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.out)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM)
|
||||
|
@ -229,7 +229,7 @@ macro (HDF_FUNCTION_TEST OTHER_TEST)
|
||||
endif ()
|
||||
|
||||
#message (STATUS "Performing ${OTHER_TEST}")
|
||||
TRY_COMPILE (${OTHER_TEST}
|
||||
try_compile (${OTHER_TEST}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
|
||||
COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}"
|
||||
@ -286,7 +286,7 @@ if (NOT WINDOWS)
|
||||
option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
|
||||
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
|
||||
try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
|
||||
${CMAKE_BINARY_DIR}
|
||||
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
|
||||
COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
|
||||
@ -443,7 +443,7 @@ if (NOT WINDOWS)
|
||||
# Check a bunch of time functions
|
||||
#-----------------------------------------------------------------------------
|
||||
CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY)
|
||||
foreach (test
|
||||
foreach (time_test
|
||||
HAVE_TM_GMTOFF
|
||||
HAVE___TM_GMTOFF
|
||||
# HAVE_TIMEZONE
|
||||
@ -453,7 +453,7 @@ if (NOT WINDOWS)
|
||||
HAVE_TM_ZONE
|
||||
HAVE_STRUCT_TM_TM_ZONE
|
||||
)
|
||||
HDF_FUNCTION_TEST (${test})
|
||||
HDF_FUNCTION_TEST (${time_test})
|
||||
endforeach ()
|
||||
if (NOT CYGWIN AND NOT MINGW)
|
||||
HDF_FUNCTION_TEST (HAVE_TIMEZONE)
|
||||
@ -506,6 +506,8 @@ CHECK_FUNCTION_EXISTS (lround ${HDF_PREFIX}_HAVE_LROUND)
|
||||
CHECK_FUNCTION_EXISTS (lroundf ${HDF_PREFIX}_HAVE_LROUNDF)
|
||||
CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT)
|
||||
|
||||
CHECK_FUNCTION_EXISTS (pread ${HDF_PREFIX}_HAVE_PREAD)
|
||||
CHECK_FUNCTION_EXISTS (pwrite ${HDF_PREFIX}_HAVE_PWRITE)
|
||||
CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R)
|
||||
CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM)
|
||||
CHECK_FUNCTION_EXISTS (round ${HDF_PREFIX}_HAVE_ROUND)
|
||||
@ -555,7 +557,7 @@ endif ()
|
||||
# Check a bunch of other functions
|
||||
#-----------------------------------------------------------------------------
|
||||
if (NOT WINDOWS)
|
||||
foreach (test
|
||||
foreach (other_test
|
||||
HAVE_ATTRIBUTE
|
||||
HAVE_C99_FUNC
|
||||
# STDC_HEADERS
|
||||
@ -564,7 +566,7 @@ if (NOT WINDOWS)
|
||||
SYSTEM_SCOPE_THREADS
|
||||
HAVE_SOCKLEN_T
|
||||
)
|
||||
HDF_FUNCTION_TEST (${test})
|
||||
HDF_FUNCTION_TEST (${other_test})
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
macro (SET_HDF_BUILD_TYPE)
|
||||
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
if(_isMultiConfig)
|
||||
set(HDF_CFG_NAME ${CTEST_CONFIGURATION_TYPE})
|
||||
set(HDF_CFG_NAME ${CMAKE_BUILD_TYPE})
|
||||
set(HDF_BUILD_TYPE ${CMAKE_CFG_INTDIR})
|
||||
set(HDF_CFG_BUILD_TYPE \${CMAKE_INSTALL_CONFIG_NAME})
|
||||
else()
|
||||
@ -170,7 +170,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
|
||||
if (${importtype} MATCHES "IMPORT")
|
||||
set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}")
|
||||
endif ()
|
||||
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
if (${HDF_CFG_NAME} MATCHES "Debug")
|
||||
set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME})
|
||||
else ()
|
||||
set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME})
|
||||
@ -273,7 +273,7 @@ macro (HDF_README_PROPERTIES target_fortran)
|
||||
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2015")
|
||||
else ()
|
||||
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2017")
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}")
|
||||
endif ()
|
||||
|
@ -96,7 +96,7 @@ endmacro ()
|
||||
# Check a bunch of cxx functions
|
||||
#-----------------------------------------------------------------------------
|
||||
if (CMAKE_CXX_COMPILER_LOADED)
|
||||
foreach (test
|
||||
foreach (cxx_test
|
||||
OLD_HEADER_FILENAME
|
||||
HDF_NO_NAMESPACE
|
||||
HDF_NO_STD
|
||||
@ -104,6 +104,6 @@ if (CMAKE_CXX_COMPILER_LOADED)
|
||||
NO_STATIC_CAST
|
||||
CXX_HAVE_OFFSETOF
|
||||
)
|
||||
HDF_CXX_FUNCTION_TEST (${test})
|
||||
HDF_CXX_FUNCTION_TEST (${cxx_test})
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
@ -57,15 +57,15 @@ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if ("${TEST_RESULT}" STREQUAL "0")
|
||||
if (NOT TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if ("${TEST_EXPECT}" STREQUAL "1")
|
||||
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -80,7 +80,7 @@ if (TEST_REGEX)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT)
|
||||
if ("${REGEX_RESULT}" STREQUAL "0")
|
||||
if (NOT REGEX_RESULT)
|
||||
message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -111,7 +111,7 @@ if (TEST_APPEND)
|
||||
endif ()
|
||||
|
||||
# if the return value is !=${TEST_EXPECT} bail out
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
|
||||
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
|
||||
if (NOT TEST_NOERRDISPLAY)
|
||||
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
@ -126,7 +126,7 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
|
||||
# remove special output
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
|
||||
if ("${TEST_FIND_RESULT}" GREATER "0")
|
||||
if (TEST_FIND_RESULT GREATER 0)
|
||||
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
|
||||
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
|
||||
endif ()
|
||||
@ -207,33 +207,33 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT "${str_act}" STREQUAL "${str_ref}")
|
||||
if (NOT "${str_act}" STREQUAL "")
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -241,7 +241,7 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -258,34 +258,34 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
if (len_act GREATER 0 AND len_ref GREATER 0)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
list (GET test_ref ${line} str_ref)
|
||||
if (NOT "${str_act}" STREQUAL "${str_ref}")
|
||||
if (NOT "${str_act}" STREQUAL "")
|
||||
if (NOT str_act STREQUAL str_ref)
|
||||
if (str_act)
|
||||
set (TEST_RESULT 1)
|
||||
message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
if (len_act EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
if (len_ref EQUAL 0)
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
if (NOT len_act EQUAL len_ref)
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -293,7 +293,7 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -306,15 +306,15 @@ if (TEST_GREP_COMPARE)
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if ("${TEST_RESULT}" STREQUAL "0")
|
||||
if (NOT TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if ("${TEST_EXPECT}" STREQUAL "1")
|
||||
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
|
||||
if (TEST_EXPECT)
|
||||
# TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
if (TEST_RESULT)
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -8,14 +8,3 @@ set(CMAKE_Fortran_COMPILER ftn)
|
||||
|
||||
# the following is used if cross-compiling
|
||||
set(CMAKE_CROSSCOMPILING_EMULATOR "")
|
||||
|
||||
# option to use pre-generated H5Tinit.c file
|
||||
set(HDF5_USE_PREGEN OFF)
|
||||
# directory where H5Tinit.c file will be found
|
||||
#set(HDF5_USE_PREGEN_DIR "/lscratch1/lknox/HDF5_1_10_4/CMake-hdf5-1.10.4")
|
||||
|
||||
# option to generate H5Tinit.c by running H5detect on knl compute node during build
|
||||
set(HDF5_BATCH_H5DETECT ON)
|
||||
set(HDF5_BATCH_CMD "sbatch")
|
||||
set(HDF5_BATCH_H5DETECT_SCRIPT "knl_H5detect.sl")
|
||||
set(MPIEXEC_EXECUTABLE "srun")
|
||||
|
46
configure.ac
46
configure.ac
@ -1130,11 +1130,12 @@ case "$host_cpu-$host_vendor-$host_os" in
|
||||
## functionality so clock_gettime and CLOCK_MONOTONIC are defined
|
||||
## correctly. This was later updated to 200112L so that
|
||||
## posix_memalign() is visible for the direct VFD code on Linux
|
||||
## systems.
|
||||
## systems. Even later, this was changed to 200809L to support
|
||||
## pread/pwrite in VFDs.
|
||||
##
|
||||
## POSIX feature information can be found in the gcc manual at:
|
||||
## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
|
||||
H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS"
|
||||
H5_CPPFLAGS="-D_POSIX_C_SOURCE=200809L $H5_CPPFLAGS"
|
||||
|
||||
## Need to add this so that O_DIRECT is visible for the direct
|
||||
## VFD on Linux systems.
|
||||
@ -3265,6 +3266,47 @@ case "X-$STRICT_FORMAT_CHECKS" in
|
||||
esac
|
||||
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Enable use of pread/pwrite instead of read/write in certain VFDs.
|
||||
##
|
||||
AC_SUBST([PREADWRITE])
|
||||
|
||||
## Check these first to avoid interspersed output in the AC_ARG_ENABLE line
|
||||
## below. (Probably overkill to check for both, but we'll be extra careful)
|
||||
PREADWRITE_HAVE_BOTH=yes
|
||||
AC_CHECK_FUNC([pread], [], [PREADWRITE_HAVE_BOTH=no])
|
||||
AC_CHECK_FUNC([pwrite], [], [PREADWRITE_HAVE_BOTH=no])
|
||||
|
||||
AC_MSG_CHECKING([whether to use pread/pwrite instead of read/write in certain VFDs])
|
||||
AC_ARG_ENABLE([preadwrite],
|
||||
[AS_HELP_STRING([--enable-preadwrite],
|
||||
[Enable using pread/pwrite instead of read/write in sec2/log/core VFDs.
|
||||
[default=yes if pread/pwrite are present]])],
|
||||
[PREADWRITE=$enableval])
|
||||
|
||||
## Set the default level.
|
||||
if test "X-$PREADWRITE" = X- ; then
|
||||
PREADWRITE=yes
|
||||
fi
|
||||
|
||||
case "X-$PREADWRITE" in
|
||||
X-yes)
|
||||
if test "X-$PREADWRITE_HAVE_BOTH" = "X-yes"; then
|
||||
AC_DEFINE([HAVE_PREADWRITE], [1], [Define if both pread and pwrite exist.])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
;;
|
||||
X-no)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unrecognized value: $PREADWRITE])
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Enable embedded library information
|
||||
##
|
||||
|
@ -71,7 +71,7 @@
|
||||
vds-simpleIO.h5
|
||||
vds-eiger.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES-clear-objects")
|
||||
@ -91,7 +91,7 @@
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES-${example}")
|
||||
@ -150,7 +150,7 @@
|
||||
WORKING_DIRECTORY
|
||||
${PROJECT_BINARY_DIR}/H5EX-shared
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (EXAMPLES-shared-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES-shared-clear-objects")
|
||||
@ -171,7 +171,7 @@
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES-shared-${example}")
|
||||
@ -181,42 +181,42 @@
|
||||
### Windows pops up a modal permission dialog on this test
|
||||
if (H5_HAVE_PARALLEL AND NOT WIN32)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME EXAMPLES_PAR-ph5example COMMAND $<TARGET_FILE:ph5example>)
|
||||
add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS})
|
||||
else ()
|
||||
add_test (NAME EXAMPLES_PAR-ph5example COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:ph5example>"
|
||||
add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example>;${MPIEXEC_POSTFLAGS}"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=ph5example.txt"
|
||||
#-D "TEST_REFERENCE=ph5example.out"
|
||||
-D "TEST_OUTPUT=ph5example.out"
|
||||
-D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors"
|
||||
-D "TEST_FILTER:STRING=PHDF5 tests finished with no errors"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
set_tests_properties (EXAMPLES_PAR-ph5example PROPERTIES DEPENDS ${last_test})
|
||||
if (last_test)
|
||||
set_tests_properties (MPI_TEST_EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES_PAR-ph5example")
|
||||
set (last_test "MPI_TEST_EXAMPLES-ph5example")
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND $<TARGET_FILE:ph5example-shared>)
|
||||
add_test (NAME MPI_TEST_EXAMPLES-shared-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example-shared> ${MPIEXEC_POSTFLAGS})
|
||||
else ()
|
||||
add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:ph5example-shared>"
|
||||
add_test (NAME MPI_TEST_EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example-shared>;${MPIEXEC_POSTFLAGS}"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=ph5example-shared.txt"
|
||||
#-D "TEST_REFERENCE=ph5example-shared.out"
|
||||
-D "TEST_OUTPUT=ph5example-shared.out"
|
||||
-D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors"
|
||||
-D "TEST_FILTER:STRING=PHDF5 tests finished with no errors"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES DEPENDS ${last_test})
|
||||
set_tests_properties (MPI_TEST_EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
|
||||
if (last_test)
|
||||
set_tests_properties (MPI_TEST_EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "EXAMPLES_PAR-shared-ph5example")
|
||||
set (last_test "MPI_TEST_EXAMPLES-shared-ph5example")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -37,7 +37,7 @@
|
||||
SDScompound.h5
|
||||
test.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f90_ex-clear-objects")
|
||||
@ -62,7 +62,7 @@
|
||||
SDScompound.h5
|
||||
test.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (f90_ex-shared-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f90_ex-shared-clear-objects")
|
||||
@ -83,7 +83,7 @@ foreach (example ${examples})
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f90_ex_${example}")
|
||||
@ -102,59 +102,57 @@ foreach (example ${examples})
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (f90_ex-shared_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f90_ex-shared_${example}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if (HDF5_ENABLE_F2003)
|
||||
foreach (example ${F2003_examples})
|
||||
foreach (example ${F2003_examples})
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>)
|
||||
else ()
|
||||
add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=f03_ex_${example}.txt"
|
||||
#-D "TEST_REFERENCE=f03_ex_${example}.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (last_test)
|
||||
set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f03_ex_${example}")
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>)
|
||||
add_test (NAME f03_ex-shared_${example} COMMAND $<TARGET_FILE:f03_ex_${example}-shared>)
|
||||
else ()
|
||||
add_test (NAME f03_ex_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}>"
|
||||
add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=f03_ex_${example}.txt"
|
||||
#-D "TEST_REFERENCE=f03_ex_${example}.out"
|
||||
-D "TEST_OUTPUT=f03_ex_${example}-shared.txt"
|
||||
#-D "TEST_REFERENCE=f03_ex_${example}-shared.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
if (last_test)
|
||||
set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f03_ex_${example}")
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME f03_ex-shared_${example} COMMAND $<TARGET_FILE:f03_ex_${example}-shared>)
|
||||
else ()
|
||||
add_test (NAME f03_ex-shared_${example} COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:f03_ex_${example}-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_OUTPUT=f03_ex_${example}-shared.txt"
|
||||
#-D "TEST_REFERENCE=f03_ex_${example}-shared.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
set_tests_properties (f03_ex-shared_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "f03_ex-shared_${example}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
set (last_test "f03_ex-shared_${example}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
|
||||
add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:f90_ex_ph5example> ${MPIEXEC_POSTFLAGS})
|
||||
add_test (NAME MPI_TEST_f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:f90_ex_ph5example> ${MPIEXEC_POSTFLAGS})
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:f90_ex_ph5example> ${MPIEXEC_POSTFLAGS})
|
||||
add_test (NAME MPI_TEST_f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:f90_ex_ph5example> ${MPIEXEC_POSTFLAGS})
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -61,8 +61,6 @@ RunTest()
|
||||
./$TEST_EXEC
|
||||
}
|
||||
|
||||
F2003_ENABLED=@HAVE_FORTRAN_2003@
|
||||
|
||||
################## MAIN ##################
|
||||
|
||||
# Run tests
|
||||
@ -97,17 +95,8 @@ then
|
||||
RunTest mountexample &&\
|
||||
rm mountexample &&\
|
||||
RunTest compound &&\
|
||||
rm compound); then
|
||||
EXIT_VALUE=${EXIT_SUCCESS}
|
||||
else
|
||||
EXIT_VALUE=${EXIT_FAILURE}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $EXIT_VALUE -eq ${EXIT_SUCCESS} -a "$F2003_ENABLED" = "yes" ]
|
||||
then
|
||||
# Add attention tests for Fortran 2003 features
|
||||
if (RunTest rwdset_fortran2003 &&\
|
||||
rm compound &&\
|
||||
RunTest rwdset_fortran2003 &&\
|
||||
rm rwdset_fortran2003 &&\
|
||||
RunTest nested_derived_type &&\
|
||||
rm nested_derived_type &&\
|
||||
@ -120,12 +109,11 @@ then
|
||||
EXIT_VALUE=${EXIT_FAILURE}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Cleanup
|
||||
rm *.o
|
||||
rm *.h5
|
||||
echo
|
||||
|
||||
exit $EXIT_VALUE
|
||||
exit $EXIT_VALUE
|
||||
|
||||
|
@ -9,11 +9,7 @@ if (WIN32)
|
||||
if (NOT H5_HAVE_PARALLEL)
|
||||
set (H5_NOPAREXP ";")
|
||||
endif ()
|
||||
if (NOT HDF5_ENABLE_F2003)
|
||||
set (H5_NOF03EXP ";")
|
||||
else ()
|
||||
set (H5_F03EXP ";")
|
||||
endif ()
|
||||
set (H5_F03EXP ";")
|
||||
configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY)
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -995,167 +995,6 @@ done:
|
||||
}
|
||||
|
||||
|
||||
#ifdef NEW_HYPERSLAB_API
|
||||
/****if* H5Sf/h5scombine_hyperslab_c
|
||||
* NAME
|
||||
* h5scombine_hyperslab_c
|
||||
* PURPOSE
|
||||
* Call H5Scombine_hyperslab
|
||||
* INPUTS
|
||||
* space_id - identifier of the dataspace
|
||||
* operator - defines how the new selection is combined
|
||||
* start - offset of start of hyperslab
|
||||
* count - number of blocks included in the hyperslab
|
||||
* stride - hyperslab stride (interval between blocks)
|
||||
* block - size of block in the hyperslab
|
||||
* OUTPUTS
|
||||
* hyper_id - identifier for the new dataspace
|
||||
* RETURNS
|
||||
* 0 on success, -1 on failure
|
||||
* AUTHOR
|
||||
* Elena Pourmal
|
||||
* Monday, October 7, 2002
|
||||
* HISTORY
|
||||
*
|
||||
* SOURCE
|
||||
*/
|
||||
|
||||
int_f
|
||||
h5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id)
|
||||
/******/
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space_id;
|
||||
hid_t c_hyper_id;
|
||||
hsize_t *c_start = NULL;
|
||||
hsize_t *c_count = NULL;
|
||||
hsize_t *c_stride = NULL;
|
||||
hsize_t *c_block = NULL;
|
||||
|
||||
H5S_seloper_t c_op;
|
||||
herr_t status;
|
||||
int rank;
|
||||
int i;
|
||||
|
||||
rank = H5Sget_simple_extent_ndims(*space_id);
|
||||
if (rank < 0 ) return ret_value;
|
||||
c_start = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (c_start == NULL) goto DONE;
|
||||
|
||||
c_count = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (c_count == NULL) goto DONE;
|
||||
|
||||
c_stride = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (c_stride == NULL) goto DONE;
|
||||
|
||||
c_block = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
|
||||
if (c_block == NULL) goto DONE;
|
||||
|
||||
|
||||
/*
|
||||
* Reverse dimensions due to C-FORTRAN storage order.
|
||||
*/
|
||||
|
||||
for (i=0; i < rank; i++) {
|
||||
int t= (rank - i) - 1;
|
||||
c_start[i] = (hsize_t)start[t];
|
||||
c_count[i] = (hsize_t)count[t];
|
||||
c_stride[i] = (hsize_t)stride[t];
|
||||
c_block[i] = (hsize_t)block[t];
|
||||
}
|
||||
|
||||
c_op = (H5S_seloper_t)*op;
|
||||
|
||||
c_space_id = (hid_t)*space_id;
|
||||
c_hyper_id = H5Scombine_hyperslab(c_space_id, c_op, c_start, c_stride, c_count, c_block);
|
||||
if ( c_hyper_id < 0 ) goto DONE;
|
||||
*hyper_id = (hid_t_f)c_hyper_id;
|
||||
ret_value = 0;
|
||||
DONE:
|
||||
if(c_start != NULL) HDfree(c_start);
|
||||
if(c_count != NULL) HDfree(c_count);
|
||||
if(c_stride!= NULL) HDfree(c_stride);
|
||||
if(c_block != NULL) HDfree(c_block);
|
||||
return ret_value;
|
||||
}
|
||||
/****if* H5Sf/h5scombine_select_c
|
||||
* NAME
|
||||
* h5scombine_select_c
|
||||
* PURPOSE
|
||||
* Call H5Scombine_ select
|
||||
* INPUTS
|
||||
* space1_id - identifier of the first dataspace
|
||||
* operator - defines how the new selection is combined
|
||||
* space2_id - identifier of the second dataspace
|
||||
* OUTPUTS
|
||||
* ds_id - identifier for the new dataspace
|
||||
* RETURNS
|
||||
* 0 on success, -1 on failure
|
||||
* AUTHOR
|
||||
* Elena Pourmal
|
||||
* Monday, October 7, 2002
|
||||
* HISTORY
|
||||
*
|
||||
* SOURCE
|
||||
*/
|
||||
|
||||
int_f
|
||||
h5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id)
|
||||
/******/
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space1_id;
|
||||
hid_t c_space2_id;
|
||||
hid_t c_ds_id;
|
||||
H5S_seloper_t c_op;
|
||||
|
||||
c_op = (H5S_seloper_t)*op;
|
||||
|
||||
c_space1_id = (hid_t)*space1_id;
|
||||
c_space2_id = (hid_t)*space2_id;
|
||||
c_ds_id = H5Scombine_select(c_space1_id, c_op, c_space2_id);
|
||||
if ( c_ds_id < 0 ) return ret_value;
|
||||
*ds_id = (hid_t_f)c_ds_id;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
/****if* H5Sf/h5sselect_select_c
|
||||
* NAME
|
||||
* h5sselect_select_c
|
||||
* PURPOSE
|
||||
* Call H5Sselect_ select
|
||||
* INPUTS
|
||||
* space1_id - identifier of the first dataspace to modify
|
||||
* operator - defines how the new selection is combined
|
||||
* space2_id - identifier of the second dataspace
|
||||
* RETURNS
|
||||
* 0 on success, -1 on failure
|
||||
* AUTHOR
|
||||
* Elena Pourmal
|
||||
* Monday, October 7, 2002
|
||||
* HISTORY
|
||||
*
|
||||
* SOURCE
|
||||
*/
|
||||
|
||||
int_f
|
||||
h5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id)
|
||||
/******/
|
||||
{
|
||||
int ret_value = -1;
|
||||
hid_t c_space1_id;
|
||||
hid_t c_space2_id;
|
||||
H5S_seloper_t c_op;
|
||||
|
||||
c_op = (H5S_seloper_t)*op;
|
||||
|
||||
c_space1_id = (hid_t)*space1_id;
|
||||
c_space2_id = (hid_t)*space2_id;
|
||||
if( H5Sselect_select(c_space1_id, c_op, c_space2_id)< 0) return ret_value;
|
||||
ret_value = 0;
|
||||
return ret_value;
|
||||
}
|
||||
#endif /*NEW_HYPERSLAB_API*/
|
||||
/****if* H5Sf/h5sget_select_type_c
|
||||
* NAME
|
||||
* h5sget_select_type_c
|
||||
|
@ -1275,310 +1275,6 @@ CONTAINS
|
||||
DEALLOCATE(def_stride)
|
||||
|
||||
END SUBROUTINE h5sselect_hyperslab_f
|
||||
! !$!
|
||||
! !$!****s* H5S/h5scombine_hyperslab_f
|
||||
! !$!
|
||||
! !$! NAME
|
||||
! !$! h5scombine_hyperslab_f
|
||||
! !$!
|
||||
! !$! PURPOSE
|
||||
! !$! Combine a hyperslab selection with the current
|
||||
! !$! selection for a dataspace
|
||||
! !$!
|
||||
! !$! INPUTS
|
||||
! !$! space_id - dataspace of selection to use
|
||||
! !$! operator - flag, valid values are:
|
||||
! !$! H5S_SELECT_NOOP_F
|
||||
! !$! H5S_SELECT_SET_F
|
||||
! !$! H5S_SELECT_OR_F
|
||||
! !$! H5S_SELECT_AND_F
|
||||
! !$! H5S_SELECT_XOR_F
|
||||
! !$! H5S_SELECT_NOTB_F
|
||||
! !$! H5S_SELECT_NOTA_F
|
||||
! !$! H5S_SELECT_APPEND_F
|
||||
! !$! H5S_SELECT_PREPEND_F
|
||||
! !$! start - array with hyperslab offsets
|
||||
! !$! count - number of blocks included in the
|
||||
! !$! hyperslab
|
||||
! !$! OUTPUTS
|
||||
! !$! hyper_id - identifier for the new hyperslab
|
||||
! !$! hdferr: - error code
|
||||
! !$! Success: 0
|
||||
! !$! Failure: -1
|
||||
! !$! OPTIONAL PARAMETERS
|
||||
! !$! stride - array with hyperslab strides
|
||||
! !$! block - array with hyperslab block sizes
|
||||
! !$!
|
||||
! !$! AUTHOR
|
||||
! !$! Elena Pourmal
|
||||
! !$! October 7, 2002
|
||||
! !$!
|
||||
! !$! HISTORY
|
||||
! !$!
|
||||
! !$!
|
||||
! !$! NOTES
|
||||
! !$! Commented out until 1.6 ? 10/08/2002
|
||||
! !$!
|
||||
! !$! SOURCE
|
||||
! SUBROUTINE h5scombine_hyperslab_f(space_id, operator, start, count, &
|
||||
! hyper_id, hdferr, stride, block)
|
||||
! IMPLICIT NONE
|
||||
! INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
|
||||
! INTEGER, INTENT(IN) :: operator ! Flag, valid values are:
|
||||
! H5S_SELECT_NOOP_F
|
||||
! H5S_SELECT_SET_F
|
||||
! H5S_SELECT_OR_F
|
||||
! H5S_SELECT_AND_F
|
||||
! H5S_SELECT_XOR_F
|
||||
! H5S_SELECT_NOTB_F
|
||||
! H5S_SELECT_NOTA_F
|
||||
! H5S_SELECT_APPEND_F
|
||||
! H5S_SELECT_PREPEND_F
|
||||
!
|
||||
! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start
|
||||
! Starting coordinates of the hyperslab
|
||||
! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
|
||||
! Number of blocks to select
|
||||
! from dataspace
|
||||
! INTEGER(HID_T), INTENT(OUT) :: hyper_id ! New hyperslab identifier
|
||||
! INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride
|
||||
! Array of how many elements to move
|
||||
! in each direction
|
||||
! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block
|
||||
! Sizes of element block
|
||||
! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block
|
||||
! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride
|
||||
! INTEGER :: rank
|
||||
! INTEGER :: error1, error2
|
||||
|
||||
! INTERFACE
|
||||
! INTEGER FUNCTION h5scombine_hyperslab_c(space_id, operator, &
|
||||
! start, count, stride, block, hyper_id)
|
||||
! USE H5GLOBAL
|
||||
! !DEC$IF DEFINED(HDF5F90_WINDOWS)
|
||||
! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_HYPERSLAB_C'::h5scombine_hyperslab_c
|
||||
! !DEC$ENDIF
|
||||
! INTEGER(HID_T), INTENT(IN) :: space_id
|
||||
! INTEGER, INTENT(IN) :: operator
|
||||
! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start
|
||||
! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
|
||||
! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride
|
||||
! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block
|
||||
! INTEGER(HID_T), INTENT(OUT) :: hyper_id
|
||||
! END FUNCTION h5scombine_hyperslab_c
|
||||
! END INTERFACE
|
||||
|
||||
! if (present(stride).and. present(block)) then
|
||||
! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, &
|
||||
! stride, block, hyper_id)
|
||||
! return
|
||||
! endif
|
||||
! Case of optional parameters.
|
||||
!
|
||||
! Find the rank of the dataspace to allocate memory for
|
||||
! default stride and block arrays.
|
||||
!
|
||||
! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr)
|
||||
! if( hdferr .EQ. -1) return
|
||||
!
|
||||
! if (present(stride).and. .not.present(block)) then
|
||||
! allocate(def_block(rank), stat=error1)
|
||||
! if (error1.NE.0) then
|
||||
! hdferr = -1
|
||||
! return
|
||||
! endif
|
||||
! def_block = 1
|
||||
! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, &
|
||||
! stride, def_block, hyper_id)
|
||||
! deallocate(def_block)
|
||||
! return
|
||||
! endif
|
||||
|
||||
! if (.not.present(stride).and. present(block)) then
|
||||
! allocate(def_stride(rank), stat=error2)
|
||||
! if (error2.NE.0) then
|
||||
! hdferr = -1
|
||||
! return
|
||||
! endif
|
||||
! def_stride = 1
|
||||
! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, &
|
||||
! def_stride, block, hyper_id)
|
||||
! deallocate(def_stride)
|
||||
! return
|
||||
! endif
|
||||
! allocate(def_block(rank), stat=error1)
|
||||
! allocate(def_stride(rank), stat=error2)
|
||||
! if ((error1.NE.0) .OR. (error2.NE.0)) then
|
||||
! hdferr = -1
|
||||
! return
|
||||
! endif
|
||||
! def_block = 1
|
||||
! def_stride = 1
|
||||
! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, &
|
||||
! def_stride, def_block, hyper_id)
|
||||
! deallocate(def_block)
|
||||
! deallocate(def_stride)
|
||||
|
||||
! END SUBROUTINE h5scombine_hyperslab_f
|
||||
|
||||
! !$!
|
||||
! !$!****s* H5S/
|
||||
! !$!
|
||||
! !$! NAME
|
||||
! !$! h5scombine_select_f
|
||||
! !$!
|
||||
! !$! PURPOSE
|
||||
! !$! Combine two hyperslab selections with an operation
|
||||
! !$! and return a dataspace with resulting selection.
|
||||
! !$!
|
||||
! !$! INPUTS
|
||||
! !$! space1_id - dataspace of selection to use
|
||||
! !$! operator - flag, valid values are:
|
||||
! !$! H5S_SELECT_NOOP_F
|
||||
! !$! H5S_SELECT_SET_F
|
||||
! !$! H5S_SELECT_OR_F
|
||||
! !$! H5S_SELECT_AND_F
|
||||
! !$! H5S_SELECT_XOR_F
|
||||
! !$! H5S_SELECT_NOTB_F
|
||||
! !$! H5S_SELECT_NOTA_F
|
||||
! !$! H5S_SELECT_APPEND_F
|
||||
! !$! H5S_SELECT_PREPEND_F
|
||||
! !$! space2_id - dataspace of selection to use
|
||||
! !$! OUTPUTS
|
||||
! !$! ds_id - idataspace identifier with the new selection
|
||||
! !$! hdferr: - error code
|
||||
! !$! Success: 0
|
||||
! !$! Failure: -1
|
||||
! !$! OPTIONAL PARAMETERS - NONE
|
||||
! !$!
|
||||
! !$! AUTHOR
|
||||
! !$! Elena Pourmal
|
||||
! !$! October 7, 2002
|
||||
! !$!
|
||||
! !$! HISTORY
|
||||
! !$!
|
||||
! !$!
|
||||
! !$! NOTES commented out until 1.6 release(?) 10/08/2002
|
||||
! !$!
|
||||
|
||||
! ! SOURCE
|
||||
! !$ SUBROUTINE h5scombine_select_f(space1_id, operator, space2_id, &
|
||||
! ds_id, hdferr)
|
||||
! IMPLICIT NONE
|
||||
! INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier
|
||||
! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier
|
||||
! INTEGER, INTENT(IN) :: operator ! Flag, valid values are:
|
||||
! H5S_SELECT_NOOP_F
|
||||
! H5S_SELECT_SET_F
|
||||
! H5S_SELECT_OR_F
|
||||
! H5S_SELECT_AND_F
|
||||
! H5S_SELECT_XOR_F
|
||||
! H5S_SELECT_NOTB_F
|
||||
! H5S_SELECT_NOTA_F
|
||||
! H5S_SELECT_APPEND_F
|
||||
! H5S_SELECT_PREPEND_F
|
||||
!
|
||||
! INTEGER(HID_T), INTENT(OUT) :: ds_id ! New dataspace identifier
|
||||
! INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
!
|
||||
! INTERFACE
|
||||
! INTEGER FUNCTION h5scombine_select_c(space1_id, operator, &
|
||||
! space2_id, ds_id)
|
||||
! USE H5GLOBAL
|
||||
! !DEC$IF DEFINED(HDF5F90_WINDOWS)
|
||||
! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SCOMBINE_SELECT_C'::h5scombine_select_c
|
||||
! !DEC$ENDIF
|
||||
! INTEGER(HID_T), INTENT(IN) :: space1_id
|
||||
! INTEGER(HID_T), INTENT(IN) :: space2_id
|
||||
! INTEGER, INTENT(IN) :: operator
|
||||
! INTEGER(HID_T), INTENT(OUT) :: ds_id
|
||||
! END FUNCTION h5scombine_select_c
|
||||
! END INTERFACE
|
||||
|
||||
! hdferr = h5scombine_select_c(space1_id, operator, space2_id, &
|
||||
! ds_id)
|
||||
! return
|
||||
|
||||
! END SUBROUTINE h5scombine_select_f
|
||||
|
||||
! !$!
|
||||
! !$!****s* H5S/
|
||||
! !$!
|
||||
! !$! NAME
|
||||
! !$! h5sselect_select_f
|
||||
! !$!
|
||||
! !$! PURPOSE
|
||||
! !$! Refine a hyperslab selection with an operation
|
||||
! !$! using second hyperslab
|
||||
! !$!
|
||||
! !$! INPUTS
|
||||
! !$! space1_id - dataspace of selection to modify
|
||||
! !$! operator - flag, valid values are:
|
||||
! !$! H5S_SELECT_NOOP_F
|
||||
! !$! H5S_SELECT_SET_F
|
||||
! !$! H5S_SELECT_OR_F
|
||||
! !$! H5S_SELECT_AND_F
|
||||
! !$! H5S_SELECT_XOR_F
|
||||
! !$! H5S_SELECT_NOTB_F
|
||||
! !$! H5S_SELECT_NOTA_F
|
||||
! !$! H5S_SELECT_APPEND_F
|
||||
! !$! H5S_SELECT_PREPEND_F
|
||||
! !$! space2_id - dataspace of selection to use
|
||||
! !$!
|
||||
! !$! OUTPUTS
|
||||
! !$! hdferr: - error code
|
||||
! !$! Success: 0
|
||||
! !$! Failure: -1
|
||||
! !$! OPTIONAL PARAMETERS - NONE
|
||||
! !$!
|
||||
! !$! AUTHOR
|
||||
! !$! Elena Pourmal
|
||||
! !$! October 7, 2002
|
||||
! !$!
|
||||
! !$! HISTORY
|
||||
! !$!
|
||||
! !$!
|
||||
! !$! NOTESCommented out until 1.6 release(?) 10/08/2002 EIP
|
||||
! !$!
|
||||
|
||||
! ! SOURCE
|
||||
! SUBROUTINE h5sselect_select_f(space1_id, operator, space2_id, &
|
||||
! hdferr)
|
||||
! IMPLICIT NONE
|
||||
! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! Dataspace identifier to
|
||||
! modify
|
||||
! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier
|
||||
! INTEGER, INTENT(IN) :: operator ! Flag, valid values are:
|
||||
! H5S_SELECT_NOOP_F
|
||||
! H5S_SELECT_SET_F
|
||||
! H5S_SELECT_OR_F
|
||||
! H5S_SELECT_AND_F
|
||||
! H5S_SELECT_XOR_F
|
||||
! H5S_SELECT_NOTB_F
|
||||
! H5S_SELECT_NOTA_F
|
||||
! H5S_SELECT_APPEND_F
|
||||
! H5S_SELECT_PREPEND_F
|
||||
!
|
||||
! INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||
|
||||
! INTERFACE
|
||||
! INTEGER FUNCTION h5sselect_select_c(space1_id, operator, &
|
||||
! space2_id)
|
||||
! USE H5GLOBAL
|
||||
! !DEC$IF DEFINED(HDF5F90_WINDOWS)
|
||||
! !DEC$ATTRIBUTES C,reference,decorate,alias:'H5SSELECT_SELECT_C'::h5sselect_select_c
|
||||
! !DEC$ENDIF
|
||||
! INTEGER(HID_T), INTENT(INOUT) :: space1_id
|
||||
! INTEGER(HID_T), INTENT(IN) :: space2_id
|
||||
! INTEGER, INTENT(IN) :: operator
|
||||
! END FUNCTION h5sselect_select_c
|
||||
! END INTERFACE
|
||||
|
||||
! hdferr = h5sselect_select_c(space1_id, operator, space2_id)
|
||||
! return
|
||||
|
||||
! END SUBROUTINE h5sselect_select_f
|
||||
|
||||
!
|
||||
!****s* H5S/h5sget_select_type_f
|
||||
|
@ -120,9 +120,6 @@ H5_FCDLL int_f h5sset_extent_none_c( hid_t_f *space_id );
|
||||
H5_FCDLL int_f h5sselect_hyperslab_c( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block);
|
||||
H5_FCDLL int_f h5sget_select_type_c( hid_t_f *space_id , int_f *op);
|
||||
H5_FCDLL int_f h5sselect_elements_c( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord);
|
||||
H5_FCDLL int_f h5scombine_hyperslab_c( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id);
|
||||
H5_FCDLL int_f h5scombine_select_c( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id);
|
||||
H5_FCDLL int_f h5sselect_select_c( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id);
|
||||
H5_FCDLL int_f h5sdecode_c( _fcd buf, hid_t_f *obj_id );
|
||||
H5_FCDLL int_f h5sencode_c(_fcd buf, hid_t_f *obj_id, size_t_f *nalloc );
|
||||
H5_FCDLL int_f h5sextent_equal_c( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal);
|
||||
|
@ -58,7 +58,7 @@ add_test (
|
||||
vds.h5
|
||||
visit.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "FORTRAN_testhdf5-clear-objects")
|
||||
@ -103,26 +103,24 @@ endif ()
|
||||
set_tests_properties (FORTRAN_testhdf5_fortran_1_8 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran)
|
||||
|
||||
#-- Adding test for fortranlib_test_F03
|
||||
if (HDF5_ENABLE_F2003)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
|
||||
else ()
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_REGEX= 0 error.s."
|
||||
-D "TEST_MATCH= 0 error(s)"
|
||||
-D "TEST_OUTPUT=fortranlib_test_F03.txt"
|
||||
#-D "TEST_REFERENCE=fortranlib_test_F03.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
|
||||
else ()
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03 COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_REGEX= 0 error.s."
|
||||
-D "TEST_MATCH= 0 error(s)"
|
||||
-D "TEST_OUTPUT=fortranlib_test_F03.txt"
|
||||
#-D "TEST_REFERENCE=fortranlib_test_F03.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
# set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
|
||||
set_tests_properties (FORTRAN_fortranlib_test_F03 PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
|
||||
endif ()
|
||||
|
||||
#-- Adding test for fflush1
|
||||
add_test (NAME FORTRAN_fflush1 COMMAND $<TARGET_FILE:fflush1>)
|
||||
@ -215,26 +213,24 @@ if (BUILD_SHARED_LIBS)
|
||||
set_tests_properties (FORTRAN_testhdf5_fortran_1_8-shared PROPERTIES DEPENDS FORTRAN_testhdf5_fortran_1_8)
|
||||
|
||||
#-- Adding test for fortranlib_test_F03
|
||||
if (HDF5_ENABLE_F2003)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $<TARGET_FILE:fortranlib_test_F03-shared>)
|
||||
else ()
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_REGEX= 0 error.s."
|
||||
-D "TEST_MATCH= 0 error(s)"
|
||||
-D "TEST_OUTPUT=fortranlib_test_F03.txt"
|
||||
#-D "TEST_REFERENCE=fortranlib_test_F03.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
# set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
|
||||
set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03)
|
||||
if (HDF5_ENABLE_USING_MEMCHECKER)
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND $<TARGET_FILE:fortranlib_test_F03-shared>)
|
||||
else ()
|
||||
add_test (NAME FORTRAN_fortranlib_test_F03-shared COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:fortranlib_test_F03-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_SKIP_COMPARE=TRUE"
|
||||
-D "TEST_REGEX= 0 error.s."
|
||||
-D "TEST_MATCH= 0 error(s)"
|
||||
-D "TEST_OUTPUT=fortranlib_test_F03.txt"
|
||||
#-D "TEST_REFERENCE=fortranlib_test_F03.out"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/fshared"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
# set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s")
|
||||
set_tests_properties (FORTRAN_fortranlib_test_F03-shared PROPERTIES DEPENDS FORTRAN_fortranlib_test_F03)
|
||||
|
||||
#-- Adding test for fflush1
|
||||
add_test (NAME FORTRAN_fflush1-shared COMMAND $<TARGET_FILE:fflush1-shared>)
|
||||
|
@ -657,7 +657,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error)
|
||||
minimize = .TRUE.
|
||||
CALL h5pget_dset_no_attrs_hint_f(dcpl, minimize, error)
|
||||
CALL check("h5pget_dset_no_attrs_hint_f",error,total_error)
|
||||
if(error .eq. 0 .and. minimize .neqv. .FALSE.) then
|
||||
if(minimize .neqv. .FALSE.) then
|
||||
total_error = total_error + 1
|
||||
write(*,*) "Default dataset minimize flag was incorrect (H5P)"
|
||||
endif
|
||||
@ -671,7 +671,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error)
|
||||
minimize = .FALSE.
|
||||
CALL h5pget_dset_no_attrs_hint_f(dcpl, minimize, error)
|
||||
CALL check("h5pget_dset_no_attrs_hint_f",error,total_error)
|
||||
if(error .eq. 0 .and. minimize .neqv. .TRUE.) then
|
||||
if(minimize .neqv. .TRUE.) then
|
||||
total_error = total_error + 1
|
||||
write(*,*) "Unable to get correct dataset minimize flag (H5P)"
|
||||
endif
|
||||
@ -681,7 +681,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error)
|
||||
minimize = .TRUE.
|
||||
CALL h5fget_dset_no_attrs_hint_f(fid, minimize, error)
|
||||
CALL check("h5fget_dset_no_attrs_hint_f",error,total_error)
|
||||
if(error .eq. 0 .and. minimize .neqv. .FALSE.) then
|
||||
if(minimize .neqv. .FALSE.) then
|
||||
total_error = total_error + 1
|
||||
write(*,*) "Default dataset minimize flag was incorrect (H5F)"
|
||||
endif
|
||||
@ -695,7 +695,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error)
|
||||
minimize = .FALSE.
|
||||
CALL h5fget_dset_no_attrs_hint_f(fid, minimize, error)
|
||||
CALL check("h5fget_dset_no_attrs_hint_f",error,total_error)
|
||||
if(error .eq. 0 .and. minimize .neqv. .TRUE.) then
|
||||
if(minimize .neqv. .TRUE.) then
|
||||
total_error = total_error + 1
|
||||
write(*,*) "Unable to get correct dataset minimize flag (H5F)"
|
||||
endif
|
||||
|
@ -15,4 +15,4 @@
|
||||
### T E S T I N G ###
|
||||
##############################################################################
|
||||
##############################################################################
|
||||
add_test (NAME FORT_parallel_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:parallel_test> ${MPIEXEC_POSTFLAGS})
|
||||
add_test (NAME MPI_TEST_FORT_parallel_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:parallel_test> ${MPIEXEC_POSTFLAGS})
|
||||
|
@ -51,7 +51,7 @@ add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_
|
||||
ex_table_12.h5
|
||||
ex_ds1.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (HL_ex-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "HL_ex-clear-objects")
|
||||
@ -71,7 +71,7 @@ foreach (example ${examples})
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (HL_ex_${example} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "HL_ex_${example}")
|
||||
|
@ -70,8 +70,8 @@ macro (ADD_H5_FORTRAN_EXE file)
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
foreach (test ${H5_TESTS})
|
||||
ADD_H5_FORTRAN_EXE(${test})
|
||||
foreach (h5_test ${H5_TESTS})
|
||||
ADD_H5_FORTRAN_EXE(${h5_test})
|
||||
endforeach ()
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
|
@ -87,6 +87,6 @@ if (BUILD_SHARED_LIBS)
|
||||
)
|
||||
endif ()
|
||||
|
||||
foreach (test ${H5_TESTS})
|
||||
ADD_H5_FORTRAN_TEST(${test})
|
||||
foreach (h5_test ${H5_TESTS})
|
||||
ADD_H5_FORTRAN_TEST(${h5_test})
|
||||
endforeach ()
|
||||
|
@ -61,7 +61,7 @@ macro (HL_ADD_TEST hl_name)
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test}
|
||||
ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}"
|
||||
WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR}
|
||||
@ -104,7 +104,7 @@ add_test (
|
||||
testfl_packet_table_vlen.h5
|
||||
test_table.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (HL_test-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "HL_test-clear-objects")
|
||||
|
@ -147,7 +147,7 @@ if (NOT SWMR_INCOMPAT)
|
||||
-E remove
|
||||
WATCH.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (H5WATCH-clearall-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "H5WATCH-clearall-objects")
|
||||
|
@ -71,7 +71,7 @@ foreach (HDFJAVA_JAR ${CMAKE_JAVA_INCLUDE_PATH})
|
||||
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${HDFJAVA_JAR}")
|
||||
endforeach ()
|
||||
|
||||
MACRO (ADD_H5_TEST resultfile resultcode)
|
||||
macro (ADD_H5_TEST resultfile resultcode)
|
||||
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
|
||||
add_test (
|
||||
NAME JAVA_datasets-${resultfile}
|
||||
@ -87,16 +87,15 @@ MACRO (ADD_H5_TEST resultfile resultcode)
|
||||
-D "TEST_REFERENCE=datasets/${resultfile}.txt"
|
||||
-P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_datasets-${resultfile} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "JAVA_datasets-${resultfile}")
|
||||
ENDMACRO ()
|
||||
endmacro ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
|
||||
foreach (example ${HDF_JAVA_EXAMPLES})
|
||||
if ("${example}" STREQUAL "H5Ex_D_External")
|
||||
if (example STREQUAL "H5Ex_D_External")
|
||||
add_test (
|
||||
NAME JAVA_datasets-${example}-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@ -112,7 +111,7 @@ if (BUILD_TESTING)
|
||||
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_datasets-${example}-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
add_test (
|
||||
|
@ -72,7 +72,7 @@ MACRO (ADD_H5_TEST resultfile resultcode)
|
||||
-D "TEST_REFERENCE=datatypes/${resultfile}.txt"
|
||||
-P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_datatypes-${resultfile} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "JAVA_datatypes-${resultfile}")
|
||||
@ -86,7 +86,7 @@ if (BUILD_TESTING)
|
||||
-E remove
|
||||
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_datatypes-${example}-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
add_test (
|
||||
|
@ -55,7 +55,7 @@ foreach (h5_file ${HDF_JAVA_TEST_FILES})
|
||||
endforeach ()
|
||||
add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list})
|
||||
|
||||
MACRO (ADD_H5_TEST resultfile resultcode)
|
||||
macro (ADD_H5_TEST resultfile resultcode)
|
||||
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
|
||||
add_test (
|
||||
NAME JAVA_groups-${resultfile}
|
||||
@ -71,16 +71,16 @@ MACRO (ADD_H5_TEST resultfile resultcode)
|
||||
-D "TEST_REFERENCE=groups/${resultfile}.txt"
|
||||
-P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_groups-${resultfile} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "JAVA_groups-${resultfile}")
|
||||
ENDMACRO ()
|
||||
endmacro ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
foreach (example ${HDF_JAVA_EXAMPLES})
|
||||
if (NOT "${example}" STREQUAL "H5Ex_G_Iterate" AND NOT "${example}" STREQUAL "H5Ex_G_Visit")
|
||||
if ("${example}" STREQUAL "H5Ex_G_Compact")
|
||||
if (NOT example STREQUAL "H5Ex_G_Iterate" AND NOT example STREQUAL "H5Ex_G_Visit")
|
||||
if (example STREQUAL "H5Ex_G_Compact")
|
||||
add_test (
|
||||
NAME JAVA_groups-${example}-clear-h5s
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@ -96,7 +96,7 @@ if (BUILD_TESTING)
|
||||
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
|
||||
)
|
||||
endif ()
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_groups-${example}-clear-h5s PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "JAVA_groups-${example}-clear-h5s")
|
||||
@ -108,7 +108,7 @@ if (BUILD_TESTING)
|
||||
${HDFJAVA_EXAMPLES_SOURCE_DIR}/testfiles/examples.groups.${example}.txt
|
||||
${HDFJAVA_EXAMPLES_GROUPS_BINARY_DIR}/${example}.txt
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_groups-${example}-copy-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "JAVA_groups-${example}-copy-objects")
|
||||
|
@ -73,7 +73,7 @@ MACRO (ADD_H5_TEST resultfile resultcode)
|
||||
-D "TEST_REFERENCE=intro/${resultfile}.txt"
|
||||
-P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_intro-${resultfile} PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
set (last_test "JAVA_intro-${resultfile}")
|
||||
@ -88,7 +88,7 @@ if (BUILD_TESTING)
|
||||
-E remove
|
||||
${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5
|
||||
)
|
||||
if (NOT "${last_test}" STREQUAL "")
|
||||
if (last_test)
|
||||
set_tests_properties (JAVA_intro-${example}-clear-objects PROPERTIES DEPENDS ${last_test})
|
||||
endif ()
|
||||
add_test (
|
||||
|
@ -70,8 +70,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
|
||||
* In general, arguments to the HDF Java API are straightforward translations from the 'C' API described in the HDF
|
||||
* Reference Manual.
|
||||
*
|
||||
* <center>
|
||||
* <table border=2 cellpadding=2>
|
||||
* <table border=1>
|
||||
* <caption><b>HDF-5 C types to Java types</b> </caption>
|
||||
* <tr>
|
||||
* <td><b>HDF-5</b></td>
|
||||
@ -107,8 +106,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
|
||||
* <td>Special -- see HDFArray</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </center>
|
||||
* <center> <b>General Rules for Passing Arguments and Results</b> </center>
|
||||
* <b>General Rules for Passing Arguments and Results</b>
|
||||
* <p>
|
||||
* In general, arguments passed <b>IN</b> to Java are the analogous basic types, as above. The exception is for arrays,
|
||||
* which are discussed below.
|
||||
@ -143,7 +141,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
|
||||
* <p>
|
||||
* All the routines where this convention is used will have specific documentation of the details, given below.
|
||||
* <p>
|
||||
* <a NAME="ARRAYS"> <b>Arrays</b> </a>
|
||||
* <b>Arrays</b>
|
||||
* <p>
|
||||
* HDF5 needs to read and write multi-dimensional arrays of any number type (and records). The HDF5 API describes the
|
||||
* layout of the source and destination, and the data for the array passed as a block of bytes, for instance,
|
||||
@ -176,7 +174,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
|
||||
* and the parameter <i>data</i> can be any multi-dimensional array of numbers, such as float[][], or int[][][], or
|
||||
* Double[][].
|
||||
* <p>
|
||||
* <a NAME="CONSTANTS"> <b>HDF-5 Constants</b></a>
|
||||
* <b>HDF-5 Constants</b>
|
||||
* <p>
|
||||
* The HDF-5 API defines a set of constants and enumerated values. Most of these values are available to Java programs
|
||||
* via the class <a href="./hdf.hdf5lib.HDF5Constants.html"> <b>HDF5Constants</b></a>. For example, the parameters for
|
||||
@ -196,7 +194,7 @@ import hdf.hdf5lib.structs.H5O_info_t;
|
||||
* The Java application uses both types of constants the same way, the only difference is that the
|
||||
* <b><i>HDF5CDataTypes</i></b> may have different values on different platforms.
|
||||
* <p>
|
||||
* <a NAME="ERRORS"> <b>Error handling and Exceptions</b></a>
|
||||
* <b>Error handling and Exceptions</b>
|
||||
* <p>
|
||||
* The HDF5 error API (H5E) manages the behavior of the error stack in the HDF-5 library. This API is omitted from the
|
||||
* JHI5. Errors are converted into Java exceptions. This is totally different from the C interface, but is very natural
|
||||
@ -3235,6 +3233,8 @@ public class H5 implements java.io.Serializable {
|
||||
* @param file_id
|
||||
* IN: Identifier of the target file.
|
||||
*
|
||||
* @return true if the file-level is set to create minimized dataset object headers, false if not.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
**/
|
||||
@ -7000,6 +7000,8 @@ public class H5 implements java.io.Serializable {
|
||||
* @param dcpl_id
|
||||
* IN: Dataset creation property list
|
||||
*
|
||||
* @return true if the given dcpl is set to create minimized dataset object headers, false if not.
|
||||
*
|
||||
* @exception HDF5LibraryException
|
||||
* - Error from the HDF-5 Library.
|
||||
**/
|
||||
|
@ -90,8 +90,7 @@ like this:
|
||||
The <i><b>H5</b> </i>class automatically loads the native method implementations
|
||||
and the HDF5 library.
|
||||
|
||||
<h3>
|
||||
<a NAME="DOWNLOAD"></a>To Obtain</h3>
|
||||
<h3>To Obtain</h3>
|
||||
The JHI5 is included with the <a href="https://portal.hdfgroup.org/display/support/Downloads">HDF5</a> library.
|
||||
|
||||
</body>
|
||||
|
@ -14,6 +14,19 @@ set (HDF5_JAVA_JNI_CSRCS
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5lImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5oImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pACPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pDAPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pDCPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pDXPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pFAPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pFCPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pGAPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pGCPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pLAPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pLCPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pOCPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pOCpyPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pStrCPLImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5plImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5rImp.c
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5sImp.c
|
||||
@ -36,6 +49,19 @@ set (HDF5_JAVA_JNI_CHDRS
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5lImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5oImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pACPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pDAPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pDCPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pDXPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pFAPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pFCPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pGAPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pGCPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pLAPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pLCPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pOCPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pOCpyPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5pStrCPLImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5plImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5rImp.h
|
||||
${HDF5_JAVA_JNI_SOURCE_DIR}/h5sImp.h
|
||||
|
@ -34,7 +34,10 @@ libhdf5_java_la_LDFLAGS = -avoid-version -shared -export-dynamic -version-info $
|
||||
# Source files for the library
|
||||
libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \
|
||||
h5aImp.c h5dImp.c h5eImp.c h5fImp.c h5gImp.c h5iImp.c h5lImp.c h5oImp.c \
|
||||
h5pImp.c h5plImp.c h5rImp.c h5sImp.c h5tImp.c h5vlImp.c h5zImp.c
|
||||
h5pImp.c h5pACPLImp.c h5pDAPLImp.c h5pDCPLImp.c h5pDXPLImp.c \
|
||||
h5pFAPLImp.c h5pFCPLImp.c h5pGAPLImp.c h5pGCPLImp.c h5pLAPLImp.c h5pLCPLImp.c \
|
||||
h5pOCPLImp.c h5pOCpyPLImp.c h5pStrCPLImp.c h5plImp.c h5rImp.c h5sImp.c h5tImp.c \
|
||||
h5vlImp.c h5zImp.c
|
||||
|
||||
# HDF5 Java (JNI) library depends on HDF5 Library.
|
||||
libhdf5_java_la_LIBADD=$(LIBHDF5)
|
||||
|
@ -33,21 +33,14 @@ extern "C" {
|
||||
#include "h5jni.h"
|
||||
#include "exceptionImp.h"
|
||||
|
||||
extern H5E_auto2_t efunc;
|
||||
extern void *edata;
|
||||
extern H5E_auto2_t efunc;
|
||||
extern void *edata;
|
||||
|
||||
|
||||
/*******************/
|
||||
/* Local Variables */
|
||||
/*******************/
|
||||
|
||||
/* These types are copied from H5Eprivate.h
|
||||
* They should be moved to a public include file, and deleted from
|
||||
* here.
|
||||
*/
|
||||
|
||||
#define H5E_NSLOTS 32 /*number of slots in an error stack */
|
||||
|
||||
/*
|
||||
* The list of error messages in the system is kept as an array of
|
||||
* error_code/message pairs, one for major error numbers and another for
|
||||
@ -73,29 +66,29 @@ typedef struct H5E_num_t {
|
||||
/* Local Macros */
|
||||
/********************/
|
||||
|
||||
#define THROWEXCEPTION(className,args) { \
|
||||
jclass jc; \
|
||||
jmethodID jm; \
|
||||
jobject ex; \
|
||||
jc = ENVPTR->FindClass(ENVPAR (className)); \
|
||||
if (jc == NULL) { \
|
||||
return JNI_FALSE; \
|
||||
} \
|
||||
jm = ENVPTR->GetMethodID(ENVPAR jc, "<init>", "(Ljava/lang/String;)V"); \
|
||||
if (jm == NULL) { \
|
||||
printf("THROWEXCEPTION FATAL ERROR: GetMethodID failed\n"); \
|
||||
return JNI_FALSE; \
|
||||
} \
|
||||
ex = ENVPTR->NewObjectA (ENVPAR jc, jm, (jvalue*)(args)); \
|
||||
if (ex == NULL) { \
|
||||
printf("THROWEXCEPTION FATAL ERROR: %s: Creation failed\n", (className)); \
|
||||
return JNI_FALSE; \
|
||||
} \
|
||||
if (ENVPTR->Throw(ENVPAR (jthrowable)ex) < 0) { \
|
||||
printf("THROWEXCEPTION FATAL ERROR: %s: Throw failed\n", (className)); \
|
||||
return JNI_FALSE; \
|
||||
} \
|
||||
return JNI_TRUE; \
|
||||
#define THROWEXCEPTION(className, args) \
|
||||
{ \
|
||||
jmethodID jm; \
|
||||
jclass jc; \
|
||||
jobject ex; \
|
||||
\
|
||||
if (NULL == (jc = ENVPTR->FindClass(ENVONLY, (className)))) \
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
|
||||
\
|
||||
if (NULL == (jm = ENVPTR->GetMethodID(ENVONLY, jc, "<init>", "(Ljava/lang/String;)V"))) { \
|
||||
HDprintf("THROWEXCEPTION FATAL ERROR: GetMethodID failed\n"); \
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
|
||||
} \
|
||||
\
|
||||
if (NULL == (ex = ENVPTR->NewObjectA(ENVONLY, jc, jm, (jvalue *)(args)))) { \
|
||||
HDprintf("THROWEXCEPTION FATAL ERROR: Class %s: Creation failed\n", (className)); \
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
|
||||
} \
|
||||
\
|
||||
if (ENVPTR->Throw(ENVONLY, (jthrowable)ex) < 0) { \
|
||||
HDprintf("THROWEXCEPTION FATAL ERROR: Class %s: Throw failed\n", (className)); \
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
|
||||
} \
|
||||
}
|
||||
|
||||
/********************/
|
||||
@ -112,7 +105,9 @@ walk_error_callback
|
||||
{
|
||||
H5E_num_t *err_nums = (H5E_num_t *)_err_nums;
|
||||
|
||||
if(err_desc) {
|
||||
UNUSED(n);
|
||||
|
||||
if (err_desc) {
|
||||
err_nums->maj_num = err_desc->maj_num;
|
||||
err_nums->min_num = err_desc->min_num;
|
||||
} /* end if */
|
||||
@ -130,8 +125,15 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5error_1off
|
||||
(JNIEnv *env, jclass clss)
|
||||
{
|
||||
H5Eget_auto2(H5E_DEFAULT, &efunc, &edata);
|
||||
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
|
||||
UNUSED(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Eget_auto2(H5E_DEFAULT, &efunc, &edata) < 0)
|
||||
return -1;
|
||||
|
||||
if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5error_1off() */
|
||||
|
||||
@ -145,10 +147,12 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5error_1on
|
||||
(JNIEnv *env, jclass clss)
|
||||
{
|
||||
UNUSED(env);
|
||||
UNUSED(clss);
|
||||
|
||||
H5Eset_auto2(H5E_DEFAULT, efunc, edata);
|
||||
} /* end Java_hdf_hdf5lib_H5_H5error_1on() */
|
||||
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_exceptions_HDFLibraryException
|
||||
* Method: printStackTrace0
|
||||
@ -163,18 +167,25 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException_printStackTrace0
|
||||
FILE *stream = NULL;
|
||||
const char *file = NULL;
|
||||
|
||||
if(file_name == NULL) {
|
||||
UNUSED(obj);
|
||||
|
||||
if (NULL == file_name) {
|
||||
H5Eprint2(H5E_DEFAULT, stderr);
|
||||
} /* end if */
|
||||
}
|
||||
else {
|
||||
file = ENVPTR->GetStringUTFChars(ENVPAR file_name, 0);
|
||||
stream = HDfopen(file, "a+");
|
||||
if(stream) {
|
||||
PIN_JAVA_STRING(ENVONLY, file_name, file, NULL, "printStackTrace0: file name not pinned");
|
||||
|
||||
if ((stream = HDfopen(file, "a+"))) {
|
||||
H5Eprint2(H5E_DEFAULT, stream);
|
||||
HDfclose(stream);
|
||||
} /* end if */
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR file_name, file);
|
||||
} /* end else */
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
if (file)
|
||||
UNPIN_JAVA_STRING(ENVONLY, file_name, file);
|
||||
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_exceptions_HDF5LibraryException_printStackTrace0() */
|
||||
|
||||
/*
|
||||
@ -189,10 +200,15 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMajorErrorNumber
|
||||
(JNIEnv *env, jobject obj)
|
||||
{
|
||||
H5E_num_t err_nums;
|
||||
|
||||
UNUSED(env);
|
||||
UNUSED(obj);
|
||||
|
||||
err_nums.maj_num = 0;
|
||||
err_nums.min_num = 0;
|
||||
|
||||
H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &err_nums);
|
||||
if (H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &err_nums) < 0)
|
||||
return -1;
|
||||
|
||||
return err_nums.maj_num;
|
||||
} /* end Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMajorErrorNumber() */
|
||||
@ -209,27 +225,42 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMinorErrorNumber
|
||||
(JNIEnv *env, jobject obj)
|
||||
{
|
||||
H5E_num_t err_nums;
|
||||
|
||||
UNUSED(env);
|
||||
UNUSED(obj);
|
||||
|
||||
err_nums.maj_num = 0;
|
||||
err_nums.min_num = 0;
|
||||
|
||||
H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &err_nums);
|
||||
if (H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &err_nums) < 0)
|
||||
return -1;
|
||||
|
||||
return err_nums.min_num;
|
||||
} /* end Java_hdf_hdf5lib_exceptions_HDF5LibraryException__1getMinorErrorNumber() */
|
||||
|
||||
/*
|
||||
* Routine to raise particular Java exceptions from C
|
||||
* Routine to raise particular Java exceptions from C.
|
||||
*/
|
||||
static jboolean
|
||||
H5JNIErrorClass
|
||||
(JNIEnv *env, const char *message, const char *className)
|
||||
{
|
||||
char *args[2];
|
||||
jstring str = ENVPTR->NewStringUTF(ENVPAR message);
|
||||
args[0] = (char *)str;
|
||||
jstring str;
|
||||
char *args[2];
|
||||
jboolean retVal = JNI_FALSE;
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, message)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
args[0] = (char *) str;
|
||||
args[1] = 0;
|
||||
|
||||
THROWEXCEPTION(className, args);
|
||||
|
||||
retVal = JNI_TRUE;
|
||||
|
||||
done:
|
||||
return retVal;
|
||||
} /* end H5JNIErrorClass() */
|
||||
|
||||
/*
|
||||
@ -316,7 +347,7 @@ h5unimplemented
|
||||
*/
|
||||
jboolean
|
||||
h5raiseException
|
||||
(JNIEnv *env, const char *exception, const char *message)
|
||||
(JNIEnv *env, const char *message, const char *exception)
|
||||
{
|
||||
return H5JNIErrorClass(env, message, exception);
|
||||
} /* end h5raiseException() */
|
||||
@ -336,51 +367,76 @@ jboolean
|
||||
h5libraryError
|
||||
(JNIEnv *env)
|
||||
{
|
||||
char *args[2];
|
||||
const char *exception = NULL;
|
||||
char *msg_str = NULL;
|
||||
int num_errs = 0;
|
||||
H5E_type_t error_msg_type;
|
||||
H5E_num_t exceptionNumbers;
|
||||
jstring str = NULL;
|
||||
ssize_t msg_size = 0;
|
||||
hid_t min_num;
|
||||
hid_t maj_num;
|
||||
ssize_t msg_size = 0;
|
||||
H5E_type_t error_msg_type;
|
||||
jstring str = NULL;
|
||||
hid_t stk_id = -1;
|
||||
H5E_num_t exceptionNumbers;
|
||||
hid_t stk_id = H5I_INVALID_HID;
|
||||
char *args[2];
|
||||
char *msg_str = NULL;
|
||||
jboolean retVal = JNI_FALSE;
|
||||
|
||||
exceptionNumbers.maj_num = 0;
|
||||
exceptionNumbers.min_num = 0;
|
||||
|
||||
/* Save current stack contents for future use */
|
||||
stk_id = H5Eget_current_stack(); /* This will clear current stack */
|
||||
if(stk_id >= 0)
|
||||
H5Ewalk2(stk_id, H5E_WALK_DOWNWARD, walk_error_callback, &exceptionNumbers);
|
||||
if ((stk_id = H5Eget_current_stack()) >= 0)
|
||||
/* This will clear current stack */
|
||||
if (H5Ewalk2(stk_id, H5E_WALK_DOWNWARD, walk_error_callback, &exceptionNumbers) < 0)
|
||||
goto done;
|
||||
|
||||
maj_num = exceptionNumbers.maj_num;
|
||||
min_num = exceptionNumbers.min_num;
|
||||
|
||||
/*
|
||||
* TODO: handle < 0 case.
|
||||
*/
|
||||
|
||||
/*
|
||||
* No error detected in HDF5 error stack.
|
||||
*/
|
||||
if (!maj_num && !min_num)
|
||||
goto done;
|
||||
|
||||
exception = defineHDF5LibraryException(maj_num);
|
||||
|
||||
/* get the length of the name */
|
||||
msg_size = H5Eget_msg(min_num, NULL, NULL, 0);
|
||||
if(msg_size > 0) {
|
||||
msg_size++; /* add extra space for the null terminator */
|
||||
msg_str = (char*)HDcalloc((size_t)msg_size, sizeof(char));
|
||||
if(msg_str) {
|
||||
msg_size = H5Eget_msg(min_num, &error_msg_type, (char *)msg_str, (size_t)msg_size);
|
||||
str = ENVPTR->NewStringUTF(ENVPAR msg_str);
|
||||
HDfree(msg_str);
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
if ((msg_size = H5Eget_msg(min_num, NULL, NULL, 0)) < 0)
|
||||
goto done;
|
||||
|
||||
if (msg_size > 0) {
|
||||
if (NULL == (msg_str = (char *) HDcalloc((size_t)msg_size + 1, sizeof(char))))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "h5libraryerror: failed to allocate buffer for error message");
|
||||
|
||||
if ((msg_size = H5Eget_msg(min_num, &error_msg_type, msg_str, (size_t)msg_size + 1)) < 0)
|
||||
goto done;
|
||||
msg_str[msg_size] = '\0';
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, msg_str)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
}
|
||||
else
|
||||
str = NULL;
|
||||
if(stk_id >= 0)
|
||||
|
||||
if (stk_id >= 0)
|
||||
H5Eset_current_stack(stk_id);
|
||||
|
||||
args[0] = (char *)str;
|
||||
args[0] = (char *) str;
|
||||
args[1] = 0;
|
||||
THROWEXCEPTION(exception, args);
|
||||
} /* end h5libraryError() */
|
||||
|
||||
THROWEXCEPTION(exception, args);
|
||||
|
||||
retVal = JNI_TRUE;
|
||||
|
||||
done:
|
||||
if (msg_str)
|
||||
HDfree(msg_str);
|
||||
|
||||
return retVal;
|
||||
} /* end h5libraryError() */
|
||||
|
||||
/*
|
||||
* defineHDF5LibraryException() returns the name of the sub-class
|
||||
|
@ -1260,7 +1260,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5VL_1CAP_1FLAG_1THREADSAFE(JNIEnv *env, jclass c
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5VL_1NATIVE(JNIEnv *env, jclass cls) { return H5VL_NATIVE; }
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5VL_1NATIVE_1NAME(JNIEnv *env, jclass cls) { return (jstring)ENVPTR->NewStringUTF(ENVPAR H5VL_NATIVE_NAME); }
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5VL_1NATIVE_1NAME(JNIEnv *env, jclass cls) { return (jstring)ENVPTR->NewStringUTF(ENVONLY, H5VL_NATIVE_NAME); }
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5VL_1NATIVE_1VALUE(JNIEnv *env, jclass cls) { return H5VL_NATIVE_VALUE; }
|
||||
JNIEXPORT jint JNICALL
|
||||
|
@ -35,7 +35,10 @@ extern "C" {
|
||||
#include "h5jni.h"
|
||||
#include "h5Imp.h"
|
||||
|
||||
extern JavaVM *jvm;
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
/* extern JavaVM *jvm; */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
@ -46,10 +49,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5open
|
||||
(JNIEnv *env, jclass clss)
|
||||
{
|
||||
herr_t retVal = H5open();
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5open()) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5open */
|
||||
|
||||
@ -62,10 +69,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5close
|
||||
(JNIEnv *env, jclass clss)
|
||||
{
|
||||
herr_t retVal = H5close();
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5close()) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5close */
|
||||
|
||||
@ -78,10 +89,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5dont_1atexit
|
||||
(JNIEnv *env, jclass clss)
|
||||
{
|
||||
herr_t retVal = H5dont_atexit();
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5dont_atexit()) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5dont_1atexit */
|
||||
|
||||
@ -94,29 +109,25 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5get_1libversion
|
||||
(JNIEnv *env, jclass clss, jintArray libversion)
|
||||
{
|
||||
unsigned *theArray = NULL;
|
||||
herr_t status = -1;
|
||||
jboolean isCopy;
|
||||
jboolean libversionArrayIsCopy;
|
||||
int *libversionArray = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
if (libversion == NULL) {
|
||||
h5nullArgument(env, "H5get_version: libversion is NULL");
|
||||
} /* end if */
|
||||
else {
|
||||
theArray = (unsigned*)ENVPTR->GetIntArrayElements(ENVPAR libversion, &isCopy);
|
||||
if (theArray == NULL) {
|
||||
h5JNIFatalError( env, "H5get_libversion: input not pinned");
|
||||
} /* end if */
|
||||
else {
|
||||
status = H5get_libversion(&(theArray[0]), &(theArray[1]), &(theArray[2]));
|
||||
UNUSED(clss);
|
||||
|
||||
if (status < 0) {
|
||||
ENVPTR->ReleaseIntArrayElements(ENVPAR libversion, (jint*)theArray, JNI_ABORT);
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
ENVPTR->ReleaseIntArrayElements(ENVPAR libversion, (jint*)theArray,0);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
return (jint)status;
|
||||
if (libversion == NULL)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5get_libversion: libversion is NULL");
|
||||
|
||||
PIN_INT_ARRAY(ENVONLY, libversion, libversionArray, &libversionArrayIsCopy, "H5get_libversion: libversion input not pinned");
|
||||
|
||||
if ((status = H5get_libversion((unsigned *) &(libversionArray[0]), (unsigned *) &(libversionArray[1]), (unsigned *) &(libversionArray[2]))) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (libversionArray)
|
||||
UNPIN_INT_ARRAY(ENVONLY, libversion, libversionArray, (status < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5get_1libversion */
|
||||
|
||||
/*
|
||||
@ -128,6 +139,9 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5check_1version
|
||||
(JNIEnv *env, jclass clss, jint majnum, jint minnum, jint relnum)
|
||||
{
|
||||
UNUSED(env);
|
||||
UNUSED(clss);
|
||||
|
||||
return (jint)H5check_version((unsigned)majnum, (unsigned)minnum, (unsigned)relnum);
|
||||
} /* end Java_hdf_hdf5lib_H5_H5check_1version */
|
||||
|
||||
@ -141,10 +155,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5garbage_1collect
|
||||
(JNIEnv *env, jclass clss)
|
||||
{
|
||||
herr_t retVal = H5garbage_collect();
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5garbage_collect()) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5garbage_1collect */
|
||||
|
||||
@ -158,11 +176,15 @@ Java_hdf_hdf5lib_H5_H5set_1free_1list_1limits
|
||||
(JNIEnv *env, jclass clss, jint reg_global_lim, jint reg_list_lim,
|
||||
jint arr_global_lim, jint arr_list_lim, jint blk_global_lim, jint blk_list_lim )
|
||||
{
|
||||
herr_t retVal = H5set_free_list_limits((int)reg_global_lim, (int)reg_list_lim,
|
||||
(int)arr_global_lim, (int)arr_list_lim, (int)blk_global_lim, (int)blk_list_lim);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5set_free_list_limits((int)reg_global_lim, (int)reg_list_lim,
|
||||
(int)arr_global_lim, (int)arr_list_lim, (int)blk_global_lim, (int)blk_list_lim)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5set_1free_1list_1limits */
|
||||
|
||||
@ -176,7 +198,13 @@ Java_hdf_hdf5lib_H5_H5is_1library_1threadsafe
|
||||
(JNIEnv *env, jclass clss)
|
||||
{
|
||||
hbool_t is_ts = false;
|
||||
H5is_library_threadsafe(&is_ts);
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5is_library_threadsafe(&is_ts) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jboolean)is_ts;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5is_1library_1threadsafe */
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -39,6 +39,9 @@ extern "C" {
|
||||
#include "h5jni.h"
|
||||
#include "h5eImp.h"
|
||||
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
extern JavaVM *jvm;
|
||||
|
||||
typedef struct _cb_wrapper {
|
||||
@ -46,20 +49,6 @@ typedef struct _cb_wrapper {
|
||||
jobject op_data;
|
||||
} cb_wrapper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define CBENVPTR (cbenv)
|
||||
#define CBENVPAR
|
||||
#define JVMPTR (jvm)
|
||||
#define JVMPAR
|
||||
#define JVMPAR2
|
||||
#else /* __cplusplus */
|
||||
#define CBENVPTR (*cbenv)
|
||||
#define CBENVPAR cbenv,
|
||||
#define JVMPTR (*jvm)
|
||||
#define JVMPAR jvm
|
||||
#define JVMPAR2 jvm,
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/********************/
|
||||
/* Local Prototypes */
|
||||
/********************/
|
||||
@ -77,12 +66,15 @@ Java_hdf_hdf5lib_H5_H5Eauto_1is_1v2
|
||||
{
|
||||
unsigned int is_stack = 0;
|
||||
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Eauto_is_v2: invalid argument");
|
||||
} /* end if */
|
||||
else if (H5Eauto_is_v2((hid_t)stk_id, &is_stack) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eauto_is_v2: invalid stack ID");
|
||||
|
||||
if (H5Eauto_is_v2((hid_t)stk_id, &is_stack) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jboolean)is_stack;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eauto_1is_1v2 */
|
||||
|
||||
@ -95,20 +87,34 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eregister_1class
|
||||
(JNIEnv *env, jclass cls, jstring cls_name, jstring lib_name, jstring version)
|
||||
{
|
||||
hid_t ret_val = -1;
|
||||
const char* the_cls_name;
|
||||
const char* the_lib_name;
|
||||
const char* the_version;
|
||||
const char* the_cls_name = NULL;
|
||||
const char* the_lib_name = NULL;
|
||||
const char* the_version = NULL;
|
||||
hid_t ret_val = H5I_INVALID_HID;
|
||||
|
||||
PIN_JAVA_STRING_THREE(cls_name, the_cls_name, lib_name, the_lib_name, version, the_version);
|
||||
if (the_cls_name != NULL && the_lib_name != NULL && the_version != NULL) {
|
||||
ret_val = H5Eregister_class(the_cls_name, the_lib_name, the_version);
|
||||
UNUSED(cls);
|
||||
|
||||
UNPIN_JAVA_STRING_THREE(cls_name, the_cls_name, lib_name, the_lib_name, version, the_version);
|
||||
if (NULL == cls_name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Eregister_class: class name is NULL");
|
||||
if (NULL == lib_name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Eregister_class: lib name is NULL");
|
||||
if (NULL == version)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Eregister_class: version string is NULL");
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
PIN_JAVA_STRING(ENVONLY, cls_name, the_cls_name, NULL, "H5Eregister_class: class name not pinned");
|
||||
PIN_JAVA_STRING(ENVONLY, lib_name, the_lib_name, NULL, "H5Eregister_class: lib name not pinned");
|
||||
PIN_JAVA_STRING(ENVONLY, version, the_version, NULL, "H5Eregister_class: version string not pinned");
|
||||
|
||||
if ((ret_val = H5Eregister_class(the_cls_name, the_lib_name, the_version)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (the_version)
|
||||
UNPIN_JAVA_STRING(ENVONLY, version, the_version);
|
||||
if (the_lib_name)
|
||||
UNPIN_JAVA_STRING(ENVONLY, lib_name, the_lib_name);
|
||||
if (the_cls_name)
|
||||
UNPIN_JAVA_STRING(ENVONLY, cls_name, the_cls_name);
|
||||
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eregister_1class */
|
||||
@ -122,11 +128,16 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eunregister_1class
|
||||
(JNIEnv *env, jclass cls, jlong cls_id)
|
||||
{
|
||||
if (cls_id < 0) {
|
||||
h5badArgument(env, "H5Eunregister_class: invalid argument");
|
||||
} /* end if */
|
||||
else if (H5Eunregister_class((hid_t)cls_id) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (cls_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eunregister_class: invalid error class ID");
|
||||
|
||||
if (H5Eunregister_class((hid_t)cls_id) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eunregister_1class */
|
||||
|
||||
/*
|
||||
@ -138,11 +149,16 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eclose_1msg
|
||||
(JNIEnv *env, jclass cls, jlong err_id)
|
||||
{
|
||||
if (err_id < 0) {
|
||||
h5badArgument(env, "H5Eclose_msg: invalid argument");
|
||||
} /* end if */
|
||||
else if (H5Eclose_msg((hid_t)err_id) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (err_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eclose_msg: invalid error message ID");
|
||||
|
||||
if (H5Eclose_msg((hid_t)err_id) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eclose_1msg */
|
||||
|
||||
/*
|
||||
@ -154,24 +170,25 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Ecreate_1msg
|
||||
(JNIEnv *env, jclass cls, jlong err_id, jint msg_type, jstring err_msg)
|
||||
{
|
||||
hid_t ret_val = -1;
|
||||
const char *the_err_msg;
|
||||
H5E_type_t error_msg_type = (H5E_type_t)msg_type;
|
||||
const char *the_err_msg = NULL;
|
||||
hid_t ret_val = H5I_INVALID_HID;
|
||||
|
||||
if (err_id < 0) {
|
||||
h5badArgument(env, "H5Ecreate_msg: invalid argument");
|
||||
} /* end if */
|
||||
else {
|
||||
PIN_JAVA_STRING(err_msg, the_err_msg);
|
||||
if (the_err_msg != NULL) {
|
||||
ret_val = H5Ecreate_msg((hid_t)err_id, error_msg_type, the_err_msg);
|
||||
UNUSED(cls);
|
||||
|
||||
UNPIN_JAVA_STRING(err_msg, the_err_msg);
|
||||
if (err_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Ecreate_msg: invalid error class ID");
|
||||
if (NULL == err_msg)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ecreate_msg: error message string is NULL");
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
} /* end else */
|
||||
PIN_JAVA_STRING(ENVONLY, err_msg, the_err_msg, NULL, "H5Ecreate_msg: error message string not pinned");
|
||||
|
||||
if ((ret_val = H5Ecreate_msg((hid_t)err_id, error_msg_type, the_err_msg)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (the_err_msg)
|
||||
UNPIN_JAVA_STRING(ENVONLY, err_msg, the_err_msg);
|
||||
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Ecreate_1msg */
|
||||
@ -185,12 +202,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Ecreate_1stack
|
||||
(JNIEnv *env, jclass cls)
|
||||
{
|
||||
hid_t ret_val = -1;
|
||||
hid_t ret_val = H5I_INVALID_HID;
|
||||
|
||||
ret_val = H5Ecreate_stack();
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((ret_val = H5Ecreate_stack()) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Ecreate_1stack */
|
||||
|
||||
@ -203,12 +222,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eget_1current_1stack
|
||||
(JNIEnv *env, jclass cls)
|
||||
{
|
||||
hid_t ret_val = -1;
|
||||
hid_t ret_val = H5I_INVALID_HID;
|
||||
|
||||
ret_val = H5Eget_current_stack();
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((ret_val = H5Eget_current_stack()) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eget_1current_1stack */
|
||||
|
||||
@ -221,11 +242,16 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eclose_1stack
|
||||
(JNIEnv *env, jclass cls, jlong stk_id)
|
||||
{
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Eclose_stack: invalid argument");
|
||||
} /* end if */
|
||||
else if (H5Eclose_stack((hid_t)stk_id) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eclose_stack: invalid error stack ID");
|
||||
|
||||
if (H5Eclose_stack((hid_t)stk_id) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eclose_1stack */
|
||||
|
||||
/*
|
||||
@ -237,20 +263,24 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eprint2
|
||||
(JNIEnv *env, jclass cls, jlong stk_id, jobject stream_obj)
|
||||
{
|
||||
herr_t ret_val = -1;
|
||||
herr_t ret_val = FAIL;
|
||||
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Eprint2: invalid argument");
|
||||
} /* end if */
|
||||
UNUSED(cls);
|
||||
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eprint2: invalid error stack ID");
|
||||
|
||||
if (!stream_obj) {
|
||||
if ((ret_val = H5Eprint2((hid_t)stk_id, stdout)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
}
|
||||
else {
|
||||
if(!stream_obj)
|
||||
ret_val = H5Eprint2((hid_t)stk_id, stdout);
|
||||
else
|
||||
ret_val = H5Eprint2((hid_t)stk_id, (FILE*)stream_obj);
|
||||
if ((ret_val = H5Eprint2((hid_t)stk_id, (FILE *)stream_obj)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
}
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
} /* end else */
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eprint2 */
|
||||
|
||||
/*
|
||||
@ -262,43 +292,36 @@ JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eget_1class_1name
|
||||
(JNIEnv *env, jclass cls, jlong cls_id)
|
||||
{
|
||||
char *namePtr;
|
||||
jstring str = NULL;
|
||||
ssize_t buf_size;
|
||||
jstring str = NULL;
|
||||
ssize_t buf_size;
|
||||
char *namePtr = NULL;
|
||||
|
||||
if (cls_id < 0) {
|
||||
h5badArgument(env, "H5Eget_class_name: invalid argument");
|
||||
} /* end if */
|
||||
else {
|
||||
/* get the length of the name */
|
||||
buf_size = H5Eget_class_name((hid_t)cls_id, NULL, 0);
|
||||
UNUSED(cls);
|
||||
|
||||
if (buf_size < 0) {
|
||||
h5badArgument( env, "H5Eget_class_name: buf_size < 0");
|
||||
} /* end if */
|
||||
else if (buf_size == 0) {
|
||||
h5badArgument( env, "H5Eget_class_name: No class name");
|
||||
} /* end else if */
|
||||
else {
|
||||
buf_size++; /* add extra space for the null terminator */
|
||||
namePtr = (char*)HDmalloc(sizeof(char) * (size_t)buf_size);
|
||||
if (namePtr == NULL) {
|
||||
h5outOfMemory( env, "H5Eget_class_name: malloc failed");
|
||||
} /* end if */
|
||||
else {
|
||||
buf_size = H5Eget_class_name((hid_t)cls_id, (char *)namePtr, (size_t)buf_size);
|
||||
if (cls_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_class_name: invalid error class ID");
|
||||
|
||||
/* Get the length of the name */
|
||||
if ((buf_size = H5Eget_class_name((hid_t)cls_id, NULL, 0)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (!buf_size)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_class_name: no class name");
|
||||
|
||||
if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Eget_class_name: malloc failed");
|
||||
|
||||
if ((H5Eget_class_name((hid_t)cls_id, (char *)namePtr, (size_t)buf_size + 1)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
namePtr[buf_size] = '\0';
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, namePtr)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
if (namePtr)
|
||||
HDfree(namePtr);
|
||||
|
||||
if (buf_size < 0) {
|
||||
HDfree(namePtr);
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
str = ENVPTR->NewStringUTF(ENVPAR namePtr);
|
||||
HDfree(namePtr);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
return str;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eget_1class_1name */
|
||||
|
||||
@ -311,11 +334,16 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eset_1current_1stack
|
||||
(JNIEnv *env, jclass cls, jlong stk_id)
|
||||
{
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Eset_current_stack: invalid argument");
|
||||
} /* end if */
|
||||
else if (H5Eset_current_stack((hid_t)stk_id) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eset_current_stack: invalid error stack ID");
|
||||
|
||||
if (H5Eset_current_stack((hid_t)stk_id) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eset_1current_1stack */
|
||||
|
||||
/*
|
||||
@ -327,11 +355,16 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Epop
|
||||
(JNIEnv *env, jclass cls, jlong stk_id, jlong count)
|
||||
{
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Epop: invalid argument");
|
||||
} /* end if */
|
||||
else if (H5Epop((hid_t)stk_id, (size_t)count) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Epop: invalid error stack ID");
|
||||
|
||||
if (H5Epop((hid_t)stk_id, (size_t)count) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Epop */
|
||||
|
||||
/*
|
||||
@ -344,35 +377,43 @@ Java_hdf_hdf5lib_H5_H5Epush2
|
||||
(JNIEnv *env, jclass cls, jlong stk_id, jstring filename, jstring funcname,
|
||||
jint linenumber, jlong class_id, jlong major_id, jlong minor_id, jstring err_desc)
|
||||
{
|
||||
herr_t ret_val = -1;
|
||||
const char* fName;
|
||||
const char* fncName;
|
||||
const char* errMsg;
|
||||
const char *fName = NULL;
|
||||
const char *fncName = NULL;
|
||||
const char *errMsg = NULL;
|
||||
herr_t ret_val = FAIL;
|
||||
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Epush: invalid argument");
|
||||
} /* end if */
|
||||
else if (class_id < 0) {
|
||||
h5badArgument(env, "H5Epush: invalid class_id argument");
|
||||
} /* end else if */
|
||||
else if (major_id < 0) {
|
||||
h5badArgument(env, "H5Epush: invalid major_id argument");
|
||||
} /* end else if */
|
||||
else if (minor_id < 0) {
|
||||
h5badArgument(env, "H5Epush: invalid minor_id argument");
|
||||
} /* end else if */
|
||||
else {
|
||||
PIN_JAVA_STRING_THREE(filename, fName, funcname, fncName, err_desc, errMsg);
|
||||
if (fName != NULL && fncName != NULL && errMsg != NULL) {
|
||||
ret_val = H5Epush2((hid_t)stk_id, fName, fncName, (unsigned)linenumber, (hid_t)class_id,
|
||||
(hid_t)major_id, (hid_t)minor_id, errMsg);
|
||||
UNUSED(cls);
|
||||
|
||||
UNPIN_JAVA_STRING_THREE(filename, fName, funcname, fncName, err_desc, errMsg);
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Epush2: invalid error stack ID");
|
||||
if (class_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Epush2: invalid error class ID");
|
||||
if (major_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Epush2: invalid major error class ID");
|
||||
if (minor_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Epush2: invalid minor error class ID");
|
||||
if (NULL == filename)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Epush2: filename is NULL");
|
||||
if (NULL == funcname)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Epush2: function name is NULL");
|
||||
if (NULL == err_desc)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Epush2: error message is NULL");
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
} /* end else */
|
||||
PIN_JAVA_STRING(ENVONLY, filename, fName, NULL, "H5Epush2: filename not pinned");
|
||||
PIN_JAVA_STRING(ENVONLY, funcname, fncName, NULL, "H5Epush2: function name not pinned");
|
||||
PIN_JAVA_STRING(ENVONLY, err_desc, errMsg, NULL, "H5Epush2: error message not pinned");
|
||||
|
||||
if ((ret_val = H5Epush2((hid_t)stk_id, fName, fncName, (unsigned)linenumber, (hid_t)class_id,
|
||||
(hid_t)major_id, (hid_t)minor_id, errMsg)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (errMsg)
|
||||
UNPIN_JAVA_STRING(ENVONLY, err_desc, errMsg);
|
||||
if (fncName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, funcname, fncName);
|
||||
if (fName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, filename, fName);
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Epush2 */
|
||||
|
||||
/*
|
||||
@ -384,11 +425,16 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eclear2
|
||||
(JNIEnv *env, jclass cls, jlong stk_id)
|
||||
{
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Eclear2: invalid argument");
|
||||
} /* end if */
|
||||
else if (H5Eclear2((hid_t)stk_id) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eclear2: invalid error stack ID");
|
||||
|
||||
if (H5Eclear2((hid_t)stk_id) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eclear2 */
|
||||
|
||||
/*
|
||||
@ -400,57 +446,45 @@ JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Eget_1msg
|
||||
(JNIEnv *env, jclass cls, jlong msg_id, jintArray error_msg_type_list)
|
||||
{
|
||||
char *namePtr;
|
||||
jstring str = NULL;
|
||||
jboolean isCopy;
|
||||
ssize_t buf_size;
|
||||
jint *theArray;
|
||||
H5E_type_t error_msg_type;
|
||||
H5E_type_t error_msg_type;
|
||||
jstring str = NULL;
|
||||
ssize_t buf_size;
|
||||
jint *theArray = NULL;
|
||||
char *namePtr = NULL;
|
||||
|
||||
if (msg_id < 0) {
|
||||
h5badArgument(env, "H5Eget_msg: invalid argument");
|
||||
} /* end if */
|
||||
else if (error_msg_type_list == NULL) {
|
||||
h5nullArgument(env, "H5Eget_msg: error_msg_type_list is NULL");
|
||||
} /* end if */
|
||||
else {
|
||||
/* get the length of the name */
|
||||
buf_size = H5Eget_msg((hid_t)msg_id, NULL, NULL, 0);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((buf_size < 0) || (buf_size == 0)) {
|
||||
h5JNIFatalError(env, "H5Eget_msg: Invalid message");
|
||||
} /* end if */
|
||||
else {
|
||||
buf_size++; /* add extra space for the null terminator */
|
||||
namePtr = (char*)HDmalloc(sizeof(char) * (size_t)buf_size);
|
||||
if (namePtr == NULL) {
|
||||
h5outOfMemory(env, "H5Eget_msg: malloc failed");
|
||||
} /* end if */
|
||||
else {
|
||||
theArray = (jint*)ENVPTR->GetIntArrayElements(ENVPAR error_msg_type_list, &isCopy);
|
||||
if (theArray == NULL) {
|
||||
HDfree(namePtr);
|
||||
h5JNIFatalError(env, "H5Eget_msg: error_msg_type_list not pinned");
|
||||
} /* end if */
|
||||
else {
|
||||
buf_size = H5Eget_msg((hid_t)msg_id, &error_msg_type, (char *)namePtr, (size_t)buf_size);
|
||||
if (msg_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_msg: invalid error message ID");
|
||||
if (NULL == error_msg_type_list)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Eget_msg: error_msg_type_list is NULL");
|
||||
|
||||
if (buf_size < 0) {
|
||||
HDfree(namePtr);
|
||||
ENVPTR->ReleaseIntArrayElements(ENVPAR error_msg_type_list, theArray, JNI_ABORT);
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
theArray[0] = error_msg_type;
|
||||
ENVPTR->ReleaseIntArrayElements(ENVPAR error_msg_type_list, theArray, 0);
|
||||
/* Get the length of the name */
|
||||
if ((buf_size = H5Eget_msg((hid_t)msg_id, NULL, NULL, 0)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
str = ENVPTR->NewStringUTF(ENVPAR namePtr);
|
||||
HDfree(namePtr);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
if (!buf_size)
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Eget_msg: invalid message");
|
||||
|
||||
if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Eget_msg: malloc failed");
|
||||
|
||||
PIN_INT_ARRAY(ENVONLY, error_msg_type_list, theArray, NULL, "H5Eget_msg: error_msg_type_list not pinned");
|
||||
|
||||
if ((H5Eget_msg((hid_t)msg_id, &error_msg_type, (char *)namePtr, (size_t)buf_size + 1)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
namePtr[buf_size] = '\0';
|
||||
|
||||
theArray[0] = error_msg_type;
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, namePtr)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_INT_ARRAY(ENVONLY, error_msg_type_list, theArray, 0);
|
||||
if (namePtr)
|
||||
HDfree(namePtr);
|
||||
|
||||
return str;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eget_1msg */
|
||||
@ -466,14 +500,15 @@ Java_hdf_hdf5lib_H5_H5Eget_1num
|
||||
{
|
||||
ssize_t ret_val = -1;
|
||||
|
||||
if (stk_id < 0) {
|
||||
h5badArgument(env, "H5Eget_num: invalid argument");
|
||||
} /* end if */
|
||||
else {
|
||||
ret_val = H5Eget_num((hid_t)stk_id);
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
} /* end else */
|
||||
UNUSED(cls);
|
||||
|
||||
if (stk_id < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_num: invalid error stack ID");
|
||||
|
||||
if ((ret_val = H5Eget_num((hid_t)stk_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Eget_1num */
|
||||
|
||||
@ -481,52 +516,67 @@ static herr_t
|
||||
H5E_walk_cb
|
||||
(int nindx, const H5E_error2_t *info, void *cb_data)
|
||||
{
|
||||
JNIEnv *cbenv;
|
||||
jint status = -1;
|
||||
jclass cls;
|
||||
jmethodID mid;
|
||||
jstring str1, str2, str3;
|
||||
jmethodID constructor;
|
||||
jvalue args[7];
|
||||
jobject cb_info_t = NULL;
|
||||
cb_wrapper *wrapper = (cb_wrapper *)cb_data;
|
||||
void *op_data = (void *)wrapper->op_data;
|
||||
jobject visit_callback = wrapper->visit_callback;
|
||||
jmethodID constructor;
|
||||
jmethodID mid;
|
||||
jobject visit_callback = wrapper->visit_callback;
|
||||
jstring str1, str2, str3;
|
||||
jobject cb_info_t = NULL;
|
||||
jvalue args[7];
|
||||
JNIEnv *cbenv = NULL;
|
||||
jclass cls;
|
||||
void *op_data = (void *)wrapper->op_data;
|
||||
jint status = FAIL;
|
||||
|
||||
if (JVMPTR->AttachCurrentThread(JVMPAR, (void **)&cbenv, NULL) < 0) {
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_TRUE);
|
||||
H5_JNI_FATAL_ERROR(CBENVONLY, "H5E_walk_cb: failed to attach current thread to JVM");
|
||||
}
|
||||
|
||||
if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(ILhdf/hdf5lib/structs/H5E_error2_t;Lhdf/hdf5lib/callbacks/H5E_walk_t;)I")))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
args[0].j = info->cls_id;
|
||||
args[1].j = info->maj_num;
|
||||
args[2].j = info->min_num;
|
||||
args[3].i = (jint)info->line;
|
||||
|
||||
if (NULL == (str1 = CBENVPTR->NewStringUTF(CBENVONLY, info->func_name)))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
args[4].l = str1;
|
||||
|
||||
if (NULL == (str2 = CBENVPTR->NewStringUTF(CBENVONLY, info->file_name)))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
args[5].l = str2;
|
||||
|
||||
if (NULL == (str3 = CBENVPTR->NewStringUTF(CBENVONLY, info->desc)))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
args[6].l = str3;
|
||||
|
||||
/* Get a reference to your class if you don't have it already */
|
||||
if (NULL == (cls = CBENVPTR->FindClass(CBENVONLY, "hdf/hdf5lib/structs/H5E_error2_t")))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
/* get a reference to the constructor; the name is <init> */
|
||||
if (NULL == (constructor = CBENVPTR->GetMethodID(CBENVONLY, cls, "<init>", "(JJJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V")))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == (cb_info_t = CBENVPTR->NewObjectA(CBENVONLY, cls, constructor, args)))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
status = CBENVPTR->CallIntMethod(CBENVONLY, visit_callback, mid, nindx, cb_info_t, op_data);
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
if (CBENVONLY)
|
||||
JVMPTR->DetachCurrentThread(JVMPAR);
|
||||
|
||||
if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) {
|
||||
cls = CBENVPTR->GetObjectClass(CBENVPAR visit_callback);
|
||||
if (cls != 0) {
|
||||
mid = CBENVPTR->GetMethodID(CBENVPAR cls, "callback", "(ILhdf/hdf5lib/structs/H5E_error2_t;Lhdf/hdf5lib/callbacks/H5E_walk_t;)I");
|
||||
if (mid != 0) {
|
||||
args[0].j = info->cls_id;
|
||||
args[1].j = info->maj_num;
|
||||
args[2].j = info->min_num;
|
||||
args[3].i = (jint)info->line;
|
||||
str1 = CBENVPTR->NewStringUTF(CBENVPAR info->func_name);
|
||||
args[4].l = str1;
|
||||
str2 = CBENVPTR->NewStringUTF(CBENVPAR info->file_name);
|
||||
args[5].l = str2;
|
||||
str3 = CBENVPTR->NewStringUTF(CBENVPAR info->desc);
|
||||
args[6].l = str3;
|
||||
// get a reference to your class if you don't have it already
|
||||
cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5E_error2_t");
|
||||
if (cls != 0) {
|
||||
// get a reference to the constructor; the name is <init>
|
||||
constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(JJJILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
||||
if (constructor != 0) {
|
||||
cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
|
||||
if (cb_info_t == NULL) {
|
||||
printf("FATAL ERROR: hdf/hdf5lib/structs/H5E_error2_t: Creation failed\n");
|
||||
}
|
||||
else {
|
||||
status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, nindx, cb_info_t, op_data);
|
||||
}
|
||||
} /* end if (constructor != 0) */
|
||||
} /* end if(cls != 0) */
|
||||
} /* end if (mid != 0) */
|
||||
} /* end if (cls != 0) */
|
||||
} /* end if */
|
||||
JVMPTR->DetachCurrentThread(JVMPAR);
|
||||
return (herr_t)status;
|
||||
} /* end H5E_walk_cb */
|
||||
|
||||
@ -539,15 +589,23 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Ewalk2
|
||||
(JNIEnv *env, jclass cls, jlong stk_id, jlong direction, jobject callback_op, jobject op_data)
|
||||
{
|
||||
cb_wrapper wrapper = {callback_op, op_data};
|
||||
cb_wrapper wrapper = { callback_op, op_data };
|
||||
|
||||
ENVPTR->GetJavaVM(ENVPAR &jvm);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((op_data == NULL) || (callback_op == NULL)) {
|
||||
h5nullArgument(env, "H5Ewalk2: op_data or callback_op is NULL");
|
||||
} /* end if */
|
||||
else if (H5Ewalk2(stk_id, (H5E_direction_t)direction, (H5E_walk2_t)H5E_walk_cb, (void*)&wrapper) < 0)
|
||||
h5libraryError(env);
|
||||
ENVPTR->GetJavaVM(ENVONLY, &jvm);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == op_data)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ewalk2: op_data is NULL");
|
||||
if (NULL == callback_op)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ewalk2: callback_op is NULL");
|
||||
|
||||
if (H5Ewalk2(stk_id, (H5E_direction_t)direction, (H5E_walk2_t)H5E_walk_cb, (void *)&wrapper) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end iJava_hdf_hdf5lib_H5_H5Ewalk2f */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -28,7 +28,10 @@ extern "C" {
|
||||
#include "h5fImp.h"
|
||||
#include "h5util.h"
|
||||
|
||||
extern JavaVM *jvm;
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
/* extern JavaVM *jvm; */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
@ -39,18 +42,22 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Fopen
|
||||
(JNIEnv *env, jclass clss, jstring name, jint flags, jlong access_id)
|
||||
{
|
||||
hid_t status = -1;
|
||||
const char *fileName;
|
||||
const char *fileName = NULL;
|
||||
hid_t status = H5I_INVALID_HID;
|
||||
|
||||
PIN_JAVA_STRING(name, fileName);
|
||||
if (fileName != NULL) {
|
||||
status = H5Fopen(fileName, (unsigned)flags, (hid_t)access_id );
|
||||
UNUSED(clss);
|
||||
|
||||
UNPIN_JAVA_STRING(name, fileName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fopen: file name is NULL");
|
||||
|
||||
if (status < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Fopen: file name not pinned");
|
||||
|
||||
if ((status = H5Fopen(fileName, (unsigned)flags, (hid_t)access_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (fileName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, fileName);
|
||||
|
||||
return (jlong)status;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Fopen */
|
||||
@ -64,18 +71,22 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Fcreate
|
||||
(JNIEnv *env, jclass clss, jstring name, jint flags, jlong create_id, jlong access_id)
|
||||
{
|
||||
hid_t status = -1;
|
||||
const char *fileName;
|
||||
const char *fileName = NULL;
|
||||
hid_t status = H5I_INVALID_HID;
|
||||
|
||||
PIN_JAVA_STRING(name, fileName);
|
||||
if (fileName != NULL) {
|
||||
status = H5Fcreate(fileName, (unsigned)flags, create_id, access_id);
|
||||
UNUSED(clss);
|
||||
|
||||
UNPIN_JAVA_STRING(name, fileName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fcreate: file name is NULL");
|
||||
|
||||
if (status < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Fcreate: file name not pinned");
|
||||
|
||||
if ((status = H5Fcreate(fileName, (unsigned)flags, create_id, access_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (fileName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, fileName);
|
||||
|
||||
return (jlong)status;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Fcreate */
|
||||
@ -89,12 +100,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fflush
|
||||
(JNIEnv *env, jclass clss, jlong object_id, jint scope)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
retVal = H5Fflush((hid_t)object_id, (H5F_scope_t)scope );
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Fflush((hid_t)object_id, (H5F_scope_t)scope)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fflush */
|
||||
|
||||
@ -107,34 +120,29 @@ JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fget_1name
|
||||
(JNIEnv *env, jclass cls, jlong file_id)
|
||||
{
|
||||
char *namePtr;
|
||||
jstring str = NULL;
|
||||
ssize_t buf_size;
|
||||
jstring str = NULL;
|
||||
ssize_t buf_size;
|
||||
char *namePtr = NULL;
|
||||
|
||||
/* get the length of the name */
|
||||
buf_size = H5Fget_name((hid_t)file_id, NULL, 0);
|
||||
UNUSED(cls);
|
||||
|
||||
if (buf_size <= 0) {
|
||||
h5badArgument(env, "H5Fget_name: buf_size <= 0");
|
||||
} /* end if */
|
||||
else {
|
||||
buf_size++; /* add extra space for the null terminator */
|
||||
namePtr = (char*)HDmalloc(sizeof(char) * (size_t)buf_size);
|
||||
if (namePtr == NULL) {
|
||||
h5outOfMemory(env, "H5Fget_name: malloc failed");
|
||||
} /* end if */
|
||||
else {
|
||||
buf_size = H5Fget_name((hid_t)file_id, namePtr, (size_t)buf_size);
|
||||
if (buf_size < 0) {
|
||||
HDfree(namePtr);
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
str = ENVPTR->NewStringUTF(ENVPAR namePtr);
|
||||
HDfree(namePtr);
|
||||
}/* end else */
|
||||
}/* end else */
|
||||
}/* end else */
|
||||
/* Get the length of the name */
|
||||
if ((buf_size = H5Fget_name((hid_t)file_id, NULL, 0)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (NULL == (namePtr = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Fget_name: malloc failed");
|
||||
|
||||
if ((H5Fget_name((hid_t)file_id, namePtr, (size_t)buf_size + 1)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
namePtr[buf_size] = '\0';
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, namePtr)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
if (namePtr)
|
||||
HDfree(namePtr);
|
||||
|
||||
return str;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1name */
|
||||
@ -148,24 +156,29 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fis_1hdf5
|
||||
(JNIEnv *env, jclass clss, jstring name)
|
||||
{
|
||||
const char *fileName = NULL;
|
||||
htri_t bval = JNI_FALSE;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
#ifdef H5_NO_DEPRECATED_SYMBOLS
|
||||
h5unimplemented(env, "H5Fis_hdf5: not implemented");
|
||||
#else
|
||||
const char *fileName;
|
||||
|
||||
PIN_JAVA_STRING(name, fileName);
|
||||
if (fileName != NULL) {
|
||||
bval = H5Fis_hdf5(fileName);
|
||||
|
||||
UNPIN_JAVA_STRING(name, fileName);
|
||||
|
||||
if (bval > 0)
|
||||
bval = JNI_TRUE;
|
||||
else if (bval < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
H5_UNIMPLEMENTED(ENVONLY, "H5Fis_hdf5: not implemented");
|
||||
#endif
|
||||
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fis_hdf5: file name is NULL");
|
||||
|
||||
PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Fis_hdf5: file name not pinned");
|
||||
|
||||
if ((bval = H5Fis_hdf5(fileName)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
|
||||
|
||||
done:
|
||||
if (fileName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, fileName);
|
||||
|
||||
return (jboolean)bval;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fis_1hdf5 */
|
||||
|
||||
@ -178,20 +191,24 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fis_1accessible
|
||||
(JNIEnv *env, jclass clss, jstring name, jlong file_id)
|
||||
{
|
||||
const char *fileName = NULL;
|
||||
htri_t bval = JNI_FALSE;
|
||||
const char *fileName;
|
||||
|
||||
PIN_JAVA_STRING(name, fileName);
|
||||
if (fileName != NULL) {
|
||||
bval = H5Fis_accessible(fileName, (hid_t)file_id);
|
||||
UNUSED(clss);
|
||||
|
||||
UNPIN_JAVA_STRING(name, fileName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fis_accessible: file name is NULL");
|
||||
|
||||
if (bval > 0)
|
||||
bval = JNI_TRUE;
|
||||
else if (bval < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Fis_accessible: file name not pinned");
|
||||
|
||||
if ((bval = H5Fis_accessible(fileName, (hid_t)file_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
|
||||
|
||||
done:
|
||||
if (fileName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, fileName);
|
||||
|
||||
return (jboolean)bval;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fis_1accessible */
|
||||
@ -205,12 +222,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Fget_1create_1plist
|
||||
(JNIEnv *env, jclass clss, jlong file_id)
|
||||
{
|
||||
hid_t retVal = -1;
|
||||
hid_t retVal = H5I_INVALID_HID;
|
||||
|
||||
retVal = H5Fget_create_plist((hid_t)file_id);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Fget_create_plist((hid_t)file_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Fget_1create_1plist */
|
||||
|
||||
@ -223,12 +242,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Fget_1access_1plist
|
||||
(JNIEnv *env, jclass clss, jlong file_id)
|
||||
{
|
||||
hid_t retVal = -1;
|
||||
hid_t retVal = H5I_INVALID_HID;
|
||||
|
||||
retVal = H5Fget_access_plist((hid_t)file_id);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Fget_access_plist((hid_t)file_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Fget_1access_1plist */
|
||||
|
||||
@ -243,9 +264,12 @@ Java_hdf_hdf5lib_H5_H5Fget_1intent
|
||||
{
|
||||
unsigned intent = 0;
|
||||
|
||||
if (H5Fget_intent((hid_t)file_id, &intent) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Fget_intent((hid_t)file_id, &intent) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)intent;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1intent */
|
||||
|
||||
@ -258,14 +282,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Fclose
|
||||
(JNIEnv *env, jclass clss, jlong file_id)
|
||||
{
|
||||
herr_t status = -1;
|
||||
herr_t status = FAIL;
|
||||
|
||||
if (file_id > 0)
|
||||
status = H5Fclose((hid_t)file_id );
|
||||
UNUSED(clss);
|
||||
|
||||
if (status < 0)
|
||||
h5libraryError(env);
|
||||
if ((status = H5Fclose((hid_t)file_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Fclose */
|
||||
|
||||
@ -278,18 +302,22 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fmount
|
||||
(JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong child_id, jlong plist_id)
|
||||
{
|
||||
herr_t status = -1;
|
||||
const char *fileName;
|
||||
const char *fileName = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
PIN_JAVA_STRING(name, fileName);
|
||||
if (fileName != NULL) {
|
||||
status = H5Fmount((hid_t)loc_id, fileName, (hid_t)child_id, (hid_t)plist_id);
|
||||
UNUSED(clss);
|
||||
|
||||
UNPIN_JAVA_STRING(name, fileName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fmount: file name is NULL");
|
||||
|
||||
if (status < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Fmount: file name not pinned");
|
||||
|
||||
if ((status = H5Fmount((hid_t)loc_id, fileName, (hid_t)child_id, (hid_t)plist_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (fileName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, fileName);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fmount */
|
||||
@ -303,18 +331,22 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Funmount
|
||||
(JNIEnv *env, jclass clss, jlong loc_id, jstring name)
|
||||
{
|
||||
herr_t status = -1;
|
||||
const char *fileName;
|
||||
const char *fileName = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
PIN_JAVA_STRING(name, fileName);
|
||||
if (fileName != NULL) {
|
||||
status = H5Funmount((hid_t)loc_id, fileName);
|
||||
UNUSED(clss);
|
||||
|
||||
UNPIN_JAVA_STRING(name, fileName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Funmount: file name is NULL");
|
||||
|
||||
if (status < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Funmount: file name not pinned");
|
||||
|
||||
if ((status = H5Funmount((hid_t)loc_id, fileName)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (fileName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, fileName);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Funmount */
|
||||
@ -328,11 +360,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fget_1freespace
|
||||
(JNIEnv *env, jclass cls, jlong file_id)
|
||||
{
|
||||
hssize_t ret_val = H5Fget_freespace((hid_t)file_id);
|
||||
hssize_t ret_val = -1;
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((ret_val = H5Fget_freespace((hid_t)file_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1freespace */
|
||||
|
||||
@ -345,12 +380,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Freopen
|
||||
(JNIEnv *env, jclass clss, jlong file_id)
|
||||
{
|
||||
hid_t retVal = -1;
|
||||
hid_t retVal = H5I_INVALID_HID;
|
||||
|
||||
retVal = H5Freopen((hid_t)file_id);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Freopen((hid_t)file_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Freopen */
|
||||
|
||||
@ -364,47 +401,40 @@ Java_hdf_hdf5lib_H5_H5Fget_1obj_1ids
|
||||
(JNIEnv *env, jclass cls, jlong file_id, jint types, jlong maxObjs,
|
||||
jlongArray obj_id_list)
|
||||
{
|
||||
ssize_t ret_val = -1;
|
||||
jlong *obj_id_listP;
|
||||
jboolean isCopy;
|
||||
hid_t *id_list;
|
||||
size_t rank;
|
||||
size_t i;
|
||||
jboolean isCopy;
|
||||
ssize_t ret_val = -1;
|
||||
size_t i;
|
||||
jsize rank;
|
||||
jlong *obj_id_listP = NULL;
|
||||
hid_t *id_list = NULL;
|
||||
|
||||
if (obj_id_list == NULL) {
|
||||
h5nullArgument(env, "H5Fget_obj_ids: obj_id_list is NULL");
|
||||
} /* end if */
|
||||
else {
|
||||
obj_id_listP = ENVPTR->GetLongArrayElements(ENVPAR obj_id_list, &isCopy);
|
||||
if (obj_id_listP == NULL) {
|
||||
h5JNIFatalError(env, "H5Fget_obj_ids: obj_id_list not pinned");
|
||||
} /* end if */
|
||||
else {
|
||||
rank = (size_t)ENVPTR->GetArrayLength(ENVPAR obj_id_list);
|
||||
UNUSED(cls);
|
||||
|
||||
id_list = (hid_t *)HDmalloc(rank * sizeof(hid_t));
|
||||
if (id_list == NULL) {
|
||||
ENVPTR->ReleaseLongArrayElements(ENVPAR obj_id_list, obj_id_listP, JNI_ABORT);
|
||||
h5JNIFatalError(env, "H5Fget_obj_ids: obj_id_list not converted to hid_t");
|
||||
} /* end if */
|
||||
else {
|
||||
ret_val = H5Fget_obj_ids((hid_t)file_id, (unsigned int)types, (size_t)maxObjs, id_list);
|
||||
if (NULL == obj_id_list)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fget_obj_ids: obj_id_list is NULL");
|
||||
|
||||
if (ret_val < 0) {
|
||||
ENVPTR->ReleaseLongArrayElements(ENVPAR obj_id_list, obj_id_listP, JNI_ABORT);
|
||||
HDfree(id_list);
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
for (i = 0; i < rank; i++) {
|
||||
obj_id_listP[i] = (jlong)id_list[i];
|
||||
} /* end for */
|
||||
HDfree(id_list);
|
||||
ENVPTR->ReleaseLongArrayElements(ENVPAR obj_id_list, obj_id_listP, 0);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
PIN_LONG_ARRAY(ENVONLY, obj_id_list, obj_id_listP, &isCopy, "H5Fget_obj_ids: obj_id_list not pinned");
|
||||
|
||||
if ((rank = ENVPTR->GetArrayLength(ENVONLY, obj_id_list)) < 0) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Fget_obj_ids: obj_id_list length < 0");
|
||||
}
|
||||
|
||||
if (NULL == (id_list = (hid_t *) HDmalloc((size_t)rank * sizeof(hid_t))))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Fget_obj_ids: malloc failed");
|
||||
|
||||
if ((ret_val = H5Fget_obj_ids((hid_t)file_id, (unsigned int)types, (size_t)maxObjs, id_list)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
for (i = 0; i < (size_t)rank; i++) {
|
||||
obj_id_listP[i] = (jlong)id_list[i];
|
||||
} /* end for */
|
||||
|
||||
done:
|
||||
if (id_list)
|
||||
HDfree(id_list);
|
||||
if (obj_id_listP)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, obj_id_list, obj_id_listP, (ret_val < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1obj_1ids */
|
||||
@ -418,11 +448,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fget_1obj_1count
|
||||
(JNIEnv *env, jclass cls, jlong file_id, jint types)
|
||||
{
|
||||
ssize_t ret_val = H5Fget_obj_count((hid_t)file_id, (unsigned int)types);
|
||||
ssize_t ret_val = -1;
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((ret_val = H5Fget_obj_count((hid_t)file_id, (unsigned int)types)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)ret_val;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1obj_1count_1long */
|
||||
|
||||
@ -437,9 +470,12 @@ Java_hdf_hdf5lib_H5_H5Fget_1filesize
|
||||
{
|
||||
hsize_t size = 0;
|
||||
|
||||
if (H5Fget_filesize ((hid_t)file_id, &size) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Fget_filesize((hid_t)file_id, &size) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong) size;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1filesize */
|
||||
|
||||
@ -454,9 +490,12 @@ Java_hdf_hdf5lib_H5_H5Fget_1mdc_1hit_1rate
|
||||
{
|
||||
double rate = 0.0;
|
||||
|
||||
if (H5Fget_mdc_hit_rate((hid_t)file_id, &rate) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Fget_mdc_hit_rate((hid_t)file_id, &rate) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jdouble)rate;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1mdc_1hit_1rate */
|
||||
|
||||
@ -469,33 +508,37 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fget_1mdc_1size
|
||||
(JNIEnv *env, jclass cls, jlong file_id, jlongArray metadata_cache)
|
||||
{
|
||||
jint size = 0;
|
||||
jlong *metadata_cache_ptr;
|
||||
size_t max_size = 0, min_clean_size = 0, cur_size = 0;
|
||||
int cur_num_entries = -1;
|
||||
jboolean isCopy;
|
||||
jboolean isCopy;
|
||||
size_t max_size = 0, min_clean_size = 0, cur_size = 0;
|
||||
jlong *metadata_cache_ptr = NULL;
|
||||
jsize size = 0;
|
||||
int cur_num_entries = -1;
|
||||
|
||||
if (metadata_cache == NULL) {
|
||||
h5nullArgument(env, "H5Fget_mdc_size: metadata_cache is NULL");
|
||||
} /* end if */
|
||||
else {
|
||||
size = (int)ENVPTR->GetArrayLength(ENVPAR metadata_cache);
|
||||
if (size < 3) {
|
||||
h5badArgument(env, "H5Fget_mdc_size: length of metadata_cache < 3.");
|
||||
} /* end if */
|
||||
else {
|
||||
if (H5Fget_mdc_size((hid_t)file_id, &max_size, &min_clean_size, &cur_size, &cur_num_entries) < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
metadata_cache_ptr = ENVPTR->GetLongArrayElements(ENVPAR metadata_cache, &isCopy);
|
||||
metadata_cache_ptr[0] = (jlong)max_size;
|
||||
metadata_cache_ptr[1] = (jlong)min_clean_size;
|
||||
metadata_cache_ptr[2] = (jlong)cur_size;
|
||||
ENVPTR->ReleaseLongArrayElements(ENVPAR metadata_cache, metadata_cache_ptr, 0);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
UNUSED(cls);
|
||||
|
||||
if (NULL == metadata_cache)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_size: metadata cache array is NULL");
|
||||
|
||||
if ((size = ENVPTR->GetArrayLength(ENVONLY, metadata_cache)) < 0) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_size: metadata_cache length < 0");
|
||||
}
|
||||
|
||||
if (size < 3)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_size: length of metadata_cache array < 3");
|
||||
|
||||
if (H5Fget_mdc_size((hid_t)file_id, &max_size, &min_clean_size, &cur_size, &cur_num_entries) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
PIN_LONG_ARRAY(ENVONLY, metadata_cache, metadata_cache_ptr, &isCopy, "H5Fget_mdc_size: metadata_cache array not pinned");
|
||||
|
||||
metadata_cache_ptr[0] = (jlong)max_size;
|
||||
metadata_cache_ptr[1] = (jlong)min_clean_size;
|
||||
metadata_cache_ptr[2] = (jlong)cur_size;
|
||||
|
||||
done:
|
||||
if (metadata_cache_ptr)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, metadata_cache, metadata_cache_ptr, 0);
|
||||
|
||||
return (jint)cur_num_entries;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1mdc_1size */
|
||||
@ -509,31 +552,36 @@ JNIEXPORT jobject JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fget_1info
|
||||
(JNIEnv *env, jclass clss, jlong obj_id)
|
||||
{
|
||||
H5F_info2_t finfo;
|
||||
jvalue args[9];
|
||||
H5F_info2_t finfo;
|
||||
jobject ihinfobuf;
|
||||
jvalue args[9];
|
||||
jobject ret_obj = NULL;
|
||||
|
||||
if (H5Fget_info2((hid_t)obj_id, &finfo) < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
args[0].j = (jlong)finfo.sohm.msgs_info.index_size;
|
||||
args[1].j = (jlong)finfo.sohm.msgs_info.heap_size;
|
||||
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
|
||||
ihinfobuf = ret_obj;
|
||||
UNUSED(clss);
|
||||
|
||||
args[0].i = (jint)finfo.super.version;
|
||||
args[1].j = (jlong)finfo.super.super_size;
|
||||
args[2].j = (jlong)finfo.super.super_ext_size;
|
||||
args[3].i = (jint)finfo.free.version;
|
||||
args[4].j = (jlong)finfo.free.meta_size;
|
||||
args[5].j = (jlong)finfo.free.tot_space;
|
||||
args[6].j = (jint)finfo.sohm.version;
|
||||
args[7].j = (jlong)finfo.sohm.hdr_size;
|
||||
args[8].l = ihinfobuf;
|
||||
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5F_info2_t", "(IJJIJJIJLhdf/hdf5lib/structs/H5_ih_info_t;)V", args);
|
||||
} /* end else */
|
||||
if (H5Fget_info2((hid_t)obj_id, &finfo) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
args[0].j = (jlong)finfo.sohm.msgs_info.index_size;
|
||||
args[1].j = (jlong)finfo.sohm.msgs_info.heap_size;
|
||||
|
||||
CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args, ret_obj);
|
||||
|
||||
ihinfobuf = ret_obj;
|
||||
|
||||
args[0].i = (jint)finfo.super.version;
|
||||
args[1].j = (jlong)finfo.super.super_size;
|
||||
args[2].j = (jlong)finfo.super.super_ext_size;
|
||||
args[3].i = (jint)finfo.free.version;
|
||||
args[4].j = (jlong)finfo.free.meta_size;
|
||||
args[5].j = (jlong)finfo.free.tot_space;
|
||||
args[6].j = (jint)finfo.sohm.version;
|
||||
args[7].j = (jlong)finfo.sohm.hdr_size;
|
||||
args[8].l = ihinfobuf;
|
||||
|
||||
CALL_CONSTRUCTOR(ENVONLY, "hdf/hdf5lib/structs/H5F_info2_t", "(IJJIJJIJLhdf/hdf5lib/structs/H5_ih_info_t;)V", args, ret_obj);
|
||||
|
||||
done:
|
||||
return ret_obj;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1info */
|
||||
|
||||
@ -546,8 +594,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Freset_1mdc_1hit_1rate_1stats
|
||||
(JNIEnv *env, jclass cls, jlong file_id)
|
||||
{
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Freset_mdc_hit_rate_stats((hid_t)file_id) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Freset_1mdc_1hit_1rate_1stats */
|
||||
|
||||
/*
|
||||
@ -559,8 +612,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fclear_1elink_1file_1cache
|
||||
(JNIEnv *env, jclass cls, jlong file_id)
|
||||
{
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Fclear_elink_file_cache((hid_t)file_id) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fclear_1elink_1file_1cache */
|
||||
|
||||
/*
|
||||
@ -572,8 +630,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write
|
||||
(JNIEnv *env, jclass cls, jlong file_id)
|
||||
{
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Fstart_swmr_write((hid_t)file_id) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fstart_1swmr_1write */
|
||||
|
||||
/*
|
||||
@ -585,8 +648,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging
|
||||
(JNIEnv *env, jclass cls, jlong file_id)
|
||||
{
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Fstart_mdc_logging((hid_t)file_id) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fstart_1mdc_1logging */
|
||||
|
||||
/*
|
||||
@ -598,8 +666,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging
|
||||
(JNIEnv *env, jclass cls, jlong file_id)
|
||||
{
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Fstop_mdc_logging((hid_t)file_id) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fstop_1mdc_1logging */
|
||||
|
||||
/*
|
||||
@ -611,32 +684,38 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status
|
||||
(JNIEnv *env, jclass cls, jlong file_id, jbooleanArray mdc_logging_status)
|
||||
{
|
||||
jboolean *mdc_logging_status_ptr = NULL;
|
||||
jboolean isCopy;
|
||||
hbool_t is_enabled;
|
||||
hbool_t is_currently_logging;
|
||||
jboolean *mdc_logging_status_ptr;
|
||||
jint size;
|
||||
jboolean isCopy;
|
||||
jsize size;
|
||||
|
||||
if (mdc_logging_status == NULL) {
|
||||
h5nullArgument(env, "H5Fget_mdc_logging_status: mdc_logging_status is NULL");
|
||||
} /* end if */
|
||||
else {
|
||||
size = (int)ENVPTR->GetArrayLength(ENVPAR mdc_logging_status);
|
||||
if (size < 2) {
|
||||
h5badArgument(env, "H5Fget_mdc_logging_status: length of mdc_logging_status < 2.");
|
||||
} /* end if */
|
||||
else {
|
||||
if (H5Fget_mdc_logging_status((hid_t)file_id, &is_enabled, &is_currently_logging) < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
mdc_logging_status_ptr = ENVPTR->GetBooleanArrayElements(ENVPAR mdc_logging_status, &isCopy);
|
||||
mdc_logging_status_ptr[0] = (jboolean)is_enabled;
|
||||
mdc_logging_status_ptr[1] = (jboolean)is_currently_logging;
|
||||
ENVPTR->ReleaseBooleanArrayElements(ENVPAR mdc_logging_status, mdc_logging_status_ptr, 0);
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
} /* end else */
|
||||
UNUSED(cls);
|
||||
|
||||
if (NULL == mdc_logging_status)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_logging_status: mdc_logging_status is NULL");
|
||||
|
||||
if ((size = ENVPTR->GetArrayLength(ENVONLY, mdc_logging_status)) < 0) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_logging_status: mdc_logging_status length < 0");
|
||||
}
|
||||
|
||||
if (size < 2)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Fget_mdc_logging_status: length of mdc_logging_status < 2");
|
||||
|
||||
if (H5Fget_mdc_logging_status((hid_t)file_id, &is_enabled, &is_currently_logging) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
PIN_BOOL_ARRAY(ENVONLY, mdc_logging_status, mdc_logging_status_ptr, &isCopy, "H5Fget_mdc_logging_status: mdc_logging_status array not pinned");
|
||||
|
||||
mdc_logging_status_ptr[0] = (jboolean)is_enabled;
|
||||
mdc_logging_status_ptr[1] = (jboolean)is_currently_logging;
|
||||
|
||||
done:
|
||||
if (mdc_logging_status_ptr)
|
||||
UNPIN_BOOL_ARRAY(ENVONLY, mdc_logging_status, mdc_logging_status_ptr, 0);
|
||||
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fget_1mdc_1logging_1status */
|
||||
|
||||
/*
|
||||
@ -648,17 +727,18 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fset_1dset_1no_1attrs_1hint
|
||||
(JNIEnv *env, jclass clss, jlong file_id, jboolean minimize)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
hbool_t minimize_val;
|
||||
hbool_t minimize_val;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
if (minimize == JNI_TRUE)
|
||||
minimize_val = TRUE;
|
||||
else
|
||||
minimize_val = FALSE;
|
||||
UNUSED(clss);
|
||||
|
||||
retVal = H5Fset_dset_no_attrs_hint((hid_t)file_id, (hbool_t)minimize_val);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
minimize_val = (minimize == JNI_TRUE) ? TRUE : FALSE;
|
||||
|
||||
if ((retVal = H5Fset_dset_no_attrs_hint((hid_t)file_id, (hbool_t)minimize_val)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -670,17 +750,18 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fget_1dset_1no_1attrs_1hint
|
||||
(JNIEnv *env, jclass clss, jlong file_id)
|
||||
{
|
||||
hbool_t minimize = FALSE;
|
||||
jboolean bval = JNI_FALSE;
|
||||
jboolean bval = JNI_FALSE;
|
||||
hbool_t minimize = FALSE;
|
||||
|
||||
if (H5Fget_dset_no_attrs_hint((hid_t)file_id, (hbool_t *)&minimize) < 0) {
|
||||
h5libraryError(env);
|
||||
}
|
||||
else {
|
||||
if (minimize == TRUE)
|
||||
bval = JNI_TRUE;
|
||||
} /* end else */
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Fget_dset_no_attrs_hint((hid_t)file_id, (hbool_t *)&minimize) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (minimize == TRUE)
|
||||
bval = JNI_TRUE;
|
||||
|
||||
done:
|
||||
return bval;
|
||||
}
|
||||
|
||||
@ -693,11 +774,15 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fset_1libver_1bounds
|
||||
(JNIEnv *env, jclass clss, jlong file_id, jint low, jint high)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
retVal = H5Fset_libver_bounds((hid_t)file_id, (H5F_libver_t)low, (H5F_libver_t)high);
|
||||
if(retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Fset_libver_bounds((hid_t)file_id, (H5F_libver_t)low, (H5F_libver_t)high)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Fset_1libver_1bounds */
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ Java_hdf_hdf5lib_H5_H5Fis_1hdf5
|
||||
* Signature: (Ljava/lang/String;J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Fis_1ccessible
|
||||
Java_hdf_hdf5lib_H5_H5Fis_1accessible
|
||||
(JNIEnv*, jclass, jstring, jlong);
|
||||
|
||||
/*
|
||||
|
@ -29,7 +29,10 @@ extern "C" {
|
||||
#include "h5util.h"
|
||||
#include "h5gImp.h"
|
||||
|
||||
extern JavaVM *jvm;
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
/* extern JavaVM *jvm; */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
@ -40,12 +43,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Gclose
|
||||
(JNIEnv *env, jclass clss, jlong group_id)
|
||||
{
|
||||
herr_t retVal = -1;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
retVal = H5Gclose((hid_t)group_id);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Gclose((hid_t)group_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Gclose */
|
||||
|
||||
@ -63,33 +68,46 @@ jobject
|
||||
create_H5G_info_t
|
||||
(JNIEnv *env, H5G_info_t group_info)
|
||||
{
|
||||
jclass cls;
|
||||
jfieldID fid_storage_type, fid_nlinks, fid_max_corder, fid_mounted;
|
||||
jboolean jmounted;
|
||||
jclass cls;
|
||||
jint storage_type;
|
||||
jobject obj = NULL;
|
||||
jfieldID fid_storage_type, fid_nlinks, fid_max_corder, fid_mounted;
|
||||
|
||||
cls = ENVPTR->FindClass(ENVPAR "hdf/hdf5lib/structs/H5G_info_t");
|
||||
if (cls != NULL) {
|
||||
obj = ENVPTR->AllocObject(ENVPAR cls);
|
||||
if (obj != NULL) {
|
||||
if ((fid_storage_type = ENVPTR->GetFieldID(ENVPAR cls, "storage_type", "I")) != NULL) {
|
||||
if ((fid_nlinks = ENVPTR->GetFieldID(ENVPAR cls, "nlinks", "J")) != NULL) {
|
||||
if ((fid_max_corder = ENVPTR->GetFieldID(ENVPAR cls, "max_corder", "J")) != NULL) {
|
||||
if ((fid_mounted = ENVPTR->GetFieldID(ENVPAR cls, "mounted", "Z")) != NULL) {
|
||||
jmounted = (group_info.mounted==0) ? JNI_FALSE : JNI_TRUE;
|
||||
storage_type = (jint)group_info.storage_type;
|
||||
if (NULL == (cls = ENVPTR->FindClass(ENVONLY, "hdf/hdf5lib/structs/H5G_info_t")))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
ENVPTR->SetIntField(ENVPAR obj, fid_storage_type, (jint)storage_type);
|
||||
ENVPTR->SetLongField(ENVPAR obj, fid_nlinks, (jlong)group_info.nlinks);
|
||||
ENVPTR->SetLongField(ENVPAR obj, fid_max_corder, (jlong)group_info.max_corder);
|
||||
ENVPTR->SetBooleanField(ENVPAR obj, fid_mounted, jmounted);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (NULL == (obj = ENVPTR->AllocObject(ENVONLY, cls)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == (fid_storage_type = ENVPTR->GetFieldID(ENVONLY, cls, "storage_type", "I")))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == (fid_nlinks = ENVPTR->GetFieldID(ENVONLY, cls, "nlinks", "J")))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == (fid_max_corder = ENVPTR->GetFieldID(ENVONLY, cls, "max_corder", "J")))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == (fid_mounted = ENVPTR->GetFieldID(ENVONLY, cls, "mounted", "Z")))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
jmounted = (group_info.mounted == 0) ? JNI_FALSE : JNI_TRUE;
|
||||
storage_type = (jint)group_info.storage_type;
|
||||
|
||||
ENVPTR->SetIntField(ENVONLY, obj, fid_storage_type, (jint)storage_type);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
ENVPTR->SetLongField(ENVONLY, obj, fid_nlinks, (jlong)group_info.nlinks);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
ENVPTR->SetLongField(ENVONLY, obj, fid_max_corder, (jlong)group_info.max_corder);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
ENVPTR->SetBooleanField(ENVONLY, obj, fid_mounted, jmounted);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
return obj;
|
||||
} /* end create_H5G_info_t */
|
||||
|
||||
@ -103,17 +121,22 @@ Java_hdf_hdf5lib_H5__1H5Gcreate2
|
||||
(JNIEnv *env, jclass clss, jlong loc_id, jstring name,
|
||||
jlong link_plist_id, jlong create_plist_id, jlong access_plist_id)
|
||||
{
|
||||
hid_t group_id = -1;
|
||||
const char *gName;
|
||||
const char *grpName = NULL;
|
||||
hid_t group_id = H5I_INVALID_HID;
|
||||
|
||||
PIN_JAVA_STRING(name, gName);
|
||||
if (gName != NULL) {
|
||||
group_id = H5Gcreate2((hid_t)loc_id, gName, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id );
|
||||
UNUSED(clss);
|
||||
|
||||
UNPIN_JAVA_STRING(name, gName);
|
||||
if (group_id < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Gcreate2: group name is NULL");
|
||||
|
||||
PIN_JAVA_STRING(ENVONLY, name, grpName, NULL, "H5Gcreate2: group name not pinned");
|
||||
|
||||
if ((group_id = H5Gcreate2((hid_t)loc_id, grpName, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (grpName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, grpName);
|
||||
|
||||
return (jlong)group_id;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Gcreate2 */
|
||||
@ -127,12 +150,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Gcreate_1anon
|
||||
(JNIEnv *env, jclass cls, jlong loc_id, jlong gcpl_id, jlong gapl_id)
|
||||
{
|
||||
hid_t group_id = -1;
|
||||
hid_t group_id = H5I_INVALID_HID;
|
||||
|
||||
group_id = H5Gcreate_anon((hid_t)loc_id, (hid_t)gcpl_id, (hid_t)gapl_id);
|
||||
if (group_id < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((group_id = H5Gcreate_anon((hid_t)loc_id, (hid_t)gcpl_id, (hid_t)gapl_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)group_id;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Gcreate_1anon */
|
||||
|
||||
@ -145,18 +170,22 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5__1H5Gopen2
|
||||
(JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_plist_id)
|
||||
{
|
||||
hid_t group_id = -1;
|
||||
const char *gName;
|
||||
const char *grpName = NULL;
|
||||
hid_t group_id = H5I_INVALID_HID;
|
||||
|
||||
PIN_JAVA_STRING(name, gName);
|
||||
if (gName != NULL) {
|
||||
group_id = H5Gopen2((hid_t)loc_id, gName, (hid_t)access_plist_id );
|
||||
UNUSED(clss);
|
||||
|
||||
UNPIN_JAVA_STRING(name, gName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Gopen2: group name is NULL");
|
||||
|
||||
if (group_id < 0)
|
||||
h5libraryError(env);
|
||||
}
|
||||
PIN_JAVA_STRING(ENVONLY, name, grpName, NULL, "H5Gopen2: group name not pinned");
|
||||
|
||||
if ((group_id = H5Gopen2((hid_t)loc_id, grpName, (hid_t)access_plist_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (grpName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, grpName);
|
||||
|
||||
return (jlong)group_id;
|
||||
} /* end Java_hdf_hdf5lib_H5__1H5Gopen2 */
|
||||
@ -171,11 +200,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Gget_1create_1plist
|
||||
(JNIEnv *env, jclass cls, jlong loc_id)
|
||||
{
|
||||
hid_t plist_id = H5Gget_create_plist((hid_t)loc_id);
|
||||
hid_t plist_id = H5I_INVALID_HID;
|
||||
|
||||
if (plist_id < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(cls);
|
||||
|
||||
if ((plist_id = H5Gget_create_plist((hid_t)loc_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)plist_id;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Gget_1create_1plist */
|
||||
|
||||
@ -188,14 +220,18 @@ JNIEXPORT jobject JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Gget_1info
|
||||
(JNIEnv *env, jclass cls, jlong loc_id)
|
||||
{
|
||||
jobject obj = NULL;
|
||||
H5G_info_t group_info;
|
||||
jobject obj = NULL;
|
||||
|
||||
UNUSED(cls);
|
||||
|
||||
if (H5Gget_info((hid_t)loc_id, &group_info) < 0)
|
||||
h5libraryError(env);
|
||||
else
|
||||
obj = create_H5G_info_t(env, group_info);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (NULL == (obj = create_H5G_info_t(env, group_info)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_info: unable to create H5G_info_t object");
|
||||
|
||||
done:
|
||||
return obj;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info */
|
||||
|
||||
@ -208,23 +244,30 @@ JNIEXPORT jobject JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name
|
||||
(JNIEnv *env, jclass cls, jlong loc_id, jstring name, jlong lapl_id)
|
||||
{
|
||||
jobject obj = NULL;
|
||||
herr_t ret_val = -1;
|
||||
const char *gName;
|
||||
H5G_info_t group_info;
|
||||
const char *grpName = NULL;
|
||||
jobject obj = NULL;
|
||||
herr_t ret_val = FAIL;
|
||||
|
||||
PIN_JAVA_STRING(name, gName);
|
||||
if (gName != NULL) {
|
||||
ret_val = H5Gget_info_by_name((hid_t)loc_id, gName, &group_info, (hid_t)lapl_id);
|
||||
UNUSED(cls);
|
||||
|
||||
UNPIN_JAVA_STRING(name, gName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Gget_info_by_name: group name is NULL");
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
else
|
||||
obj = create_H5G_info_t(env, group_info);
|
||||
PIN_JAVA_STRING(ENVONLY, name, grpName, NULL, "H5Gget_info_by_name: group name not pinned");
|
||||
|
||||
if ((ret_val = H5Gget_info_by_name((hid_t)loc_id, grpName, &group_info, (hid_t)lapl_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (NULL == (obj = create_H5G_info_t(env, group_info))) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_info_by_name: unable to create H5G_info_t object");
|
||||
}
|
||||
|
||||
done:
|
||||
if (grpName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, grpName);
|
||||
|
||||
return obj;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name */
|
||||
|
||||
@ -238,26 +281,33 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx
|
||||
(JNIEnv *env, jclass cls, jlong loc_id, jstring name, jint index_type,
|
||||
jint order, jlong n, jlong lapl_id)
|
||||
{
|
||||
jobject obj = NULL;
|
||||
herr_t ret_val = -1;
|
||||
const char *gName;
|
||||
H5G_info_t group_info;
|
||||
H5_index_t cindex_type = (H5_index_t)index_type;
|
||||
H5_iter_order_t corder = (H5_iter_order_t)order;
|
||||
H5_iter_order_t corder = (H5_iter_order_t)order;
|
||||
H5_index_t cindex_type = (H5_index_t)index_type;
|
||||
H5G_info_t group_info;
|
||||
const char *grpName = NULL;
|
||||
jobject obj = NULL;
|
||||
herr_t ret_val = FAIL;
|
||||
|
||||
PIN_JAVA_STRING(name, gName);
|
||||
if (gName != NULL) {
|
||||
ret_val = H5Gget_info_by_idx((hid_t)loc_id, gName, cindex_type,
|
||||
corder, (hsize_t)n, &group_info, (hid_t)lapl_id);
|
||||
UNUSED(cls);
|
||||
|
||||
UNPIN_JAVA_STRING(name, gName);
|
||||
if (NULL == name)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Gget_info_by_idx: group name is NULL");
|
||||
|
||||
if (ret_val < 0)
|
||||
h5libraryError(env);
|
||||
else
|
||||
obj = create_H5G_info_t(env, group_info);
|
||||
PIN_JAVA_STRING(ENVONLY, name, grpName, NULL, "H5Gget_info_by_idx: group name not pinned");
|
||||
|
||||
if ((ret_val = H5Gget_info_by_idx((hid_t)loc_id, grpName, cindex_type,
|
||||
corder, (hsize_t)n, &group_info, (hid_t)lapl_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (NULL == (obj = create_H5G_info_t(env, group_info))) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Gget_info_by_idx: unable to create H5G_info_t object");
|
||||
}
|
||||
|
||||
done:
|
||||
if (grpName)
|
||||
UNPIN_JAVA_STRING(ENVONLY, name, grpName);
|
||||
|
||||
return obj;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx */
|
||||
|
||||
@ -270,8 +320,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Gflush
|
||||
(JNIEnv *env, jclass clss, jlong loc_id)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Gflush((hid_t)loc_id) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Gflush */
|
||||
|
||||
/*
|
||||
@ -283,8 +338,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Grefresh
|
||||
(JNIEnv *env, jclass clss, jlong loc_id)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Grefresh((hid_t)loc_id) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Grefresh */
|
||||
|
||||
|
||||
|
@ -27,7 +27,10 @@ extern "C" {
|
||||
#include "h5jni.h"
|
||||
#include "h5iImp.h"
|
||||
|
||||
extern JavaVM *jvm;
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
/* extern JavaVM *jvm; */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
@ -40,10 +43,12 @@ Java_hdf_hdf5lib_H5_H5Iget_1type
|
||||
{
|
||||
H5I_type_t retVal = H5I_BADID;
|
||||
|
||||
retVal = H5Iget_type((hid_t)obj_id);
|
||||
if (retVal == H5I_BADID)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5I_BADID == (retVal = H5Iget_type((hid_t)obj_id)))
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iget_1type */
|
||||
|
||||
@ -56,32 +61,32 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iget_1name_1long
|
||||
(JNIEnv *env, jclass clss, jlong obj_id, jobjectArray name, jlong buf_size)
|
||||
{
|
||||
char *aName;
|
||||
jstring str;
|
||||
hssize_t size = -1;
|
||||
long bs;
|
||||
ssize_t size = -1;
|
||||
jstring str;
|
||||
char *aName = NULL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (buf_size < 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Iget_name_long: buf_size < 0");
|
||||
|
||||
if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Iget_name_long: malloc failed");
|
||||
|
||||
if ((size = H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size + 1)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
aName[buf_size] = '\0';
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, aName)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
ENVPTR->SetObjectArrayElement(ENVONLY, name, 0, str);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
if (aName)
|
||||
HDfree(aName);
|
||||
|
||||
bs = (long)buf_size;
|
||||
if (bs <= 0) {
|
||||
h5badArgument(env, "H5Iget_name: buf_size <= 0");
|
||||
} /* end if */
|
||||
else {
|
||||
aName = (char*)HDmalloc(sizeof(char) * (size_t)bs);
|
||||
if (aName == NULL) {
|
||||
h5outOfMemory(env, "H5Iget_name: malloc failed");
|
||||
} /* end if */
|
||||
else {
|
||||
size = H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size);
|
||||
if (size < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
str = ENVPTR->NewStringUTF(ENVPAR aName);
|
||||
ENVPTR->SetObjectArrayElement(ENVPAR name, 0, str);
|
||||
}
|
||||
HDfree(aName);
|
||||
}
|
||||
}
|
||||
return (jlong)size;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iget_1name */
|
||||
|
||||
@ -95,33 +100,30 @@ JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iget_1name
|
||||
(JNIEnv *env, jclass clss, jlong obj_id)
|
||||
{
|
||||
char *aName;
|
||||
jstring str = NULL;
|
||||
ssize_t buf_size;
|
||||
ssize_t buf_size = -1;
|
||||
char *aName = NULL;
|
||||
|
||||
/* get the length of the name */
|
||||
buf_size = H5Iget_name((hid_t)obj_id, NULL, 0);
|
||||
UNUSED(clss);
|
||||
|
||||
/* Get the length of the name */
|
||||
if ((buf_size = H5Iget_name((hid_t)obj_id, NULL, 0)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (NULL == (aName = (char *) HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Iget_name: malloc failed");
|
||||
|
||||
if (H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size + 1) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
aName[buf_size] = '\0';
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, aName)))
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
if (aName)
|
||||
HDfree(aName);
|
||||
|
||||
if (buf_size <= 0) {
|
||||
h5badArgument(env, "H5Iget_name: buf_size <= 0");
|
||||
} /* end if */
|
||||
else {
|
||||
buf_size++; /* add extra space for the null terminator */
|
||||
aName = (char*)HDmalloc(sizeof(char) * (size_t)buf_size);
|
||||
if (aName == NULL) {
|
||||
h5outOfMemory(env, "H5Iget_name: malloc failed");
|
||||
} /* end if */
|
||||
else {
|
||||
buf_size = H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size);
|
||||
if (buf_size < 0) {
|
||||
h5libraryError(env);
|
||||
} /* end if */
|
||||
else {
|
||||
str = ENVPTR->NewStringUTF(ENVPAR aName);
|
||||
}
|
||||
HDfree(aName);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iget_1name */
|
||||
|
||||
@ -134,12 +136,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iget_1ref
|
||||
(JNIEnv *env, jclass clss, jlong obj_id)
|
||||
{
|
||||
int retVal = -1;
|
||||
int retVal = FAIL;
|
||||
|
||||
retVal = H5Iget_ref((hid_t)obj_id);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Iget_ref((hid_t)obj_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iget_1ref */
|
||||
|
||||
@ -152,12 +156,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iinc_1ref
|
||||
(JNIEnv *env, jclass clss, jlong obj_id)
|
||||
{
|
||||
int retVal = -1;
|
||||
int retVal = FAIL;
|
||||
|
||||
retVal = H5Iinc_ref((hid_t)obj_id);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Iinc_ref((hid_t)obj_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iinc_1ref */
|
||||
|
||||
@ -170,12 +176,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Idec_1ref
|
||||
(JNIEnv *env, jclass clss, jlong obj_id)
|
||||
{
|
||||
int retVal = -1;
|
||||
int retVal = FAIL;
|
||||
|
||||
retVal = H5Idec_ref((hid_t)obj_id);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Idec_ref((hid_t)obj_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Idec_1ref */
|
||||
|
||||
@ -189,12 +197,14 @@ JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iget_1file_1id
|
||||
(JNIEnv *env, jclass clss, jlong obj_id)
|
||||
{
|
||||
hid_t file_id = -1;
|
||||
hid_t file_id = H5I_INVALID_HID;
|
||||
|
||||
file_id = H5Iget_file_id((hid_t)obj_id);
|
||||
if (file_id < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((file_id = H5Iget_file_id((hid_t)obj_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong) file_id;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iget_1file_1id */
|
||||
|
||||
@ -207,12 +217,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iget_1type_1ref
|
||||
(JNIEnv *env, jclass clss, jint type)
|
||||
{
|
||||
int retVal = -1;
|
||||
int retVal = FAIL;
|
||||
|
||||
retVal = H5Iget_type_ref((H5I_type_t)type);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Iget_type_ref((H5I_type_t)type)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iget_1type_1ref */
|
||||
|
||||
@ -225,12 +237,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Idec_1type_1ref
|
||||
(JNIEnv *env, jclass clss, jint type)
|
||||
{
|
||||
int retVal = -1;
|
||||
int retVal = FAIL;
|
||||
|
||||
retVal = H5Idec_type_ref((H5I_type_t)type);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Idec_type_ref((H5I_type_t)type)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Idec_1type_1ref */
|
||||
|
||||
@ -243,12 +257,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iinc_1type_1ref
|
||||
(JNIEnv *env, jclass clss, jint type)
|
||||
{
|
||||
int retVal = -1;
|
||||
int retVal = FAIL;
|
||||
|
||||
retVal = H5Iinc_type_ref((H5I_type_t)type);
|
||||
if (retVal < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Iinc_type_ref((H5I_type_t)type)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iinc_1type_1ref */
|
||||
|
||||
@ -261,11 +277,14 @@ JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Inmembers
|
||||
(JNIEnv *env, jclass clss, jint type)
|
||||
{
|
||||
hsize_t num_members;
|
||||
hsize_t num_members = 0;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Inmembers((H5I_type_t)type, &num_members) < 0)
|
||||
h5libraryError(env);
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)num_members;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Inmembers */
|
||||
|
||||
@ -280,12 +299,14 @@ Java_hdf_hdf5lib_H5_H5Iis_1valid
|
||||
{
|
||||
htri_t bval = JNI_FALSE;
|
||||
|
||||
bval = H5Iis_valid((hid_t)obj_id);
|
||||
if (bval > 0)
|
||||
bval = JNI_TRUE;
|
||||
else if (bval < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((bval = H5Iis_valid((hid_t)obj_id)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
|
||||
|
||||
done:
|
||||
return (jboolean)bval;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iis_1valid */
|
||||
/*
|
||||
@ -299,12 +320,14 @@ Java_hdf_hdf5lib_H5_H5Itype_1exists
|
||||
{
|
||||
htri_t bval = JNI_FALSE;
|
||||
|
||||
bval = H5Itype_exists((H5I_type_t)type);
|
||||
if (bval > 0)
|
||||
bval = JNI_TRUE;
|
||||
else if (bval < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if ((bval = H5Itype_exists((H5I_type_t)type)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;
|
||||
|
||||
done:
|
||||
return (jboolean)bval;
|
||||
} /* end else Java_hdf_hdf5lib_H5_H5Itype_1exists */
|
||||
|
||||
@ -317,8 +340,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Iclear_1type
|
||||
(JNIEnv *env, jclass clss, jint type, jboolean force)
|
||||
{
|
||||
if (H5Iclear_type((H5I_type_t)type, (hbool_t)force) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Iclear_type((H5I_type_t)type, (hbool_t)force) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Iclear_1type */
|
||||
|
||||
/*
|
||||
@ -330,8 +358,13 @@ JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Idestroy_1type
|
||||
(JNIEnv *env, jclass clss, jint type)
|
||||
{
|
||||
if (H5Idestroy_type((H5I_type_t)type) < 0)
|
||||
h5libraryError(env);
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Idestroy_type((H5I_type_t)type) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Idestroy_1type */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -27,147 +27,299 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ENVPTR (env)
|
||||
#define ENVPAR
|
||||
#define ENVONLY
|
||||
#define CBENVPTR (cbenv)
|
||||
#define CBENVPAR
|
||||
#define CBENVONLY
|
||||
#define JVMPTR (jvm)
|
||||
#define JVMPAR
|
||||
#define JVMPAR2
|
||||
#else /* __cplusplus */
|
||||
#define ENVPTR (*env)
|
||||
#define ENVPAR env,
|
||||
#define ENVONLY env
|
||||
#define CBENVPTR (*cbenv)
|
||||
#define CBENVPAR cbenv,
|
||||
#define CBENVONLY cbenv
|
||||
#define JVMPTR (*jvm)
|
||||
#define JVMPAR jvm
|
||||
#define JVMPAR2 jvm,
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Used to silence compiler when a particular
|
||||
* function parameter is not used.
|
||||
*/
|
||||
#define UNUSED(o) (void) o
|
||||
|
||||
/* Macros for class access */
|
||||
/* Calling code must define ret_obj as jobject */
|
||||
#define CALL_CONSTRUCTOR(classname,classsig,args) { \
|
||||
jclass cls; \
|
||||
jmethodID constructor; \
|
||||
cls = ENVPTR->FindClass(ENVPAR (classname)); \
|
||||
if (cls == 0) { \
|
||||
h5JNIFatalError(env, "JNI error: GetObjectClass\n"); \
|
||||
ret_obj = NULL; \
|
||||
} \
|
||||
constructor = ENVPTR->GetMethodID(ENVPAR cls, "<init>", (classsig)); \
|
||||
if (constructor == 0) { \
|
||||
h5JNIFatalError(env, "JNI error: GetMethodID failed\n"); \
|
||||
ret_obj = NULL; \
|
||||
} \
|
||||
ret_obj = ENVPTR->NewObjectA(ENVPAR cls, constructor, (args)); \
|
||||
#define CALL_CONSTRUCTOR(env, classname, classsig, args, ret_obj) \
|
||||
{ \
|
||||
jmethodID constructor; \
|
||||
jclass cls; \
|
||||
\
|
||||
if (NULL == (cls = ENVPTR->FindClass(env, (classname)))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, "JNI error: GetObjectClass"); \
|
||||
} \
|
||||
if (NULL == (constructor = ENVPTR->GetMethodID(ENVONLY, cls, "<init>", (classsig)))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, "JNI error: GetMethodID failed"); \
|
||||
} \
|
||||
if (NULL == (ret_obj = ENVPTR->NewObjectA(ENVONLY, cls, constructor, (args)))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_FALSE); \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* Macros for pinning/unpinning objects.
|
||||
*/
|
||||
#define PIN_BYTE_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = ENVPTR->GetByteArrayElements(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PIN_BYTE_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = (jbyte *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_BYTE_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleaseByteArrayElements(env, pinnedArray, (jbyte *) bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
#define PIN_SHORT_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = ENVPTR->GetShortArrayElements(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PIN_SHORT_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = (jshort *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_SHORT_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleaseShortArrayElements(env, pinnedArray, (jshort *) bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
#define PIN_INT_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = ENVPTR->GetIntArrayElements(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PIN_INT_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = (jint *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_INT_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleaseIntArrayElements(env, pinnedArray, (jint *) bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
#define PIN_LONG_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = ENVPTR->GetLongArrayElements(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PIN_LONG_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = (jlong *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_LONG_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleaseLongArrayElements(env, pinnedArray, (jlong *) bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
#define PIN_FLOAT_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = ENVPTR->GetFloatArrayElements(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PIN_FLOAT_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = (jfloat *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_FLOAT_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleaseFloatArrayElements(env, pinnedArray, (jfloat *) bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
#define PIN_DOUBLE_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = ENVPTR->GetDoubleArrayElements(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PIN_DOUBLE_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = (jdouble *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_DOUBLE_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleaseDoubleArrayElements(env, pinnedArray, (jdouble *) bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
#define PIN_BOOL_ARRAY(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = ENVPTR->GetBooleanArrayElements(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PIN_BOOL_ARRAY_CRITICAL(env, arrayToPin, outBuf, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outBuf = (jboolean *) ENVPTR->GetPrimitiveArrayCritical(env, arrayToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_BOOL_ARRAY(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleaseBooleanArrayElements(env, pinnedArray, (jboolean *) bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
#define UNPIN_ARRAY_CRITICAL(env, pinnedArray, bufToRelease, freeMode) \
|
||||
{ \
|
||||
ENVPTR->ReleasePrimitiveArrayCritical(env, pinnedArray, bufToRelease, freeMode); \
|
||||
}
|
||||
|
||||
/* Macros for string access */
|
||||
#define PIN_JAVA_STRING(javastr,localstr) { \
|
||||
jboolean isCopy; \
|
||||
(localstr) = NULL; \
|
||||
if ((javastr) == NULL) { \
|
||||
h5nullArgument(env, "java string is NULL"); \
|
||||
} \
|
||||
else { \
|
||||
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
|
||||
if ((localstr) == NULL) { \
|
||||
h5JNIFatalError(env, "local c string is not pinned"); \
|
||||
} \
|
||||
} \
|
||||
#define PIN_JAVA_STRING(env, stringToPin, outString, isCopy, failErrMsg) \
|
||||
{ \
|
||||
if (NULL == (outString = ENVPTR->GetStringUTFChars(env, stringToPin, isCopy))) { \
|
||||
CHECK_JNI_EXCEPTION(env, JNI_TRUE); \
|
||||
H5_JNI_FATAL_ERROR(env, failErrMsg); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_JAVA_STRING(javastr,localstr) { \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
|
||||
#define UNPIN_JAVA_STRING(env, pinnedString, stringToRelease) \
|
||||
{ \
|
||||
ENVPTR->ReleaseStringUTFChars(env, pinnedString, stringToRelease); \
|
||||
}
|
||||
|
||||
#define PIN_JAVA_STRING_TWO(javastr,localstr,java2str,local2str) { \
|
||||
jboolean isCopy; \
|
||||
(localstr) = NULL; \
|
||||
(local2str) = NULL; \
|
||||
if ((javastr) == NULL) { \
|
||||
h5nullArgument(env, "java string is NULL"); \
|
||||
} \
|
||||
else if ((java2str) == NULL) { \
|
||||
h5nullArgument(env, "second java string is NULL"); \
|
||||
} \
|
||||
else { \
|
||||
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
|
||||
if ((localstr) == NULL) { \
|
||||
h5JNIFatalError(env, "local c string is not pinned"); \
|
||||
} \
|
||||
else { \
|
||||
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
|
||||
if ((local2str) == NULL) { \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
|
||||
h5JNIFatalError(env, "second local c string is not pinned"); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_JAVA_STRING_TWO(javastr,localstr,java2str,local2str) { \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (java2str), (local2str)); \
|
||||
}
|
||||
|
||||
#define PIN_JAVA_STRING_THREE(javastr,localstr,java2str,local2str,java3str,local3str) { \
|
||||
jboolean isCopy; \
|
||||
(localstr) = NULL; \
|
||||
(local2str) = NULL; \
|
||||
(local3str) = NULL; \
|
||||
if ((javastr) == NULL) { \
|
||||
h5nullArgument(env, "java string is NULL"); \
|
||||
} \
|
||||
else if ((java2str) == NULL) { \
|
||||
h5nullArgument(env, "second java string is NULL"); \
|
||||
} \
|
||||
else if ((java3str) == NULL) { \
|
||||
h5nullArgument(env, "third java string is NULL"); \
|
||||
} \
|
||||
else { \
|
||||
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
|
||||
if ((localstr) == NULL) { \
|
||||
h5JNIFatalError(env, "local c string is not pinned"); \
|
||||
} \
|
||||
else { \
|
||||
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
|
||||
if ((local2str) == NULL) { \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
|
||||
h5JNIFatalError(env, "second local c string is not pinned"); \
|
||||
} \
|
||||
else { \
|
||||
(local3str) = ENVPTR->GetStringUTFChars(ENVPAR (java3str), &isCopy); \
|
||||
if ((local3str) == NULL) { \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (java2str), (local2str)); \
|
||||
h5JNIFatalError(env, "third local c string is not pinned"); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define UNPIN_JAVA_STRING_THREE(javastr,localstr,java2str,local2str,java3str,local3str) { \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (java2str), (local2str)); \
|
||||
ENVPTR->ReleaseStringUTFChars(ENVPAR (java3str), (local3str)); \
|
||||
/*
|
||||
* Macro to check for a JNI exception after a JNI method is called.
|
||||
* If an exception occurred, the value of 'clearException' will determine
|
||||
* whether or not the exception will be cleared in order for the native
|
||||
* method to do its own error handling.
|
||||
*
|
||||
* If the exception does not get cleared, this macro will skip to the
|
||||
* cleanup+return section of the native method, since at that point
|
||||
* cleaning up and returning is the only safe thing that can be done.
|
||||
*/
|
||||
#define CHECK_JNI_EXCEPTION(env, clearException) \
|
||||
{ \
|
||||
if (JNI_TRUE == (*env)->ExceptionCheck(env)) { \
|
||||
if (JNI_TRUE == clearException) \
|
||||
(*env)->ExceptionClear(env); \
|
||||
else \
|
||||
goto done; \
|
||||
} \
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern jboolean h5JNIFatalError(JNIEnv *, const char *);
|
||||
extern jboolean h5nullArgument(JNIEnv *, const char *);
|
||||
extern jboolean h5badArgument (JNIEnv *, const char *);
|
||||
extern jboolean h5outOfMemory (JNIEnv *, const char *);
|
||||
extern jboolean h5libraryError(JNIEnv *env );
|
||||
extern jboolean h5raiseException(JNIEnv *, const char *, const char *);
|
||||
extern jboolean h5JNIFatalError(JNIEnv *env, const char *);
|
||||
extern jboolean h5nullArgument(JNIEnv *env, const char *);
|
||||
extern jboolean h5badArgument(JNIEnv *env, const char *);
|
||||
extern jboolean h5outOfMemory(JNIEnv *env, const char *);
|
||||
extern jboolean h5libraryError(JNIEnv *env);
|
||||
extern jboolean h5raiseException(JNIEnv *env, const char *, const char *);
|
||||
extern jboolean h5unimplemented( JNIEnv *env, const char *functName);
|
||||
|
||||
/*
|
||||
* The following macros are to facilitate immediate cleanup+return
|
||||
* from a native JNI method when an exception is to be thrown.
|
||||
* Since, in general, the "cleanup" methods are the only safe JNI
|
||||
* methods to call once an exception has occurred, we want to immediately
|
||||
* cleanup and return instead of letting the native method continue.
|
||||
*
|
||||
* Note that a native method can clear the exception when one occurs and
|
||||
* then do its own error handling, but we instead opt to immediately return.
|
||||
*/
|
||||
#define H5_JNI_FATAL_ERROR(env, message) \
|
||||
{ \
|
||||
h5JNIFatalError(env, message); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define H5_NULL_ARGUMENT_ERROR(env, message) \
|
||||
{ \
|
||||
h5nullArgument(env, message); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define H5_BAD_ARGUMENT_ERROR(env, message) \
|
||||
{ \
|
||||
h5badArgument(env, message); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define H5_OUT_OF_MEMORY_ERROR(env, message) \
|
||||
{ \
|
||||
h5outOfMemory(env, message); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define H5_LIBRARY_ERROR(env) \
|
||||
{ \
|
||||
h5libraryError(env); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define H5_RAISE_EXCEPTION(env, message, exception) \
|
||||
{ \
|
||||
h5raiseException(env, message, exception); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
#define H5_UNIMPLEMENTED(env, message) \
|
||||
{ \
|
||||
h5unimplemented(env, message); \
|
||||
goto done; \
|
||||
}
|
||||
|
||||
/* implemented at H5.c */
|
||||
extern jint get_enum_value(JNIEnv *env, jobject enum_obj);
|
||||
extern jobject get_enum_object(JNIEnv *env, const char* enum_class_name,
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
36
java/src/jni/h5pACPLImp.c
Normal file
36
java/src/jni/h5pACPLImp.c
Normal file
@ -0,0 +1,36 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* For details of the HDF libraries, see the HDF Documentation at:
|
||||
* http://hdfgroup.org/HDF5/doc/
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "hdf5.h"
|
||||
#include "h5jni.h"
|
||||
#include "h5pACPLImp.h"
|
||||
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
/* extern JavaVM *jvm; */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
27
java/src/jni/h5pACPLImp.h
Normal file
27
java/src/jni/h5pACPLImp.h
Normal file
@ -0,0 +1,27 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _Included_hdf_hdf5lib_H5_H5PACPL
|
||||
#define _Included_hdf_hdf5lib_H5_H5PACPL
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Included_hdf_hdf5lib_H5_H5PACPL */
|
325
java/src/jni/h5pDAPLImp.c
Normal file
325
java/src/jni/h5pDAPLImp.c
Normal file
@ -0,0 +1,325 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* For details of the HDF libraries, see the HDF Documentation at:
|
||||
* http://hdfgroup.org/HDF5/doc/
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "hdf5.h"
|
||||
#include "h5jni.h"
|
||||
#include "h5pDAPLImp.h"
|
||||
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
extern JavaVM *jvm;
|
||||
|
||||
typedef struct _cb_wrapper {
|
||||
jobject visit_callback;
|
||||
jobject op_data;
|
||||
} cb_wrapper;
|
||||
|
||||
static herr_t H5D_append_cb(hid_t dataset_id, hsize_t *cur_dims, void *cb_data);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_chunk_cache
|
||||
* Signature: (JJJD)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1chunk_1cache
|
||||
(JNIEnv *env, jclass clss, jlong dapl, jlong rdcc_nslots,
|
||||
jlong rdcc_nbytes, jdouble rdcc_w0)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pset_chunk_cache((hid_t)dapl, (size_t)rdcc_nslots, (size_t)rdcc_nbytes, (double) rdcc_w0) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1chunk_1cache */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_chunk_cache
|
||||
* Signature: (J[J[J[D)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1chunk_1cache
|
||||
(JNIEnv *env, jclass clss, jlong dapl, jlongArray rdcc_nslots,
|
||||
jlongArray rdcc_nbytes, jdoubleArray rdcc_w0)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jdouble *w0Array = NULL;
|
||||
jlong *rdcc_nslotsArray = NULL;
|
||||
jlong *nbytesArray = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL != rdcc_w0)
|
||||
PIN_DOUBLE_ARRAY(ENVONLY, rdcc_w0, w0Array, &isCopy, "H5Pget_chunk_cache: rdcc_w0 array not pinned");
|
||||
if (NULL != rdcc_nslots)
|
||||
PIN_LONG_ARRAY(ENVONLY, rdcc_nslots, rdcc_nslotsArray, &isCopy, "H5Pget_chunk_cache: rdcc_nslots array not pinned");
|
||||
if (NULL != rdcc_nbytes)
|
||||
PIN_LONG_ARRAY(ENVONLY, rdcc_nbytes, nbytesArray, &isCopy, "H5Pget_chunk_cache: nbytesArray array not pinned");
|
||||
|
||||
{
|
||||
/* direct cast (size_t *)variable fails on 32-bit environment */
|
||||
long long rdcc_nslots_temp = *rdcc_nslotsArray;
|
||||
long long nbytes_temp = *nbytesArray;
|
||||
size_t rdcc_nslots_t = (size_t) rdcc_nslots_temp;
|
||||
size_t nbytes_t = (size_t) nbytes_temp;
|
||||
|
||||
if ((status = H5Pget_chunk_cache((hid_t)dapl, &rdcc_nslots_t, &nbytes_t, (double *)w0Array)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
*rdcc_nslotsArray = (jlong)rdcc_nslots_t;
|
||||
*nbytesArray = (jlong)nbytes_t;
|
||||
} /* end direct cast special handling */
|
||||
|
||||
done:
|
||||
if (nbytesArray)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, rdcc_nbytes, nbytesArray, (status < 0) ? JNI_ABORT : 0);
|
||||
if (rdcc_nslotsArray)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, rdcc_nslots, rdcc_nslotsArray, (status < 0) ? JNI_ABORT : 0);
|
||||
if (w0Array)
|
||||
UNPIN_DOUBLE_ARRAY(ENVONLY, rdcc_w0, w0Array, (status < 0) ? JNI_ABORT : 0);
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1chunk_1cache */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_efile_prefix
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id, jstring prefix)
|
||||
{
|
||||
const char *extFilePrefix = NULL;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == prefix)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pset_efile_prefix: external file prefix is NULL");
|
||||
|
||||
PIN_JAVA_STRING(ENVONLY, prefix, extFilePrefix, NULL, "H5Pset_efile_prefix: external file prefix not pinned");
|
||||
|
||||
if ((retVal = H5Pset_efile_prefix((hid_t)dapl_id, extFilePrefix)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (extFilePrefix)
|
||||
UNPIN_JAVA_STRING(ENVONLY, prefix, extFilePrefix);
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_efile_prefix
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id)
|
||||
{
|
||||
ssize_t prefix_size = -1;
|
||||
char *pre = NULL;
|
||||
jstring str = NULL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((prefix_size = H5Pget_efile_prefix((hid_t)dapl_id, (char *)NULL, 0)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (NULL == (pre = (char *) HDmalloc(sizeof(char) * (size_t)prefix_size + 1)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_efile_prefix: memory allocation failed");
|
||||
|
||||
if (H5Pget_efile_prefix((hid_t)dapl_id, (char *)pre, (size_t)prefix_size + 1) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
pre[(size_t)prefix_size] = '\0';
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, pre))) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_efile_prefix: out of memory - unable to construct string from UTF characters");
|
||||
}
|
||||
|
||||
done:
|
||||
if (pre)
|
||||
HDfree(pre);
|
||||
|
||||
return (jstring)str;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_append_flush
|
||||
* Signature: (JI[JLjava/lang/Object;Ljava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1append_1flush
|
||||
(JNIEnv *env, jclass clss, jlong plist_id, jint ndims, jlongArray boundary, jobject callback_op, jobject op_data)
|
||||
{
|
||||
cb_wrapper wrapper = { callback_op, op_data };
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
ENVPTR->GetJavaVM(ENVONLY, &jvm);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == op_data)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pset_append_flush: op_data is NULL");
|
||||
if (NULL == callback_op)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pset_append_flush: callback_op is NULL");
|
||||
|
||||
if ((status = H5Pset_append_flush((hid_t)plist_id, (unsigned)ndims, (const hsize_t *)boundary, (H5D_append_cb_t)H5D_append_cb, (void *)&wrapper)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1append_1flush */
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_append_flush
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual_view
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual_1view
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id, jint view)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pset_virtual_view((hid_t)dapl_id, (H5D_vds_view_t)view) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1view */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_view
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1view
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id)
|
||||
{
|
||||
H5D_vds_view_t virtual_view = H5D_VDS_ERROR;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pget_virtual_view((hid_t)dapl_id, &virtual_view) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)virtual_view;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1view */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual_printf_gap
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual_1printf_1gap
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id, jlong gap_size)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pset_virtual_printf_gap((hid_t)dapl_id, (hsize_t)gap_size) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1virtual_1printf_1gap */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_printf_gap
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap
|
||||
(JNIEnv *env, jclass clss, jlong dapl_id)
|
||||
{
|
||||
hsize_t gap_size = 0;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pget_virtual_printf_gap((hid_t)dapl_id, &gap_size) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)gap_size;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap */
|
||||
|
||||
static herr_t
|
||||
H5D_append_cb
|
||||
(hid_t dataset_id, hsize_t *cur_dims, void *cb_data)
|
||||
{
|
||||
cb_wrapper *wrapper = (cb_wrapper *)cb_data;
|
||||
jlongArray cur_dimsArray;
|
||||
jmethodID mid;
|
||||
jobject visit_callback = wrapper->visit_callback;
|
||||
jclass cls;
|
||||
JNIEnv *cbenv = NULL;
|
||||
void *op_data = (void *)wrapper->op_data;
|
||||
jint status = -1;
|
||||
|
||||
if (JVMPTR->AttachCurrentThread(JVMPAR, (void **)&cbenv, NULL) < 0) {
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_TRUE);
|
||||
H5_JNI_FATAL_ERROR(CBENVONLY, "H5D_append_cb: failed to attach current thread to JVM");
|
||||
}
|
||||
|
||||
if (NULL == (cls = CBENVPTR->GetObjectClass(CBENVONLY, visit_callback)))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL == (mid = CBENVPTR->GetMethodID(CBENVONLY, cls, "callback", "(J[JLhdf/hdf5lib/callbacks/H5D_append_t;)I")))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
if (NULL != cur_dims) {
|
||||
if (NULL == (cur_dimsArray = CBENVPTR->NewLongArray(CBENVONLY, 2)))
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
CBENVPTR->SetLongArrayRegion(CBENVONLY, cur_dimsArray, 0, 2, (const jlong *)cur_dims);
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
|
||||
status = CBENVPTR->CallIntMethod(CBENVONLY, visit_callback, mid, dataset_id, cur_dims, op_data);
|
||||
CHECK_JNI_EXCEPTION(CBENVONLY, JNI_FALSE);
|
||||
}
|
||||
|
||||
done:
|
||||
if (CBENVONLY)
|
||||
JVMPTR->DetachCurrentThread(JVMPAR);
|
||||
|
||||
return (herr_t)status;
|
||||
} /* end H5D_append_cb */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
112
java/src/jni/h5pDAPLImp.h
Normal file
112
java/src/jni/h5pDAPLImp.h
Normal file
@ -0,0 +1,112 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _Included_hdf_hdf5lib_H5_H5PDAPL
|
||||
#define _Included_hdf_hdf5lib_H5_H5PDAPL
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_chunk_cache
|
||||
* Signature: (JJJD)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1chunk_1cache
|
||||
(JNIEnv *, jclass, jlong, jlong, jlong, jdouble);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_chunk_cache
|
||||
* Signature: (J[J[J[D)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1chunk_1cache
|
||||
(JNIEnv *, jclass, jlong, jlongArray, jlongArray, jdoubleArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_efile_prefix
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1efile_1prefix
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_efile_prefix
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_append_flush
|
||||
* Signature: (JI[JLjava/lang/Object;Ljava/lang/Object;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1append_1flush
|
||||
(JNIEnv*, jclass, jlong, jint, jlongArray, jobject, jobject);
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_append_flush
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual_view
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual_1view
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_view
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1view
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual_printf_gap
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual_1printf_1gap
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_printf_gap
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1printf_1gap
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Included_hdf_hdf5lib_H5_H5PDAPL */
|
1415
java/src/jni/h5pDCPLImp.c
Normal file
1415
java/src/jni/h5pDCPLImp.c
Normal file
File diff suppressed because it is too large
Load Diff
396
java/src/jni/h5pDCPLImp.h
Normal file
396
java/src/jni/h5pDCPLImp.h
Normal file
@ -0,0 +1,396 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _Included_hdf_hdf5lib_H5_H5PDCPL
|
||||
#define _Included_hdf_hdf5lib_H5_H5PDCPL
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_layout
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1layout
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_layout
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1layout
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_chunk
|
||||
* Signature: (JI[B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1chunk
|
||||
(JNIEnv *, jclass, jlong, jint, jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_chunk
|
||||
* Signature: (JI[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1chunk
|
||||
(JNIEnv *, jclass, jlong, jint, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_chunk_opts
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1chunk_1opts
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_chunk_opts
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1chunk_1opts
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_dset_no_attrs_hint
|
||||
* Signature: (JZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1dset_1no_1attrs_1hint
|
||||
(JNIEnv *, jclass, jlong, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_dset_no_attrs_hint
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1dset_1no_1attrs_1hint
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_deflate
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1deflate
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fill_value
|
||||
* Signature: (JJ[B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fill_1value
|
||||
(JNIEnv *, jclass, jlong, jlong, jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_fill_value
|
||||
* Signature: (JJ[B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1fill_1value
|
||||
(JNIEnv *, jclass, jlong, jlong, jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pfill_value_defined
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pfill_1value_1defined
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fill_time
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fill_1time
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_fill_time
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1fill_1time
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_alloc_time
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1alloc_1time
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_alloc_time
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1alloc_1time
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_filter
|
||||
* Signature: (JIIJ[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1filter
|
||||
(JNIEnv *, jclass, jlong, jint, jint, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pall_filters_avail
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pall_1filters_1avail
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_nfilters
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1nfilters
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_filter
|
||||
* Signature: (JI[I[J[IJ[Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1filter
|
||||
(JNIEnv *, jclass, jlong, jint, jintArray, jlongArray, jintArray, jlong, jobjectArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_filter2
|
||||
* Signature: (JI[I[J[IJ[Ljava/lang/String;[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1filter2
|
||||
(JNIEnv *, jclass, jlong, jint, jintArray, jlongArray, jintArray, jlong, jobjectArray, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_filter_by_id
|
||||
* Signature: (JI[I[J[IJ[Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id
|
||||
(JNIEnv *, jclass, jlong, jint, jintArray, jlongArray, jintArray, jlong, jobjectArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_filter_by_id2
|
||||
* Signature: (JI[I[J[IJ[Ljava/lang/String;[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id2
|
||||
(JNIEnv *, jclass, jlong, jint, jintArray, jlongArray, jintArray, jlong, jobjectArray, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pmodify_filter
|
||||
* Signature: (JIIJ[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pmodify_1filter
|
||||
(JNIEnv *, jclass, jlong, jint, jint, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Premove_filter
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5P1remove_1filter
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fletcher32
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fletcher32
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_nbit
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1nbit
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_scaleoffset
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1scaleoffset
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_shuffle
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1shuffle
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_szip
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1szip
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_external
|
||||
* Signature: (JLjava/lang/String;JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1external
|
||||
(JNIEnv *, jclass, jlong, jstring, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_external
|
||||
* Signature: (JIJ[Ljava/lang/String;[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1external
|
||||
(JNIEnv *, jclass, jlong, jint, jlong, jobjectArray, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_external_count
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1external_1count
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual
|
||||
* Signature: (JJLjava/lang/String;Ljava/lang/String;J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual
|
||||
(JNIEnv *, jclass, jlong, jlong, jstring, jstring, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_count
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1count
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_dsetname
|
||||
* Signature: (JJ)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_filename
|
||||
* Signature: (JJ)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_srcspace
|
||||
* Signature: (JJ)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1srcspace
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_vspace
|
||||
* Signature: (JJ)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1vspace
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_virtual_prefix
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1virtual_1prefix
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_virtual_prefix
|
||||
* Signature: (J)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Included_hdf_hdf5lib_H5_H5PDCPL */
|
505
java/src/jni/h5pDXPLImp.c
Normal file
505
java/src/jni/h5pDXPLImp.c
Normal file
@ -0,0 +1,505 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* For details of the HDF libraries, see the HDF Documentation at:
|
||||
* http://hdfgroup.org/HDF5/doc/
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "hdf5.h"
|
||||
#include "h5jni.h"
|
||||
#include "h5pDXPLImp.h"
|
||||
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
/* extern JavaVM *jvm; */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_buffer
|
||||
* Signature: (JJ[B[B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1buffer
|
||||
(JNIEnv *env, jclass clss, jlong plist, jlong size, jbyteArray tconv, jbyteArray bkg)
|
||||
{
|
||||
#ifdef notdef
|
||||
jboolean isCopy;
|
||||
jbyte *tconvP = NULL;
|
||||
jbyte *bkgP = NULL;
|
||||
#endif
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
#ifndef notdef
|
||||
UNUSED(plist);
|
||||
UNUSED(size);
|
||||
UNUSED(tconv);
|
||||
UNUSED(bkg);
|
||||
#endif
|
||||
|
||||
H5_UNIMPLEMENTED(ENVONLY, "H5Pset_buffer: not implemented");
|
||||
|
||||
/* NOTE: DON'T IMPLEMENT THIS!!! */
|
||||
#ifdef notdef
|
||||
if (NULL != tconv)
|
||||
PIN_BYTE_ARRAY(ENVONLY, tconv, tconvP, &isCopy, "H5Pset_buffer: tconv not pinned");
|
||||
if (NULL != bkg)
|
||||
PIN_BYTE_ARRAY(ENVONLY, bkg, bkgP, &isCopy, "H5Pset_buffer: bkg not pinned");
|
||||
|
||||
if ((status = H5Pset_buffer((hid_t)plist, (size_t)size, tconvP, bkgP)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
#endif
|
||||
|
||||
done:
|
||||
#ifdef notdef
|
||||
if (bkgP)
|
||||
UNPIN_BYTE_ARRAY(ENVONLY, bkg, bkgP, (status < 0) ? JNI_ABORT : 0);
|
||||
if (tconvP)
|
||||
UNPIN_BYTE_ARRAY(ENVONLY, tconv, tconvP, (status < 0) ? JNI_ABORT : 0);
|
||||
#endif
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1buffer */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_buffer
|
||||
* Signature: (J[B[B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1buffer
|
||||
(JNIEnv *env, jclass clss, jlong plist, jbyteArray tconv, jbyteArray bkg)
|
||||
{
|
||||
#ifdef notdef
|
||||
jboolean isCopy;
|
||||
jbyte *tconvP = NULL;
|
||||
jbyte *bkgP = NULL;
|
||||
#endif
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
#ifndef notdef
|
||||
UNUSED(plist);
|
||||
UNUSED(tconv);
|
||||
UNUSED(bkg);
|
||||
#endif
|
||||
|
||||
H5_UNIMPLEMENTED(ENVONLY, "H5Pget_buffer: not implemented");
|
||||
|
||||
/* NOTE: DON'T IMPLEMENT THIS!!! */
|
||||
#ifdef notdef
|
||||
if (NULL == tconv)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_buffer: tconv input array is NULL");
|
||||
if (NULL == bkg)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_buffer: bkg array is NULL");
|
||||
|
||||
PIN_BYTE_ARRAY(ENVONLY, tconv, tconvP, &isCopy, "H5Pget_buffer: tconv not pinned");
|
||||
PIN_BYTE_ARRAY(ENVONLY, bkg, bkgP, &isCopy, "H5Pget_buffer: bkg not pinned");
|
||||
|
||||
if ((status = H5Pget_buffer((hid_t)plist, tconvP, bkgP)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
#endif
|
||||
|
||||
done:
|
||||
#ifdef notdef
|
||||
if (bkgP)
|
||||
UNPIN_BYTE_ARRAY(ENVONLY, bkg, bkgP, (status < 0) ? JNI_ABORT : 0);
|
||||
if (tconvP)
|
||||
UNPIN_BYTE_ARRAY(ENVONLY, tconv, tconvP, (status < 0) ? JNI_ABORT : 0);
|
||||
#endif
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1buffer */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_buffer_size
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1buffer_1size
|
||||
(JNIEnv *env, jclass clss, jlong plist, jlong size)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pset_buffer((hid_t)plist, (size_t)size, NULL, NULL) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1buffer_1size */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_buffer_size
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1buffer_1size
|
||||
(JNIEnv *env, jclass clss, jlong plist)
|
||||
{
|
||||
size_t size = 0;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (!(size = H5Pget_buffer((hid_t)plist, NULL, NULL)))
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)size;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1buffer_1size */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_preserve
|
||||
* Signature: (JZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1preserve
|
||||
(JNIEnv *env, jclass clss, jlong plist, jboolean status)
|
||||
{
|
||||
hbool_t st = JNI_FALSE;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (JNI_TRUE == status)
|
||||
st = TRUE;
|
||||
else if (JNI_FALSE == status)
|
||||
st = false;
|
||||
else
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pset_preserve: status not TRUE or FALSE");
|
||||
|
||||
if ((retVal = H5Pset_preserve((hid_t)plist, st)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1preserve */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_preserve
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1preserve
|
||||
(JNIEnv *env, jclass clss, jlong plist)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pget_preserve((hid_t)plist)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1preserve */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_edc_check
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1edc_1check
|
||||
(JNIEnv *env, jclass clss, jlong plist, jint check)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pset_edc_check((hid_t)plist, (H5Z_EDC_t)check)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1edc_1check */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_edc_check
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1edc_1check
|
||||
(JNIEnv *env, jclass clss, jlong plist)
|
||||
{
|
||||
H5Z_EDC_t retVal = -1;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pget_edc_check((hid_t)plist)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1edc_1check */
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_filter_callback
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_data_transform
|
||||
* Signature: (JLjava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1data_1transform
|
||||
(JNIEnv *env, jclass clss, jlong plist_id, jstring expression)
|
||||
{
|
||||
const char *express = NULL;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == expression)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pset_data_transform: data transform expression is NULL");
|
||||
|
||||
PIN_JAVA_STRING(ENVONLY, expression, express, NULL, "H5Pset_data_transform: data transform expression not pinned");
|
||||
|
||||
if ((retVal = H5Pset_data_transform((hid_t)plist_id, express)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (express)
|
||||
UNPIN_JAVA_STRING(ENVONLY, expression, express);
|
||||
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1data_1transform */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_data_transform
|
||||
* Signature: (J[Ljava/lang/String;J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1data_1transform
|
||||
(JNIEnv *env, jclass clss, jlong plist_id, jobjectArray expression, jlong size)
|
||||
{
|
||||
jstring str = NULL;
|
||||
char *express = NULL;
|
||||
ssize_t express_size = -1;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (size <= 0)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_data_transform: size <= 0");
|
||||
|
||||
if ((express_size = H5Pget_data_transform((hid_t)plist_id, (char *)NULL, (size_t)size)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
if (NULL == (express = (char *) HDmalloc(sizeof(char) * (size_t)express_size + 1)))
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_data_transform: memory allocation failed");
|
||||
|
||||
if (H5Pget_data_transform((hid_t)plist_id, express, (size_t)express_size + 1) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
express[express_size] = '\0';
|
||||
|
||||
if (NULL == (str = ENVPTR->NewStringUTF(ENVONLY, express))) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_JNI_FATAL_ERROR(ENVONLY, "H5Pget_data_transform: out of memory - unable to construct string from UTF characters");
|
||||
}
|
||||
|
||||
ENVPTR->SetObjectArrayElement(ENVONLY, expression, 0, str);
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
|
||||
|
||||
done:
|
||||
if (express)
|
||||
HDfree(express);
|
||||
|
||||
return (jlong)express_size;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1data_1transform */
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_type_conv_cb
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_type_conv_cb
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_hyper_vector_size
|
||||
* Signature: (JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1hyper_1vector_1size
|
||||
(JNIEnv *env, jclass clss, jlong plist, jlong vector_size)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pset_hyper_vector_size((hid_t)plist, (size_t)vector_size)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1hyper_1vector_1size */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_hyper_vector_size
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1hyper_1vector_1size
|
||||
(JNIEnv *env, jclass clss, jlong plist, jlongArray vector_size)
|
||||
{
|
||||
jboolean isCopy;
|
||||
size_t size;
|
||||
jlong *theArray = NULL;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == vector_size)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_hyper_vector_size: vector_size is NULL");
|
||||
|
||||
PIN_LONG_ARRAY(ENVONLY, vector_size, theArray, &isCopy, "H5Pget_hyper_vector_size: vector_size not pinned");
|
||||
|
||||
if ((retVal = H5Pget_hyper_vector_size((hid_t)plist, &size)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
theArray[0] = (jlong)size;
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, vector_size, theArray, (retVal < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1hyper_1vector_1size */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_btree_ratios
|
||||
* Signature: (JDDD)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1btree_1ratios
|
||||
(JNIEnv *env, jclass clss, jlong plist_id, jdouble left, jdouble middle, jdouble right)
|
||||
{
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((status = H5Pset_btree_ratios((hid_t)plist_id, (double)left,(double)middle, (double)right)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1btree_1ratios */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_btree_ratios
|
||||
* Signature: (J[D[D[D)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1btree_1ratios
|
||||
(JNIEnv *env, jclass clss, jlong plist_id, jdoubleArray left,
|
||||
jdoubleArray middle, jdoubleArray right)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jdouble *leftP = NULL;
|
||||
jdouble *middleP = NULL;
|
||||
jdouble *rightP = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == left)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_btree_ratios: left input array is NULL");
|
||||
if (NULL == middle)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_btree_ratios: middle input array is NULL");
|
||||
if (NULL == right)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_btree_ratios: right input array is NULL");
|
||||
|
||||
PIN_DOUBLE_ARRAY(ENVONLY, left, leftP, &isCopy, "H5Pget_btree_ratios: left array not pinned");
|
||||
PIN_DOUBLE_ARRAY(ENVONLY, middle, middleP, &isCopy, "H5Pget_btree_ratios: middle array not pinned");
|
||||
PIN_DOUBLE_ARRAY(ENVONLY, right, rightP, &isCopy, "H5Pget_btree_ratios: right array not pinned");
|
||||
|
||||
if ((status = H5Pget_btree_ratios((hid_t)plist_id, (double *)leftP,
|
||||
(double *)middleP, (double *)rightP)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (rightP)
|
||||
UNPIN_DOUBLE_ARRAY(ENVONLY, right, rightP, (status < 0) ? JNI_ABORT : 0);
|
||||
if (middleP)
|
||||
UNPIN_DOUBLE_ARRAY(ENVONLY, middle, middleP, (status < 0) ? JNI_ABORT : 0);
|
||||
if (leftP)
|
||||
UNPIN_DOUBLE_ARRAY(ENVONLY, left, leftP, (status < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1btree_1ratios */
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_vlen_mem_manager
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_vlen_mem_manager
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_dxpl_mpio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_chunk_opt
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_chunk_opt_num
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_chunk_opt_ratio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_collective_opt
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_mpio_actual_chunk_opt_mode
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_mpio_actual_io_mode
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_mpio_no_collective_cause
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
209
java/src/jni/h5pDXPLImp.h
Normal file
209
java/src/jni/h5pDXPLImp.h
Normal file
@ -0,0 +1,209 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _Included_hdf_hdf5lib_H5_H5PDXPL
|
||||
#define _Included_hdf_hdf5lib_H5_H5PDXPL
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_buffer
|
||||
* Signature: (JJ[B[B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1buffer
|
||||
(JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_buffer
|
||||
* Signature: (J[B[B)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1buffer
|
||||
(JNIEnv *, jclass, jlong, jbyteArray, jbyteArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_buffer_size
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1buffer_1size
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_buffer_size
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1buffer_1size
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_preserve
|
||||
* Signature: (JZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1preserve
|
||||
(JNIEnv *, jclass, jlong, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_preserve
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1preserve
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_edc_check
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1edc_1check
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_edc_check
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1edc_1check
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_filter_callback
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_data_transform
|
||||
* Signature: (JLjava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1data_1transform
|
||||
(JNIEnv *, jclass, jlong, jstring);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_data_transform
|
||||
* Signature: (J[Ljava/lang/String;J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1data_1transform
|
||||
(JNIEnv *, jclass, jlong, jobjectArray, jlong);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_type_conv_cb
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_type_conv_cb
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_hyper_vector_size
|
||||
* Signature: (JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1hyper_1vector_1size
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_hyper_vector_size
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1hyper_1vector_1size
|
||||
(JNIEnv *, jclass, jlong, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_btree_ratios
|
||||
* Signature: (JDDD)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1btree_1ratios
|
||||
(JNIEnv *, jclass, jlong, jdouble, jdouble, jdouble);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_btree_ratios
|
||||
* Signature: (J[D[D[D)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1btree_1ratios
|
||||
(JNIEnv *, jclass, jlong, jdoubleArray, jdoubleArray, jdoubleArray);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_vlen_mem_manager
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_vlen_mem_manager
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_dxpl_mpio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_chunk_opt
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_chunk_opt_num
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_chunk_opt_ratio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_dxpl_mpio_collective_opt
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_mpio_actual_chunk_opt_mode
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_mpio_actual_io_mode
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_mpio_no_collective_cause
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Included_hdf_hdf5lib_H5_H5PDXPL */
|
1647
java/src/jni/h5pFAPLImp.c
Normal file
1647
java/src/jni/h5pFAPLImp.c
Normal file
File diff suppressed because it is too large
Load Diff
501
java/src/jni/h5pFAPLImp.h
Normal file
501
java/src/jni/h5pFAPLImp.h
Normal file
@ -0,0 +1,501 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _Included_hdf_hdf5lib_H5_H5PFAPL
|
||||
#define _Included_hdf_hdf5lib_H5_H5PFAPL
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_driver
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_driver
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1driver
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_driver_info
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fclose_degree
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fclose_1degree
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_fclose_degree
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1fclose_1degree
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_core
|
||||
* Signature: (JJZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1core
|
||||
(JNIEnv *, jclass, jlong, jlong, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_fapl_core
|
||||
* Signature: (J[J[Z)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1fapl_1core
|
||||
(JNIEnv *, jclass, jlong, jlongArray, jbooleanArray);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_core_write_tracking
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_core_write_tracking
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_direct
|
||||
* Signature: (JJJJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1direct
|
||||
(JNIEnv *, jclass, jlong, jlong, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_fapl_direct
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1fapl_1direct
|
||||
(JNIEnv *, jclass, jlong, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_family
|
||||
* Signature: (JJJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1family
|
||||
(JNIEnv *, jclass, jlong, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_fapl_family
|
||||
* Signature: (J[J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1fapl_1family
|
||||
(JNIEnv *, jclass, jlong, jlongArray, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_family_offset
|
||||
* Signature: (JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1family_1offset
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_family_offset
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1family_1offset
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_log
|
||||
* Signature: (JLjava/lang/String;JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1log
|
||||
(JNIEnv *, jclass, jlong, jstring, jlong, jlong);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_fapl_mpio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_fapl_mpio
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_fapl_mpiposix
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_fapl_mpiposix
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_multi
|
||||
* Signature: (J[I[J[Ljava/lang/String;[JZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi
|
||||
(JNIEnv *, jclass, jlong, jintArray, jlongArray, jobjectArray, jlongArray, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_fapl_multi
|
||||
* Signature: (J[I[J[Ljava/lang/String;[J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1fapl_1multi
|
||||
(JNIEnv *, jclass, jlong, jintArray, jlongArray, jobjectArray, jlongArray);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_multi_type
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_multi_type
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_split
|
||||
* Signature: (JLjava/lang/String;JLjava/lang/String;J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1split
|
||||
(JNIEnv *, jclass, jlong, jstring, jlong, jstring, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_sec2
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1sec2
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_stdio
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1stdio
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_fapl_windows
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1fapl_1windows
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_file_image
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_file_image
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_file_image_callbacks
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_file_image_callbacks
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_meta_block_size
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1meta_1block_1size
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_meta_block_size
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1meta_1block_1size
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_page_buffer_size
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_page_buffer_size
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_sieve_buf_size
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1sieve_1buf_1size
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_sieve_buf_size
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1sieve_1buf_1size
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_alignment
|
||||
* Signature: (JJJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1alignment
|
||||
(JNIEnv *, jclass, jlong, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_alignment
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1alignment
|
||||
(JNIEnv *, jclass, jlong, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_cache
|
||||
* Signature: (JIJJD)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1cache
|
||||
(JNIEnv *, jclass, jlong, jint, jlong, jlong, jdouble);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_cache
|
||||
* Signature: (J[I[J[J[D)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1cache
|
||||
(JNIEnv *, jclass, jlong, jintArray, jlongArray, jlongArray, jdoubleArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_elink_file_cache_size
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1elink_1file_1cache_1size
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_elink_file_cache_size
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1elink_1file_1cache_1size
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_evict_on_close
|
||||
* Signature: (JZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1evict_1on_1close
|
||||
(JNIEnv *, jclass, jlong, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_evict_on_close
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1evict_1on_1close
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_metadata_read_attempts
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1metadata_1read_1attempts
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_metadata_read_attempts
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1metadata_1read_1attempts
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_mdc_config
|
||||
* Signature: (JLhdf/hdf5lib/structs/H5AC_cache_config_t;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1mdc_1config
|
||||
(JNIEnv *, jclass, jlong, jobject);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_mdc_config
|
||||
* Signature: (J)Lhdf/hdf5lib/structs/H5AC_cache_config_t;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1mdc_1config
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_mdc_image_config
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_mdc_image_config
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_mdc_log_options
|
||||
* Signature: (JZLjava/lang/String;Z)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1mdc_1log_1options
|
||||
(JNIEnv *, jclass, jlong, jboolean, jstring, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_mdc_log_options
|
||||
* Signature: (J[Z)Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options
|
||||
(JNIEnv *, jclass, jlong, jbooleanArray);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_all_coll_metadata_ops
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_all_coll_metadata_ops
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_coll_metadata_write
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_coll_metadata_write
|
||||
*/
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_gc_references
|
||||
* Signature: (JZ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1gc_1references
|
||||
(JNIEnv *, jclass, jlong, jboolean);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_gc_references
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1gc_1references
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_small_data_block_size
|
||||
* Signature: (JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1small_1data_1block_1size
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_small_data_block_size
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1small_1data_1block_1size
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_libver_bounds
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1libver_1bounds
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_libver_bounds
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1libver_1bounds
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* TODO: H5Pset_object_flush_cb
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: H5Pget_object_flush_cb
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Included_hdf_hdf5lib_H5_H5PFAPL */
|
572
java/src/jni/h5pFCPLImp.c
Normal file
572
java/src/jni/h5pFCPLImp.c
Normal file
@ -0,0 +1,572 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* For details of the HDF libraries, see the HDF Documentation at:
|
||||
* http://hdfgroup.org/HDF5/doc/
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "hdf5.h"
|
||||
#include "h5jni.h"
|
||||
#include "h5pFCPLImp.h"
|
||||
|
||||
/*
|
||||
* Pointer to the JNI's Virtual Machine; used for callback functions.
|
||||
*/
|
||||
/* extern JavaVM *jvm; */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_userblock
|
||||
* Signature: (JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1userblock
|
||||
(JNIEnv *env, jclass clss, jlong plist, jlong size)
|
||||
{
|
||||
long sz = (long) size;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pset_userblock((hid_t)plist, (hsize_t)sz)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1userblock */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_userblock
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1userblock
|
||||
(JNIEnv *env, jclass clss, jlong plist, jlongArray size)
|
||||
{
|
||||
jboolean isCopy;
|
||||
hsize_t s;
|
||||
jlong *theArray = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == size)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_userblock: size is NULL");
|
||||
|
||||
PIN_LONG_ARRAY(ENVONLY, size, theArray, &isCopy, "H5Pget_userblock: size not pinned");
|
||||
|
||||
if ((status = H5Pget_userblock((hid_t)plist, &s)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
theArray[0] = (jlong)s;
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1userblock */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_sizes
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1sizes
|
||||
(JNIEnv *env, jclass clss, jlong plist, jint sizeof_addr, jint sizeof_size)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pset_sizes((hid_t)plist, (size_t)sizeof_addr, (size_t)sizeof_size)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1sizes */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_sizes
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1sizes
|
||||
(JNIEnv *env, jclass clss, jlong plist, jlongArray size)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jlong *theArray = NULL;
|
||||
jsize arrLen;
|
||||
size_t ss;
|
||||
size_t sa;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == size)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_sizes: size is NULL");
|
||||
|
||||
if ((arrLen = ENVPTR->GetArrayLength(ENVONLY, size)) < 0) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_sizes: size array length < 0");
|
||||
}
|
||||
if (arrLen < 2)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_sizes: size input array < 2 elements");
|
||||
|
||||
PIN_LONG_ARRAY(ENVONLY, size, theArray, &isCopy, "H5Pget_sizes: size not pinned");
|
||||
|
||||
if ((status = H5Pget_sizes((hid_t)plist, &sa, &ss)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
theArray[0] = (jlong)sa;
|
||||
theArray[1] = (jlong)ss;
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1sizes */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_sym_k
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1sym_1k
|
||||
(JNIEnv *env, jclass clss, jlong plist, jint ik, jint lk)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pset_sym_k((hid_t)plist, (unsigned)ik, (unsigned)lk)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1sym_1k */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_sym_k
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1sym_1k
|
||||
(JNIEnv *env, jclass clss, jlong plist, jintArray size)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jsize arrLen;
|
||||
jint *theArray = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == size)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_sym_k: size is NULL");
|
||||
|
||||
if ((arrLen = ENVPTR->GetArrayLength(ENVONLY, size)) < 0) {
|
||||
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_sym_k: size array length < 0");
|
||||
}
|
||||
if (arrLen < 2)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_sym_k: size < 2 elements");
|
||||
|
||||
PIN_INT_ARRAY(ENVONLY, size, theArray, &isCopy, "H5Pget_sym_k: size not pinned");
|
||||
|
||||
if ((status = H5Pget_sym_k((hid_t)plist, (unsigned *)&(theArray[0]), (unsigned *)&(theArray[1]))) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1sym_1k */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_istore_k
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1istore_1k
|
||||
(JNIEnv *env, jclass clss, jlong plist, jint ik)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((retVal = H5Pset_istore_k((hid_t)plist, (unsigned)ik)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1istore_1k */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_istore_k
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1istore_1k
|
||||
(JNIEnv *env, jclass clss, jlong plist, jintArray ik)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jint *theArray = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == ik)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_store_k: ik is NULL");
|
||||
|
||||
PIN_INT_ARRAY(ENVONLY, ik, theArray, &isCopy, "H5Pget_store_k: size not pinned");
|
||||
|
||||
if ((status = H5Pget_istore_k((hid_t)plist, (unsigned *)&(theArray[0]))) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_INT_ARRAY(ENVONLY, ik, theArray, (status < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)status;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1istore_1k */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_file_space_page_size
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1file_1space_1page_1size
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id, jlong fsp_size)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pset_file_space_page_size((hid_t)fcpl_id, (hsize_t)fsp_size) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1file_1space_1page_1size */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_page_size
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1page_1size
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id)
|
||||
{
|
||||
hsize_t fsp_size = 0;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pget_file_space_page_size((hid_t)fcpl_id, &fsp_size) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)fsp_size;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1page_1size */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_file_space_strategy
|
||||
* Signature: (JIZJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1file_1space_1strategy
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id, jint strategy, jboolean persist, jlong threshold)
|
||||
{
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pset_file_space_strategy((hid_t)fcpl_id, (H5F_fspace_strategy_t)strategy, (hbool_t)persist, (hsize_t)threshold) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_file_space_strategy */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_strategy
|
||||
* Signature: (J[Z[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id, jbooleanArray persist, jlongArray threshold)
|
||||
{
|
||||
H5F_fspace_strategy_t thestrategy = H5F_FSPACE_STRATEGY_FSM_AGGR; /* Library default */
|
||||
jboolean isCopy;
|
||||
jboolean *persistArray = NULL;
|
||||
jlong *thresholdArray = NULL;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (persist)
|
||||
PIN_BOOL_ARRAY(ENVONLY, persist, persistArray, &isCopy, "H5Pget_file_space: persist not pinned");
|
||||
if (threshold)
|
||||
PIN_LONG_ARRAY(ENVONLY, threshold, thresholdArray, &isCopy, "H5Pget_file_space: threshold not pinned");
|
||||
|
||||
if ((status = H5Pget_file_space_strategy((hid_t)fcpl_id, &thestrategy, (hbool_t *)persistArray, (hsize_t *)thresholdArray)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (thresholdArray)
|
||||
UNPIN_LONG_ARRAY(ENVONLY, threshold, thresholdArray, (status < 0) ? JNI_ABORT : 0);
|
||||
if (persistArray)
|
||||
UNPIN_BOOL_ARRAY(ENVONLY, persist, persistArray, (status < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)thestrategy;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_strategy_persist
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy_1persist
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id)
|
||||
{
|
||||
hbool_t persist = FALSE;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((status = H5Pget_file_space_strategy((hid_t)fcpl_id, NULL, &persist, NULL)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jboolean)persist;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy_1persist */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_strategy_threshold
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy_1threshold
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id)
|
||||
{
|
||||
hsize_t threshold = 0;
|
||||
herr_t status = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if ((status = H5Pget_file_space_strategy((hid_t)fcpl_id, NULL, NULL, &threshold)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jlong)threshold;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1threshold */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_shared_mesg_nindexes
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1nindexes
|
||||
(JNIEnv *env, jclass clss, jlong plist_id, jint nindexes)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (nindexes > H5O_SHMESG_MAX_NINDEXES)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pset_shared_mesg_nindexes: number of indexes is greater than H5O_SHMESG_MAX_NINDEXES");
|
||||
|
||||
if ((retVal = H5Pset_shared_mesg_nindexes((hid_t)plist_id, (unsigned)nindexes)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1nindexes */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_shared_mesg_nindexes
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1nindexes
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id)
|
||||
{
|
||||
unsigned nindexes;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (H5Pget_shared_mesg_nindexes((hid_t)fcpl_id, &nindexes) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)nindexes;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1nindexes */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_shared_mesg_index
|
||||
* Signature: (JIII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1index
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id, jint index_num,
|
||||
jint mesg_type_flags, jint min_mesg_size)
|
||||
{
|
||||
unsigned nindexes; /* Number of SOHM indexes */
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
/* Check arguments */
|
||||
if ((unsigned) mesg_type_flags > H5O_SHMESG_ALL_FLAG)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pset_shared_mesg_index: unrecognized flags in mesg_type_flags");
|
||||
|
||||
/* Read the current number of indexes */
|
||||
if (H5Pget_shared_mesg_nindexes((hid_t)fcpl_id, &nindexes) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
/* Range check */
|
||||
if ((unsigned) index_num >= nindexes)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pset_shared_mesg_index: index_num is too large; no such index");
|
||||
|
||||
if ((retVal = H5Pset_shared_mesg_index((hid_t)fcpl_id, (unsigned)index_num, (unsigned) mesg_type_flags, (unsigned) min_mesg_size)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1index */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_shared_mesg_index
|
||||
* Signature: (JI[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1index
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id, jint index_num, jintArray mesg_info)
|
||||
{
|
||||
jboolean isCopy;
|
||||
unsigned nindexes; /* Number of SOHM indexes */
|
||||
jint *theArray = NULL;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == mesg_info)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_shared_mesg_index: mesg_info is NULL");
|
||||
|
||||
/* Read the current number of indexes */
|
||||
if (H5Pget_shared_mesg_nindexes((hid_t)fcpl_id, &nindexes) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
/* Range check */
|
||||
if ((unsigned) index_num >= nindexes)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_shared_mesg_index: index_num is too large; no such index");
|
||||
|
||||
PIN_INT_ARRAY(ENVONLY, mesg_info, theArray, &isCopy, "H5Pget_shared_mesg_index: input not pinned");
|
||||
|
||||
if ((retVal = H5Pget_shared_mesg_index((hid_t)fcpl_id, (unsigned)index_num, (unsigned *)&(theArray[0]), (unsigned *)&(theArray[1]))) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_INT_ARRAY(ENVONLY, mesg_info, theArray, (retVal < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1index */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_shared_mesg_phase_change
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1phase_1change
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id, jint max_list, jint min_btree)
|
||||
{
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
/* Check that values are sensible. The min_btree value must be no greater
|
||||
* than the max list plus one.
|
||||
*
|
||||
* Range check to make certain they will fit into encoded form.
|
||||
*/
|
||||
|
||||
if (max_list + 1 < min_btree)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pset_shared_mesg_phase_change: minimum B-tree value is greater than maximum list value");
|
||||
if (max_list > H5O_SHMESG_MAX_LIST_SIZE)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pset_shared_mesg_phase_change: max list value is larger than H5O_SHMESG_MAX_LIST_SIZE");
|
||||
if (min_btree > H5O_SHMESG_MAX_LIST_SIZE)
|
||||
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pset_shared_mesg_phase_change: min btree value is larger than H5O_SHMESG_MAX_LIST_SIZE");
|
||||
|
||||
if ((retVal = H5Pset_shared_mesg_phase_change((hid_t)fcpl_id, (unsigned)max_list, (unsigned)min_btree)) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1phase_1change */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_shared_mesg_phase_change
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1phase_1change
|
||||
(JNIEnv *env, jclass clss, jlong fcpl_id, jintArray size)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jint *theArray = NULL;
|
||||
herr_t retVal = FAIL;
|
||||
|
||||
UNUSED(clss);
|
||||
|
||||
if (NULL == size)
|
||||
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_shared_mesg_phase_change: size is NULL");
|
||||
|
||||
PIN_INT_ARRAY(ENVONLY, size, theArray, &isCopy, "H5Pget_shared_mesg_phase_change: input not pinned");
|
||||
|
||||
if ((retVal = H5Pget_shared_mesg_phase_change((hid_t)fcpl_id, (unsigned *)&(theArray[0]), (unsigned *)&(theArray[1]))) < 0)
|
||||
H5_LIBRARY_ERROR(ENVONLY);
|
||||
|
||||
done:
|
||||
if (theArray)
|
||||
UNPIN_INT_ARRAY(ENVONLY, size, theArray, (retVal < 0) ? JNI_ABORT : 0);
|
||||
|
||||
return (jint)retVal;
|
||||
} /* end Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1phase_1change */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
207
java/src/jni/h5pFCPLImp.h
Normal file
207
java/src/jni/h5pFCPLImp.h
Normal file
@ -0,0 +1,207 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef _Included_hdf_hdf5lib_H5_H5PFCPL
|
||||
#define _Included_hdf_hdf5lib_H5_H5PFCPL
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_userblock
|
||||
* Signature: (JJ)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1userblock
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_userblock
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1userblock
|
||||
(JNIEnv *, jclass, jlong, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_sizes
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1sizes
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_sizes
|
||||
* Signature: (J[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1sizes
|
||||
(JNIEnv *, jclass, jlong, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_sym_k
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1sym_1k
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_sym_k
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1sym_1k
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_istore_k
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1istore_1k
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_istore_k
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1istore_1k
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_file_space_page_size
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1file_1space_1page_1size
|
||||
(JNIEnv *, jclass, jlong, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_page_size
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1page_1size
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_file_space_strategy
|
||||
* Signature: (JIZJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1file_1space_1strategy
|
||||
(JNIEnv *, jclass, jlong, jint, jboolean, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_strategy
|
||||
* Signature: (J[Z[J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy
|
||||
(JNIEnv *, jclass, jlong, jbooleanArray, jlongArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_strategy_persist
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy_1persist
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_file_space_strategy_threshold
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1file_1space_1strategy_1threshold
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_shared_mesg_nindexes
|
||||
* Signature: (JI)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1nindexes
|
||||
(JNIEnv *, jclass, jlong, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_shared_mesg_nindexes
|
||||
* Signature: (J)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1nindexes
|
||||
(JNIEnv *, jclass, jlong);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_shared_mesg_index
|
||||
* Signature: (JIII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1index
|
||||
(JNIEnv *, jclass, jlong, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_shared_mesg_index
|
||||
* Signature: (JI[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1index
|
||||
(JNIEnv *, jclass, jlong, jint, jintArray);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pset_shared_mesg_phase_change
|
||||
* Signature: (JII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pset_1shared_1mesg_1phase_1change
|
||||
(JNIEnv *, jclass, jlong, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: hdf_hdf5lib_H5
|
||||
* Method: H5Pget_shared_mesg_phase_change
|
||||
* Signature: (J[I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_hdf_hdf5lib_H5_H5Pget_1shared_1mesg_1phase_1change
|
||||
(JNIEnv *, jclass, jlong, jintArray);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _Included_hdf_hdf5lib_H5_H5PFCPL */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user