hdf5/test/fillval.c

2706 lines
91 KiB
C
Raw Normal View History

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*
2019-08-16 05:46:00 +08:00
* Purpose: Tests dataset fill values.
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*/
#include "h5test.h"
#include "H5srcdir.h"
[svn-r859] Changes since 19981030 ---------------------- ./MANIFEST Added new Pablo files HDF5record_RT.h and ProcIDs.h ./acconfig.h ./configure [REGENERATED] ./configure.in ./src/H5.c ./src/H5Vprivate.h ./src/H5config.h.in [REGENERATED] ./src/H5private.h ./src/H5public.h ./test/big.c Added more configuration stuff for the Win32 environment. Removed all the #ifdef WIN32 from the source and replaced them with OS-independent stuff. Specifics follow: Check for non-Posix.1 `st_blocks' field in `struct stat' which is used by the big file test to decide if the file system supports holes. If the st_blocks field isn't present then we just skip the test. Configure checks for <io.h> <sys/resource.h> <sys/time.h> and <winsock.h> and defines HAVE_IO_H, HAVE_SYS_RESOURCE_H, HAVE_SYS_TIME_H and HAVE_WINSOCK_H when they're found. Configure checks whether both <sys/time.h> and <time.h> can be included and defines SYS_TIME_WITH_TIME if so. Otherwise include only <sys/time.h> or <time.h> even if both exist. Configure checks sizeof(__int64) and defines SIZEOF___INT64 to the result or to zero if __int64 isn't defined. The source uses `long long' in preference to `__int64'. Removed null WIN32 definition for `inline' since such a definition already exists in H5config.h Protected gettimeofday() calls in debugging code with HAVE_GETTIMEOFDAY instead of WIN32. ./src/H5F.c ./src/H5Flow.c ./src/H5Fmpio.c ./src/H5Fsec2.c ./src/H5Fstdio.h ./src/H5P.c ./src/H5Tconv.c ./src/H5private.h Removed #include of system files from library source files and consolodated them into H5private.h where they're protected by various configuration macros (most of them were duplicated there already anyway). ./test/big.c ./test/chunk.c ./test/cmpd_dset.c ./test/dsets.c ./test/dtypes.c ./test/extend.c ./test/external.c ./test/fillval.c ./test/flush1.c ./test/flush2.c ./test/iopipe.c ./test/links.c ./test/mount.c ./test/mtime.c ./test/overhead.c ./test/ragged.c ./test/shtype.c ./test/unlink.c Protected system #include's with #ifdef's from H5config.h. Undefined NDEBUG since some of the tests rely on assert() to check return values. Removed WIN32 definitions for __unused__ since this can be controlled by the definition of HAVE_ATTRIBUTE in H5config.h ./test/testhdf5.h Removed the CLEAN_CMD definition because we no longer use it. Albert's cleanup() functions replaced it. ./test/fillval.c Initialized auto hid_t variables to fix warnings in error recovery code when data flow analysis is turned on in compilers. ./test/h5tools.c Initialized an auto variable to fix a compiler warning. ./test/chunk.c ./test/ragged.c The WIN32 had some unsigned variables changed to signed because the compiler generates warnings when coercing unsigned to double(?). I changed them back to unsigned because they really are unsigned quantities. If this the change was just to shut up extraneous warnings then perhaps a compiler flag can do the same; otherwise if the compiler generates bad code then we should supply a patch file instead messing up source code with bug work-arounds. ./src/H5detect.c Protected system #include's with #ifdef's from H5config.h thereby removing a WIN32. If getpwuid() doesn't exist (HAVE_GETPWUID) then we assume that `struct passwd' doesn't exist either (we don't really need it in that case). The H5T_NATIVE_LLONG and H5T_NATIVE_ULLONG are defined in terms of `long long' or else `__int64' or else `long' depending on what's available. ./src/H5Flow.c ./src/H5Ofill.c Added __unused__ to some function arguments that aren't used when assertions are turned off. ./src/H5V.c Changed an auto variable name in some hand-inlined code to get rid of a warning about the variable shadowing a previous auto.
1998-11-03 01:58:28 +08:00
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*
* Define NO_FILLING if you want to compare how this test works when there is
* no fill value (that is, when the fill value is zero).
*/
/* #define NO_FILLING */
static const char *FILENAME[] = {"fillval_1", "fillval_2", "fillval_3", "fillval_4", "fillval_5",
"fillval_6", "fillval_7", "fillval_8", "fillval_9", NULL};
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Common type for compound datatype operations */
typedef struct {
float a;
int x;
double y;
char z;
} comp_datatype;
/* Common type for compound+vl datatype operations */
typedef struct {
2020-09-30 22:27:10 +08:00
int x;
char *a;
char *b;
int y;
} comp_vl_datatype;
/* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory
* for version 1.4(after 1.4.3). To get this data file, simply compile
* gen_old_fill.c with HDF5 library (before v1.5) and run it. */
#define FILE_COMPATIBLE "fill_old.h5"
2020-09-30 22:27:10 +08:00
#define FILE_NAME_RAW "fillval.raw"
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*-------------------------------------------------------------------------
* Function: create_compound_type
*
* Purpose: create a compound datatype
*
* Return: Success: datatype ID
*
* Failure: -1
*
*-------------------------------------------------------------------------
*/
2020-09-30 22:27:10 +08:00
static hid_t
create_compound_type(void)
{
hid_t ret_value = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
if ((ret_value = H5Tcreate(H5T_COMPOUND, sizeof(comp_datatype))) < 0)
goto error;
if (H5Tinsert(ret_value, "a", HOFFSET(comp_datatype, a), H5T_NATIVE_FLOAT) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5Tinsert(ret_value, "x", HOFFSET(comp_datatype, x), H5T_NATIVE_INT) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5Tinsert(ret_value, "y", HOFFSET(comp_datatype, y), H5T_NATIVE_DOUBLE) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5Tinsert(ret_value, "z", HOFFSET(comp_datatype, z), H5T_NATIVE_CHAR) < 0)
goto error;
return ret_value;
error:
H5E_BEGIN_TRY
{
H5Tclose(ret_value);
}
H5E_END_TRY
return -1;
}
/*-------------------------------------------------------------------------
* Function: create_compound_vl_type
*
* Purpose: create a compound+vl datatype
*
* Return: Success: datatype ID
*
* Failure: -1
*
*-------------------------------------------------------------------------
*/
static hid_t
create_compound_vl_type(void)
{
hid_t str_id = H5I_INVALID_HID; /* Datatype for VL-string fields */
hid_t ret_value = H5I_INVALID_HID;
/* Create a string datatype */
2020-09-30 22:27:10 +08:00
if ((str_id = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Tset_size(str_id, H5T_VARIABLE) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if ((ret_value = H5Tcreate(H5T_COMPOUND, sizeof(comp_vl_datatype))) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Tinsert(ret_value, "x", HOFFSET(comp_vl_datatype, x), H5T_NATIVE_INT) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Tinsert(ret_value, "a", HOFFSET(comp_vl_datatype, a), str_id) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Tinsert(ret_value, "b", HOFFSET(comp_vl_datatype, b), str_id) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Tinsert(ret_value, "y", HOFFSET(comp_vl_datatype, y), H5T_NATIVE_INT) < 0)
TEST_ERROR;
/* Close string datatype */
2020-09-30 22:27:10 +08:00
if (H5Tclose(str_id) < 0)
TEST_ERROR;
return ret_value;
error:
2020-09-30 22:27:10 +08:00
H5E_BEGIN_TRY
{
H5Tclose(str_id);
H5Tclose(ret_value);
2020-09-30 22:27:10 +08:00
}
H5E_END_TRY
return -1;
} /* end create_compound_vl_type() */
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_getset
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value()
* functions.
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Failure: number of errors
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
*-------------------------------------------------------------------------
*/
static int
test_getset(void)
{
hid_t dcpl = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
int fill_i;
hid_t type_ss = H5I_INVALID_HID, type_si = H5I_INVALID_HID;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
struct fill_si {
2020-09-30 22:27:10 +08:00
int v1, v2;
} fill_si;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
struct fill_ss {
2020-09-30 22:27:10 +08:00
short v1, v2;
} fill_ss, fill_ss_rd;
TESTING("property lists");
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*
* Create the dataset creation property list and the data types that will
* be used during this test.
*/
2020-09-30 22:27:10 +08:00
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto error;
if ((type_ss = H5Tcreate(H5T_COMPOUND, sizeof fill_ss)) < 0 ||
H5Tinsert(type_ss, "v1", HOFFSET(struct fill_ss, v1), H5T_NATIVE_SHORT) < 0 ||
H5Tinsert(type_ss, "v2", HOFFSET(struct fill_ss, v2), H5T_NATIVE_SHORT) < 0) {
goto error;
}
if ((type_si = H5Tcreate(H5T_COMPOUND, sizeof fill_si)) < 0 ||
H5Tinsert(type_si, "v1", HOFFSET(struct fill_si, v1), H5T_NATIVE_INT) < 0 ||
H5Tinsert(type_si, "v2", HOFFSET(struct fill_si, v2), H5T_NATIVE_INT) < 0) {
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*
* Reading the fill value from a dataset creation property list that has
* no fill value should result in a failure.
*/
H5E_BEGIN_TRY
{
H5Pget_fill_value(dcpl, H5T_NATIVE_INT, &fill_i);
}
H5E_END_TRY
2020-09-30 22:27:10 +08:00
if (fill_i != 0) {
H5_FAILED();
puts(" H5Pget_fill_value() should return default 0");
2020-09-30 22:27:10 +08:00
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
/*
* Set the fill value using a struct as the data type.
*/
fill_ss.v1 = 1111;
fill_ss.v2 = 2222;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, type_ss, &fill_ss) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*
* Get the fill value using the same data type that was used to set it.
*/
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, type_ss, &fill_ss_rd) < 0)
goto error;
if (fill_ss.v1 != fill_ss_rd.v1 || fill_ss.v2 != fill_ss_rd.v2) {
H5_FAILED();
puts(" Failed to get fill value using same data type that was ");
puts(" used to set the fill value.");
2020-09-30 22:27:10 +08:00
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
/*
* Get the fill value using some other data type.
*/
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, type_si, &fill_si) < 0)
goto error;
if (fill_ss.v1 != fill_si.v1 || fill_ss.v2 != fill_si.v2) {
H5_FAILED();
puts(" Failed to get fill value using a data type other than what");
puts(" was used to set the fill value.");
2020-09-30 22:27:10 +08:00
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
/*
* Reset the fill value
*/
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, type_si, &fill_si) < 0)
goto error;
if (H5Pget_fill_value(dcpl, type_ss, &fill_ss) < 0)
goto error;
if (fill_si.v1 != fill_ss.v1 || fill_si.v2 != fill_ss.v2) {
H5_FAILED();
puts(" Resetting the fill value was unsuccessful.");
2020-09-30 22:27:10 +08:00
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
/* Success */
2020-09-30 22:27:10 +08:00
if (H5Pclose(dcpl) < 0)
goto error;
if (H5Tclose(type_si) < 0)
goto error;
if (H5Tclose(type_ss) < 0)
goto error;
PASSED();
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
return 0;
2020-09-30 22:27:10 +08:00
error:
H5E_BEGIN_TRY
{
H5Pclose(dcpl);
H5Tclose(type_si);
H5Tclose(type_ss);
}
H5E_END_TRY
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
return 1;
}
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_getset_vl
*
2019-08-16 05:46:00 +08:00
* Purpose: Tests the H5Pget_fill_value() and H5Pset_fill_value()
* functions, using variable-length datatype.
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: number of errors
*
*-------------------------------------------------------------------------
*/
static int
test_getset_vl(hid_t fapl)
{
hsize_t dims[1] = {2};
hid_t fileid = (H5I_INVALID_HID), spaceid = (H5I_INVALID_HID), dtypeid = (H5I_INVALID_HID),
datasetid = (H5I_INVALID_HID), plistid = (H5I_INVALID_HID);
char fill_value[] = "aaaa";
char orig_fill_value[] = "aaaa";
char *f1 = fill_value;
char *f2;
char filename[1024];
TESTING("property lists, with variable-length datatype");
/* Create string type. */
2020-09-30 22:27:10 +08:00
if ((dtypeid = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Tset_size(dtypeid, H5T_VARIABLE) < 0)
TEST_ERROR;
/* Set up dataset creation property list, with fill value */
2020-09-30 22:27:10 +08:00
if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(plistid, dtypeid, &f1) < 0)
TEST_ERROR;
/* Modify original fill value string */
fill_value[0] = 'b';
/* Retrieve fill value from property */
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(plistid, dtypeid, &f2) < 0)
TEST_ERROR;
/* Verify that the fill value is the original value */
if (strcmp(f2, orig_fill_value) != 0)
TEST_ERROR;
/* Release the fill value retrieved */
free(f2);
/* Open file. */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
2020-09-30 22:27:10 +08:00
if ((fileid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write an dataset of this type. */
2020-09-30 22:27:10 +08:00
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if ((datasetid = H5Dcreate2(fileid, "Dataset", dtypeid, spaceid, H5P_DEFAULT, plistid, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Close IDs (except datatype) */
2020-09-30 22:27:10 +08:00
if (H5Dclose(datasetid) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Pclose(plistid) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Sclose(spaceid) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Fclose(fileid) < 0)
TEST_ERROR;
/* Re-open file, group & dataset */
2020-09-30 22:27:10 +08:00
if ((fileid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if ((datasetid = H5Dopen2(fileid, "Dataset", H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Get dataset's creation property list */
2020-09-30 22:27:10 +08:00
if ((plistid = H5Dget_create_plist(datasetid)) < 0)
TEST_ERROR;
/* Query fill value */
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(plistid, dtypeid, &f2) < 0)
TEST_ERROR;
/* Verify that the fill value is the original value */
if (strcmp(f2, orig_fill_value) != 0)
TEST_ERROR;
/* Release the fill value retrieved */
free(f2);
/* Close IDs */
2020-09-30 22:27:10 +08:00
if (H5Dclose(datasetid) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Fclose(fileid) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Pclose(plistid) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Tclose(dtypeid) < 0)
TEST_ERROR;
PASSED();
return 0;
2020-09-30 22:27:10 +08:00
error:
H5E_BEGIN_TRY
{
}
H5E_END_TRY
return 1;
} /* end test_getset_vl() */
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_create
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Purpose: Tests creating datasets that have fill values.
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Failure: number of errors
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
*-------------------------------------------------------------------------
*/
static int
test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
{
hid_t file = H5I_INVALID_HID, space = H5I_INVALID_HID, dcpl = H5I_INVALID_HID,
comp_type_id = H5I_INVALID_HID;
hid_t dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID, dset3 = H5I_INVALID_HID, dset4 = H5I_INVALID_HID,
dset5 = H5I_INVALID_HID, dset6 = H5I_INVALID_HID,
/* dset7=H5I_INVALID_HID, */ dset8 = H5I_INVALID_HID, dset9 = H5I_INVALID_HID,
dset10 = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
hsize_t cur_size[5] = {2, 8, 8, 4, 2};
hsize_t ch_size[5] = {1, 1, 1, 4, 1};
short rd_s, fill_s = 0x1234;
long rd_l, fill_l = 0x4321;
char filename[1024];
H5D_space_status_t allocation;
H5D_alloc_time_t alloc_time;
2019-08-16 05:46:00 +08:00
H5D_fill_time_t fill_time;
2020-09-30 22:27:10 +08:00
comp_datatype rd_c, fill_ctype;
2020-09-30 22:27:10 +08:00
if (H5D_CHUNKED == layout) {
TESTING("chunked dataset creation");
}
else if (H5D_COMPACT == layout) {
TESTING("compact dataset creation");
2020-09-30 22:27:10 +08:00
}
else {
TESTING("contiguous dataset creation");
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
/*
* Create a file.
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
*/
h5_fixname(base_name, fapl, filename, sizeof filename);
2020-09-30 22:27:10 +08:00
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
if ((space = H5Screate_simple(5, cur_size, cur_size)) < 0)
goto error;
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto error;
if (H5D_CHUNKED == layout) {
if (H5Pset_chunk(dcpl, 5, ch_size) < 0)
goto error;
}
else if (H5D_COMPACT == layout) {
if (H5Pset_layout(dcpl, H5D_COMPACT) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
/* Create a compound datatype */
2020-09-30 22:27:10 +08:00
if ((comp_type_id = create_compound_type()) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
/* I. Test cases for late space allocation except compact dataset */
2020-09-30 22:27:10 +08:00
if (H5D_COMPACT != layout) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0)
goto error;
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
/* 1. Compound datatype test */
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, comp_type_id, &fill_ctype) < 0)
goto error;
fill_ctype.y = 4444;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, comp_type_id, &fill_ctype) < 0)
goto error;
if ((dset9 = H5Dcreate2(file, "dset9", comp_type_id, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
/* The three datasets test three fill
* conversion paths: small to large, large to small, and no conversion.
* They depend on `short' being smaller than `long'.
*/
/* 2. Small to large fill conversion */
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#ifndef NO_FILLING
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, H5T_NATIVE_SHORT, &fill_s) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#endif
2020-09-30 22:27:10 +08:00
if ((dset1 = H5Dcreate2(file, "dset1", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
2020-09-30 22:27:10 +08:00
/* 3. Large to small fill conversion */
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#ifndef NO_FILLING
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#endif
2020-09-30 22:27:10 +08:00
if ((dset2 = H5Dcreate2(file, "dset2", H5T_NATIVE_SHORT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
2020-09-30 22:27:10 +08:00
/* 4. No conversion */
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#ifndef NO_FILLING
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#endif
2020-09-30 22:27:10 +08:00
if ((dset3 = H5Dcreate2(file, "dset3", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 5. late space allocation and never write fill value */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
if ((dset4 = H5Dcreate2(file, "dset4", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 6. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC.
* Supposed to fail. */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0)
goto error;
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
H5E_BEGIN_TRY
{
if (H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT) != FAIL)
goto error;
2020-09-30 22:27:10 +08:00
}
H5E_END_TRY
}
/* II. Test early space allocation cases */
2020-09-30 22:27:10 +08:00
if (H5Pclose(dcpl) < 0)
goto error;
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto error;
if (H5D_CHUNKED == layout) {
if (H5Pset_chunk(dcpl, 5, ch_size) < 0)
goto error;
}
2020-09-30 22:27:10 +08:00
else if (H5D_COMPACT == layout) {
if (H5Pset_layout(dcpl, H5D_COMPACT) < 0)
goto error;
}
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
goto error;
/* 1. Compound datatype test */
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, comp_type_id, &fill_ctype) < 0)
goto error;
fill_ctype.y = 4444;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, comp_type_id, &fill_ctype) < 0)
goto error;
if ((dset8 = H5Dcreate2(file, "dset8", comp_type_id, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0)
goto error;
/* 2. Never write fill value */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
if ((dset5 = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 3. Write fill value at space allocation time */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
if ((dset6 = H5Dcreate2(file, "dset6", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC.
* Supposed to fail. */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0)
goto error;
H5E_BEGIN_TRY
{
if (H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT) != FAIL)
goto error;
2020-09-30 22:27:10 +08:00
}
H5E_END_TRY
/*
* Test that a dataset with an undefined fill value can be
* created and then re-opened after the file it is in has
* been closed and re-opened. This is to test for a bug that
* was introduced in the fill value object header message
* decoding logic.
*/
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0)
goto error;
if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, NULL) < 0)
goto error;
if ((dset10 = H5Dcreate2(file, "dset10", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
/* Close everything */
2020-09-30 22:27:10 +08:00
if (H5D_COMPACT != layout) {
if (H5Dclose(dset1) < 0)
goto error;
if (H5Dclose(dset2) < 0)
goto error;
if (H5Dclose(dset3) < 0)
goto error;
if (H5Dclose(dset4) < 0)
goto error;
if (H5Dclose(dset9) < 0)
goto error;
}
if (H5Dclose(dset5) < 0)
goto error;
if (H5Dclose(dset6) < 0)
goto error;
if (H5Dclose(dset8) < 0)
goto error;
if (H5Dclose(dset10) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5Sclose(space) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
if (H5Fclose(file) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
/* Open the file and get the dataset fill value from each dataset */
2020-09-30 22:27:10 +08:00
if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
/* I. Check cases for late space allocation except compact dataset */
2020-09-30 22:27:10 +08:00
if (H5D_COMPACT != layout) {
/* 1. Large to small conversion */
2020-09-30 22:27:10 +08:00
if ((dset1 = H5Dopen2(file, "dset1", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl = H5Dget_create_plist(dset1)) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#ifndef NO_FILLING
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, H5T_NATIVE_SHORT, &rd_s) < 0)
goto error;
if (rd_s != fill_s) {
H5_FAILED();
printf(" %d: Got a different fill value than what was set.", __LINE__);
printf(" Got %d, set %d\n", rd_s, fill_s);
2020-09-30 22:27:10 +08:00
goto error;
}
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#endif
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset1) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* 2. Small to large conversion */
2020-09-30 22:27:10 +08:00
if ((dset2 = H5Dopen2(file, "dset2", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl = H5Dget_create_plist(dset2)) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#ifndef NO_FILLING
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0)
goto error;
if (rd_l != fill_l) {
H5_FAILED();
printf(" %d: Got a different fill value than what was set.", __LINE__);
printf(" Got %ld, set %ld\n", rd_l, fill_l);
2020-09-30 22:27:10 +08:00
goto error;
}
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#endif
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset2) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
/* 3. No conversion */
2020-09-30 22:27:10 +08:00
if ((dset3 = H5Dopen2(file, "dset3", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl = H5Dget_create_plist(dset3)) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#ifndef NO_FILLING
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0)
goto error;
if (rd_l != fill_l) {
H5_FAILED();
printf(" %d: Got a different fill value than what was set.", __LINE__);
printf(" Got %ld, set %ld\n", rd_l, fill_l);
2020-09-30 22:27:10 +08:00
goto error;
}
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
#endif
2020-09-30 22:27:10 +08:00
if (H5Pget_alloc_time(dcpl, &alloc_time) < 0)
goto error;
if (H5Pget_fill_time(dcpl, &fill_time) < 0)
goto error;
if (alloc_time != H5D_ALLOC_TIME_LATE) {
H5_FAILED();
puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
printf(" Got %d\n", alloc_time);
}
2020-09-30 22:27:10 +08:00
if (fill_time != H5D_FILL_TIME_ALLOC) {
H5_FAILED();
puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
printf(" Got %d\n", fill_time);
}
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset3) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
[svn-r745] Changes since 19981002 ---------------------- ./doc/html/H5.format.html ./src/H5HG.c Fixed a bug in the global heap that caused H5HG_read() to write past the end of the buffer in certain cases. ./test/big.c The test is skipped if hdf5 was configured with `--disable-hsizet'. ./src/H5Ofill.c Data type conversions are implemented for the fill value. ./src/H5.c Tracing prints one of H5P_FILE_CREATE, H5P_FILE_ACCESS, H5P_DATASET_CREATE, H5P_DATASET_XFER, or H5P_MOUNT instead of the more cryptic H5I_TEMPLATE_* constants. ./src/H5D.c Removed prototype for H5D_find_name(). ./src/H5I.c The GROUP_MASK and ID_MASK are both calculated from GROUP_BITS instead of being set by hand. We don't use the sign bit of hid_t; all valid hid_t values are positive so we can say things like `if ((file=H5Fopen(...))<0)'. Changed `(int)pow(2.0,x)' to `1<<x' so we don't have to worry about rounding. Fixed H5I_get_type() so it doesn't always fail an assertion. ./src/H5E.c ./src/H5Epublic.h Added minor error H5E_MOUNT ./src/H5F.c ./src/H5Fprivate.h Added H5Fmount() and H5Funmount(). Mounting and unmounting works as documented but some of the other things aren't implemented yet, the biggest being current working groups always acting on the root of the mount tree, and H5Fclose() closing the entire tree. The rest of the stuff will be added shortly... ./src/H5P.c ./src/H5Ppublic.h Added the H5P_MOUNT property list but haven't implemented any particular properties for it yet. ./src/H5Gstab.c Hard links across files return an error instead of failing an assertion.
1998-10-09 01:13:14 +08:00
/* 4. late space allocation and never write fill value */
2020-09-30 22:27:10 +08:00
if ((dset4 = H5Dopen2(file, "dset4", H5P_DEFAULT)) < 0)
goto error;
if (H5Dget_space_status(dset4, &allocation) < 0)
goto error;
if (layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) {
H5_FAILED();
puts(" Got allocated space instead of unallocated.");
printf(" Got %d\n", allocation);
goto error;
}
2020-09-30 22:27:10 +08:00
if ((dcpl = H5Dget_create_plist(dset4)) < 0)
goto error;
if (H5Pget_alloc_time(dcpl, &alloc_time) < 0)
goto error;
if (H5Pget_fill_time(dcpl, &fill_time) < 0)
goto error;
if (alloc_time != H5D_ALLOC_TIME_LATE) {
H5_FAILED();
puts(" Got non-H5D_ALLOC_TIME_LATE space allocation time.");
printf(" Got %d\n", alloc_time);
}
2020-09-30 22:27:10 +08:00
if (fill_time != H5D_FILL_TIME_NEVER) {
H5_FAILED();
puts(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
printf(" Got %d\n", fill_time);
}
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset4) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
/* 5. Compound datatype test */
2020-09-30 22:27:10 +08:00
if ((dset9 = H5Dopen2(file, "dset9", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl = H5Dget_create_plist(dset9)) < 0)
goto error;
if (H5Pget_fill_value(dcpl, comp_type_id, &rd_c) < 0)
goto error;
if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 ||
rd_c.z != '\0') {
H5_FAILED();
puts(" Got wrong fill value");
printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x,
rd_c.z);
}
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset9) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
}
/* II. Check early space allocation cases */
/* 1. Never write fill value */
2020-09-30 22:27:10 +08:00
if ((dset5 = H5Dopen2(file, "dset5", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl = H5Dget_create_plist(dset5)) < 0)
goto error;
if (H5Dget_space_status(dset5, &allocation) < 0)
goto error;
if (layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) {
H5_FAILED();
printf(" %d: Got unallocated space instead of allocated.\n", __LINE__);
printf(" Got %d\n", allocation);
goto error;
}
2020-09-30 22:27:10 +08:00
if (H5Pget_alloc_time(dcpl, &alloc_time) < 0)
goto error;
if (alloc_time != H5D_ALLOC_TIME_EARLY) {
H5_FAILED();
puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
printf(" Got %d\n", alloc_time);
}
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_time(dcpl, &fill_time) < 0)
goto error;
if (fill_time != H5D_FILL_TIME_NEVER) {
H5_FAILED();
puts(" Got non-H5D_FILL_TIME_NEVER fill value write time.");
printf(" Got %d\n", fill_time);
}
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset5) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
/* 2. test writing fill value at space allocation time */
2020-09-30 22:27:10 +08:00
if ((dset6 = H5Dopen2(file, "dset6", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl = H5Dget_create_plist(dset6)) < 0)
goto error;
if (H5Dget_space_status(dset6, &allocation) < 0)
goto error;
if (layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) {
H5_FAILED();
printf(" %d: Got unallocated space instead of allocated.\n", __LINE__);
printf(" Got %d\n", allocation);
goto error;
}
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_value(dcpl, H5T_NATIVE_LONG, &rd_l) < 0)
goto error;
if (rd_l != fill_l) {
H5_FAILED();
printf(" %d: Got a different fill value than what was set.", __LINE__);
printf(" Got %ld, set %ld\n", rd_l, fill_l);
goto error;
}
2020-09-30 22:27:10 +08:00
if (H5Pget_alloc_time(dcpl, &alloc_time) < 0)
goto error;
if (alloc_time != H5D_ALLOC_TIME_EARLY) {
H5_FAILED();
puts(" Got non-H5D_ALLOC_TIME_EARLY space allocation time.");
printf(" Got %d\n", alloc_time);
}
2020-09-30 22:27:10 +08:00
if (H5Pget_fill_time(dcpl, &fill_time) < 0)
goto error;
if (fill_time != H5D_FILL_TIME_ALLOC) {
H5_FAILED();
puts(" Got non-H5D_FILL_TIME_ALLOC fill value write time.");
printf(" Got %d\n", fill_time);
}
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset6) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
/* 3. Compound datatype test */
2020-09-30 22:27:10 +08:00
if ((dset8 = H5Dopen2(file, "dset8", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl = H5Dget_create_plist(dset8)) < 0)
goto error;
if (H5Pget_fill_value(dcpl, comp_type_id, &rd_c) < 0)
goto error;
if (!H5_FLT_ABS_EQUAL(rd_c.a, 0) || !H5_DBL_ABS_EQUAL(rd_c.y, fill_ctype.y) || rd_c.x != 0 ||
rd_c.z != '\0') {
H5_FAILED();
puts(" Got wrong fill value");
printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", (double)rd_c.a, rd_c.y, rd_c.x,
rd_c.z);
}
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset8) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
/*
* Check that the dataset with an undefined fill value can
* be opened.
*/
if ((dset10 = H5Dopen2(file, "dset10", H5P_DEFAULT)) < 0)
goto error;
if (H5Dclose(dset10) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5Fclose(file) < 0)
goto error;
PASSED();
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
return 0;
error:
2020-09-30 22:27:10 +08:00
H5E_BEGIN_TRY
{
H5Pclose(dcpl);
H5Sclose(space);
if (H5D_COMPACT != layout) {
H5Dclose(dset1);
H5Dclose(dset2);
H5Dclose(dset3);
H5Dclose(dset4);
H5Dclose(dset9);
}
H5Dclose(dset5);
H5Dclose(dset6);
2020-09-30 22:27:10 +08:00
H5Dclose(dset8);
H5Dclose(dset10);
2020-09-30 22:27:10 +08:00
H5Fclose(file);
}
H5E_END_TRY
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
return 1;
}
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_rdwr_cases
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Purpose: Tests fill values read and write for datasets.
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Failure: 1
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
*-------------------------------------------------------------------------
*/
static int
2020-09-30 22:27:10 +08:00
test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_fill_time_t fill_time,
H5D_layout_t layout, H5T_class_t datatype, hid_t ctype_id)
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
{
hid_t fspace = H5I_INVALID_HID, mspace = H5I_INVALID_HID, dset1 = H5I_INVALID_HID,
dset2 = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
hsize_t cur_size[5] = {2, 8, 8, 4, 2};
hsize_t one[5] = {1, 1, 1, 1, 1};
hsize_t hs_size[5], hs_stride[5];
hsize_t hs_offset[5], nelmts;
int fillval = (-1), val_rd, should_be;
int i, j, *buf = NULL, odd;
unsigned u;
comp_datatype rd_c, fill_c, should_be_c;
comp_datatype *buf_c = NULL;
H5D_space_status_t allocation = H5D_SPACE_STATUS_ERROR;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
testpar/t_2Gio.c: Fix a typo that I think was introduced by a previous warnings PR. An array element was assigned to itself---shape[2]Â =Â shape[2];---instead of being assigned to chunk[2]. fortran/src/H5Pf.c: move conditional compilation controlled by H5_NO_DEPRECATED_SYMBOLS outside of a function for readability. fortran/src/H5match_types.c: put a variable's declaration under the same conditional compilation (H5_FORTRAN_HAVE_C_LONG_DOUBLE) as its use. For now, skip compilation of some unused debug dump routines in the JNI. While I'm in the JNI, delete a set-but-unused variable. src/H5Z.c: condition a variable declaration on H5_NO_DEPRECATED_SYMBOLS so that it's not declared but unused or vice versa. test/cache_common.h: add an #include in to get some symbols we need to avoid implicit declaration warnings. test/dsets.c: use a more conventional conditional-compilation syntax. test/dt_arith.c, test/fillval.c: initialize a bunch of uninitialized variables before use. test/vfd.c: pass the expected type of `void **` to posix_memalign(3) instead of `int **`. testpar/t_bigio.c: explicitly compare with 0 instead of using ! when "equal to 0?" is the question not "is false?" Repair some indentation while I'm here. testpar/testpar.h: repair misaligned line-continuation backslashes in a macro that probably should be a function so that we don't have to fiddle with the line continuation to begin with. tools/src/h5repack/h5repack_main.c: fix some compiler fussing about enums. tools/test/perform/pio_engine.c: the compiler fusses if you cast a function call returning double directly to off_t. It's ok if you cast a variable that's a double to off_t, however. Write and use a new function, sqrto(), to avoid the cast warnings.
2020-01-30 01:43:55 +08:00
fill_c.a = 0;
fill_c.x = 0;
fill_c.y = 0;
fill_c.z = 0;
2020-09-30 22:27:10 +08:00
if (datatype == H5T_INTEGER) {
fillval = *(int *)_fillval;
}
2020-09-30 22:27:10 +08:00
else if (datatype == H5T_COMPOUND) {
fill_c.a = ((comp_datatype *)_fillval)->a;
fill_c.x = ((comp_datatype *)_fillval)->x;
fill_c.y = ((comp_datatype *)_fillval)->y;
fill_c.z = ((comp_datatype *)_fillval)->z;
}
else {
puts("Invalid type for test");
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
/* Create dataset */
2020-09-30 22:27:10 +08:00
if ((fspace = H5Screate_simple(5, cur_size, cur_size)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (datatype == H5T_INTEGER &&
(dset1 = H5Dcreate2(file, dname, H5T_NATIVE_INT, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (datatype == H5T_COMPOUND &&
(dset2 = H5Dcreate2(file, dname, ctype_id, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Read some data and make sure it's the fill value */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
for (j = 0; j < 5; j++)
hs_offset[j] = (hsize_t)HDrand() % cur_size[j];
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
goto error;
2020-09-30 22:27:10 +08:00
/* case for atomic datatype */
if (datatype == H5T_INTEGER) {
if (H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0)
goto error;
if (fill_time != H5D_FILL_TIME_NEVER && val_rd != fillval) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
fprintf(stdout,
" Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE
"}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], val_rd,
fillval);
2020-09-30 22:27:10 +08:00
goto error;
}
/* case for compound datatype */
2019-08-16 05:46:00 +08:00
}
2020-09-30 22:27:10 +08:00
else if (datatype == H5T_COMPOUND) {
if (H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, &rd_c) < 0)
goto error;
if (fill_time != H5D_FILL_TIME_NEVER &&
(!H5_FLT_ABS_EQUAL(rd_c.a, fill_c.a) || rd_c.x != fill_c.x ||
!H5_DBL_ABS_EQUAL(rd_c.y, fill_c.y) || rd_c.z != fill_c.z)) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
fprintf(stdout,
" Elmt={%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE ",%" PRIuHSIZE
"}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], (double)rd_c.a,
rd_c.x, rd_c.y, rd_c.z, (double)fill_c.a, fill_c.x, fill_c.y, fill_c.z);
goto error;
}
}
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Select all odd data locations in the file dataset */
2020-09-30 22:27:10 +08:00
for (i = 0, nelmts = 1; i < 5; i++) {
hs_size[i] = cur_size[i] / 2;
hs_offset[i] = 0;
hs_stride[i] = 2;
nelmts *= hs_size[i];
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, hs_size, hs_size)) < 0)
goto error;
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, hs_stride, hs_size, NULL) < 0)
goto error;
/* Read non-contiguous selection from empty dataset */
/* case for atomic datatype */
2020-09-30 22:27:10 +08:00
if (datatype == H5T_INTEGER) {
/*check for overflow*/
assert((nelmts * sizeof(int)) == (hsize_t)((size_t)(nelmts * sizeof(int))));
buf = (int *)malloc((size_t)(nelmts * sizeof(int)));
2020-09-30 22:27:10 +08:00
if (H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0)
goto error;
/* Verify values, except if no fill value written */
2020-09-30 22:27:10 +08:00
if (fill_time != H5D_FILL_TIME_NEVER) {
for (u = 0; u < nelmts; u++) {
if (buf[u] != fillval) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
fprintf(stdout,
" Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
", %" PRIuHSIZE "}, read: %u, "
"Fill value: %u\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4], buf[u],
fillval);
goto error;
} /* end if */
2020-09-30 22:27:10 +08:00
} /* end for */
} /* end if */
}
/* case for compound datatype */
2020-09-30 22:27:10 +08:00
else if (datatype == H5T_COMPOUND) {
/*check for overflow*/
assert((nelmts * sizeof(comp_datatype)) == (hsize_t)((size_t)(nelmts * sizeof(comp_datatype))));
buf_c = (comp_datatype *)malloc((size_t)nelmts * sizeof(comp_datatype));
2020-09-30 22:27:10 +08:00
if (H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0)
goto error;
/* Verify values, except if no fill value written */
2020-09-30 22:27:10 +08:00
if (fill_time != H5D_FILL_TIME_NEVER) {
for (u = 0; u < nelmts; u++) {
if (!H5_FLT_ABS_EQUAL(buf_c[u].a, fill_c.a) || buf_c[u].x != fill_c.x ||
!H5_DBL_ABS_EQUAL(buf_c[u].y, fill_c.y) || buf_c[u].z != fill_c.z) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not a fill value.\n", (unsigned)__LINE__);
fprintf(stdout,
" Elmt={%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
", %" PRIuHSIZE "}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], hs_offset[4],
(double)buf_c[u].a, buf_c[u].x, buf_c[u].y, buf_c[u].z, (double)fill_c.a,
fill_c.x, fill_c.y, fill_c.z);
goto error;
} /* end if */
2020-09-30 22:27:10 +08:00
} /* end for */
} /* end if */
}
/* Write to all odd data locations */
/* case for atomic datatype */
2020-09-30 22:27:10 +08:00
if (datatype == H5T_INTEGER) {
for (u = 0; u < nelmts; u++)
buf[u] = 9999;
2020-09-30 22:27:10 +08:00
if (H5Dwrite(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0)
goto error;
}
/* case for compound datatype */
2020-09-30 22:27:10 +08:00
else if (datatype == H5T_COMPOUND) {
2023-06-30 03:33:46 +08:00
memset(buf_c, 0, ((size_t)nelmts * sizeof(comp_datatype)));
2020-09-30 22:27:10 +08:00
for (u = 0; u < nelmts; u++) {
buf_c[u].a = 1111.11F;
buf_c[u].x = 2222;
buf_c[u].y = 3333.3333;
2020-09-30 22:27:10 +08:00
buf_c[u].z = 'd';
}
if (H5Dwrite(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0)
goto error;
}
/* Check if space is allocated */
2020-09-30 22:27:10 +08:00
if (datatype == H5T_INTEGER && H5Dget_space_status(dset1, &allocation) < 0)
goto error;
if (datatype == H5T_COMPOUND && H5Dget_space_status(dset2, &allocation) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (layout == H5D_CONTIGUOUS && allocation != H5D_SPACE_STATUS_ALLOCATED) {
H5_FAILED();
printf(" %d: Got unallocated space instead of allocated.\n", __LINE__);
printf(" Got %d\n", allocation);
goto error;
}
free(buf);
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
buf = NULL;
H5Sclose(mspace);
/* Read some data and make sure it's the right value */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
for (j = 0, odd = 0; j < 5; j++) {
hs_offset[j] = (hsize_t)HDrand() % cur_size[j];
odd += (int)(hs_offset[j] % 2);
} /* end for */
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
2020-09-30 22:27:10 +08:00
/* case for atomic datatype */
if (datatype == H5T_INTEGER) {
if (H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (fill_time == H5D_FILL_TIME_ALLOC) {
should_be = odd ? fillval : 9999;
2020-09-30 22:27:10 +08:00
if (val_rd != should_be) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
"should be: %u\n",
(long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3],
(long)hs_offset[4], val_rd, should_be);
goto error;
}
2020-09-30 22:27:10 +08:00
}
else if (fill_time == H5D_FILL_TIME_NEVER && !odd) {
should_be = 9999;
if (val_rd != should_be) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
"should be: %u\n",
(long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3],
(long)hs_offset[4], val_rd, should_be);
2020-09-30 22:27:10 +08:00
goto error;
}
2019-08-16 05:46:00 +08:00
}
2020-09-30 22:27:10 +08:00
else if (fill_time == H5D_FILL_TIME_NEVER && odd) {
/*Trash data. Don't compare*/
}
} /* end for datatype==H5T_INTEGER */
/* case for compound datatype */
else if (datatype == H5T_COMPOUND) {
if (H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, &rd_c) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (fill_time == H5D_FILL_TIME_ALLOC) {
if (odd) {
should_be_c.a = fill_c.a;
should_be_c.x = fill_c.x;
should_be_c.y = fill_c.y;
should_be_c.z = fill_c.z;
}
else {
should_be_c.a = buf_c[0].a;
should_be_c.x = buf_c[0].x;
should_be_c.y = buf_c[0].y;
should_be_c.z = buf_c[0].z;
}
if (!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x ||
!H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c "
"should be: %f,%d,%f,%c\n",
(long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3],
(long)hs_offset[4], (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a,
should_be_c.x, should_be_c.y, should_be_c.z);
goto error;
2020-09-30 22:27:10 +08:00
}
} /* end for fill_time == H5D_FILL_TIME_ALLOC */
else if (fill_time == H5D_FILL_TIME_NEVER && !odd) {
should_be_c.a = buf_c[0].a;
should_be_c.x = buf_c[0].x;
should_be_c.y = buf_c[0].y;
should_be_c.z = buf_c[0].z;
if (!H5_FLT_ABS_EQUAL(rd_c.a, should_be_c.a) || rd_c.x != should_be_c.x ||
!H5_DBL_ABS_EQUAL(rd_c.y, should_be_c.y) || rd_c.z != should_be_c.z) {
H5_FAILED();
fprintf(stdout, "%u: Value read was not correct.\n", (unsigned)__LINE__);
printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f,%d,%f,%c "
"should be: %f,%d,%f,%c\n",
(long)hs_offset[0], (long)hs_offset[1], (long)hs_offset[2], (long)hs_offset[3],
(long)hs_offset[4], (double)rd_c.a, rd_c.x, rd_c.y, rd_c.z, (double)should_be_c.a,
should_be_c.x, should_be_c.y, should_be_c.z);
goto error;
}
2020-09-30 22:27:10 +08:00
} /* end for fill_time == H5D_FILL_TIME_NEVER */
else if (fill_time == H5D_FILL_TIME_NEVER && odd) {
/*Trash data. Don't compare*/
}
2020-09-30 22:27:10 +08:00
} /* end for datatype==H5T_COMPOUND */
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
2020-09-30 22:27:10 +08:00
if (datatype == H5T_COMPOUND) {
free(buf_c);
buf_c = NULL;
} /* end if */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
goto error;
if (datatype == H5T_INTEGER && H5Dclose(dset1) < 0)
goto error;
if (datatype == H5T_COMPOUND && H5Dclose(dset2) < 0)
goto error;
if (H5Sclose(fspace) < 0)
goto error;
return 0;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
2020-09-30 22:27:10 +08:00
error:
H5E_BEGIN_TRY
{
if (datatype == H5T_INTEGER)
H5Dclose(dset1);
if (datatype == H5T_COMPOUND)
H5Dclose(dset2);
H5Sclose(fspace);
H5Sclose(mspace);
}
H5E_END_TRY
return 1;
}
/*-------------------------------------------------------------------------
* Function: test_rdwr
*
* Purpose: Tests fill values for datasets.
*
* Return: Success: 0
*
* Failure: number of errors
*
*-------------------------------------------------------------------------
*/
static int
test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout)
{
2020-09-30 22:27:10 +08:00
char filename[1024];
hid_t file = H5I_INVALID_HID, dcpl = H5I_INVALID_HID, ctype_id = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
hsize_t ch_size[5] = {2, 8, 8, 4, 2};
int nerrors = 0;
int fillval = 0x4c70f1cd;
comp_datatype fill_ctype = {0, 0, 0, 0};
if (H5D_CHUNKED == layout) {
TESTING("chunked dataset I/O");
2020-09-30 22:27:10 +08:00
}
else if (H5D_COMPACT == layout) {
TESTING("compact dataset I/O");
2020-09-30 22:27:10 +08:00
}
else {
TESTING("contiguous dataset I/O");
}
h5_fixname(base_name, fapl, filename, sizeof filename);
2020-09-30 22:27:10 +08:00
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5D_CHUNKED == layout) {
if (H5Pset_chunk(dcpl, 5, ch_size) < 0)
goto error;
}
2020-09-30 22:27:10 +08:00
else if (H5D_COMPACT == layout) {
if (H5Pset_layout(dcpl, H5D_COMPACT) < 0)
goto error;
}
2020-09-30 22:27:10 +08:00
if ((ctype_id = create_compound_type()) < 0)
goto error;
/* I. Test H5D_ALLOC_TIME_LATE space allocation cases */
2020-09-30 22:27:10 +08:00
if (H5D_COMPACT != layout) {
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0)
goto error;
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
fillval = 0;
2020-09-30 22:27:10 +08:00
nerrors += test_rdwr_cases(file, dcpl, "dset1", &fillval, H5D_FILL_TIME_ALLOC, layout, H5T_INTEGER,
(hid_t)-1);
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset2", &fillval, H5D_FILL_TIME_NEVER, layout, H5T_INTEGER,
(hid_t)-1);
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
fillval = 0x4c70f1cd;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset3", &fillval, H5D_FILL_TIME_ALLOC, layout, H5T_INTEGER,
(hid_t)-1);
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value is user-defined */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset4", &fillval, H5D_FILL_TIME_NEVER, layout, H5T_INTEGER,
(hid_t)-1);
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is undefined */
/* This case has been tested in test_create() function */
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value is undefined */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
if (H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset5", &fillval, H5D_FILL_TIME_NEVER, layout, H5T_INTEGER,
(hid_t)-1);
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined
* as compound type */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
2023-06-30 03:33:46 +08:00
memset(&fill_ctype, 0, sizeof(fill_ctype));
fill_ctype.y = 4444.4444;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, ctype_id, &fill_ctype) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset11", &fill_ctype, H5D_FILL_TIME_ALLOC, layout,
H5T_COMPOUND, ctype_id);
if (H5Pclose(dcpl) < 0)
goto error;
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto error;
if (H5D_CHUNKED == layout) {
if (H5Pset_chunk(dcpl, 5, ch_size) < 0)
goto error;
}
}
/* II. Test H5D_ALLOC_TIME_EARLY space allocation cases */
2020-09-30 22:27:10 +08:00
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
goto error;
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
fillval = 0;
2020-09-30 22:27:10 +08:00
nerrors +=
test_rdwr_cases(file, dcpl, "dset6", &fillval, H5D_FILL_TIME_ALLOC, layout, H5T_INTEGER, (hid_t)-1);
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
nerrors +=
test_rdwr_cases(file, dcpl, "dset7", &fillval, H5D_FILL_TIME_NEVER, layout, H5T_INTEGER, (hid_t)-1);
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
fillval = 0x4c70f1cd;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0)
goto error;
nerrors +=
test_rdwr_cases(file, dcpl, "dset8", &fillval, H5D_FILL_TIME_ALLOC, layout, H5T_INTEGER, (hid_t)-1);
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value is user-defined */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0)
goto error;
nerrors +=
test_rdwr_cases(file, dcpl, "dset9", &fillval, H5D_FILL_TIME_NEVER, layout, H5T_INTEGER, (hid_t)-1);
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is undefined */
/* This case has been tested in test_create() function */
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value is undefined */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
if (H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0)
goto error;
nerrors +=
test_rdwr_cases(file, dcpl, "dset10", &fillval, H5D_FILL_TIME_NEVER, layout, H5T_INTEGER, (hid_t)-1);
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined
* as compound type */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
2023-06-30 03:33:46 +08:00
memset(&fill_ctype, 0, sizeof(fill_ctype));
fill_ctype.y = 4444.4444;
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, ctype_id, &fill_ctype) < 0)
goto error;
nerrors += test_rdwr_cases(file, dcpl, "dset12", &fill_ctype, H5D_FILL_TIME_ALLOC, layout, H5T_COMPOUND,
ctype_id);
2020-09-30 22:27:10 +08:00
if (nerrors)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
if (H5Tclose(ctype_id) < 0)
goto error;
if (H5Fclose(file) < 0)
goto error;
PASSED();
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
return 0;
2020-09-30 22:27:10 +08:00
error:
H5E_BEGIN_TRY
{
H5Pclose(dcpl);
2020-09-30 22:27:10 +08:00
H5Tclose(ctype_id);
H5Fclose(file);
2020-09-30 22:27:10 +08:00
}
H5E_END_TRY
return nerrors;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend_init_integer
*
2019-08-16 05:46:00 +08:00
* Purpose: Initializes integer values
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: < 0
*
*-------------------------------------------------------------------------
*/
static int
test_extend_init_integer(void *_buf, size_t nelmts, const void *_val)
{
int *buf = (int *)_buf; /* Buffer to initialize */
2020-09-30 22:27:10 +08:00
const int *val = (const int *)_val; /* Value to use */
2020-09-30 22:27:10 +08:00
while (nelmts) {
*buf++ = *val;
nelmts--;
} /* end while */
return 0;
} /* end test_extend_init_integer() */
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend_verify_integer
*
2019-08-16 05:46:00 +08:00
* Purpose: Verifies integer values
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: < 0
*
*-------------------------------------------------------------------------
*/
static int
2020-09-30 22:27:10 +08:00
test_extend_verify_integer(unsigned lineno, const hsize_t *offset, const void *_test_val,
const void *_compare_val)
{
2020-09-30 22:27:10 +08:00
const int *test_val = (const int *)_test_val; /* Value to test */
const int *compare_val = (const int *)_compare_val; /* Value to compare against */
/* Verify value */
2020-09-30 22:27:10 +08:00
if (*test_val != *compare_val) {
fprintf(stdout, "%u: Value read was not expected.\n", lineno);
fprintf(stdout,
" Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
"}, read: %d, "
"expected: %d\n",
offset[0], offset[1], offset[2], offset[3], offset[4], *test_val, *compare_val);
goto error;
} /* end if */
return 0;
error:
return -1;
} /* end test_extend_verify_integer() */
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend_release_integer
*
2019-08-16 05:46:00 +08:00
* Purpose: Release element of integer value
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: < 0
*
*-------------------------------------------------------------------------
*/
static int
test_extend_release_integer(void H5_ATTR_UNUSED *_elmt)
{
return 0;
} /* end test_extend_release_integer() */
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend_init_cmpd_vl
*
2019-08-16 05:46:00 +08:00
* Purpose: Initializes compound+vl values
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: < 0
*
*-------------------------------------------------------------------------
*/
static int
test_extend_init_cmpd_vl(void *_buf, size_t nelmts, const void *_val)
{
comp_vl_datatype *buf = (comp_vl_datatype *)_buf; /* Buffer to initialize */
2020-09-30 22:27:10 +08:00
const comp_vl_datatype *val = (const comp_vl_datatype *)_val; /* Value to use */
2020-09-30 22:27:10 +08:00
while (nelmts) {
/* Shallow copy all fields */
*buf = *val;
/* Deep copy string fields */
buf->a = strdup(val->a);
buf->b = strdup(val->b);
buf++;
nelmts--;
} /* end while */
return 0;
} /* end test_extend_init_cmpd_vl() */
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend_verify_cmpd_vl
*
2019-08-16 05:46:00 +08:00
* Purpose: Verifies compound+vl values
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: < 0
*
*-------------------------------------------------------------------------
*/
static int
2020-09-30 22:27:10 +08:00
test_extend_verify_cmpd_vl(unsigned lineno, const hsize_t *offset, const void *_test_val,
const void *_compare_val)
{
2020-09-30 22:27:10 +08:00
const comp_vl_datatype *test_val = (const comp_vl_datatype *)_test_val; /* Value to test */
const comp_vl_datatype *compare_val =
(const comp_vl_datatype *)_compare_val; /* Value to compare against */
/* Verify value */
if ((test_val->x != compare_val->x) || strcmp(test_val->a, compare_val->a) != 0 ||
strcmp(test_val->b, compare_val->b) != 0 || (test_val->y != compare_val->y)) {
fprintf(stdout, "%u: Value read was not expected.\n", lineno);
fprintf(stdout,
" Elmt = {%" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE ", %" PRIuHSIZE
"}, read: {%d, '%s', '%s', %d} "
"expected: {%d, '%s', '%s', %d}\n",
offset[0], offset[1], offset[2], offset[3], offset[4], test_val->x, test_val->a, test_val->b,
test_val->y, compare_val->x, compare_val->a, compare_val->b, compare_val->y);
goto error;
} /* end if */
return 0;
error:
return -1;
} /* end test_extend_verify_cmpd_vl() */
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend_release_cmpd_vl
*
2019-08-16 05:46:00 +08:00
* Purpose: Release element of compound+vl value
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: < 0
*
*-------------------------------------------------------------------------
*/
static int
test_extend_release_cmpd_vl(void *_elmt)
{
2020-09-30 22:27:10 +08:00
comp_vl_datatype *elmt = (comp_vl_datatype *)_elmt; /* Element to free */
/* Free memory for string fields */
free(elmt->a);
free(elmt->b);
return 0;
} /* end test_extend_release_integer() */
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend_cases
*
2019-08-16 05:46:00 +08:00
* Purpose: Called to test fill values with various different values
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
* Failure: number of errors
*
*-------------------------------------------------------------------------
*/
static int
test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t *ch_size, hsize_t *start_size,
2020-09-30 22:27:10 +08:00
hsize_t *max_size, hid_t dtype, void *fillval)
{
hid_t fspace = H5I_INVALID_HID, mspace = H5I_INVALID_HID; /* File & memory dataspaces */
hid_t dset = H5I_INVALID_HID; /* Dataset ID */
hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
hsize_t extend_size[5]; /* Dimensions to extend to */
2020-09-30 22:27:10 +08:00
hsize_t one[5] = {1, 1, 1, 1, 1}; /* Dimensions of single element dataspace */
hsize_t hs_size[5], hs_stride[5], hs_offset[5];
size_t nelmts;
H5T_class_t dtype_class; /* Class of datatype */
int (*init_rtn)(void *, size_t, const void *);
int (*verify_rtn)(unsigned, const hsize_t *, const void *, const void *);
int (*release_rtn)(void *);
size_t val_size; /* Size of element */
void *val_rd, *odd_val;
const void *init_val, *should_be, *even_val;
2020-09-30 22:27:10 +08:00
int val_rd_i, init_val_i = 9999;
2020-05-11 00:48:30 +08:00
comp_vl_datatype init_val_c = {87, NULL, NULL, 129};
comp_vl_datatype val_rd_c;
void *buf = NULL;
2020-09-30 22:27:10 +08:00
unsigned odd; /* Whether an odd or even coord. was read */
unsigned i, j; /* Local index variables */
2020-05-11 00:48:30 +08:00
/* Set vl datatype init value strings */
init_val_c.a = strdup("baz");
init_val_c.b = strdup("mumble");
2020-05-11 00:48:30 +08:00
/* Make copy of dataset creation property list */
2020-09-30 22:27:10 +08:00
if ((dcpl = H5Pcopy(_dcpl)) < 0)
TEST_ERROR;
#ifndef NO_FILLING
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_value(dcpl, dtype, fillval) < 0)
TEST_ERROR;
#endif
/* Get class of datatype */
2020-09-30 22:27:10 +08:00
if ((dtype_class = H5Tget_class(dtype)) < 0)
TEST_ERROR;
/* Create a dataspace */
2020-09-30 22:27:10 +08:00
if ((fspace = H5Screate_simple(5, start_size, max_size)) < 0)
TEST_ERROR;
/* Create dataset */
2020-09-30 22:27:10 +08:00
if ((dset = H5Dcreate2(file, dset_name, dtype, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Set up pointers to elements */
2020-09-30 22:27:10 +08:00
if (dtype_class == H5T_INTEGER) {
/* Initialize specific values for this datatype */
2020-09-30 22:27:10 +08:00
val_size = sizeof(int);
init_val = &init_val_i;
init_rtn = test_extend_init_integer;
verify_rtn = test_extend_verify_integer;
release_rtn = test_extend_release_integer;
2020-09-30 22:27:10 +08:00
val_rd = &val_rd_i;
odd_val = fillval;
even_val = &init_val_i;
} /* end if */
else {
/* Sanity check */
assert(dtype_class == H5T_COMPOUND);
/* Initialize specific values for this datatype */
2020-09-30 22:27:10 +08:00
val_size = sizeof(comp_vl_datatype);
init_val = &init_val_c;
init_rtn = test_extend_init_cmpd_vl;
verify_rtn = test_extend_verify_cmpd_vl;
release_rtn = test_extend_release_cmpd_vl;
2020-09-30 22:27:10 +08:00
val_rd = &val_rd_c;
odd_val = fillval;
even_val = &init_val_c;
} /* end else */
/* Read some data and make sure it's the fill value */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
/* Set offset for random element */
2020-09-30 22:27:10 +08:00
for (j = 0; j < 5; j++)
hs_offset[j] = (hsize_t)HDrand() % start_size[j];
/* Select the random element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Read the random element */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in */
2020-09-30 22:27:10 +08:00
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, fillval) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
} /* end for */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
TEST_ERROR;
/* Initialize dataspace & hyperslab info */
2020-09-30 22:27:10 +08:00
for (i = 0, nelmts = 1; i < 5; i++) {
hs_size[i] = (start_size[i] + 1) / 2;
hs_offset[i] = 0;
hs_stride[i] = 2;
nelmts *= hs_size[i];
} /* end for */
/* Check for overflow */
assert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size)));
/* Allocate & initialize buffer */
buf = malloc((size_t)(nelmts * val_size));
init_rtn(buf, nelmts, init_val);
/* Create dataspace describing memory buffer */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, hs_size, hs_size)) < 0)
TEST_ERROR;
/* Select elements within file dataspace */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, hs_stride, hs_size, NULL) < 0)
TEST_ERROR;
/* Write to all even data locations */
2020-09-30 22:27:10 +08:00
if (H5Dwrite(dset, dtype, mspace, fspace, H5P_DEFAULT, buf) < 0)
TEST_ERROR;
/* Close memory dataspace */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
TEST_ERROR;
/* Read some data and make sure it's the right value */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
/* Set offset for random element */
2020-09-30 22:27:10 +08:00
for (j = 0, odd = 0; j < 5; j++) {
hs_offset[j] = (hsize_t)HDrand() % start_size[j];
odd += (unsigned)(hs_offset[j] % 2);
} /* end for */
/* Select the random element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Read the random element */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in */
2020-09-30 22:27:10 +08:00
should_be = odd ? odd_val : even_val;
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
} /* end for */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
TEST_ERROR;
/* Extend the dataset one element in each dimension */
2020-09-30 22:27:10 +08:00
for (i = 0; i < 5; i++)
extend_size[i] = start_size[i] + 1;
2020-09-30 22:27:10 +08:00
if (H5Dset_extent(dset, extend_size) < 0)
TEST_ERROR;
/* Re-open file dataspace */
2020-09-30 22:27:10 +08:00
if (H5Sclose(fspace) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if ((fspace = H5Dget_space(dset)) < 0)
TEST_ERROR;
/* Read some data and make sure it's the right value */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
/* Set offset for random element */
2020-09-30 22:27:10 +08:00
for (j = 0, odd = 0; j < 5; j++) {
hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
if (hs_offset[j] >= start_size[j])
odd = 1;
else
odd += (unsigned)(hs_offset[j] % 2);
} /* end for */
/* Select the random element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Read the random element */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in */
2020-09-30 22:27:10 +08:00
should_be = odd ? odd_val : even_val;
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
} /* end for */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
TEST_ERROR;
/* Extend the dataset to the maximum dimension sizes */
2020-09-30 22:27:10 +08:00
if (H5Dset_extent(dset, max_size) < 0)
TEST_ERROR;
/* Re-open file dataspace */
2020-09-30 22:27:10 +08:00
if (H5Sclose(fspace) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if ((fspace = H5Dget_space(dset)) < 0)
TEST_ERROR;
/* Read some data and make sure it's the right value */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
/* Set offset for random element */
2020-09-30 22:27:10 +08:00
for (j = 0, odd = 0; j < 5; j++) {
hs_offset[j] = (hsize_t)HDrand() % max_size[j];
if (hs_offset[j] >= start_size[j])
odd = 1;
else
odd += (unsigned)(hs_offset[j] % 2);
} /* end for */
/* Select the random element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Read the random element */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in */
2020-09-30 22:27:10 +08:00
should_be = odd ? odd_val : even_val;
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
} /* end for */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
TEST_ERROR;
/* Shrink the dataset to half of it's maximum size, plus 1/2 of a chunk */
2020-09-30 22:27:10 +08:00
for (i = 0; i < 5; i++)
extend_size[i] = (max_size[i] / 2) + (ch_size[i] / 2);
2020-09-30 22:27:10 +08:00
if (H5Dset_extent(dset, extend_size) < 0)
TEST_ERROR;
/* Re-open file dataspace */
2020-09-30 22:27:10 +08:00
if (H5Sclose(fspace) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if ((fspace = H5Dget_space(dset)) < 0)
TEST_ERROR;
/* Read some data and make sure it's the right value */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
/* Set offset for random element */
2020-09-30 22:27:10 +08:00
for (j = 0, odd = 0; j < 5; j++) {
hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
if (hs_offset[j] >= start_size[j])
odd = 1;
else
odd += (unsigned)(hs_offset[j] % 2);
} /* end for */
/* Select the random element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Read the random element */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in */
2020-09-30 22:27:10 +08:00
should_be = odd ? odd_val : even_val;
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
} /* end for */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
TEST_ERROR;
/* Extend the dataset's size by one element, in a dimension that won't
* cause additional chunks to be needed */
extend_size[2] += 1;
2020-09-30 22:27:10 +08:00
if (H5Dset_extent(dset, extend_size) < 0)
TEST_ERROR;
/* Re-open file dataspace */
2020-09-30 22:27:10 +08:00
if (H5Sclose(fspace) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if ((fspace = H5Dget_space(dset)) < 0)
TEST_ERROR;
/* Create dataspace for single element sized buffer */
2020-09-30 22:27:10 +08:00
if ((mspace = H5Screate_simple(5, one, NULL)) < 0)
TEST_ERROR;
/* Set location for "top-most" element in dataset to write */
2020-09-30 22:27:10 +08:00
for (i = 0; i < 5; i++)
hs_offset[i] = extend_size[i] - 1;
/* Select the element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Write one element in a chunk that's 'partial' and overwrite a fill
* value that was initialized in the H5Dset_extent() routine. This will
* overwrite a fill-value element, which must be de-allocated properly or
* next read of another fill-value initialized element in this chunk will
* fail.
*/
2020-09-30 22:27:10 +08:00
if (H5Dwrite(dset, dtype, mspace, fspace, H5P_DEFAULT, buf) < 0)
TEST_ERROR;
/* Read value back in */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in is the value written out */
2020-09-30 22:27:10 +08:00
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, buf) < 0)
TEST_ERROR;
/* Set the element back to fillval */
2020-09-30 22:27:10 +08:00
if (H5Dwrite(dset, dtype, mspace, fspace, H5P_DEFAULT, fillval) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
/* Set location for another element initialized by H5Dset_extent() */
hs_offset[3] -= 1;
/* Select the element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Read value back in */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in is the fill-value */
2020-09-30 22:27:10 +08:00
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, fillval) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
/* Read some data and make sure it's the right value */
2020-09-30 22:27:10 +08:00
for (i = 0; i < 1000; i++) {
/* Set offset for random element */
2020-09-30 22:27:10 +08:00
for (j = 0, odd = 0; j < 5; j++) {
hs_offset[j] = (hsize_t)HDrand() % extend_size[j];
if (hs_offset[j] >= start_size[j])
odd = 1;
else
odd += (unsigned)(hs_offset[j] % 2);
} /* end for */
/* Select the random element */
2020-09-30 22:27:10 +08:00
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
TEST_ERROR;
/* Read the random element */
2020-09-30 22:27:10 +08:00
if (H5Dread(dset, dtype, mspace, fspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Verify the element read in */
2020-09-30 22:27:10 +08:00
should_be = odd ? odd_val : even_val;
if (verify_rtn((unsigned)__LINE__, hs_offset, val_rd, should_be) < 0)
TEST_ERROR;
/* Release any VL components */
2020-09-30 22:27:10 +08:00
if (H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0)
TEST_ERROR;
/* Clear the read buffer */
2023-06-30 03:33:46 +08:00
memset(val_rd, 0, val_size);
} /* end for */
2020-09-30 22:27:10 +08:00
if (H5Sclose(mspace) < 0)
TEST_ERROR;
/* Release elements & memory buffer */
2020-09-30 22:27:10 +08:00
for (i = 0; i < nelmts; i++)
release_rtn((void *)((char *)buf + (val_size * i)));
2020-05-11 00:48:30 +08:00
free(init_val_c.a);
free(init_val_c.b);
free(buf);
/* Cleanup IDs */
2020-09-30 22:27:10 +08:00
if (H5Pclose(dcpl) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Dclose(dset) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Sclose(fspace) < 0)
TEST_ERROR;
return 0;
error:
free(init_val_c.a);
free(init_val_c.b);
free(buf);
2020-05-11 00:48:30 +08:00
2020-09-30 22:27:10 +08:00
H5E_BEGIN_TRY
{
H5Pclose(dcpl);
H5Dclose(dset);
H5Sclose(fspace);
H5Sclose(mspace);
}
H5E_END_TRY
return -1;
} /* end test_extend_cases() */
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_extend
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Purpose: Test that filling works okay when a dataset is extended.
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Failure: number of errors
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
*-------------------------------------------------------------------------
*/
static int
test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
{
hid_t file = H5I_INVALID_HID; /* File ID */
hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list ID */
hid_t cmpd_vl_tid = H5I_INVALID_HID; /* Compound+vl datatype ID */
2020-09-30 22:27:10 +08:00
hsize_t start_size[5] = {8, 8, 8, 4, 2};
hsize_t max_size[5] = {32, 32, 32, 16, 8};
hsize_t ch_size[5] = {1, 8, 8, 4, 2};
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#ifdef NO_FILLING
2020-09-30 22:27:10 +08:00
int fillval_i = 0;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#else
2020-09-30 22:27:10 +08:00
int fillval_i = 0x4c70f1cd;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#endif
2020-09-30 22:27:10 +08:00
comp_vl_datatype fillval_c = {32, NULL, NULL, 64}; /* Fill value for compound+vl datatype tests */
char filename[1024];
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Print testing message */
2020-09-30 22:27:10 +08:00
if (H5D_CHUNKED == layout)
TESTING("chunked dataset extend");
else
TESTING("contiguous dataset extend");
2020-05-11 00:48:30 +08:00
/* Set vl datatype fill value strings */
fillval_c.a = strdup("foo");
fillval_c.b = strdup("bar");
2020-05-11 00:48:30 +08:00
/* Create dataset creation property list */
2020-09-30 22:27:10 +08:00
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5D_CHUNKED == layout)
if (H5Pset_chunk(dcpl, 5, ch_size) < 0)
TEST_ERROR;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
#if 1
/*
* Remove this once contiguous datasets can support extensions in other
* than the slowest varying dimension. The purpose of this block is to
* make only the slowest varying dimension extendible and yet have the
* same total number of elements as originally.
*
* If this is removed prematurely then you will get an error `only the
* first dimension can be extendible' as long as the test isn't skipped
* below.
*/
2020-09-30 22:27:10 +08:00
if (H5D_CONTIGUOUS == layout) {
max_size[0] = (max_size[0] * max_size[1] * max_size[2] * max_size[3] * max_size[4]) /
(start_size[1] * start_size[2] * start_size[3] * start_size[4]);
max_size[1] = start_size[1];
max_size[2] = start_size[2];
max_size[3] = start_size[3];
max_size[4] = start_size[4];
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
#endif
#if 1
/*
* Remove this once internal contiguous datasets can support
* extending. If it's removed prematurely you will get an error
* `extendible contiguous non-external dataset' as long as the test isn't
* skipped below.
*/
2020-09-30 22:27:10 +08:00
if (H5D_CONTIGUOUS == layout) {
int fd;
hsize_t nelmts;
2020-09-30 22:27:10 +08:00
nelmts = max_size[0] * max_size[1] * max_size[2] * max_size[3] * max_size[4];
if ((fd = HDopen(FILE_NAME_RAW, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0 ||
HDclose(fd) < 0)
goto error;
if (H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts * sizeof(int)) < 0)
goto error;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
#endif
#if 1
/*
* Remove this when contiguous datasets can be extended to some
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
* predetermined fininte size, even if it's just in the slowest varying
* dimension. If it's removed prematurely then you'll get one of the
* errors described above or `unable to select fill value region'.
*/
2020-09-30 22:27:10 +08:00
if (H5D_CONTIGUOUS == layout) {
SKIPPED();
puts(" Not implemented yet -- needs H5S_SELECT_DIFF operator");
2020-09-30 22:27:10 +08:00
goto skip;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}
#endif
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Create a file and dataset */
h5_fixname(base_name, fapl, filename, sizeof filename);
2020-09-30 22:27:10 +08:00
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Get the compound+vl datatype */
2020-09-30 22:27:10 +08:00
if ((cmpd_vl_tid = create_compound_vl_type()) < 0)
TEST_ERROR;
/* Test integer datatype case */
2020-09-30 22:27:10 +08:00
if (test_extend_cases(file, dcpl, "dset1", ch_size, start_size, max_size, H5T_NATIVE_INT, &fillval_i) < 0)
TEST_ERROR;
/* Test compound+vl datatype datatype case */
2020-09-30 22:27:10 +08:00
if (test_extend_cases(file, dcpl, "dset2", ch_size, start_size, max_size, cmpd_vl_tid, &fillval_c) < 0)
TEST_ERROR;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Cleanup */
2020-09-30 22:27:10 +08:00
if (H5Tclose(cmpd_vl_tid) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Pclose(dcpl) < 0)
TEST_ERROR;
2020-09-30 22:27:10 +08:00
if (H5Fclose(file) < 0)
TEST_ERROR;
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
free(fillval_c.a);
free(fillval_c.b);
2020-05-11 00:48:30 +08:00
PASSED();
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
return 0;
error:
free(fillval_c.a);
free(fillval_c.b);
2020-05-11 00:48:30 +08:00
2020-09-30 22:27:10 +08:00
H5E_BEGIN_TRY
{
H5Tclose(cmpd_vl_tid);
2020-09-30 22:27:10 +08:00
H5Pclose(dcpl);
H5Fclose(file);
}
H5E_END_TRY
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
return 1;
skip:
free(fillval_c.a);
free(fillval_c.b);
2020-05-11 00:48:30 +08:00
2020-09-30 22:27:10 +08:00
H5E_BEGIN_TRY
{
H5Pclose(dcpl);
H5Fclose(file);
}
H5E_END_TRY
return 0;
} /* end test_extend() */
/*-------------------------------------------------------------------------
* Function: test_compatible
*
* Purpose: Tests fill value and dataspace for datasets created by v1.4
* library.
*
* Return: Success: 0
*
* Failure: number of errors
*
*-------------------------------------------------------------------------
*/
static int
test_compatible(void)
{
hid_t file = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, dset2 = H5I_INVALID_HID;
hid_t dcpl1 = H5I_INVALID_HID, dcpl2 = H5I_INVALID_HID, fspace = H5I_INVALID_HID,
mspace = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
int rd_fill = 0, fill_val = 4444, val_rd = 0;
hsize_t dims[2], one[2] = {1, 1};
hsize_t hs_offset[2] = {3, 4};
H5D_fill_value_t status;
const char *testfile = H5_get_srcdir_filename(FILE_COMPATIBLE); /* Corrected test file name */
TESTING("contiguous dataset compatibility with v. 1.4");
2020-09-30 22:27:10 +08:00
if ((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
printf(" Could not open file %s. Try set $srcdir to point at the "
"source directory of test\n",
testfile);
2020-09-30 22:27:10 +08:00
goto error;
}
if ((dset1 = H5Dopen2(file, "dset1", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl1 = H5Dget_create_plist(dset1)) < 0)
goto error;
if (H5Pfill_value_defined(dcpl1, &status) < 0)
goto error;
if (status != H5D_FILL_VALUE_UNDEFINED) {
H5_FAILED();
printf(" %d: Got a different fill value than what was set.", __LINE__);
printf(" Got status=%ld, suppose to be H5D_FILL_VALUE_UNDEFINED\n", (long)status);
2020-09-30 22:27:10 +08:00
goto error;
}
if ((fspace = H5Dget_space(dset1)) < 0)
goto error;
if (H5Sget_simple_extent_dims(fspace, dims, NULL) < 0)
goto error;
if (dims[0] != 8 || dims[1] != 8) {
H5_FAILED();
puts(" Got a different dimension size than what was set.");
printf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
2020-09-30 22:27:10 +08:00
goto error;
}
if ((mspace = H5Screate_simple(2, one, NULL)) < 0)
goto error;
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
goto error;
if (H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0)
goto error;
if (val_rd != 0) {
H5_FAILED();
puts(" Got a different value than what was set.");
printf(" Got %ld, set 0\n", (long)val_rd);
2020-09-30 22:27:10 +08:00
goto error;
}
if (H5Pclose(dcpl1) < 0)
goto error;
if (H5Sclose(fspace) < 0)
goto error;
if (H5Sclose(mspace) < 0)
goto error;
if (H5Dclose(dset1) < 0)
goto error;
if ((dset2 = H5Dopen2(file, "dset2", H5P_DEFAULT)) < 0)
goto error;
if ((dcpl2 = H5Dget_create_plist(dset2)) < 0)
goto error;
if (H5Pfill_value_defined(dcpl2, &status) < 0)
goto error;
if (status != H5D_FILL_VALUE_USER_DEFINED) {
H5_FAILED();
printf(" %d: Got a different fill value than what was set.", __LINE__);
printf(" Got status=%ld, suppose to be H5D_FILL_VALUE_USER_DEFINED\n", (long)status);
2020-09-30 22:27:10 +08:00
goto error;
}
if (H5Pget_fill_value(dcpl2, H5T_NATIVE_INT, &rd_fill) < 0)
goto error;
if (rd_fill != fill_val) {
H5_FAILED();
printf(" %d: Got a different fill value than what was set.", __LINE__);
printf(" Got %ld, set %ld\n", (long)rd_fill, (long)fill_val);
2020-09-30 22:27:10 +08:00
goto error;
}
fspace = -1;
if ((fspace = H5Dget_space(dset2)) < 0)
goto error;
dims[0] = dims[1] = (hsize_t)-1;
if (H5Sget_simple_extent_dims(fspace, dims, NULL) < 0)
goto error;
if (dims[0] != 8 || dims[1] != 8) {
H5_FAILED();
puts(" Got a different dimension size than what was set.");
printf(" Got dims[0]=%ld, dims[1]=%ld, set 8x8\n", (long)dims[0], (long)dims[1]);
2020-09-30 22:27:10 +08:00
goto error;
}
if ((mspace = H5Screate_simple(2, one, NULL)) < 0)
goto error;
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL, one, NULL) < 0)
goto error;
if (H5Dread(dset2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd) < 0)
goto error;
if (val_rd != fill_val) {
H5_FAILED();
puts(" Got a different value than what was set.");
printf(" Got %ld, set %ld\n", (long)val_rd, (long)fill_val);
2020-09-30 22:27:10 +08:00
goto error;
}
if (H5Pclose(dcpl2) < 0)
goto error;
if (H5Sclose(fspace) < 0)
goto error;
if (H5Sclose(mspace) < 0)
goto error;
if (H5Dclose(dset2) < 0)
goto error;
if (H5Fclose(file) < 0)
goto error;
PASSED();
return 0;
error:
2020-09-30 22:27:10 +08:00
H5E_BEGIN_TRY
{
H5Pclose(dcpl1);
H5Sclose(fspace);
H5Sclose(mspace);
H5Dclose(dset1);
H5Pclose(dcpl2);
H5Sclose(fspace);
H5Dclose(dset2);
H5Fclose(file);
2020-09-30 22:27:10 +08:00
}
H5E_END_TRY
return 1;
}
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: test_partalloc_cases
*
2019-08-16 05:46:00 +08:00
* Purpose: Tests fill values read and write for datasets.
*
2019-08-16 05:46:00 +08:00
* Return: Success: 0
*
2019-08-16 05:46:00 +08:00
* Failure: 1
*
*-------------------------------------------------------------------------
*/
static int
test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t fill_time)
{
hid_t fspace = H5I_INVALID_HID, dset1 = H5I_INVALID_HID, rspace = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
herr_t ret;
hsize_t ds_size[2] = {4, 4};
hsize_t max_size[2] = {H5S_UNLIMITED, 4};
hsize_t chunk_size[2] = {1, 4};
int fillval = (-1);
int w_values[] = {42}; /* New value to be written */
int f_values[4] = {88, 88, 88, 88}; /* pre-seed read buffer with known values */
int r_values[4] = {88, 88, 88, 88}; /* pre-seed read buffer with known values */
hsize_t coord[1][2]; /* coordinate(s) of point to write */
hsize_t start[2], count[2];
2020-09-30 22:27:10 +08:00
fillval = 0; /* default fill value is zero */
/* Create dataset with 4x4 integer dataset */
2020-09-30 22:27:10 +08:00
if ((fspace = H5Screate_simple(2, ds_size, max_size)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if ((dset1 = H5Dcreate2(file, dname, H5T_NATIVE_INT, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/*
* Select a point in the file dataspace.
*/
2020-09-30 22:27:10 +08:00
coord[0][0] = 0;
coord[0][1] = 0;
if (H5Sselect_elements(fspace, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord))
goto error;
2019-08-16 05:46:00 +08:00
/*
* Write single data point to the dataset.
*/
2020-09-30 22:27:10 +08:00
if ((ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, fspace, H5P_DEFAULT, w_values)) < 0) {
goto error;
}
2019-08-16 05:46:00 +08:00
/* Read a line/chunk and make sure values are right */
rspace = H5Screate_simple(2, chunk_size, NULL);
/* Read the first row of elements: one known plus three fill */
start[0] = 0;
start[1] = 0;
count[0] = 1;
count[1] = 4;
if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0)
goto error;
if ((ret = H5Sselect_all(rspace)) < 0)
2020-09-30 22:27:10 +08:00
goto error;
if (H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &r_values) < 0)
goto error;
2013-05-03 23:39:44 +08:00
/* Read the third row of elements: all fill */
start[0] = 2;
start[1] = 0;
count[0] = 1;
count[1] = 4;
if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &f_values) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if (fill_time != H5D_FILL_TIME_NEVER) {
/* check allocated chunk */
2020-09-30 22:27:10 +08:00
if ((r_values[0] != w_values[0]) || (r_values[1] != fillval) || (r_values[2] != fillval) ||
(r_values[3] != fillval)) {
H5_FAILED();
fprintf(stdout, "%u: Allocated chunk value read was not correct.\n", (unsigned)__LINE__);
printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", (long)r_values[0],
(long)r_values[1], (long)r_values[2], (long)r_values[3], (long)w_values[0], (long)fillval,
(long)fillval, (long)fillval);
goto error;
}
/* check unallocated chunk */
2020-09-30 22:27:10 +08:00
if ((f_values[0] != fillval) || (f_values[1] != fillval) || (f_values[2] != fillval) ||
(f_values[3] != fillval)) {
H5_FAILED();
fprintf(stdout, "%u: Unallocated chunk value read was not correct.\n", (unsigned)__LINE__);
printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", (long)f_values[0],
(long)f_values[1], (long)f_values[2], (long)f_values[3], (long)fillval, (long)fillval,
(long)fillval, (long)fillval);
goto error;
}
/* for the "never fill" case expect to get trash values, so skip */
}
2020-09-30 22:27:10 +08:00
else if (fill_time == H5D_FILL_TIME_NEVER) {
}
2020-09-30 22:27:10 +08:00
if (H5Sclose(rspace) < 0)
goto error;
if (H5Dclose(dset1) < 0)
goto error;
if (H5Sclose(fspace) < 0)
goto error;
return 0;
2020-09-30 22:27:10 +08:00
error:
H5E_BEGIN_TRY
{
H5Dclose(dset1);
H5Sclose(fspace);
H5Sclose(rspace);
}
H5E_END_TRY
return 1;
}
/*-------------------------------------------------------------------------
* Function: test_partalloc
*
* Purpose: Tests fill values for chunked, partially-allocated datasets.
* Regression test for HDFFV-8247.
*
* Return: Success: 0
*
* Failure: number of errors
*
*-------------------------------------------------------------------------
*/
static int
test_partalloc(hid_t fapl, const char *base_name)
{
2020-09-30 22:27:10 +08:00
char filename[1024];
hid_t file = H5I_INVALID_HID, dcpl = H5I_INVALID_HID;
2020-09-30 22:27:10 +08:00
hsize_t ch_size[2] = {1, 4};
int nerrors = 0;
TESTING("chunked dataset partially allocated I/O");
h5_fixname(base_name, fapl, filename, sizeof filename);
2020-09-30 22:27:10 +08:00
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
2020-09-30 22:27:10 +08:00
if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto error;
if (H5Pset_chunk(dcpl, 2, ch_size) < 0)
goto error;
/* I. Test H5D_ALLOC_TIME_LATE space allocation cases */
2020-09-30 22:27:10 +08:00
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, "\nALLOC_TIME_LATE\n");
#endif
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_ALLOC\n");
#endif
nerrors += test_partalloc_cases(file, dcpl, "dset1", H5D_FILL_TIME_ALLOC);
2019-08-16 05:46:00 +08:00
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_NEVER\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset2", H5D_FILL_TIME_NEVER);
/* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_IFSET\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset3", H5D_FILL_TIME_IFSET);
/* II. Test H5D_ALLOC_TIME_INCR space allocation cases */
2020-09-30 22:27:10 +08:00
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, "\nALLOC_TIME_INCR\n");
#endif
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_ALLOC\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset4", H5D_FILL_TIME_ALLOC);
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_NEVER\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset5", H5D_FILL_TIME_NEVER);
/* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_IFSET\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset6", H5D_FILL_TIME_IFSET);
/* III. Test H5D_ALLOC_TIME_EARLY space allocation cases */
2020-09-30 22:27:10 +08:00
if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, "\nALLOC_TIME_EARLY\n");
#endif
/* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_ALLOC\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset7", H5D_FILL_TIME_ALLOC);
/* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_NEVER\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset8", H5D_FILL_TIME_NEVER);
/* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */
2020-09-30 22:27:10 +08:00
if (H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0)
goto error;
#ifdef DEBUG
fprintf(stdout, " FILL_TIME_IFSET\n");
#endif
2020-09-30 22:27:10 +08:00
nerrors += test_partalloc_cases(file, dcpl, "dset9", H5D_FILL_TIME_IFSET);
2020-09-30 22:27:10 +08:00
if (nerrors)
goto error;
if (H5Pclose(dcpl) < 0)
goto error;
if (H5Fclose(file) < 0)
goto error;
PASSED();
return 0;
2020-09-30 22:27:10 +08:00
error:
H5E_BEGIN_TRY
{
H5Pclose(dcpl);
H5Fclose(file);
2020-09-30 22:27:10 +08:00
}
H5E_END_TRY
return nerrors;
}
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/*-------------------------------------------------------------------------
2019-08-16 05:46:00 +08:00
* Function: main
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Purpose: Tests fill values
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Return: Success:
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
2019-08-16 05:46:00 +08:00
* Failure:
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
*
*-------------------------------------------------------------------------
*/
int
main(int argc, char *argv[])
{
2020-09-30 22:27:10 +08:00
int nerrors = 0, argno, test_contig = 1, test_chunk = 1, test_compact = 1;
hid_t fapl = (H5I_INVALID_HID), fapl2 = (H5I_INVALID_HID); /* File access property lists */
unsigned new_format; /* Whether to use the new format or not */
bool driver_is_default_compatible;
2020-09-30 22:27:10 +08:00
if (argc >= 2) {
test_contig = test_chunk = test_compact = 0;
2020-09-30 22:27:10 +08:00
for (argno = 1; argno < argc; argno++) {
if (!strcmp(argv[argno], "contiguous"))
test_contig = 1;
else if (!strcmp(argv[argno], "chunked"))
test_chunk = 1;
else if (!strcmp(argv[argno], "compact"))
2020-09-30 22:27:10 +08:00
test_compact = 1;
else {
fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
exit(EXIT_FAILURE);
}
} /* end for */
2020-09-30 22:27:10 +08:00
} /* end if */
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
h5_reset();
fapl = h5_fileaccess();
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
Subfiling VFD (#1883) * Added support for vector I/O calls to the VFD layer, and associated test code. Note that this includes the optimization to allow shortened sizes and types arrays to allow more space efficient representations of vectors in which all entries are of the same size and/or type. See the Selection I/o RFC for further details. Tested serial and parallel, debug and production on Charis. serial and parallel debug only on Jelly. * ran code formatter quick serial build and test on jelly * Add H5FD_read_selection() and H5FD_write_selection(). Currently only translate to scalar calls. Fix const buf in H5FD_write_vector(). * Format source * Fix comments * Add selection I/O to chunk code, used when: not using chunk cache, no datatype conversion, no I/O filters, no page buffer, not using collective I/O. Requires global variable H5_use_selection_io_g be set to TRUE. Implemented selection to vector I/O transaltion at the file driver layer. * Fix formatting unrelated to previous change to stop github from complaining. * Add full API support for selection I/O. Add tests for this. * Implement selection I/O for contiguous datasets. Fix bug in selection I/O translation. Add const qualifiers to some internal selection I/O routines to maintain const-correctness while avoiding memcpys. * Added vector read / write support to the MPIO VFD, with associated test code (see testpar/t_vfd.c). Note that this implementation does NOT support vector entries of size greater than 2 GB. This must be repaired before release, but it should be good enough for correctness testing. As MPIO requires vector I/O requests to be sorted in increasing address order, also added a vector sort utility in H5FDint.c This function is tested in passing by the MPIO vector I/O extension. In passing, repaired a bug in size / type vector extension management in H5FD_read/write_vector() Tested parallel debug and production on charis and Jelly. * Ran source code formatter * Add support for independent parallel I/O with selection I/O. Add HDF5_USE_SELECTION_IO env var to control selection I/O (default off). * Implement parallel collective support for selection I/O. * Fix comments and run formatter. * Update selection IO branch with develop (#1215) Merged branch 'develop' into selection_io * Sync with develop (#1262) Updated the branch with develop changes. * Implement big I/O support for vector I/O requests in the MPIO file driver. * Free arrays in H5FD__mpio_read/write_vector() as soon as they're not needed, to cut down on memory usage during I/O. * Address comments from code review. Fix const warnings with H5S_SEL_ITER_INIT(). * Committing clang-format changes * Feature/subfiling (#1464) * Initial checkin of merged sub-filing VFD. Passes regression tests (debug/shared/paralle) on Jelly. However, bugs and many compiler warnings remain -- not suitable for merge to develop. * Minor mods to src/H5FDsubfile_mpi.c to address errors reported by autogen.sh * Code formatting run -- no test * Merged my subfiling code fixes into the new selection_io_branch * Forgot to add the FindMERCURY.cmake file. This will probably disappear soon * attempting to make a more reliable subfile file open which doesn't return errors. For some unknown reason, the regular posix open will occasionally fail to create a subfile. Some better error handling for file close has been added. * added NULL option for H5FD_subfiling_config_t in H5Pset_fapl_subfiling (#1034) * NULL option automatically stacks IOC VFD for subfiling and returns a valid fapl. * added doxygen subfiling APIs * Various fixes which allow the IOR benchmark to run correctly * Lots of updates including the packaging up of the mercury_util source files to enable easier builds for our Benchmarking * Interim checkin of selection_io_with_subfiling_vfd branch Moddified testpar/t_vfd.c to test the subfiling vfd with default configuration. Must update this code to run with a variety of configurations -- most particularly multiple IO concentrators, and stripe depth small enough to test the other IO concentrators. testpar/t_vfd.c exposed a large number of race condidtions -- symtoms included: 1) Crashes (usually seg faults) 2) Heap corruption 3) Stack corruption 4) Double frees of heap space 5) Hangs 6) Out of order execution of I/O requests / violations of POSIX semantics 7) Swapped write requests Items 1 - 4 turned out to be primarily caused by file close issues -- specifically, the main I/O concentrator thread and its pool of worker threads were not being shut down properly on file close. Addressing this issue in combination with some other minor fixes seems to have addressed these issues. Items 5 & 6 appear to have been caused by issue of I/O requests to the thread pool in an order that did not maintain POSIX semantics. A rewrite of the I/O request dispatch code appears to have solved these issues. Item 7 seems to have been caused by multiple write requests from a given rank being read by the wrong worker thread. Code to issue "unique" tags for each write request via the ACK message appears to have cleaned this up. Note that the code is still in poor condtition. A partial list of known defects includes: a) Race condiditon on file close that allows superblock writes to arrive at the I/O concentrator after it has been shutdown. This defect is most evident when testpar/t_subfiling_vfd is run with 8 ranks. b) No error reporting from I/O concentrators -- must design and implement this. For now, mostly just asserts, which suggests that it should be run in debug mode. c) Much commented out and/or un-used code. d) Code orgnaization e) Build system with bits of Mercury is awkward -- think of shifting to pthreads with our own thread pool code. f) Need to add native support for vector and selection I/O to the subfiling VFD. g) Need to review, and posibly rework configuration code. h) Need to store subfile configuration data in a superblock extension message, and add code to use this data on file open. i) Test code is inadequate -- expect more issues as it is extended. In particular, there is no unit test code for the I/O request dispatch code. While I think it is correct at present, we need test code to verify this. Similarly, we need to test with multiple I/O concentrators and much smaller stripe depth. My actual code changes were limited to: src/H5FDioc.c src/H5FDioc_threads.c src/H5FDsubfile_int.c src/H5FDsubfile_mpi.c src/H5FDsubfiling.c src/H5FDsubfiling.h src/H5FDsubfiling_priv.h testpar/t_subfiling_vfd.c testpar/t_vfd.c I'm not sure what is going on with the deletions in src/mercury/src/util. Tested parallel/debug on Charis and Jelly * subfiling with selection IO (#1219) Merged branch 'selection_io' into subfiling branch. * Subfile name fixes (#1250) * fixed subfiling naming convention, and added leading zero to rank names. * Merge branch 'selection_io' into selection_io_with_subfiling_vfd (#1265) * Added script to join subfiles into a single HDF5 file (#1350) * Modified H5FD__subfiling_query() to report that the sub-filing VFD supports MPI This exposed issues with truncate and get EOF in the sub-filing VFD. I believe I have addressed these issues (get EOF not as fully tested as it should be), howeer, it exposed race conditions resulting in hangs. As of this writing, I have not been able to chase these down. Note that the tests that expose these race conditions are in testpar/t_subfiling_vfd.c, and are currently skipped. Unskip these tests to reproduce the race conditions. tested (to the extent possible) debug/parallel on charis and jelly. * Committing clang-format changes * fixed H5MM_free Co-authored-by: mainzer <mainzer#hdfgroup.org> Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com> Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org> Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Move Subfiling VFD components into H5FDsubfiling source directory * Update Autotools build and add H5_HAVE_SUBFILING_VFD macro to H5pubconf.h * Tidy up CMake build of subfiling sources * Merge branch 'develop' into feature/subfiling (#1539) Merge branch 'develop' into feature/subfiling * Add VFD interface version field to Subfiling and IOC VFDs * Merge branch 'develop' into feature/subfiling (#1557) Merge branch 'develop' into feature/subfiling * Merge branch 'develop' into feature/subfiling (#1563) Merge branch 'develop' into feature/subfiling * Tidy up merge artifacts after rebase on develop * Fix incorrect variable in mirror VFD utils CMake * Ensure VFD values are always defined * Add subfiling to CMake VFD_LIST if built * Mark MPI I/O driver self-initialization global as static * Add Subfiling VFD to predefined VFDs for HDF5_DRIVER env. variable * Initial progress towards separating private vs. public subfiling code * include libgen.h in t_vfd tests for correct dirname/basename * Committing clang-format changes * removed mercury option, included subfiling header path (#1577) Added subfiling status to configure output, installed h5fuse.sh to build directory for use in future tests. * added check for stdatomic.h (#1578) * added check for stdatomic.h with subfiling * added H5_HAVE_SUBFILING_VFD for cmake * fix old-style-definition warning (#1582) * fix old-style-definition warning * added test for enable parallel with subfiling VFD (#1586) Fails if subfiling VFD is not used with parallel support. * Subfiling/IOC VFD fixes and tidying (#1619) * Rename CMake option for Subfiling VFD to be consistent with other VFDs * Miscellaneous Subfiling fixes Add error message for unset MPI communicator Support dynamic loading of subfiling VFD with default configuration * Temporary fix for subfile name issue * Added subfile checks (#1634) * added subfile checks * Feature/subfiling (#1655) * Subfiling/IOC VFD cleanup Fix misuse of MPI_COMM_WORLD in IOC VFD Propagate Subfiling FAPL MPI settings down to IOC FAPL in default configuration case Cleanup IOC VFD debugging code Change sprintf to snprintf in a few places * Major work on separating Subfiling and IOC VFDs from each other * Re-write async_completion func to not overuse stack * Replace usage of MPI_COMM_WORLD with file's actual MPI communicator * Refactor H5FDsubfile_mpi.c * Remove empty file H5FDsubfile_mpi.c * Separate IOC VFD errors to its own error stack * Committing clang-format changes * Remove H5TRACE macros from H5FDioc.c * Integrate H5FDioc_threads.c with IOC error stack * Fix for subfile name generation Use number of I/O concentrators from existing subfiling configuration file, if one exists * Add temporary barrier in "Get EOF" operation to prevent races on EOF Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix for retrieval of machine Host ID * Default to MPI_COMM_WORLD if no MPI params set * added libs rt and pthreads (#1673) * added libs rt and pthreads * Feature/subfiling (#1689) * More tidying of IOC VFD and subfiling debug code * Remove old unused log file code * Clear FID from active file map on failure * Fix bug in generation of subfile names when truncating file * Change subfile names to start from 1 instead of 0 * Use long long for user-specified stripe size from environment variable * Skip 0-sized I/Os in low-level IOC I/O routines * Don't update EOF on read * Convert printed warning about data size mismatch to assertion * Don't add base file address to I/O addresses twice Base address should already be applied as part of H5FDwrite/read_vector calls * Account for 0-sized I/O vector entries in subfile write/read functions * Rewrite init_indep_io for clarity * Correction for IOC wraparound calculations * Some corrections to iovec calculations * Remove temporary barrier on EOF retrieval * Complete work request queue entry on error instead of skipping over * Account for stripe size wraparound for sf_col_offset calculation * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Re-write and fix bugs in I/O vector filling routines (#1703) * Rewrite I/O vector filling routines for clarity * Fix bug with iovec_fill_last when last I/O size is 0 * added subfiling_dir line read (#1714) * added subfiling_dir line read and use it * shellcheck fixes * I/O request dispatch logic update (#1731) Short-circuit I/O request dispatch when head of I/O queue is an in-progress get EOF or truncate operation. This prevents an issue where a write operation can be dispatched alongside a get EOF/truncate operation, whereas all I/O requests are supposed to be ineligible for dispatch until the get EOF/truncate is completed * h5fuse.sh.in clean-up (#1757) * Added command-line options * Committing clang-format changes * Align with changes from develop * Mimic MPI I/O VFD for EOF handling * Initialize context_id field for work request objects * Use logfile for some debugging information * Use atomic store to set IOC ready flag * Use separate communicator for sending file EOF data Minor IOC cleanup * Use H5_subfile_fid_to_context to get context ID for file in Subfiling VFD * IOVEC calculation fixes * Updates for debugging code * Minor fixes for threaded code * Committing clang-format changes * Use separate MPI communicator for barrier operations * Committing clang-format changes * Rewrite EOF routine to use nonblocking MPI communication * Committing clang-format changes * Always dispatch I/O work requests in IOC main loop * Return distinct MPI communicator to library when requested * Minor warning cleanup * Committing clang-format changes * Generate h5fuse.sh from h5fuse.sh.in in CMake * Send truncate messages to correct IOC rank * Committing clang-format changes * Miscellaneous cleanup Post some MPI receives before sends Free some duplicated MPI communicator/Info objects Remove unnecessary extra MPI_Barrier * Warning cleanup * Fix for leaked MPI communicator * Retrieve file EOF on single rank and bcast it * Fixes for a few failure paths * Cleanup of IOC file opens * Committing clang-format changes * Use plan MPI_Send for send of EOF messages * Always check MPI thread support level during Subfiling init * Committing clang-format changes * Handle a hang on failure when IOCs can't open subfiles * Committing clang-format changes * Refactor file open status consensus check * Committing clang-format changes * Fix for MPI_Comm_free being called after MPI_Finalize * Fix VFD test by setting MPI params before setting subfiling on FAPL * Update Subfiling VFD error handling and error stack usage * Improvements for Subfiling logfiles * Remove prototypes for currently unused routines * Disable I/O queue stat collecting by default * Remove unused serialization mutex variable * Update VFD testing to take subfiling VFD into account * Fix usage of global subfiling application layout object * Minor fixes for failure pathways * Keep track of the number of failures in an IOC I/O queue * Make sure not to exceed MPI_TAG_UB value for data communication messages * Committing clang-format changes * Update for rename of some H5FD 'ctl' opcodes * Always include Subfiling's public header files in hdf5.h * Remove old unused code and comments * Implement support for per-file I/O queues Allows the subfiling VFD to have multiple HDF5 files open simultaneously * Use simple MPI_Iprobe over unnecessary MPI_Improbe * Committing clang-format changes * Update HDF5 testing to query driver for H5FD_FEAT_DEFAULT_VFD_COMPATIBLE flag * Fix a few bugs related to file multi-opens * Avoid calling MPI routines if subfiling gets reinitialized * Fix issue when files are closed in a random order * Update HDF5 testing to query VFD for "using MPI" feature flag * Register atexit handler in subfiling VFD to call MPI_Finalize after HDF5 closes * Fail for collective I/O requests until support is implemented * Correct VOL test function prototypes * Minor cleanup of old code and comments * Update mercury dependency * Cleanup of subfiling configuration structure * Committing clang-format changes * Build system updates for Subfiling VFD * Fix possible hang on failure in t_vfd tests caused by mismatched MPI_Barrier calls * Copy subfiling IOC fapl in "fapl get" method * Mirror subfiling superblock writes to stub file for legacy POSIX-y HDF5 applications * Allow collective I/O for MPI_BYTE types and rank 0 bcast strategy * Committing clang-format changes * Use different scheme for subfiling write message MPI tag calculations * Committing clang-format changes * Avoid performing fstat calls on all MPI ranks * Add MPI_Barrier before finalizing IOC threads * Use try_lock in I/O queue dispatch to minimize contention from worker threads * Use simple Waitall for nonblocking I/O waits * Add configurable IOC main thread delay and try_lock option to I/O queue dispatch * Fix bug that could cause serialization of non-overlapping I/O requests * Temporarily treat collective subfiling vector I/O calls as independent * Removed unused mercury bits * Add stubs for subfiling and IOC file delete callback * Update VFD testing for Subfiling VFD * Work around HDF5 metadata cache bug for Subfiling VFD when MPI Comm size = 1 * Committing clang-format changes Co-authored-by: mainzer <mainzer#hdfgroup.org> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org> Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com> Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org> Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
2022-07-23 04:03:12 +08:00
if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
TEST_ERROR;
/* Property list tests */
nerrors += test_getset();
nerrors += test_getset_vl(fapl);
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
/* Copy the file access property list */
2020-09-30 22:27:10 +08:00
if ((fapl2 = H5Pcopy(fapl)) < 0)
TEST_ERROR;
/* Set the "use the latest version of the format" bounds for creating objects in the file */
2020-09-30 22:27:10 +08:00
if (H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR;
/* Loop over using new group format */
for (new_format = false; new_format <= true; new_format++) {
hid_t my_fapl;
/* Set the FAPL for the type of format */
2020-09-30 22:27:10 +08:00
if (new_format) {
puts("\nTesting with new file format:");
my_fapl = fapl2;
} /* end if */
else {
puts("Testing with old file format:");
my_fapl = fapl;
} /* end else */
/* Chunked storage layout tests */
2020-09-30 22:27:10 +08:00
if (test_chunk) {
nerrors += test_create(my_fapl, FILENAME[0], H5D_CHUNKED);
2020-09-30 22:27:10 +08:00
nerrors += test_rdwr(my_fapl, FILENAME[2], H5D_CHUNKED);
nerrors += test_extend(my_fapl, FILENAME[4], H5D_CHUNKED);
nerrors += test_partalloc(my_fapl, FILENAME[8]);
} /* end if */
/* Contiguous storage layout tests */
2020-09-30 22:27:10 +08:00
if (test_contig) {
nerrors += test_create(my_fapl, FILENAME[1], H5D_CONTIGUOUS);
2020-09-30 22:27:10 +08:00
nerrors += test_rdwr(my_fapl, FILENAME[3], H5D_CONTIGUOUS);
nerrors += test_extend(my_fapl, FILENAME[5], H5D_CONTIGUOUS);
Subfiling VFD (#1883) * Added support for vector I/O calls to the VFD layer, and associated test code. Note that this includes the optimization to allow shortened sizes and types arrays to allow more space efficient representations of vectors in which all entries are of the same size and/or type. See the Selection I/o RFC for further details. Tested serial and parallel, debug and production on Charis. serial and parallel debug only on Jelly. * ran code formatter quick serial build and test on jelly * Add H5FD_read_selection() and H5FD_write_selection(). Currently only translate to scalar calls. Fix const buf in H5FD_write_vector(). * Format source * Fix comments * Add selection I/O to chunk code, used when: not using chunk cache, no datatype conversion, no I/O filters, no page buffer, not using collective I/O. Requires global variable H5_use_selection_io_g be set to TRUE. Implemented selection to vector I/O transaltion at the file driver layer. * Fix formatting unrelated to previous change to stop github from complaining. * Add full API support for selection I/O. Add tests for this. * Implement selection I/O for contiguous datasets. Fix bug in selection I/O translation. Add const qualifiers to some internal selection I/O routines to maintain const-correctness while avoiding memcpys. * Added vector read / write support to the MPIO VFD, with associated test code (see testpar/t_vfd.c). Note that this implementation does NOT support vector entries of size greater than 2 GB. This must be repaired before release, but it should be good enough for correctness testing. As MPIO requires vector I/O requests to be sorted in increasing address order, also added a vector sort utility in H5FDint.c This function is tested in passing by the MPIO vector I/O extension. In passing, repaired a bug in size / type vector extension management in H5FD_read/write_vector() Tested parallel debug and production on charis and Jelly. * Ran source code formatter * Add support for independent parallel I/O with selection I/O. Add HDF5_USE_SELECTION_IO env var to control selection I/O (default off). * Implement parallel collective support for selection I/O. * Fix comments and run formatter. * Update selection IO branch with develop (#1215) Merged branch 'develop' into selection_io * Sync with develop (#1262) Updated the branch with develop changes. * Implement big I/O support for vector I/O requests in the MPIO file driver. * Free arrays in H5FD__mpio_read/write_vector() as soon as they're not needed, to cut down on memory usage during I/O. * Address comments from code review. Fix const warnings with H5S_SEL_ITER_INIT(). * Committing clang-format changes * Feature/subfiling (#1464) * Initial checkin of merged sub-filing VFD. Passes regression tests (debug/shared/paralle) on Jelly. However, bugs and many compiler warnings remain -- not suitable for merge to develop. * Minor mods to src/H5FDsubfile_mpi.c to address errors reported by autogen.sh * Code formatting run -- no test * Merged my subfiling code fixes into the new selection_io_branch * Forgot to add the FindMERCURY.cmake file. This will probably disappear soon * attempting to make a more reliable subfile file open which doesn't return errors. For some unknown reason, the regular posix open will occasionally fail to create a subfile. Some better error handling for file close has been added. * added NULL option for H5FD_subfiling_config_t in H5Pset_fapl_subfiling (#1034) * NULL option automatically stacks IOC VFD for subfiling and returns a valid fapl. * added doxygen subfiling APIs * Various fixes which allow the IOR benchmark to run correctly * Lots of updates including the packaging up of the mercury_util source files to enable easier builds for our Benchmarking * Interim checkin of selection_io_with_subfiling_vfd branch Moddified testpar/t_vfd.c to test the subfiling vfd with default configuration. Must update this code to run with a variety of configurations -- most particularly multiple IO concentrators, and stripe depth small enough to test the other IO concentrators. testpar/t_vfd.c exposed a large number of race condidtions -- symtoms included: 1) Crashes (usually seg faults) 2) Heap corruption 3) Stack corruption 4) Double frees of heap space 5) Hangs 6) Out of order execution of I/O requests / violations of POSIX semantics 7) Swapped write requests Items 1 - 4 turned out to be primarily caused by file close issues -- specifically, the main I/O concentrator thread and its pool of worker threads were not being shut down properly on file close. Addressing this issue in combination with some other minor fixes seems to have addressed these issues. Items 5 & 6 appear to have been caused by issue of I/O requests to the thread pool in an order that did not maintain POSIX semantics. A rewrite of the I/O request dispatch code appears to have solved these issues. Item 7 seems to have been caused by multiple write requests from a given rank being read by the wrong worker thread. Code to issue "unique" tags for each write request via the ACK message appears to have cleaned this up. Note that the code is still in poor condtition. A partial list of known defects includes: a) Race condiditon on file close that allows superblock writes to arrive at the I/O concentrator after it has been shutdown. This defect is most evident when testpar/t_subfiling_vfd is run with 8 ranks. b) No error reporting from I/O concentrators -- must design and implement this. For now, mostly just asserts, which suggests that it should be run in debug mode. c) Much commented out and/or un-used code. d) Code orgnaization e) Build system with bits of Mercury is awkward -- think of shifting to pthreads with our own thread pool code. f) Need to add native support for vector and selection I/O to the subfiling VFD. g) Need to review, and posibly rework configuration code. h) Need to store subfile configuration data in a superblock extension message, and add code to use this data on file open. i) Test code is inadequate -- expect more issues as it is extended. In particular, there is no unit test code for the I/O request dispatch code. While I think it is correct at present, we need test code to verify this. Similarly, we need to test with multiple I/O concentrators and much smaller stripe depth. My actual code changes were limited to: src/H5FDioc.c src/H5FDioc_threads.c src/H5FDsubfile_int.c src/H5FDsubfile_mpi.c src/H5FDsubfiling.c src/H5FDsubfiling.h src/H5FDsubfiling_priv.h testpar/t_subfiling_vfd.c testpar/t_vfd.c I'm not sure what is going on with the deletions in src/mercury/src/util. Tested parallel/debug on Charis and Jelly * subfiling with selection IO (#1219) Merged branch 'selection_io' into subfiling branch. * Subfile name fixes (#1250) * fixed subfiling naming convention, and added leading zero to rank names. * Merge branch 'selection_io' into selection_io_with_subfiling_vfd (#1265) * Added script to join subfiles into a single HDF5 file (#1350) * Modified H5FD__subfiling_query() to report that the sub-filing VFD supports MPI This exposed issues with truncate and get EOF in the sub-filing VFD. I believe I have addressed these issues (get EOF not as fully tested as it should be), howeer, it exposed race conditions resulting in hangs. As of this writing, I have not been able to chase these down. Note that the tests that expose these race conditions are in testpar/t_subfiling_vfd.c, and are currently skipped. Unskip these tests to reproduce the race conditions. tested (to the extent possible) debug/parallel on charis and jelly. * Committing clang-format changes * fixed H5MM_free Co-authored-by: mainzer <mainzer#hdfgroup.org> Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com> Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org> Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Move Subfiling VFD components into H5FDsubfiling source directory * Update Autotools build and add H5_HAVE_SUBFILING_VFD macro to H5pubconf.h * Tidy up CMake build of subfiling sources * Merge branch 'develop' into feature/subfiling (#1539) Merge branch 'develop' into feature/subfiling * Add VFD interface version field to Subfiling and IOC VFDs * Merge branch 'develop' into feature/subfiling (#1557) Merge branch 'develop' into feature/subfiling * Merge branch 'develop' into feature/subfiling (#1563) Merge branch 'develop' into feature/subfiling * Tidy up merge artifacts after rebase on develop * Fix incorrect variable in mirror VFD utils CMake * Ensure VFD values are always defined * Add subfiling to CMake VFD_LIST if built * Mark MPI I/O driver self-initialization global as static * Add Subfiling VFD to predefined VFDs for HDF5_DRIVER env. variable * Initial progress towards separating private vs. public subfiling code * include libgen.h in t_vfd tests for correct dirname/basename * Committing clang-format changes * removed mercury option, included subfiling header path (#1577) Added subfiling status to configure output, installed h5fuse.sh to build directory for use in future tests. * added check for stdatomic.h (#1578) * added check for stdatomic.h with subfiling * added H5_HAVE_SUBFILING_VFD for cmake * fix old-style-definition warning (#1582) * fix old-style-definition warning * added test for enable parallel with subfiling VFD (#1586) Fails if subfiling VFD is not used with parallel support. * Subfiling/IOC VFD fixes and tidying (#1619) * Rename CMake option for Subfiling VFD to be consistent with other VFDs * Miscellaneous Subfiling fixes Add error message for unset MPI communicator Support dynamic loading of subfiling VFD with default configuration * Temporary fix for subfile name issue * Added subfile checks (#1634) * added subfile checks * Feature/subfiling (#1655) * Subfiling/IOC VFD cleanup Fix misuse of MPI_COMM_WORLD in IOC VFD Propagate Subfiling FAPL MPI settings down to IOC FAPL in default configuration case Cleanup IOC VFD debugging code Change sprintf to snprintf in a few places * Major work on separating Subfiling and IOC VFDs from each other * Re-write async_completion func to not overuse stack * Replace usage of MPI_COMM_WORLD with file's actual MPI communicator * Refactor H5FDsubfile_mpi.c * Remove empty file H5FDsubfile_mpi.c * Separate IOC VFD errors to its own error stack * Committing clang-format changes * Remove H5TRACE macros from H5FDioc.c * Integrate H5FDioc_threads.c with IOC error stack * Fix for subfile name generation Use number of I/O concentrators from existing subfiling configuration file, if one exists * Add temporary barrier in "Get EOF" operation to prevent races on EOF Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix for retrieval of machine Host ID * Default to MPI_COMM_WORLD if no MPI params set * added libs rt and pthreads (#1673) * added libs rt and pthreads * Feature/subfiling (#1689) * More tidying of IOC VFD and subfiling debug code * Remove old unused log file code * Clear FID from active file map on failure * Fix bug in generation of subfile names when truncating file * Change subfile names to start from 1 instead of 0 * Use long long for user-specified stripe size from environment variable * Skip 0-sized I/Os in low-level IOC I/O routines * Don't update EOF on read * Convert printed warning about data size mismatch to assertion * Don't add base file address to I/O addresses twice Base address should already be applied as part of H5FDwrite/read_vector calls * Account for 0-sized I/O vector entries in subfile write/read functions * Rewrite init_indep_io for clarity * Correction for IOC wraparound calculations * Some corrections to iovec calculations * Remove temporary barrier on EOF retrieval * Complete work request queue entry on error instead of skipping over * Account for stripe size wraparound for sf_col_offset calculation * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Re-write and fix bugs in I/O vector filling routines (#1703) * Rewrite I/O vector filling routines for clarity * Fix bug with iovec_fill_last when last I/O size is 0 * added subfiling_dir line read (#1714) * added subfiling_dir line read and use it * shellcheck fixes * I/O request dispatch logic update (#1731) Short-circuit I/O request dispatch when head of I/O queue is an in-progress get EOF or truncate operation. This prevents an issue where a write operation can be dispatched alongside a get EOF/truncate operation, whereas all I/O requests are supposed to be ineligible for dispatch until the get EOF/truncate is completed * h5fuse.sh.in clean-up (#1757) * Added command-line options * Committing clang-format changes * Align with changes from develop * Mimic MPI I/O VFD for EOF handling * Initialize context_id field for work request objects * Use logfile for some debugging information * Use atomic store to set IOC ready flag * Use separate communicator for sending file EOF data Minor IOC cleanup * Use H5_subfile_fid_to_context to get context ID for file in Subfiling VFD * IOVEC calculation fixes * Updates for debugging code * Minor fixes for threaded code * Committing clang-format changes * Use separate MPI communicator for barrier operations * Committing clang-format changes * Rewrite EOF routine to use nonblocking MPI communication * Committing clang-format changes * Always dispatch I/O work requests in IOC main loop * Return distinct MPI communicator to library when requested * Minor warning cleanup * Committing clang-format changes * Generate h5fuse.sh from h5fuse.sh.in in CMake * Send truncate messages to correct IOC rank * Committing clang-format changes * Miscellaneous cleanup Post some MPI receives before sends Free some duplicated MPI communicator/Info objects Remove unnecessary extra MPI_Barrier * Warning cleanup * Fix for leaked MPI communicator * Retrieve file EOF on single rank and bcast it * Fixes for a few failure paths * Cleanup of IOC file opens * Committing clang-format changes * Use plan MPI_Send for send of EOF messages * Always check MPI thread support level during Subfiling init * Committing clang-format changes * Handle a hang on failure when IOCs can't open subfiles * Committing clang-format changes * Refactor file open status consensus check * Committing clang-format changes * Fix for MPI_Comm_free being called after MPI_Finalize * Fix VFD test by setting MPI params before setting subfiling on FAPL * Update Subfiling VFD error handling and error stack usage * Improvements for Subfiling logfiles * Remove prototypes for currently unused routines * Disable I/O queue stat collecting by default * Remove unused serialization mutex variable * Update VFD testing to take subfiling VFD into account * Fix usage of global subfiling application layout object * Minor fixes for failure pathways * Keep track of the number of failures in an IOC I/O queue * Make sure not to exceed MPI_TAG_UB value for data communication messages * Committing clang-format changes * Update for rename of some H5FD 'ctl' opcodes * Always include Subfiling's public header files in hdf5.h * Remove old unused code and comments * Implement support for per-file I/O queues Allows the subfiling VFD to have multiple HDF5 files open simultaneously * Use simple MPI_Iprobe over unnecessary MPI_Improbe * Committing clang-format changes * Update HDF5 testing to query driver for H5FD_FEAT_DEFAULT_VFD_COMPATIBLE flag * Fix a few bugs related to file multi-opens * Avoid calling MPI routines if subfiling gets reinitialized * Fix issue when files are closed in a random order * Update HDF5 testing to query VFD for "using MPI" feature flag * Register atexit handler in subfiling VFD to call MPI_Finalize after HDF5 closes * Fail for collective I/O requests until support is implemented * Correct VOL test function prototypes * Minor cleanup of old code and comments * Update mercury dependency * Cleanup of subfiling configuration structure * Committing clang-format changes * Build system updates for Subfiling VFD * Fix possible hang on failure in t_vfd tests caused by mismatched MPI_Barrier calls * Copy subfiling IOC fapl in "fapl get" method * Mirror subfiling superblock writes to stub file for legacy POSIX-y HDF5 applications * Allow collective I/O for MPI_BYTE types and rank 0 bcast strategy * Committing clang-format changes * Use different scheme for subfiling write message MPI tag calculations * Committing clang-format changes * Avoid performing fstat calls on all MPI ranks * Add MPI_Barrier before finalizing IOC threads * Use try_lock in I/O queue dispatch to minimize contention from worker threads * Use simple Waitall for nonblocking I/O waits * Add configurable IOC main thread delay and try_lock option to I/O queue dispatch * Fix bug that could cause serialization of non-overlapping I/O requests * Temporarily treat collective subfiling vector I/O calls as independent * Removed unused mercury bits * Add stubs for subfiling and IOC file delete callback * Update VFD testing for Subfiling VFD * Work around HDF5 metadata cache bug for Subfiling VFD when MPI Comm size = 1 * Committing clang-format changes Co-authored-by: mainzer <mainzer#hdfgroup.org> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org> Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com> Co-authored-by: Richard Warren <Richard.Warren@hdfgroup.org> Co-authored-by: Richard.Warren <richard.warren@jelly.ad.hdfgroup.org>
2022-07-23 04:03:12 +08:00
if (driver_is_default_compatible) {
nerrors += test_compatible();
}
} /* end if */
/* Compact dataset storage tests */
2020-09-30 22:27:10 +08:00
if (test_compact) {
nerrors += test_create(my_fapl, FILENAME[6], H5D_COMPACT);
2020-09-30 22:27:10 +08:00
nerrors += test_rdwr(my_fapl, FILENAME[7], H5D_COMPACT);
} /* end if */
2020-09-30 22:27:10 +08:00
} /* end for */
/* Close 2nd FAPL */
H5Pclose(fapl2);
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
2020-09-30 22:27:10 +08:00
if (nerrors)
goto error;
puts("All fill value tests passed.");
2020-09-30 22:27:10 +08:00
if (h5_cleanup(FILENAME, fapl))
HDremove(FILE_NAME_RAW);
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
exit(EXIT_SUCCESS);
error:
puts("***** FILL VALUE TESTS FAILED *****");
exit(EXIT_FAILURE);
[svn-r735] Changes since 19981002 ---------------------- ./src/H5D.c Fill values are working for contiguous datasets now except there are two things that need more support from the data space layer, specifically the ability to form a selection from the difference of two selections. They are (1) extending an external contiguous dataset, (2) optimization by delaying the fill until after the first H5Dwrite(). Renamed H5D_allocate() to H5D_init_storage() since allocation is only part of the story. Added a data space argument so it doesn't have to query the space from the object header -- the space is always available in the caller anyway. Removed `#ifdef HAVE_PARALLEL' from a few places where it wasn't necessary. We don't need it around code that doesn't compile anything from mpi.h or mpio.h. ./src/H5Fistore.c Uncommented H5F_istore_alloc() for non-parallel and moved the `#ifdef HAVE_PARALLEL' just around Kim's barrier. ./src/H5Fmpio.c Wrapped a couple long lines. Got rid of two signed vs. unsigned comparison warnings. ./MANIFEST ./test/Makefile.in ./test/fillval.c [NEW] Added tests for fill values. The contiguous dataset extend test is disabled until H5S_SELECT_DIFF is implemented. ./tools/Makefile.in Fixed a bug where `make test' didn't build the executables first. This should cause the snapshots to start up again. ./Makefile.in Changed to build in `test' directory before `tools' directory. We want the library tests to pass before we even start considering the tools. You can still build and/or test the tools independent of the library tests passing.
1998-10-06 05:01:10 +08:00
}