Skip to content

Commit

Permalink
Merge branch 'HDFGroup:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee authored Aug 19, 2024
2 parents 9b6acf4 + adc3a37 commit 5003e81
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 41 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,19 @@ jobs:
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
snap_name: hdf5-${{ needs.call-workflow-tarball.outputs.source_base }}
use_environ: release
secrets:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_ENDPOINT: ${{ secrets.AZURE_ENDPOINT }}
AZURE_CODE_SIGNING_NAME: ${{ secrets.AZURE_CODE_SIGNING_NAME }}
AZURE_CERT_PROFILE_NAME: ${{ secrets.AZURE_CERT_PROFILE_NAME }}

call-workflow-abi:
needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest]
uses: ./.github/workflows/abi-report.yml
with:
file_ref: '1_14_3'
file_ref: '1.14.4.3'
file_base: ${{ needs.call-workflow-tarball.outputs.file_base }}
use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }}
use_environ: release
Expand Down
2 changes: 2 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
"BLOSC_ZLIB_PACKAGE_NAME": {"type": "STRING", "value": "zlib"},
"BLOSC2_TGZ_NAME": {"type": "STRING", "value": "c-blosc2-2.14.4.tar.gz"},
"BLOSC2_PACKAGE_NAME": {"type": "STRING", "value": "blosc2"},
"BLOSC2_ZLIB_TGZ_NAME": {"type": "STRING", "value": "zlib-1.3.tar.gz"},
"BLOSC2_ZLIB_PACKAGE_NAME": {"type": "STRING", "value": "zlib"},
"BZ2_TGZ_NAME": {"type": "STRING", "value": "bzip2-bzip2-1.0.8.tar.gz"},
"BZ2_PACKAGE_NAME": {"type": "STRING", "value": "bz2"},
"FPZIP_TGZ_NAME": {"type": "STRING", "value": "fpzip-1.3.0.tar.gz"},
Expand Down
8 changes: 8 additions & 0 deletions config/cmake/cacheinit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ set (BLOSC2_TGZ_NAME "c-blosc2-2.14.4.tar.gz" CACHE STRING "Use BLOSC2 from comp

set (BLOSC2_PACKAGE_NAME "blosc2" CACHE STRING "Name of BLOSC2 package" FORCE)

set (BLOSC2_ZLIB_GIT_URL "https://github.com/madler/zlib.git" CACHE STRING "Use ZLIB from GitHub repository" FORCE)
set (BLOSC2_ZLIB_GIT_BRANCH "develop" CACHE STRING "" FORCE)

set (BLOSC2_ZLIB_TGZ_ORIGPATH "https://github.com/madler/zlib/releases/download/v1.3" CACHE STRING "Use PLUGINS from original location" FORCE)
set (BLOSC2_ZLIB_TGZ_NAME "zlib-1.3.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)

set (BLOSC2_ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of BLOSC2_ZLIB package" FORCE)

########
# bzip2
########
Expand Down
20 changes: 14 additions & 6 deletions release_docs/INSTALL_CMake.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
------bin
------include
------lib
--------plugins
------cmake

On Linux, change to the install destination directory
Expand All @@ -162,6 +163,7 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
------bin
------include
------lib
--------plugins
------share

On Mac you will find HDF5-1.15."X"-Darwin.dmg in the myhdfstuff folder. Click
Expand All @@ -173,6 +175,7 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to:
------bin
------include
------lib
--------plugins
------share

By default the installation will create the bin, include, lib and cmake
Expand Down Expand Up @@ -239,6 +242,7 @@ Notes: This short set of instructions is written for users who want to
------bin
------include
------lib
--------plugins
------cmake

On Linux, change to the install destination directory
Expand All @@ -257,6 +261,7 @@ Notes: This short set of instructions is written for users who want to
------bin
------include
------lib
--------plugins
------share

On Mac you will find HDF5-1.15."X"-Darwin.dmg in the build folder. Click
Expand All @@ -268,6 +273,7 @@ Notes: This short set of instructions is written for users who want to
------bin
------include
------lib
--------plugins
------share


Expand Down Expand Up @@ -411,10 +417,8 @@ IV. Further considerations
Notes: CMake and HDF5

1. Using CMake for building and using HDF5 is under active development.
While we have attempted to provide error-free files, please
understand that development with CMake has not been extensively
tested outside of HDF. The CMake specific files may change
before the next release.
We have attempted to provide error-free files. The CMake specific
files may change before the next release.

2. CMake support for HDF5 development should be usable on any
system where CMake is supported. Please send us any comments on
Expand Down Expand Up @@ -587,6 +591,11 @@ These five steps are described in detail below.
set (BLOSC2_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc2/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE)
set (BLOSC2_TGZ_NAME "c-blosc2-2.14.4.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE)
set (BLOSC2_PACKAGE_NAME "blosc2" CACHE STRING "Name of BLOSC2 package" FORCE)
set (BLOSC2_ZLIB_GIT_URL "https://github.com/madler/zlib.git" CACHE STRING "Use ZLIB from GitHub repository" FORCE)
set (BLOSC2_ZLIB_GIT_BRANCH "develop" CACHE STRING "" FORCE)
set (BLOSC2_ZLIB_TGZ_ORIGPATH "https://github.com/madler/zlib/releases/download/v1.3" CACHE STRING "Use PLUGINS from original location" FORCE)
set (BLOSC2_ZLIB_TGZ_NAME "zlib-1.3.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
set (BLOSC2_ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of BLOSC2_ZLIB package" FORCE)
########
# bzip2
########
Expand Down Expand Up @@ -663,7 +672,7 @@ These five steps are described in detail below.

2.1 Visual CMake users, click the Configure button. If this is the first time you are
running cmake-gui in this directory, you will be prompted for the
generator you wish to use (for example on Windows, Visual Studio 12).
generator you wish to use (for example on Windows, Visual Studio 14).
CMake will read in the CMakeLists.txt files from the source directory and
display options for the HDF5 project. After the first configure you
can adjust the cache settings and/or specify the locations of other programs.
Expand Down Expand Up @@ -1124,7 +1133,6 @@ Using individual command presets (where <compiler-type> is GNUC or MSVC or Clan
ctest --preset ci-StdShar-<compiler-type>
cpack --preset ci-StdShar-<compiler-type>


Using the workflow preset to configure, build, test and package the standard configuration:
change directory to the hdf5 source folder
execute "cmake --workflow --preset ci-StdShar-<compiler-type> --fresh"
Expand Down
14 changes: 7 additions & 7 deletions src/H5Rdeprec.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)

/* Check if using native VOL connector */
if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5G_UNKNOWN,
"can't determine if VOL object is native connector object");

/* Must use native VOL connector for this operation */
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5G_UNKNOWN,
"H5Rget_obj_type1 is only meant to be used with the native VOL connector");

/* Get object type */
Expand Down Expand Up @@ -341,12 +341,12 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref)

/* Check if using native VOL connector */
if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID,
"can't determine if VOL object is native connector object");

/* Must use native VOL connector for this operation */
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5I_INVALID_HID,
"H5Rdereference1 is only meant to be used with the native VOL connector");

/* Get object type */
Expand Down Expand Up @@ -614,12 +614,12 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *re

/* Check if using native VOL connector */
if (H5VL_object_is_native(vol_obj, &is_native_vol_obj) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID,
"can't determine if VOL object is native connector object");

/* Must use native VOL connector for this operation */
if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5I_INVALID_HID,
"H5Rdereference2 is only meant to be used with the native VOL connector");

/* Get object type */
Expand Down Expand Up @@ -694,7 +694,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref)
"can't query if file uses native VOL connector");

if (!is_native_vol_obj)
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, FAIL,
HGOTO_ERROR(H5E_REFERENCE, H5E_VOL, H5I_INVALID_HID,
"H5Rget_region is only meant to be used with the native VOL connector");

/* Get object type */
Expand Down
2 changes: 1 addition & 1 deletion src/H5TSsemaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ H5TS_semaphore_wait(H5TS_semaphore_t *sem)
*
* Purpose: Increments (unlocks) the semaphore. If the semaphore's value
* becomes greater than zero, then another thread blocked in a wait
* call will be woken up and proceed to lock the semaphore.
* call will proceed to lock the semaphore.
*
* Return: Non-negative on success / Negative on failure
*
Expand Down
52 changes: 48 additions & 4 deletions test/tfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8100,6 +8100,49 @@ test_min_dset_ohdr(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_min_dset_ohdr() */

/****************************************************************
**
** test_unseekable_file():
** Test that attempting to open an unseekable file fails gracefully
** without a segfault (see hdf5#1498)
****************************************************************/
static void
test_unseekable_file(void)
{
hid_t file_id = H5I_INVALID_HID; /* File ID */

/* Output message about test being performed */
MESSAGE(5, ("Testing creating/opening an unseekable file\n"));

/* Creation */
#ifdef H5_HAVE_WIN32_API
file_id = H5Fcreate("NUL", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
#else
file_id = H5Fcreate("/dev/null", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
#endif

H5Fclose(file_id);

/* Open, truncate */
#ifdef H5_HAVE_WIN32_API
file_id = H5Fopen("NUL", H5F_ACC_TRUNC, H5P_DEFAULT);
#else
file_id = H5Fopen("/dev/null", H5F_ACC_TRUNC, H5P_DEFAULT);
#endif

H5Fclose(file_id);

/* Open, RDWR */
#ifdef H5_HAVE_WIN32_API
file_id = H5Fopen("NUL", H5F_ACC_RDWR, H5P_DEFAULT);
#else
file_id = H5Fopen("/dev/null", H5F_ACC_RDWR, H5P_DEFAULT);
#endif

H5Fclose(file_id);

exit(EXIT_SUCCESS);
}
/****************************************************************
**
** test_deprec():
Expand Down Expand Up @@ -8419,10 +8462,11 @@ test_file(void)

test_libver_bounds(); /* Test compatibility for file space management */
test_libver_bounds_low_high(driver_name);
test_libver_macros(); /* Test the macros for library version comparison */
test_libver_macros2(); /* Test the macros for library version comparison */
test_incr_filesize(); /* Test H5Fincrement_filesize() and H5Fget_eoa() */
test_min_dset_ohdr(); /* Test dataset object header minimization */
test_libver_macros(); /* Test the macros for library version comparison */
test_libver_macros2(); /* Test the macros for library version comparison */
test_incr_filesize(); /* Test H5Fincrement_filesize() and H5Fget_eoa() */
test_min_dset_ohdr(); /* Test dataset object header minimization */
test_unseekable_file(); /* Test attempting to open/create an unseekable file */
#ifndef H5_NO_DEPRECATED_SYMBOLS
test_file_ishdf5(driver_name); /* Test detecting HDF5 files correctly */
test_deprec(driver_name); /* Test deprecated routines */
Expand Down
25 changes: 13 additions & 12 deletions test/trefer.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,21 +618,22 @@ test_reference_obj(void)

/* Check file name for reference */
namelen = H5Rget_file_name(&rbuf[0], NULL, 0);
CHECK(namelen, FAIL, "H5Dget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Dget_file_name");
CHECK(namelen, FAIL, "H5Rget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Rget_file_name");

/* Make sure size parameter is ignored */
namelen = H5Rget_file_name(&rbuf[0], NULL, 200);
CHECK(namelen, FAIL, "H5Dget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Dget_file_name");
CHECK(namelen, FAIL, "H5Rget_file_name");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Rget_file_name");

/* Get the file name for the reference */
namebuf = (char *)malloc((size_t)namelen + 1);
namelen = H5Rget_file_name(&rbuf[0], (char *)namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Dget_file_name");
namelen = H5Rget_file_name(&rbuf[0], namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Rget_file_name");
VERIFY(strcmp(namebuf, FILE_REF_OBJ), 0, "namebuf vs FILE_REF_OBJ");
VERIFY(namelen, strlen(FILE_REF_OBJ), "H5Rget_file_name");

ret = !((strcmp(namebuf, FILE_REF_OBJ) == 0) && (namelen == strlen(FILE_REF_OBJ)));
CHECK(ret, FAIL, "H5Literate");
free(namebuf);

/* Testing Dataset1 */

Expand All @@ -644,7 +645,8 @@ test_reference_obj(void)
namebuf = (char *)malloc((size_t)namelen + 1);
namelen = H5Rget_obj_name(&rbuf[0], H5P_DEFAULT, namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Rget_obj_name");
VERIFY(strcmp(namebuf, DS1_REF_OBJ), 0, "strcmp namebuf vs DS1_REF_OBJ");
VERIFY(strcmp(namebuf, DS1_REF_OBJ), 0, "namebuf vs DS1_REF_OBJ");
VERIFY(namelen, strlen(DS1_REF_OBJ), "H5Rget_obj_name");

/* Open dataset object */
ref_ds1 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
Expand Down Expand Up @@ -697,13 +699,12 @@ test_reference_obj(void)

/* Getting the name of the referenced object and verify it */
namelen = H5Rget_obj_name(&rbuf[1], H5P_DEFAULT, NULL, 0);
CHECK(namelen, FAIL, "H5Rget_obj_name");
VERIFY(namelen, strlen(DS2_REF_OBJ), "H5Rget_obj_name");

namebuf = (char *)malloc((size_t)namelen + 1);
namelen = H5Rget_obj_name(&rbuf[1], H5P_DEFAULT, namebuf, (size_t)namelen + 1);
CHECK(namelen, FAIL, "H5Rget_obj_name");
VERIFY(strcmp(namebuf, DS2_REF_OBJ), 0, "strcmp namebuf vs DS2_REF_OBJ");
VERIFY(namelen, strlen(DS2_REF_OBJ), "H5Rget_obj_name");
VERIFY(strcmp(namebuf, DS2_REF_OBJ), 0, "namebuf vs DS2_REF_OBJ");

/* Open dataset object */
ref_ds2 = H5Ropen_object(&rbuf[1], H5P_DEFAULT, dapl_id);
Expand Down
2 changes: 0 additions & 2 deletions test/ttsafe.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ main(int argc, char *argv[])
AddTest("rec_rwlock_4", tts_rec_rw_lock_smoke_check_4, NULL,
"recursive R/W lock smoke check 4 -- mixed mob", NULL);
#endif /* !H5_HAVE_WIN_THREADS */
#ifdef H5_HAVE_STDATOMIC_H
AddTest("semaphore", tts_semaphore, NULL, "lightweight system semaphores", NULL);
#endif /* H5_HAVE_STDATOMIC_H */

#ifdef H5_HAVE_THREADSAFE
AddTest("thread_id", tts_thread_id, NULL, "thread IDs", NULL);
Expand Down
2 changes: 0 additions & 2 deletions test/ttsafe.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ void tts_is_threadsafe(void);
#ifdef H5_HAVE_THREADS
void tts_thread_pool(void);
void tts_atomics(void);
#ifdef H5_HAVE_STDATOMIC_H
void tts_semaphore(void);
#endif /* H5_HAVE_STDATOMIC_H */
void tts_rec_rw_lock_smoke_check_1(void);
void tts_rec_rw_lock_smoke_check_2(void);
void tts_rec_rw_lock_smoke_check_3(void);
Expand Down
14 changes: 8 additions & 6 deletions test/ttsafe_semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "ttsafe.h"

#if defined(H5_HAVE_THREADS) && defined(H5_HAVE_STDATOMIC_H)
#if defined(H5_HAVE_THREADS)

#define NUM_PINGPONG (1000 * 1000)
#define NUM_CLIENTSERVER (50 * 1000)
Expand All @@ -40,18 +40,19 @@ static H5TS_THREAD_RETURN_TYPE
ping(void *_test_info)
{
pingpong_t *test_info = (pingpong_t *)_test_info;
unsigned count;
herr_t result;
H5TS_thread_ret_t ret_value = 0;

do {
result = H5TS_semaphore_wait(&test_info->ping_sem);
CHECK_I(result, "H5TS_semaphore_wait");

test_info->counter++;
count = ++test_info->counter;

result = H5TS_semaphore_signal(&test_info->pong_sem);
CHECK_I(result, "H5TS_semaphore_signal");
} while (test_info->counter < NUM_PINGPONG);
} while (count < NUM_PINGPONG);

return ret_value;
}
Expand All @@ -60,18 +61,19 @@ static H5TS_THREAD_RETURN_TYPE
pong(void *_test_info)
{
pingpong_t *test_info = (pingpong_t *)_test_info;
unsigned count;
herr_t result;
H5TS_thread_ret_t ret_value = 0;

do {
result = H5TS_semaphore_wait(&test_info->pong_sem);
CHECK_I(result, "H5TS_semaphore_wait");

test_info->counter++;
count = ++test_info->counter;

result = H5TS_semaphore_signal(&test_info->ping_sem);
CHECK_I(result, "H5TS_semaphore_signal");
} while (test_info->counter < NUM_PINGPONG);
} while (count < NUM_PINGPONG);

return ret_value;
}
Expand Down Expand Up @@ -268,4 +270,4 @@ tts_semaphore(void)
tts_semaphore_clientserver();
} /* end tts_semaphore() */

#endif /* defined(H5_HAVE_THREADS) && defined(H5_HAVE_STDATOMIC_H) */
#endif /* defined(H5_HAVE_THREADS) */

0 comments on commit 5003e81

Please sign in to comment.