Skip to content

Commit

Permalink
Merge remote-tracking branch 'canonical/develop' into HDoff_t_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins committed Jun 7, 2024
2 parents 233b4cc + 5500743 commit 8098c35
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ on:
pull_request:
branches: [ develop ]

# The config file handles things like http 500 errors from sites like GitLab
# and http 200 responses
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: '.github/workflows/markdown_config.json'
3 changes: 3 additions & 0 deletions .github/workflows/markdown_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"aliveStatusCodes": [200, 500]
}
1 change: 1 addition & 0 deletions CMakeVOL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LO
set (HDF5_LIBRARIES "${HDF5_LIBSH_TARGET};${LINK_LIBS};${LINK_COMP_LIBS};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>")
set (HDF5_INCLUDE_DIRS "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
set (HDF5_IS_PARALLEL ${H5_HAVE_PARALLEL})
set (HDF5_VERSION ${HDF5_PACKAGE_VERSION})

set (HDF5_C_LIBRARIES "${HDF5_LIBRARIES}")

Expand Down
5 changes: 4 additions & 1 deletion release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,10 @@ New Features

Tools:
------
-
- Allow h5repack to reserve space for a user block without a file

This is useful for users who want to reserve space
in the file for future use without requiring a file to copy.


High-Level APIs:
Expand Down
20 changes: 10 additions & 10 deletions src/H5CX.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,18 +289,18 @@ typedef struct H5CX_t {
(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */
bool mpio_coll_chunk_multi_ratio_ind_set; /* Whether instrumented "collective chunk multi ratio ind"
value is set */
bool mpio_coll_rank0_bcast; /* Instrumented "collective chunk multi ratio ind" value
(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */
bool mpio_coll_rank0_bcast_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */
#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
#endif /* H5_HAVE_PARALLEL */
uint32_t no_selection_io_cause; /* Reason for not performing selection I/O
(H5D_XFER_NO_SELECTION_IO_CAUSE_NAME) */
bool no_selection_io_cause_set; /* Whether reason for not performing selection I/O is set */
bool mpio_coll_rank0_bcast; /* Instrumented "collective rank 0 broadcast" value
(H5D_XFER_COLL_RANK0_BCAST_NAME) */
bool mpio_coll_rank0_bcast_set; /* Whether instrumented "collective rank 0 broadcast" value is set */
#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
#endif /* H5_HAVE_PARALLEL */
uint32_t no_selection_io_cause; /* Reason for not performing selection I/O
(H5D_XFER_NO_SELECTION_IO_CAUSE_NAME) */
bool no_selection_io_cause_set; /* Whether reason for not performing selection I/O is set */
bool no_selection_io_cause_valid; /* Whether reason for not performing selection I/O is valid */

uint32_t
actual_selection_io_mode; /* Actual selection I/O mode used (H5D_ACTUAL_SELECTION_IO_MODE_NAME) */
uint32_t actual_selection_io_mode; /* Actual selection I/O mode used
(H5D_XFER_ACTUAL_SELECTION_IO_MODE_NAME) */
bool actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */
bool actual_selection_io_mode_valid; /* Whether actual selection I/O mode is valid */

Expand Down
2 changes: 1 addition & 1 deletion src/H5Ppublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void
/**
* \brief Callback function for H5Pcreate_class()
*
* \param[in] prop_id The identifier of the property list class being created
* \param[in] prop_id The identifier of the property list class being closed
* \param[in] close_data User pointer to any close data required
* \return \herr_t
*
Expand Down
8 changes: 4 additions & 4 deletions test/tgenprop.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ test_genprop_cls_cpy_cb1(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, vo
}

static herr_t
test_genprop_cls_cls_cb1(hid_t list_id, void *create_data)
test_genprop_cls_cls_cb1(hid_t list_id, void *close_data)
{
count_data_t *cdata = (count_data_t *)create_data;
count_data_t *cdata = (count_data_t *)close_data;

cdata->count++;
cdata->id = list_id;
Expand Down Expand Up @@ -1006,9 +1006,9 @@ static prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */
**
****************************************************************/
static herr_t
test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *create_data)
test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *copy_data)
{
count_data_t *cdata = (count_data_t *)create_data;
count_data_t *cdata = (count_data_t *)copy_data;

cdata->count++;
cdata->id = new_list_id;
Expand Down
8 changes: 6 additions & 2 deletions tools/src/h5repack/h5repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,12 @@ check_options(pack_opt_t *options)
}
}

if (options->ublock_filename == NULL && options->ublock_size != 0)
H5TOOLS_GOTO_ERROR((-1), "file name missing for user block");
if (options->ublock_filename == NULL && options->ublock_size != 0) {
if (options->verbose > 0) {
printf("Warning: user block file name missing. Reserving a size of %ld...\n",
options->ublock_size);
}
}

/*------------------------------------------------------------------------
* Verify alignment options; threshold is zero default but alignment not
Expand Down
2 changes: 1 addition & 1 deletion tools/src/h5repack/h5repack_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
*-------------------------------------------------------------------------
*/

if (options->ublock_size > 0) {
if (options->ublock_filename != NULL && options->ublock_size > 0) {
if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0)
H5TOOLS_GOTO_ERROR((-1), "Could not copy user block. Exiting...");
}
Expand Down
48 changes: 48 additions & 0 deletions tools/test/h5repack/CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,51 @@
)
endmacro ()

macro (ADD_H5_VERIFY_USERBLOCK testname userblocksize testfile)
if (NOT HDF5_USING_ANALYSIS_TOOL)
add_test (
NAME H5REPACK_VERIFY_USERBLOCK-${testname}-clear-objects
COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
)
add_test (
NAME H5REPACK_VERIFY_USERBLOCK-${testname}
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_VERIFY_USERBLOCK-${testname} PROPERTIES
DEPENDS H5REPACK_VERIFY_USERBLOCK-${testname}-clear-objects
)
if ("H5REPACK_VERIFY_USERBLOCK-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}")
set_tests_properties (H5REPACK_VERIFY_USERBLOCK-${testname} PROPERTIES DISABLED true)
endif ()
add_test (
NAME H5REPACK_VERIFY_USERBLOCK-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_FILTER:STRING=USERBLOCK_SIZE ${userblocksize}"
-D "TEST_REFERENCE=USERBLOCK_SIZE ${userblocksize}"
-P "${HDF_RESOURCES_DIR}/grepTest.cmake"
)
set_tests_properties (H5REPACK_VERIFY_USERBLOCK-${testname}_DMP PROPERTIES
DEPENDS H5REPACK_VERIFY_USERBLOCK-${testname}
)
if ("H5REPACK_VERIFY_USERBLOCK-${testname}_DMP" MATCHES "${HDF5_DISABLE_TESTS_REGEX}")
set_tests_properties (H5REPACK_VERIFY_USERBLOCK-${testname}_DMP PROPERTIES DISABLED true)
endif ()
add_test (
NAME H5REPACK_VERIFY_USERBLOCK-${testname}-clean-objects
COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
)
set_tests_properties (H5REPACK_VERIFY_USERBLOCK-${testname}-clean-objects PROPERTIES
DEPENDS H5REPACK_VERIFY_USERBLOCK-${testname}_DMP
)
endif ()
endmacro ()

macro (ADD_H5_TEST_META testname testfile)
# Remove any output file left over from previous test run
add_test (
Expand Down Expand Up @@ -1719,6 +1764,9 @@
set (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048)
ADD_H5_TEST (add_userblock "TEST" ${arg})

# add a userblock reserve to file
ADD_H5_VERIFY_USERBLOCK (reserve_userblock 2048 ${FILE1} -b 2048)

# add alignment
set (arg ${FILE1} -t 1 -a 1)
ADD_H5_TEST (add_alignment "TEST" ${arg})
Expand Down
4 changes: 4 additions & 0 deletions tools/test/h5repack/h5repack.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,10 @@ fi
arg="h5repack_objs.h5 -u ublock.bin -b 2048"
TOOLTEST add_userblock $arg

# reserve a userblock to file
arg="h5repack_objs.h5 -b 2048"
TOOLTEST reserve_userblock $arg

# add alignment
arg="h5repack_objs.h5 -t 1 -a 1 "
TOOLTEST add_alignment $arg
Expand Down

0 comments on commit 8098c35

Please sign in to comment.