New references for Dimension Scale APIs (#1139)

* Enable usage of new-style references with dimension scale APIs

* Add API to check if an object ID represents a native connector object

* Modified code to use new function H5DSwith_new_ref to determine if new references should be used with
Dimension Scales. The new function return TRUE if non-native connector is used or if H5_DIMENSION_SCALES_WITH_NEW_REF
varible is define at configure time (--enable-dimension-scales-with-new-ref).

Tested on jelly.

ToDo: generate testing file on BE system and enable the test; add flag to CMake; test netCDF-4 with the new references.

* Adding new test files generated on BE system (hedgehog) created by 32 and 64-bit library.

test_ds chokes on test_ds_le_new_ref.h5  on BE system; test passes for test_ds_be_new_ref-32bit.h5
for the 32-bit library and fails for the 64-bit library, and vice versa. I am checking the files for further
investigation; but current implementation of the new references is not portable between LE and BE systems,
and 32 and 64-bit systems.

* Minor fixes for testing issues

* Update test_ds.c

Enabled broken test; tests pass now.

* Update RELEASE.txt

Documented new option to use new references with the HDF5 dimension scales APIs (H5DS*).

* Update MANIFEST for new 32-bit new-style references test file for H5DS APIs

* Update 'dimension scales w/ new-style refs' feature based on review

Co-authored-by: Elena <epourmal@hdfgroup.org>
This commit is contained in:
jhendersonHDF 2021-11-05 07:33:02 -05:00 committed by GitHub
parent 55ee1fd655
commit 93ac9b0aeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 827 additions and 426 deletions

View File

@ -3066,7 +3066,10 @@
./hl/test/sepia.pal ./hl/test/sepia.pal
./hl/test/test_ds.c ./hl/test/test_ds.c
./hl/test/test_ds_be.h5 ./hl/test/test_ds_be.h5
./hl/test/test_ds_be_new_ref.h5
./hl/test/test_ds_be_new_ref-32bit.h5
./hl/test/test_ds_le.h5 ./hl/test/test_ds_le.h5
./hl/test/test_ds_le_new_ref.h5
./hl/test/test_dset_append.c ./hl/test/test_dset_append.c
./hl/test/test_file_image.c ./hl/test/test_file_image.c
./hl/test/test_h5do_compat.c ./hl/test/test_h5do_compat.c

View File

@ -406,6 +406,9 @@
/* Define if the high-level library headers should be included in hdf5.h */ /* Define if the high-level library headers should be included in hdf5.h */
#cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ #cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@
/* Define if new-style references should be used with dimension scales */
#cmakedefine H5_DIMENSION_SCALES_WITH_NEW_REF @H5_DIMENSION_SCALES_WITH_NEW_REF@
/* Define if your system can convert long double to (unsigned) long long /* Define if your system can convert long double to (unsigned) long long
values correctly. */ values correctly. */
#cmakedefine H5_LDOUBLE_TO_LLONG_ACCURATE @H5_LDOUBLE_TO_LLONG_ACCURATE@ #cmakedefine H5_LDOUBLE_TO_LLONG_ACCURATE @H5_LDOUBLE_TO_LLONG_ACCURATE@

View File

@ -64,28 +64,29 @@ Languages:
Features: Features:
--------- ---------
Parallel HDF5: @HDF5_ENABLE_PARALLEL@ Parallel HDF5: @HDF5_ENABLE_PARALLEL@
Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
Large Parallel I/O: @LARGE_PARALLEL_IO@ Large Parallel I/O: @LARGE_PARALLEL_IO@
High-level library: @HDF5_BUILD_HL_LIB@ High-level library: @HDF5_BUILD_HL_LIB@
Build HDF5 Tests: @BUILD_TESTING@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@
Build HDF5 Tools: @HDF5_BUILD_TOOLS@ Build HDF5 Tests: @BUILD_TESTING@
Build High-level HDF5 Tools: @HDF5_BUILD_HL_TOOLS@ Build HDF5 Tools: @HDF5_BUILD_TOOLS@
Threadsafety: @HDF5_ENABLE_THREADSAFE@ Build High-level HDF5 Tools: @HDF5_BUILD_HL_TOOLS@
Default API mapping: @DEFAULT_API_VERSION@ Threadsafety: @HDF5_ENABLE_THREADSAFE@
With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@ Default API mapping: @DEFAULT_API_VERSION@
I/O filters (external): @EXTERNAL_FILTERS@ With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@
MPE: @H5_HAVE_LIBLMPE@ I/O filters (external): @EXTERNAL_FILTERS@
Direct VFD: @H5_HAVE_DIRECT@ MPE: @H5_HAVE_LIBLMPE@
Mirror VFD: @H5_HAVE_MIRROR_VFD@ Direct VFD: @H5_HAVE_DIRECT@
(Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@ Mirror VFD: @H5_HAVE_MIRROR_VFD@
(Read-Only) HDFS VFD: @H5_HAVE_LIBHDFS@ (Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@
dmalloc: @H5_HAVE_LIBDMALLOC@ (Read-Only) HDFS VFD: @H5_HAVE_LIBHDFS@
Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@ dmalloc: @H5_HAVE_LIBDMALLOC@
API Tracing: @HDF5_ENABLE_TRACE@ Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ API Tracing: @HDF5_ENABLE_TRACE@
Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@
Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@
Use file locking: @HDF5_FILE_LOCKING_SETTING@ Function Stack Tracing: @HDF5_ENABLE_CODESTACK@
Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ Use file locking: @HDF5_FILE_LOCKING_SETTING@
Optimization Instrumentation: @HDF5_Enable_Instrument@ Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@
Optimization Instrumentation: @HDF5_Enable_Instrument@

View File

@ -875,6 +875,38 @@ else
fi fi
## ----------------------------------------------------------------------
## Enable new references for dimension scales
##
AC_SUBST([DIMENSION_SCALES_WITH_NEW_REF])
AC_MSG_CHECKING([whether to use new references with dimension scales]);
AC_ARG_ENABLE([dimension-scales-with-new-ref],
[AS_HELP_STRING([--enable-dimension-scales-with-new-ref],
[Use new references when creating dimension scales.
[default=no]
])],
[DIMENSION_SCALES_WITH_NEW_REF=$enableval])
## Set the default value to use old references.
if test "X-$DIMENSION_SCALES_WITH_NEW_REF" = X- ; then
DIMENSION_SCALES_WITH_NEW_REF=no
fi
case "X-$DIMENSION_SCALES_WITH_NEW_REF" in
X-yes)
AC_MSG_RESULT([yes])
AC_DEFINE([DIMENSION_SCALES_WITH_NEW_REF], [1],
[Define if new references for dimension scales were requested])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
AC_MSG_ERROR([Unrecognized value: $DIMENSION_SCALES_WITH_NEW_REF])
;;
esac
## ---------------------------------------------------------------------- ## ----------------------------------------------------------------------
## Check which archiving tool to use. This needs to be done before ## Check which archiving tool to use. This needs to be done before
## the AM_PROG_LIBTOOL macro. ## the AM_PROG_LIBTOOL macro.

View File

@ -1,6 +1,14 @@
cmake_minimum_required (VERSION 3.12) cmake_minimum_required (VERSION 3.12)
project (HDF5_HL C) project (HDF5_HL C)
#-----------------------------------------------------------------------------
# Option to use new-style references with dimension scale APIs
#-----------------------------------------------------------------------------
option (HDF5_DIMENSION_SCALES_NEW_REF "Use new-style references with dimension scale APIs" OFF)
if (HDF5_DIMENSION_SCALES_NEW_REF)
set (H5_DIMENSION_SCALES_WITH_NEW_REF 1)
endif ()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# List Source files # List Source files
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -20,12 +20,18 @@
/* public LT prototypes */ /* public LT prototypes */
#include "H5DSpublic.h" #include "H5DSpublic.h"
/* attribute type of a DS dataset */ /* attribute type of a DS dataset when old references are used*/
typedef struct ds_list_t { typedef struct ds_list_t {
hobj_ref_t ref; /* object reference */ hobj_ref_t ref; /* object reference */
unsigned int dim_idx; /* dimension index of the dataset */ unsigned int dim_idx; /* dimension index of the dataset */
} ds_list_t; } ds_list_t;
/* attribute type of a DS dataset when new references are used*/
typedef struct nds_list_t {
H5R_ref_t ref;
unsigned int dim_idx; /* dimension index of the dataset */
} nds_list_t;
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* private functions * private functions
*------------------------------------------------------------------------- *-------------------------------------------------------------------------

View File

@ -25,6 +25,8 @@ typedef herr_t (*H5DS_iterate_t)(hid_t dset, unsigned dim, hid_t scale, void *vi
extern "C" { extern "C" {
#endif #endif
H5_HLDLL hbool_t H5DSwith_new_ref(hid_t obj_id);
H5_HLDLL herr_t H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx); H5_HLDLL herr_t H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx);
H5_HLDLL herr_t H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx); H5_HLDLL herr_t H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx);

View File

@ -1855,46 +1855,6 @@ H5LTset_attribute_double(hid_t loc_id, const char *obj_name, const char *attr_na
return 0; return 0;
} }
/*-------------------------------------------------------------------------
* Function: find_attr
*
* Purpose: operator function used by H5LT_find_attribute
*
* Programmer: Pedro Vicente
*
* Date: June 21, 2001
*
* Comments:
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
static herr_t
find_attr(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const H5A_info_t *ainfo,
void *op_data)
{
int ret = H5_ITER_CONT;
/* check the arguments */
if (name == NULL)
return H5_ITER_CONT;
/* Shut compiler up */
(void)loc_id;
(void)ainfo;
/* Define a positive value for return value if the attribute was found. This will
* cause the iterator to immediately return that positive value,
* indicating short-circuit success
*/
if (HDstrncmp(name, (char *)op_data, MAX(HDstrlen((char *)op_data), HDstrlen(name))) == 0)
ret = H5_ITER_STOP;
return ret;
}
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Function: H5LTfind_attribute * Function: H5LTfind_attribute
* *
@ -1926,32 +1886,22 @@ H5LTfind_attribute(hid_t loc_id, const char *attr_name)
* *
* Date: June 21, 2001 * Date: June 21, 2001
* *
* Comments:
* The function uses H5Aiterate2 with the operator function find_attr
*
* Return: * Return:
* Success: The return value of the first operator that * Success: Positive if the attribute exists attached to the
* returns non-zero, or zero if all members were * object loc_id. Zero if the attribute does not
* processed with no operator returning non-zero. * exist attached to the object loc_id.
* *
* Failure: Negative if something goes wrong within the * Failure: Negative if something goes wrong within the
* library, or the negative value returned by one * library.
* of the operators.
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
/* H5Aiterate wants a non-const pointer but we have a const pointer in the API
* call. It's safe to ignore this because we control the callback, don't
* modify the op_data buffer (i.e.: attr_name) during the traversal, and the
* library never modifies that buffer.
*/
H5_GCC_CLANG_DIAG_OFF("cast-qual")
herr_t herr_t
H5LT_find_attribute(hid_t loc_id, const char *attr_name) H5LT_find_attribute(hid_t loc_id, const char *attr_name)
{ {
return H5Aiterate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, find_attr, (void *)attr_name); htri_t attr_exists = H5Aexists(loc_id, attr_name);
return (attr_exists < 0) ? (herr_t)-1 : (attr_exists) ? (herr_t)1 : (herr_t)0;
} }
H5_GCC_CLANG_DIAG_ON("cast-qual")
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Function: H5LTget_attribute_ndims * Function: H5LTget_attribute_ndims

View File

@ -31,7 +31,9 @@ set (HL_REFERENCE_TEST_FILES
dslat.txt dslat.txt
dslon.txt dslon.txt
test_ds_be.h5 test_ds_be.h5
test_ds_be_new_ref.h5
test_ds_le.h5 test_ds_le.h5
test_ds_le_new_ref.h5
test_ld.h5 test_ld.h5
) )

View File

@ -63,7 +63,11 @@ static int test_foreign_scaleattached(const char *filename);
#define SCALE_4_NAME "scalename_4_" #define SCALE_4_NAME "scalename_4_"
#define FILENAME "test_ds_" #define FILENAME "test_ds_"
#define FILEEXT ".h5" #ifdef H5_DIMENSION_SCALES_WITH_NEW_REF
#define FILEEXT "_new_ref.h5"
#else
#define FILEEXT ".h5"
#endif
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* the main program * the main program

View File

@ -137,10 +137,15 @@ static int test_attach_detach(void);
#define DIM0_LABEL "Latitude" #define DIM0_LABEL "Latitude"
#define DIM1_LABEL "Longitude" #define DIM1_LABEL "Longitude"
#ifdef H5_DIMENSION_SCALES_WITH_NEW_REF
#define FOREIGN_FILE1 "test_ds_le_new_ref.h5"
#define FOREIGN_FILE2 "test_ds_be_new_ref.h5"
#else
#define FOREIGN_FILE1 "test_ds_le.h5" #define FOREIGN_FILE1 "test_ds_le.h5"
#define FOREIGN_FILE2 "test_ds_be.h5" #define FOREIGN_FILE2 "test_ds_be.h5"
#define FILENAME "test_ds" #endif
#define FILEEXT ".h5" #define FILENAME "test_ds"
#define FILEEXT ".h5"
#define FILE1 "test_ds3.h5" #define FILE1 "test_ds3.h5"
#define FILE2 "test_ds4.h5" #define FILE2 "test_ds4.h5"
@ -161,10 +166,15 @@ static int test_attach_detach(void);
int int
main(void) main(void)
{ {
int nerrors = 0; hid_t file_id = H5I_INVALID_HID;
int nerrors = 0;
/* create file to be used in following tests */ /* create file to be used in following tests */
if (create_test_file("1") < 0) { if ((file_id = create_test_file("1")) < 0) {
nerrors = 1;
goto error;
}
if (H5Fclose(file_id) < 0) {
nerrors = 1; nerrors = 1;
goto error; goto error;
} }
@ -179,7 +189,11 @@ main(void)
nerrors += test_long_scalenames("1") < 0 ? 1 : 0; nerrors += test_long_scalenames("1") < 0 ? 1 : 0;
nerrors += test_float_scalenames("1") < 0 ? 1 : 0; nerrors += test_float_scalenames("1") < 0 ? 1 : 0;
nerrors += test_numberofscales("1") < 0 ? 1 : 0; nerrors += test_numberofscales("1") < 0 ? 1 : 0;
if (create_test_file("2") < 0) { if ((file_id = create_test_file("2")) < 0) {
nerrors = 1;
goto error;
}
if (H5Fclose(file_id) < 0) {
nerrors = 1; nerrors = 1;
goto error; goto error;
} }
@ -254,10 +268,9 @@ open_test_file(const char *fileext)
herr_t herr_t
create_char_dataset(hid_t fid, const char *dsidx, int fulldims) create_char_dataset(hid_t fid, const char *dsidx, int fulldims)
{ {
int rank = 3; int rank = 3;
int rankds = 1; int rankds = 1;
hsize_t dims[3] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE}; hsize_t dims[3] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE};
char buf[DIM1_SIZE * DIM2_SIZE * DIM3_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE}; hsize_t s3_dim[1] = {DIM3_SIZE};
@ -275,7 +288,7 @@ create_char_dataset(hid_t fid, const char *dsidx, int fulldims)
HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */ /* make a dataset */
if (H5LTmake_dataset_char(fid, name, rank, dims, buf) >= 0) { if (H5LTmake_dataset_char(fid, name, rank, dims, NULL) >= 0) {
if (fulldims == 0) { if (fulldims == 0) {
/* make a DS dataset for the first dimension */ /* make a DS dataset for the first dimension */
if (create_DS1_char_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) if (create_DS1_char_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0)
@ -309,10 +322,9 @@ create_char_dataset(hid_t fid, const char *dsidx, int fulldims)
herr_t herr_t
create_short_dataset(hid_t fid, const char *dsidx, int fulldims) create_short_dataset(hid_t fid, const char *dsidx, int fulldims)
{ {
int rank = 3; int rank = 3;
int rankds = 1; int rankds = 1;
hsize_t dims[3] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE}; hsize_t dims[3] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE};
short buf[DIM1_SIZE * DIM2_SIZE * DIM3_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE}; hsize_t s3_dim[1] = {DIM3_SIZE};
@ -330,7 +342,7 @@ create_short_dataset(hid_t fid, const char *dsidx, int fulldims)
HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */ /* make a dataset */
if (H5LTmake_dataset_short(fid, name, rank, dims, buf) >= 0) { if (H5LTmake_dataset_short(fid, name, rank, dims, NULL) >= 0) {
if (fulldims == 0) { if (fulldims == 0) {
/* make a DS dataset for the first dimension */ /* make a DS dataset for the first dimension */
if (create_DS1_short_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) if (create_DS1_short_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0)
@ -364,10 +376,9 @@ create_short_dataset(hid_t fid, const char *dsidx, int fulldims)
herr_t herr_t
create_int_dataset(hid_t fid, const char *dsidx, int fulldims) create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
{ {
int rank = RANK; int rank = RANK;
int rankds = 1; int rankds = 1;
hsize_t dims[RANK] = {DIM1_SIZE, DIM2_SIZE}; hsize_t dims[RANK] = {DIM1_SIZE, DIM2_SIZE};
int buf[DIM1_SIZE * DIM2_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE};
int s1_wbuf[DIM1_SIZE] = {10, 20, 30}; int s1_wbuf[DIM1_SIZE] = {10, 20, 30};
@ -380,7 +391,7 @@ create_int_dataset(hid_t fid, const char *dsidx, int fulldims)
HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */ /* make a dataset */
if (H5LTmake_dataset_int(fid, name, rank, dims, buf) >= 0) { if (H5LTmake_dataset_int(fid, name, rank, dims, NULL) >= 0) {
if (fulldims == 0) { if (fulldims == 0) {
/* make a DS dataset for the first dimension */ /* make a DS dataset for the first dimension */
if (create_DS1_int_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) if (create_DS1_int_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0)
@ -409,7 +420,6 @@ create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldi
int rank = 4; int rank = 4;
int rankds = 1; int rankds = 1;
hsize_t dims[4] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE, DIM4_SIZE}; hsize_t dims[4] = {DIM1_SIZE, DIM2_SIZE, DIM3_SIZE, DIM4_SIZE};
long * buf = NULL;
hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE};
hsize_t s3_dim[1] = {DIM3_SIZE}; hsize_t s3_dim[1] = {DIM3_SIZE};
@ -429,12 +439,8 @@ create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldi
long s43_wbuf[DIM4_SIZE] = {180, 180}; long s43_wbuf[DIM4_SIZE] = {180, 180};
long s44_wbuf[DIM4_SIZE] = {280, 280}; long s44_wbuf[DIM4_SIZE] = {280, 280};
/* Allocate buffer */
if (NULL == (buf = (long *)HDmalloc(sizeof(long) * DIM1_SIZE * DIM2_SIZE * DIM3_SIZE * DIM4_SIZE)))
goto error;
/* make a dataset */ /* make a dataset */
if (H5LTmake_dataset_long(fid, dsname, rank, dims, buf) >= 0) { if (H5LTmake_dataset_long(fid, dsname, rank, dims, NULL) >= 0) {
if (fulldims == 0) { if (fulldims == 0) {
/* make a DS dataset for the first dimension */ /* make a DS dataset for the first dimension */
if (create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) if (create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0)
@ -471,23 +477,18 @@ create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldi
else else
goto error; goto error;
HDfree(buf);
return SUCCEED; return SUCCEED;
error: error:
HDfree(buf);
return FAIL; return FAIL;
} }
herr_t herr_t
create_float_dataset(hid_t fid, const char *dsidx, int fulldims) create_float_dataset(hid_t fid, const char *dsidx, int fulldims)
{ {
int rank = RANK; int rank = RANK;
int rankds = 1; int rankds = 1;
hsize_t dims[RANK] = {DIM1_SIZE, DIM2_SIZE}; hsize_t dims[RANK] = {DIM1_SIZE, DIM2_SIZE};
float buf[DIM1_SIZE * DIM2_SIZE];
hsize_t s1_dim[1] = {DIM1_SIZE}; hsize_t s1_dim[1] = {DIM1_SIZE};
hsize_t s2_dim[1] = {DIM2_SIZE}; hsize_t s2_dim[1] = {DIM2_SIZE};
float s1_wbuf[DIM1_SIZE] = {10, 20, 30}; float s1_wbuf[DIM1_SIZE] = {10, 20, 30};
@ -500,7 +501,7 @@ create_float_dataset(hid_t fid, const char *dsidx, int fulldims)
HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx);
/* make a dataset */ /* make a dataset */
if (H5LTmake_dataset_float(fid, name, rank, dims, buf) >= 0) { if (H5LTmake_dataset_float(fid, name, rank, dims, NULL) >= 0) {
if (fulldims == 0) { if (fulldims == 0) {
/* make a DS dataset for the first dimension */ /* make a DS dataset for the first dimension */
if (create_DS1_float_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) if (create_DS1_float_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -47,6 +47,16 @@ New Features
Configuration: Configuration:
------------- -------------
- Added new configure options to enable dimension scales APIs (H5DS*) to
use new object references with the native VOL connector (aka native HDF5
library). New references are always used for non-native terminal VOL
connectors (e.g., DAOS).
Autotools --enable-dimension-scales-with-new-ref
CMake HDF5_DIMENSION_SCALES_NEW_REF=ON
(EIP - 2021/10/25, HDFFV-11180)
- Refactored the utils folder. - Refactored the utils folder.
Added subfolder test and moved the 'swmr_check_compat_vfd.c file' Added subfolder test and moved the 'swmr_check_compat_vfd.c file'

View File

@ -655,6 +655,37 @@ done:
FUNC_LEAVE_API(ret_value) FUNC_LEAVE_API(ret_value)
} /* H5VLobject() */ } /* H5VLobject() */
/*---------------------------------------------------------------------------
* Function: H5VLobject_is_native
*
* Purpose: Determines whether an object ID represents a native VOL
* connector object.
*
* Return: Success: TRUE/FALSE
* Failure: FAIL
*
*---------------------------------------------------------------------------
*/
hbool_t
H5VLobject_is_native(hid_t obj_id)
{
H5VL_object_t *vol_obj = NULL;
hbool_t ret_value = FALSE;
FUNC_ENTER_API(FALSE)
H5TRACE1("b", "i", obj_id);
/* Get the location object for the ID */
if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
if (H5VL_object_is_native(vol_obj, &ret_value) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't determine if object is a native connector object")
done:
FUNC_LEAVE_API(ret_value)
} /* H5VLobject_is_native() */
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Function: H5VLget_file_type * Function: H5VLget_file_type
* *

View File

@ -356,6 +356,17 @@ H5_DLL herr_t H5VLunregister_connector(hid_t connector_id);
* \since 1.12.0 * \since 1.12.0
*/ */
H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, uint64_t *flags); H5_DLL herr_t H5VLquery_optional(hid_t obj_id, H5VL_subclass_t subcls, int opt_type, uint64_t *flags);
/**
* \ingroup H5VL
* \brief Determines whether an object ID represents a native
* VOL connector object.
*
* \param[in] obj_id Object identifier
* \return \hbool_t
*
* \since 1.12.1
*/
H5_DLL hbool_t H5VLobject_is_native(hid_t obj_id);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -67,28 +67,29 @@ Languages:
Features: Features:
--------- ---------
Parallel HDF5: @PARALLEL@ Parallel HDF5: @PARALLEL@
Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@
Large Parallel I/O: @LARGE_PARALLEL_IO@ Large Parallel I/O: @LARGE_PARALLEL_IO@
High-level library: @HDF5_HL@ High-level library: @HDF5_HL@
Build HDF5 Tests: @HDF5_TESTS@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@
Build HDF5 Tools: @HDF5_TOOLS@ Build HDF5 Tests: @HDF5_TESTS@
Threadsafety: @THREADSAFE@ Build HDF5 Tools: @HDF5_TOOLS@
Default API mapping: @DEFAULT_API_VERSION@ Threadsafety: @THREADSAFE@
With deprecated public symbols: @DEPRECATED_SYMBOLS@ Default API mapping: @DEFAULT_API_VERSION@
I/O filters (external): @EXTERNAL_FILTERS@ With deprecated public symbols: @DEPRECATED_SYMBOLS@
MPE: @MPE@ I/O filters (external): @EXTERNAL_FILTERS@
Map (H5M) API: @MAP_API@ MPE: @MPE@
Direct VFD: @DIRECT_VFD@ Map (H5M) API: @MAP_API@
Mirror VFD: @MIRROR_VFD@ Direct VFD: @DIRECT_VFD@
(Read-Only) S3 VFD: @ROS3_VFD@ Mirror VFD: @MIRROR_VFD@
(Read-Only) HDFS VFD: @HAVE_LIBHDFS@ (Read-Only) S3 VFD: @ROS3_VFD@
dmalloc: @HAVE_DMALLOC@ (Read-Only) HDFS VFD: @HAVE_LIBHDFS@
Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@ dmalloc: @HAVE_DMALLOC@
API tracing: @TRACE_API@ Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
Using memory checker: @USINGMEMCHECKER@ API tracing: @TRACE_API@
Memory allocation sanity checks: @MEMORYALLOCSANITYCHECK@ Using memory checker: @USINGMEMCHECKER@
Function stack tracing: @CODESTACK@ Memory allocation sanity checks: @MEMORYALLOCSANITYCHECK@
Use file locking: @DESIRED_FILE_LOCKING@ Function stack tracing: @CODESTACK@
Strict file format checks: @STRICT_FORMAT_CHECKS@ Use file locking: @DESIRED_FILE_LOCKING@
Optimization instrumentation: @INSTRUMENT_LIBRARY@ Strict file format checks: @STRICT_FORMAT_CHECKS@
Optimization instrumentation: @INSTRUMENT_LIBRARY@