* Implement support for complex number datatypes
Adds the new datatype class H5T_COMPLEX
Adds the new API function H5Tcomplex_create which creates a complex
number datatype from an ID of a base floating-point datatype
Adds the new feature check macros H5_HAVE_COMPLEX_NUMBERS and
H5_HAVE_C99_COMPLEX_NUMBERS
Adds the new datatype size macros H5_SIZEOF_FLOAT_COMPLEX,
H5_SIZEOF_DOUBLE_COMPLEX and H5_SIZEOF_LONG_DOUBLE_COMPLEX
Adds the new datatype ID macros H5T_NATIVE_FLOAT_COMPLEX,
H5T_NATIVE_DOUBLE_COMPLEX, H5T_NATIVE_LDOUBLE_COMPLEX,
H5T_CPLX_IEEE_F16LE, H5T_CPLX_IEEE_F16BE,
H5T_CPLX_IEEE_F32LE, H5T_CPLX_IEEE_F32BE,
H5T_CPLX_IEEE_F64LE and H5T_CPLX_IEEE_F64BE
Adds hard and soft datatype conversion paths between complex number
datatypes and all the integer and floating-point datatypes, as well as
between other complex number datatypes
Adds a special conversion path between complex number datatypes and
array or compound datatypes where the in-memory layout of data is the
same between the datatypes and data can be converted directly
Adds support for complex number datatypes to the h5dump, h5ls and
h5diff/ph5diff tools. Allows h5dump '-m' option to change floating-point
printing format for float complex and double complex datatypes, as well
as long double complex if it has the same size as double complex
Adds minimal support to the h5watch and h5import tools
Adds support for the predefined complex number datatypes and
H5Tcomplex_create function to the Java wrappers. Also adds initial,
untested support to the JNI for future use with HDFView
Adds support for just the H5T_COMPLEX datatype class to the Fortran
wrappers
Adds support for the predefined complex number datatypes and
H5Tcomplex_create function to the high level library H5LT interface
for use with the H5LTtext_to_dtype and H5LTdtype_to_text functions
Changes some usages of "complex" in the library since it conflicts with
the "complex" keyword from the complex.h header. Also changes various
usages of the word "complex" throughout the library to distinguish
compound datatypes from complex datatypes.
oss-fuzz often trips over unfreed datatype memory when parsing
fuzzed files. This changes H5T__free() to use HDONE macros so
cleanup continues on errors.
oss-fuzz occasionally complains about intermittent undefined behavior
when when Boolean variables in H5C_cache_entry_t (like is_protected)
are set to values other than 0 or 1 when parsing fuzzed files. Using
calloc() to iniitialize the H5B_t struct (like other metadata already
does) should fix this.
Added another argument, expected node level, to H5B__iterate_helper to pass down
to H5B__cache_deserialize for checking the decoded node level. When this expected
level is not known, the new macro H5_UNKNOWN_NODELEVEL (-1) will be used for not
checking the level.
Fixes GH-4432
The name check in the FUNC_ENTER checks for private FUNC_ENTER macros
(which have NOAPI in the name) only checked for not having the
public form (H5Xfoo), so they could be inappropriately applied to
package-level functions (H5X__foo).
This PR fixes the bug and updates the inappropriate macros.
gcc 14 identifies likely places where the sizeof() call is used
for the first parameter to calloc(). This PR fixes the remaining
places in the library where this occurs and reworks a few other
allocations to be more uniform.
* Cast away a signed/unsigned issue in H5HFhuge.c
* Use our platform-independent POSIX types in external_common.c
and h5test.c
* Replace a memset() call with a (const) array initializer in h5test.c
* Fix an unused done: target in h5diff
The version number in the Autotools is scraped from README.md in configure.ac, which makes README.md count as 'code', which is a problem since changes to markdown files are ignored in CI.
This change scrapes the version number from H5public.h instead
of README.md.
* Split CMake HDFCompileFlags into specific compiler files
* Separate out CXX Flags
* Add Fortran compiler specific files
* Merge in #4816 changes and close#4816
* fix hanging endif
---------
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Since each API context is local to a thread, use the stack to
store the context instead of allocating & releasing it each time.
This improves performance (slightly), reduces alloc/free calls,
and eliminates the H5FL package from the push & pop operations,
which helps simplify threadsafe operation.
One effect of this change is that the H5VLstart_lib_state /
H5VLfinish_lib_state API routines for pass through connector
authors now require a parameter that can be used to store
the library's context. It was probably a mistake to assume
that these two routines would not do this previously, so this
is essentially a bug fix for them.
Some other minor things:
* Added API context push+pop operations to cache tests
(I'm not actually certain why this was working before) and
a few other places
* Cleaned up a bunch of warnings in test code (calloc args, mainly)
* Made header file inclusions more standard in some source files
- Reverts PR#1024, which (unnecessarily) switched from deferred
package initialization to centralized initialization of all packages
and introduced H5FDperform_init() to wrap an internal routine
to initialize VFD plugins.
- Went back to deferred package initialization (primarily), to
eliminate unnecessary resource use. (Performance has been
verified to be the same either way)
- Switched VFD plugins to use “#define (H5OPEN, )” pattern,
with registration of internal VFD plugins at library initialization
time. Eliminates calling API routine (H5FDperform_init) from
within the library, which was deadlocking threadsafe concurrency.
And also eliminates exposing internal library routines in a public
header file.
- Removed copy-and-paste replicas of the H5OPEN macro and put
a (better) single definition in H5public.h
- Separated API and internal routine calls in stdio and multi VFD
plugins into separate source files, so that the library doesn’t
invoke API routines internally (also a deadlock problem for
threadsafe concurrency). Also needed a “private” header for these
plugins.
- Separated registering/unregistering a VFD plugin from initializing
/finalizing the plugin, instead of blurring those ideas together.
Defers the VFD plugin init to when it’s actually used, which reduces
resource usage, especially for the MPI-based plugins like the subfiling,
etc.
- Refactored the copy-and-pasted check for locking into a central
location in the H5FD.c code.
- Fixed a bunch of compiler warnings, especially ones that trigger CI
failures with -Werror
A recent bugfix to the library changed the return value of an API call
and a Julia CI action expects the incorrect result. This patch
papers over this until the upstream Julia wrapper CI can be fixed.
Also cleans up the links test, which had a ton of copy-and-pasted incorrect negative error checks (Calling TEST_ERROR within H5E_BEGIN_TRY / H5E_END_TRY pairs will goto out of the pair, leaving errors suppressed).
PR #4968 fixes a bug that causes the Julia CI to fail due to buggy
HDF5 behavior. The Julia CI will need to be updated to properly test
the fixed feature.