mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-15 07:40:23 +08:00
Merge pull request #425 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to hdf5_1_10
* commit 'b03e41146a3e15c7a287ab98f1963bf7944719a8': Skip tests for page buffering in test/fheap.c for parallel build Skip the two tests for page buffering in test/fheap.c because this feature is disabled in parallel. Activate full testing when this feature is re-enabled in the future for parallel build. Due to HDFVIEW-19 add read VL as string function Fix URL name updated with README changes DAILYTEST-250 change test props to reduce timeout Combined the README_DEVEL and README, and removed out-dated README material Fix for H5Dset_extent test failure with extensive array indexing (HDFFV-9771) 1) Calculate chunk index for extensive array index based on swizzled max chunks when unlim_dim > 0 2) Minor fixes to test/fheap.c that somehow were missed from last check in. See pull request #396 review comments.
This commit is contained in:
commit
b77e601996
1
MANIFEST
1
MANIFEST
@ -247,7 +247,6 @@
|
|||||||
./fortran/src/HDF5.F90
|
./fortran/src/HDF5.F90
|
||||||
./fortran/src/Makefile.am
|
./fortran/src/Makefile.am
|
||||||
./fortran/src/README
|
./fortran/src/README
|
||||||
./fortran/src/README_DEVELOPEMENT _DO_NOT_DISTRIBUTE_
|
|
||||||
./fortran/src/h5fc.in
|
./fortran/src/h5fc.in
|
||||||
./fortran/src/hdf5_fortrandll.def.in
|
./fortran/src/hdf5_fortrandll.def.in
|
||||||
|
|
||||||
|
@ -1,122 +1,18 @@
|
|||||||
|
===================================
|
||||||
|
README for the Fortran APIs to HDF5
|
||||||
|
===================================
|
||||||
|
|
||||||
README for the FORTRAN90 Prototype APIs to HDF5
|
This directory contains Fortran APIs for HDF5 Library functionality.
|
||||||
|
A complete list of implemented Fortran subroutines can be found in the HDF5
|
||||||
|
Reference Manual.
|
||||||
This distribution contains the HDF5 FORTRAN90 APIs source code (prototype)
|
|
||||||
based on the HDF5 1.2.2 release (ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current),
|
|
||||||
tests and examples.
|
|
||||||
|
|
||||||
This prototype supports a selected subset of the HDF5 Library functionality.
|
|
||||||
A complete list of the Fortran subroutines can be found in the HDF5
|
|
||||||
Reference Manual provided with this release.
|
|
||||||
Check the online documentation at http://hdf.ncsa.uiuc.edu/HDF5/doc (select
|
|
||||||
the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column) or
|
|
||||||
H5_F90.R1.2.2.RefMan.tar at ftp://hdf.ncsa.uiuc.edu/HDF5/fortran .
|
|
||||||
|
|
||||||
Changes since last release (October 1999)
|
|
||||||
=========================================
|
|
||||||
* Support for Linux
|
|
||||||
* Support for parallel features (tested on O2K platform only)
|
|
||||||
* Most of the functions from the H5R, H5P, H5T, H5E and H5I interfaces were
|
|
||||||
implemented. See Reference Manual for complete list. The new functions
|
|
||||||
include support for object and dataset region references, and for
|
|
||||||
compound datatypes.
|
|
||||||
* This prototype supports more predefined types. See list below in
|
|
||||||
the "About the Fortran APIs" section.
|
|
||||||
* This prototype supports T3E and T3E with mpt 1.3. One has to modify
|
|
||||||
H5Dff.f90, H5Aff.f90, H5Pff.f90 to comment lines with the module procedures for
|
|
||||||
double precision datatypes. See source code.
|
|
||||||
|
|
||||||
Supported platforms
|
|
||||||
===================
|
|
||||||
The FORTRAN90 APIs provided here are known to work with the
|
|
||||||
following platforms and compilers:
|
|
||||||
|
|
||||||
* SunOS 5.6 with WorkshopCompilers 4.2 Fortran 90 1.2
|
|
||||||
* SunOS 5.7 with WorkshopCompilers 5.0 Fortran 90 2.0
|
|
||||||
* OSF1 V4.0 with Digital Fortran 90 4.1
|
|
||||||
* Linux RedHat 6.1, Kernel 2.2.12 with PGF90
|
|
||||||
* T3E with Cray Fortran: Version 3.4.0.0
|
|
||||||
with mpt 1.3
|
|
||||||
|
|
||||||
Compilation
|
|
||||||
===========
|
|
||||||
|
|
||||||
1. Install HDF5 Release 1.2.2 on your system
|
|
||||||
(ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current). If you are using a
|
|
||||||
binary distribution provided by the HDF group, make sure that a GZIP
|
|
||||||
library is installed on your system. If you do not have a GZIP library,
|
|
||||||
you may copy it from the HDF FTP server.
|
|
||||||
|
|
||||||
2. In the src directory copy H5fortran_types.f90_<system> to
|
|
||||||
H5fortran_types.f90, where <system> is one of the following:
|
|
||||||
|
|
||||||
solaris
|
|
||||||
digunix
|
|
||||||
linux
|
|
||||||
|
|
||||||
Example: On Digital Unix systems use the following command
|
|
||||||
cp H5fortran_types.f90_digunix H5fortran_types.f90
|
|
||||||
|
|
||||||
3. Edit Makefile_<system >in the src/, test/ and examples/ directories
|
|
||||||
to specify the locations of the HDF5 C Library, the GZIP Library, and the
|
|
||||||
corresponding include files on your system.
|
|
||||||
|
|
||||||
4. In the src directory, run make to create the HDF5 FORTRAN90 library
|
|
||||||
hdf5_fortran.a
|
|
||||||
make -f Makefile_<system>
|
|
||||||
|
|
||||||
Example: On Solaris run
|
|
||||||
make -f Makefile_solaris
|
|
||||||
|
|
||||||
The Fortran library hdf5_fortran.a will be created.
|
|
||||||
|
|
||||||
5. In the test directory, build tests by running
|
|
||||||
make -f Makefile_<system>
|
|
||||||
This command will build fortranlib_test, fflush1 and fflush2 executables.
|
|
||||||
Run those executables to make sure that the library works on your system.
|
|
||||||
|
|
||||||
6. In the examples directory, run
|
|
||||||
make -f Makefile_<system>
|
|
||||||
to build the following examples:
|
|
||||||
|
|
||||||
fileexample - creates an HDF5 file
|
|
||||||
dsetexample - creates an empty dataset of integers
|
|
||||||
rwdsetexample - writes and reads to the dataset created by dsetexample
|
|
||||||
groupexample - creates a group in the file
|
|
||||||
grpsexample - creates groups using absolute and relative names
|
|
||||||
grpdsetexample - creates datasets in the groups
|
|
||||||
hyperslabexample - writes and reads a hyperslab
|
|
||||||
selectele - writes element selections
|
|
||||||
attrexample - creates and writes a dataset attribute
|
|
||||||
compound - creates, writes and reads one dim array of structures
|
|
||||||
mountexample - shows how to use mounting files to access a dataset
|
|
||||||
refobjexample - creates and stores references to the objects
|
|
||||||
refregexample - creates and stores references to the dataset regions
|
|
||||||
|
|
||||||
The script run_example.sh runs the examples in the appropriate order.
|
|
||||||
|
|
||||||
Use the HDF5 utility, h5dump, to see the content of the created HDF5 files.
|
|
||||||
|
|
||||||
7. Install the HDF5 Reference Manual (in HTML format). The manual
|
|
||||||
can be found in the Unix tar file H5_F90.R1.2.2.RefMan.tar
|
|
||||||
on the ftp server and is served over the Web from
|
|
||||||
http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select the "HDF5 Fortran90 Docs"
|
|
||||||
link at the bottom of the left-hand column).
|
|
||||||
|
|
||||||
|
|
||||||
8. Send bug reports and comments to hdfhelp@ncsa.uiuc.edu
|
|
||||||
|
|
||||||
User's Guide Notes
|
|
||||||
+++++++++++++++++++
|
|
||||||
|
|
||||||
About the source code organization
|
About the source code organization
|
||||||
==================================
|
==================================
|
||||||
|
|
||||||
The Fortran APIs are organized in modules parallel to the HDF5 Interfaces.
|
The Fortran APIs are organized in modules parallel to the HDF5 Interfaces.
|
||||||
Each module is in a separate file with the name H5*ff.f. Corresponding C
|
Each module is in a separate file with the name H5*ff.F90. Corresponding C
|
||||||
stubs are in the H5*f.c files. For example, the Fortran File APIs are in
|
stubs are in the H5*f.c files. For example, the Fortran File APIs are in
|
||||||
the file H5Fff.f and the corresponding C stubs are in the file H5Ff.c.
|
the file H5Fff.F90 and the corresponding C stubs are in the file H5Ff.c.
|
||||||
|
|
||||||
Each module contains Fortran definitions of the constants, interfaces to
|
Each module contains Fortran definitions of the constants, interfaces to
|
||||||
the subroutines if needed, and the subroutines themselves.
|
the subroutines if needed, and the subroutines themselves.
|
||||||
@ -124,31 +20,29 @@ the subroutines if needed, and the subroutines themselves.
|
|||||||
Users must use constant names in their programs instead of the numerical
|
Users must use constant names in their programs instead of the numerical
|
||||||
values, as the numerical values are subject to change without notice.
|
values, as the numerical values are subject to change without notice.
|
||||||
|
|
||||||
About the Fortran APIs
|
Quick overview of the Fortran APIs
|
||||||
=======================
|
==============================================
|
||||||
|
|
||||||
|
* An in-depth description of each Fortran API and its parameters can
|
||||||
|
be found in the HDF5 Reference Manual.
|
||||||
|
|
||||||
* The Fortran APIs come in the form of Fortran subroutines.
|
* The Fortran APIs come in the form of Fortran subroutines.
|
||||||
|
|
||||||
* Each Fortran subroutine name is derived from the corresponding C function
|
* Each Fortran subroutine name is derived from the corresponding C function
|
||||||
name by adding "_f" to the name. For example, the name of the C function
|
name by adding "_f" to the name. For example, the name of the C function
|
||||||
to create an HDF5 file is H5Fcreate; the corresponding Fortran subroutine
|
to create an HDF5 file is H5Fcreate; the corresponding Fortran subroutine
|
||||||
is h5fcreate_f.
|
is h5fcreate_f.
|
||||||
|
|
||||||
* A description of each Fortran subroutine and its parameters can be found
|
* The parameter list for each Fortran subroutine usually has two more parameters
|
||||||
following the description of the corresponding C function in the
|
than the corresponding C function. These additional parameters typically hold
|
||||||
Reference Manual provided with this release. The manual can be found in
|
|
||||||
the Unix tar file H5_F90.R1.2.2.tar in this directory and
|
|
||||||
is served over the Web from http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select
|
|
||||||
the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column).
|
|
||||||
|
|
||||||
* The parameter list for each Fortran subroutine has two more parameters
|
|
||||||
than the corresponding C function. These additional parameters hold
|
|
||||||
the return value and an error code. The order of the Fortran subroutine
|
the return value and an error code. The order of the Fortran subroutine
|
||||||
parameters may differ from the order of the C function parameters.
|
parameters may differ from the order of the C function parameters.
|
||||||
The Fortran subroutine parameters are listed in the following order:
|
|
||||||
|
The Fortran subroutine parameters are usually listed in the following order:
|
||||||
-- required input parameters,
|
-- required input parameters,
|
||||||
-- output parameters, including return value and error code, and
|
-- output parameters, including return value and error code, and
|
||||||
-- optional input parameters.
|
optional input parameters.
|
||||||
|
|
||||||
For example, the C function to create a dataset has the following
|
For example, the C function to create a dataset has the following
|
||||||
prototype:
|
prototype:
|
||||||
|
|
||||||
@ -158,72 +52,35 @@ About the Fortran APIs
|
|||||||
|
|
||||||
The corresponding Fortran subroutine has the following form:
|
The corresponding Fortran subroutine has the following form:
|
||||||
|
|
||||||
SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id,
|
SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, &
|
||||||
hdferr, creation_prp)
|
hdferr, dset_creation_prp, link_creation_prp, dset_access_prop)
|
||||||
|
|
||||||
The first four parameters of the Fortran subroutine correspond to the
|
The first four parameters of the Fortran subroutine correspond to the
|
||||||
C function parameters. The fifth parameter dset_id is an output
|
C function parameters. The fifth parameter dset_id is an output
|
||||||
parameter and contains a valid dataset identifier if the value of the
|
parameter and contains a valid dataset identifier if the value of the
|
||||||
sixth output parameter hdferr indicates successful completion.
|
sixth output parameter, hdferr, indicates successful completion.
|
||||||
(Error code descriptions are provided with the subroutine descriptions
|
(Error code descriptions are provided with the subroutine descriptions
|
||||||
in the Reference Manual.) The seventh input parameter creation_prp
|
in the Reference Manual.) The last three input parameters are optional
|
||||||
is optional, and may be omitted when the default creation property
|
and may be omitted, resulting in default values being used.
|
||||||
list is used.
|
|
||||||
(XXX: Update this! - QAK)
|
|
||||||
|
|
||||||
* Parameters to the Fortran subroutines have one of the following
|
* Parameters to the Fortran subroutines typically include
|
||||||
predefined datatypes (see the file H5fortran_types.f90 for KIND
|
predefined datatypes (see the build-time generated file
|
||||||
definitions):
|
H5fortran_types.F90 for a complete listing):
|
||||||
|
|
||||||
INTEGER(HID_T) compares with hid_t type in HDF5 C APIs
|
INTEGER(HID_T) compares with hid_t type in HDF5 C APIs
|
||||||
INTEGER(HSIZE_T) compares with hsize_t in HDF5 C APIs
|
INTEGER(HSIZE_T) compares with hsize_t in HDF5 C APIs
|
||||||
INTEGER(HSSIZE_T) compares with hssize_t in HDF5 C APIs
|
INTEGER(HSSIZE_T) compares with hssize_t in HDF5 C APIs
|
||||||
INTEGER(SIZE_T) compares with the C size_t type
|
INTEGER(SIZE_T) compares with the C size_t type
|
||||||
|
|
||||||
These integer types usually correspond to 4 or 8 byte integers,
|
These integer types usually correspond to 4 or 8 byte integers,
|
||||||
depending on the FORTRAN90 compiler and corresponding HDF5
|
depending on the Fortran compiler and corresponding HDF5
|
||||||
C library definitions.
|
C library definitions.
|
||||||
|
|
||||||
The H5R module defines two types:
|
* Each Fortran application must call the h5open_f subroutine to
|
||||||
TYPE(HOBJ_REF_T_F) compares to the hobj_ref_t in HDF5 C API
|
|
||||||
TYPE(HDSET_REG_REF_T_F) compares to hdset_reg_ref_t in HDF5 C API
|
|
||||||
These types are represented by character arrays now.
|
|
||||||
The internal representation can be changed in the future.
|
|
||||||
|
|
||||||
* Each Fortran application must call the h5init_types subroutine to
|
|
||||||
initialize the Fortran predefined datatypes before calling the HDF5 Fortran
|
initialize the Fortran predefined datatypes before calling the HDF5 Fortran
|
||||||
subroutines. The application must call the h5close_types subroutine
|
subroutines. The application should call the h5close_f subroutine
|
||||||
after all calls to the HDF5 Fortran Library.
|
after all calls to the HDF5 Fortran Library.
|
||||||
|
|
||||||
* The following predefined types are implemented in this prototype:
|
|
||||||
|
|
||||||
H5T_NATIVE_INTEGER
|
|
||||||
H5T_NATIVE_REAL
|
|
||||||
H5T_NATIVE_DOUBLE
|
|
||||||
H5T_NATIVE_CHARACTER
|
|
||||||
H5T_STD_REF_OBJ
|
|
||||||
H5T_STD_REF_DSETREG
|
|
||||||
H5T_IEEE_F32BE
|
|
||||||
H5T_IEEE_F32LE
|
|
||||||
H5T_IEEE_F64BE
|
|
||||||
H5T_IEEE_F64LE
|
|
||||||
H5T_STD_I8BE
|
|
||||||
H5T_STD_I8LE
|
|
||||||
H5T_STD_I16BE
|
|
||||||
H5T_STD_I16LE
|
|
||||||
H5T_STD_I32BE
|
|
||||||
H5T_STD_I32LE
|
|
||||||
H5T_STD_I64BE
|
|
||||||
H5T_STD_I64LE
|
|
||||||
H5T_STD_U8BE
|
|
||||||
H5T_STD_U8LE
|
|
||||||
H5T_STD_U16BE
|
|
||||||
H5T_STD_U16LE
|
|
||||||
H5T_STD_U32BE
|
|
||||||
H5T_STD_U32LE
|
|
||||||
H5T_STD_U64BE
|
|
||||||
H5T_STD_U64LE
|
|
||||||
|
|
||||||
|
|
||||||
* When a C application reads data stored from a Fortran program, the data
|
* When a C application reads data stored from a Fortran program, the data
|
||||||
will appear to be transposed due to the difference in the C - Fortran
|
will appear to be transposed due to the difference in the C - Fortran
|
||||||
storage order. For example, if Fortran writes a 4x6 two-dimensional dataset
|
storage order. For example, if Fortran writes a 4x6 two-dimensional dataset
|
||||||
@ -233,6 +90,45 @@ About the Fortran APIs
|
|||||||
|
|
||||||
* Fortran indices are 1 based.
|
* Fortran indices are 1 based.
|
||||||
|
|
||||||
* Compound datatype datasets can be written or read by atomic fields only.
|
============================
|
||||||
|
FOR DEVELOPERS
|
||||||
|
============================
|
||||||
|
|
||||||
|
Procedure to add a new function
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
(1) Edit the fortran/src/H5*ff.F90 file
|
||||||
|
(2) Edit the fortran/src/H5*f.c file
|
||||||
|
(3) Edit the fortran/src/H5f90proto.h file
|
||||||
|
(4) Add the new function to fortran/src/hdf5_fortrandll.def.in
|
||||||
|
|
||||||
|
Procedure for passing C variables to Fortran
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
(1) Find the C struct name you are interested in:
|
||||||
|
(a) src/H5public.h if it is a generic type, i.e. H5_*
|
||||||
|
or
|
||||||
|
(b) src/H5*public.h if is a specific type, i.e. H5*_
|
||||||
|
|
||||||
|
(2) Put that structure into an array that will be passed to fortran in:
|
||||||
|
(a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine)
|
||||||
|
(b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call
|
||||||
|
|
||||||
|
(3) Edit the function call in fortran/src/H5_ff.F90
|
||||||
|
(a) edit the call: FUNCTION h5init_flags_c
|
||||||
|
(b) edit h5init_flags_c call in h5open_f to match the number of arguments passing
|
||||||
|
|
||||||
|
(4) add the size of the array and array to fortran/src/H5f90global.F90
|
||||||
|
- must match the size found it H5_f.c
|
||||||
|
|
||||||
|
NOTE: To just add a default C value argument, do steps (2a) and (4)
|
||||||
|
|
||||||
|
|
||||||
|
Procedure for adding a new file to the repository
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
Add the name of the file to the:
|
||||||
|
(1) Makefile.am located in the same directory as the newfile
|
||||||
|
(2) CMakeLists.txt located in the same directory as the newfile
|
||||||
|
(3) MANIFEST located in the top level directory
|
||||||
|
|
||||||
Not all of the APIs provided with this prototype have been fully tested.
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
Procedure to add a new function
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
(1) Edit the fortran/src/H5*ff.f90 file
|
|
||||||
(2) Edit the fortran/src/H5*f.c file
|
|
||||||
(3) Edit the fortran/src/H5f90proto.h file
|
|
||||||
(4) Add the new function to fortran/src/hdf5_fortrandll.def.in
|
|
||||||
|
|
||||||
Procedure for passing C variables to Fortran
|
|
||||||
---------------------------------------------
|
|
||||||
|
|
||||||
(1) Find the C struct name you are interested in:
|
|
||||||
(a) src/H5public.h if it is a generic type, i.e. H5_*
|
|
||||||
or
|
|
||||||
(b) src/H5*public.h if is a specific type, i.e. H5*_
|
|
||||||
|
|
||||||
(2) Put that structure into an array that will be passed to fortran in:
|
|
||||||
(a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine)
|
|
||||||
(b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call
|
|
||||||
|
|
||||||
(3) Edit the function call in fortran/src/H5_ff.f90
|
|
||||||
(a) edit the call: FUNCTION h5init_flags_c
|
|
||||||
(b) edit h5init_flags_c call in h5open_f to match the number of arguments passing
|
|
||||||
|
|
||||||
(4) add the size of the array and array to fortran/src/H5f90global.f90
|
|
||||||
- must match the size found it H5_f.c
|
|
||||||
|
|
||||||
NOTE: To just add a default C value argument, do steps (2a) and (4)
|
|
||||||
|
|
||||||
|
|
||||||
Procedure for adding a new file to the repository
|
|
||||||
--------------------------------------------------
|
|
||||||
|
|
||||||
Add the name of the file to the:
|
|
||||||
(1) Makefile.am located in the same directory as the newfile
|
|
||||||
(2) CMakeLists.txt located in the same directory as the newfile
|
|
||||||
(3) MANIFEST located in the top level directory
|
|
||||||
|
|
@ -1798,6 +1798,9 @@ public class H5 implements java.io.Serializable {
|
|||||||
return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
|
return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id,
|
||||||
|
long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException;
|
||||||
|
|
||||||
public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id,
|
public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id,
|
||||||
long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
|
long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException;
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ extern jobject visit_callback;
|
|||||||
/* Local Prototypes */
|
/* Local Prototypes */
|
||||||
/********************/
|
/********************/
|
||||||
|
|
||||||
|
static herr_t H5DreadVL_asstr (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf);
|
||||||
static herr_t H5DreadVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf);
|
static herr_t H5DreadVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf);
|
||||||
static herr_t H5DreadVL_array (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf);
|
static herr_t H5DreadVL_array (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf);
|
||||||
static herr_t H5DwriteVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf);
|
static herr_t H5DwriteVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf);
|
||||||
@ -992,6 +993,96 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1double
|
|||||||
return (jint)status;
|
return (jint)status;
|
||||||
} /* end Java_hdf_hdf5lib_H5_H5Dwrite_1double */
|
} /* end Java_hdf_hdf5lib_H5_H5Dwrite_1double */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: hdf_hdf5lib_H5
|
||||||
|
* Method: H5DreadVL
|
||||||
|
* Signature: (JJJJJ[Ljava/lang/String;)I
|
||||||
|
*/
|
||||||
|
JNIEXPORT jint JNICALL
|
||||||
|
Java_hdf_hdf5lib_H5_H5DreadVL
|
||||||
|
(JNIEnv *env, jclass clss, jlong dataset_id, jlong mem_type_id, jlong mem_space_id,
|
||||||
|
jlong file_space_id, jlong xfer_plist_id, jobjectArray buf)
|
||||||
|
{
|
||||||
|
herr_t status = -1;
|
||||||
|
htri_t isVlenStr=0;
|
||||||
|
|
||||||
|
if (buf == NULL) {
|
||||||
|
h5nullArgument(env, "H5DreadVL: buf is NULL");
|
||||||
|
} /* end if */
|
||||||
|
else {
|
||||||
|
isVlenStr = H5Tdetect_class((hid_t)mem_type_id, H5T_STRING);
|
||||||
|
|
||||||
|
if (isVlenStr)
|
||||||
|
h5badArgument(env, "H5DreadVL: type is not variable length non-string");
|
||||||
|
else
|
||||||
|
status = H5DreadVL_asstr(env, (hid_t)dataset_id, (hid_t)mem_type_id,
|
||||||
|
(hid_t)mem_space_id, (hid_t)file_space_id,
|
||||||
|
(hid_t)xfer_plist_id, buf);
|
||||||
|
} /* end else */
|
||||||
|
|
||||||
|
return (jint)status;
|
||||||
|
} /* end Java_hdf_hdf5lib_H5_H5Dread_1VLStrings */
|
||||||
|
|
||||||
|
herr_t
|
||||||
|
H5DreadVL_asstr
|
||||||
|
(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf)
|
||||||
|
{
|
||||||
|
jint i;
|
||||||
|
jint n;
|
||||||
|
jstring jstr;
|
||||||
|
h5str_t h5str;
|
||||||
|
hvl_t *rdata;
|
||||||
|
size_t size;
|
||||||
|
size_t max_len = 0;
|
||||||
|
herr_t status = -1;
|
||||||
|
|
||||||
|
n = ENVPTR->GetArrayLength(ENVPAR buf);
|
||||||
|
rdata = (hvl_t*)HDcalloc((size_t)n, sizeof(hvl_t));
|
||||||
|
if (rdata == NULL) {
|
||||||
|
h5JNIFatalError(env, "H5DreadVL_notstr: failed to allocate buff for read");
|
||||||
|
} /* end if */
|
||||||
|
else {
|
||||||
|
status = H5Dread(did, tid, mem_sid, file_sid, xfer_plist_id, rdata);
|
||||||
|
|
||||||
|
if (status < 0) {
|
||||||
|
H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata);
|
||||||
|
HDfree(rdata);
|
||||||
|
h5JNIFatalError(env, "H5DreadVL_notstr: failed to read data");
|
||||||
|
} /* end if */
|
||||||
|
else {
|
||||||
|
max_len = 1;
|
||||||
|
for (i=0; i < n; i++) {
|
||||||
|
if ((rdata + i)->len > max_len)
|
||||||
|
max_len = (rdata + i)->len;
|
||||||
|
}
|
||||||
|
|
||||||
|
size = H5Tget_size(tid) * max_len;
|
||||||
|
HDmemset(&h5str, 0, sizeof(h5str_t));
|
||||||
|
h5str_new(&h5str, 4 * size);
|
||||||
|
|
||||||
|
if (h5str.s == NULL) {
|
||||||
|
H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata);
|
||||||
|
HDfree(rdata);
|
||||||
|
h5JNIFatalError(env, "H5DreadVL_notstr: failed to allocate buf");
|
||||||
|
} /* end if */
|
||||||
|
else {
|
||||||
|
for (i=0; i < n; i++) {
|
||||||
|
h5str.s[0] = '\0';
|
||||||
|
h5str_sprintf(&h5str, did, tid, rdata+i, 0);
|
||||||
|
jstr = ENVPTR->NewStringUTF(ENVPAR h5str.s);
|
||||||
|
ENVPTR->SetObjectArrayElement(ENVPAR buf, i, jstr);
|
||||||
|
} /* end for */
|
||||||
|
h5str_free(&h5str);
|
||||||
|
|
||||||
|
H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata);
|
||||||
|
HDfree(rdata);
|
||||||
|
} /* end else */
|
||||||
|
} /* end else */
|
||||||
|
} /* end else */
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: hdf_hdf5lib_H5
|
* Class: hdf_hdf5lib_H5
|
||||||
* Method: H5Dread_string
|
* Method: H5Dread_string
|
||||||
|
@ -204,6 +204,15 @@ JNIEXPORT jint JNICALL
|
|||||||
Java_hdf_hdf5lib_H5_H5Dwrite_1double
|
Java_hdf_hdf5lib_H5_H5Dwrite_1double
|
||||||
(JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jdoubleArray, jboolean);
|
(JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jdoubleArray, jboolean);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: hdf_hdf5lib_H5
|
||||||
|
* Method: H5DreadVL
|
||||||
|
* Signature: (JJJJJ[Ljava/lang/String;)I
|
||||||
|
*/
|
||||||
|
JNIEXPORT jint JNICALL
|
||||||
|
Java_hdf_hdf5lib_H5_H5DreadVL
|
||||||
|
(JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jobjectArray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: hdf_hdf5lib_H5
|
* Class: hdf_hdf5lib_H5
|
||||||
* Method: H5Dread_string
|
* Method: H5Dread_string
|
||||||
|
13
test/fheap.c
13
test/fheap.c
@ -16388,14 +16388,23 @@ main(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Caution when turning on ExpressMode 0:
|
* Caution when turning on ExpressMode 0:
|
||||||
* It will activate testing with different combinations of
|
* It will activate testing with different combinations of
|
||||||
* page buffering and file space strategy and the
|
* page buffering and file space strategy and the
|
||||||
* running time will be long.
|
* running time will be long.
|
||||||
|
* For parallel build, the last two tests for page buffering
|
||||||
|
* are skipped because this feature is disabled in parallel.
|
||||||
|
* Activate full testing when this feature is re-enabled
|
||||||
|
* in the future for parallel build.
|
||||||
*/
|
*/
|
||||||
if(ExpressMode > 1)
|
if(ExpressMode > 1)
|
||||||
HDprintf("***Express test mode on. Some tests may be skipped\n");
|
HDprintf("***Express test mode on. Some tests may be skipped\n");
|
||||||
else if(ExpressMode == 0)
|
else if(ExpressMode == 0) {
|
||||||
|
#ifdef H5_HAVE_PARALLEL
|
||||||
|
num_pb_fs = NUM_PB_FS - 2;
|
||||||
|
#else
|
||||||
num_pb_fs = NUM_PB_FS;
|
num_pb_fs = NUM_PB_FS;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize heap creation parameters */
|
/* Initialize heap creation parameters */
|
||||||
init_small_cparam(&small_cparam);
|
init_small_cparam(&small_cparam);
|
||||||
|
Loading…
Reference in New Issue
Block a user