Skip to content

Commit

Permalink
Hdf5 1 12 parallel compression merge (#1529)
Browse files Browse the repository at this point in the history
* Fix the function cast error in H5Dchunk.c and activate (#1170)

`-Werror=cast-function-type`.  Again.

* Parallel Compression improvements (#1302)

* Fix for parallel compression examples on Windows (#1459)

* Parallel compression adjustments for HDF5 1.12

* Committing clang-format changes

Co-authored-by: David Young <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 28, 2022
1 parent 15971fb commit 95b2c3b
Show file tree
Hide file tree
Showing 28 changed files with 11,945 additions and 5,813 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,14 @@ if (HDF5_ENABLE_PARALLEL)

# Used by Parallel Compression feature
set (PARALLEL_FILTERED_WRITES ON)
CHECK_SYMBOL_EXISTS (MPI_Mprobe "mpi.h" H5_HAVE_MPI_Mprobe)
CHECK_SYMBOL_EXISTS (MPI_Imrecv "mpi.h" H5_HAVE_MPI_Imrecv)
if (NOT H5_HAVE_MPI_Mprobe OR NOT H5_HAVE_MPI_Imrecv)
message (WARNING "The MPI_Mprobe and/or MPI_Imrecv functions could not be located.
CHECK_SYMBOL_EXISTS (MPI_Ibarrier "mpi.h" H5_HAVE_MPI_Ibarrier)
CHECK_SYMBOL_EXISTS (MPI_Issend "mpi.h" H5_HAVE_MPI_Issend)
CHECK_SYMBOL_EXISTS (MPI_Iprobe "mpi.h" H5_HAVE_MPI_Iprobe)
CHECK_SYMBOL_EXISTS (MPI_Irecv "mpi.h" H5_HAVE_MPI_Irecv)
if (H5_HAVE_MPI_Ibarrier AND H5_HAVE_MPI_Issend AND H5_HAVE_MPI_Iprobe AND H5_HAVE_MPI_Irecv)
set (H5_HAVE_PARALLEL_FILTERED_WRITES 1)
else ()
message (WARNING "The MPI_Ibarrier/MPI_Issend/MPI_Iprobe/MPI_Irecv functions could not be located.
Parallel writes of filtered data will be disabled.")
set (PARALLEL_FILTERED_WRITES OFF)
endif ()
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@
./examples/h5_ref2reg_deprec.c
./examples/h5_shared_mesg.c
./examples/ph5example.c
./examples/ph5_filtered_writes.c
./examples/ph5_filtered_writes_no_sel.c
./examples/h5_vds.c
./examples/h5_vds-exc.c
./examples/h5_vds-exclim.c
Expand Down
3 changes: 3 additions & 0 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@
/* Define if we have parallel support */
#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@

/* Define if we have support for writing to filtered datasets in parallel */
#cmakedefine H5_HAVE_PARALLEL_FILTERED_WRITES @H5_HAVE_PARALLEL_FILTERED_WRITES@

/* Define if both pread and pwrite exist. */
#cmakedefine H5_HAVE_PREADWRITE @H5_HAVE_PREADWRITE@

Expand Down
5 changes: 1 addition & 4 deletions config/gnu-warnings/error-8
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# NOTE: src/ files are not compatible with these warnings as errors
# src/H5Dchunk.c
# -Werror=cast-function-type
-Wcast-function-type
-Werror=cast-function-type
#
# For GCC 8, promote maybe-initialized warnings to an error. GCC 8
# reports 0 maybe-uninitialized warnings where earlier versions
Expand Down
17 changes: 10 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3098,28 +3098,31 @@ if test -n "$PARALLEL"; then
fi

## ----------------------------------------------------------------------
## Check for the MPI-3 functions necessary for the Parallel Compression
## Check for the MPI functions necessary for the Parallel Compression
## feature. If these are not present, issue a warning that Parallel
## Compression will be disabled.
##
AC_MSG_CHECKING([for MPI_Mprobe and MPI_Imrecv functions])
AC_MSG_CHECKING([for MPI_Ibarrier/MPI_Issend/MPI_Iprobe/MPI_Irecv functions])

AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <mpi.h>
]],
[[
MPI_Message message;
int flag;
MPI_Init(0, (void *) 0);
MPI_Mprobe(0, 0, 0, &message, (void *) 0);
MPI_Imrecv((void *) 0, 0, 0, (void *) 0, (void *) 0);
MPI_Ibarrier(0, (void *) 0);
MPI_Issend((void *) 0, 0, 0, 0, 0, 0, (void *) 0);
MPI_Iprobe(0, 0, 0, &flag, (void *) 0);
MPI_Irecv((void *) 0, 0, 0, 0, 0, 0, (void *) 0);
]]
)],
[AC_MSG_RESULT([yes])
PARALLEL_FILTERED_WRITES=yes],
PARALLEL_FILTERED_WRITES=yes
AC_DEFINE([HAVE_PARALLEL_FILTERED_WRITES], [1], [Define if we have support for writing to filtered datasets in parallel])],
[AC_MSG_RESULT([no])
AC_MSG_WARN([A simple MPI program using the MPI_Mprobe and MPI_Imrecv functions could not be compiled and linked.
AC_MSG_WARN([A simple MPI program using the MPI_Ibarrier, MPI_Issend, MPI_Iprobe and MPI_Irecv functions could not be compiled and linked.
Parallel writes of filtered data will be disabled.])
PARALLEL_FILTERED_WRITES=no]
)
Expand Down
42 changes: 26 additions & 16 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ set (examples
h5_vds-percival-unlim-maxmin
)

if (H5_HAVE_PARALLEL)
set (parallel_examples
ph5example
ph5_filtered_writes
ph5_filtered_writes_no_sel
)
endif ()

foreach (example ${examples})
add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
target_include_directories (${example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
Expand All @@ -63,23 +71,25 @@ foreach (example ${examples})
endforeach ()

if (H5_HAVE_PARALLEL)
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
target_include_directories (ph5example PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (ph5example STATIC)
target_link_libraries (ph5example PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
else ()
TARGET_C_PROPERTIES (ph5example SHARED)
target_link_libraries (ph5example PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
endif ()
set_target_properties (ph5example PROPERTIES FOLDER examples)
foreach (parallel_example ${parallel_examples})
add_executable (${parallel_example} ${HDF5_EXAMPLES_SOURCE_DIR}/${parallel_example}.c)
target_include_directories (${parallel_example} PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${parallel_example} STATIC)
target_link_libraries (${parallel_example} PRIVATE ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
else ()
TARGET_C_PROPERTIES (${parallel_example} SHARED)
target_link_libraries (${parallel_example} PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
endif ()
set_target_properties (${parallel_example} PROPERTIES FOLDER examples)

#-----------------------------------------------------------------------------
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_EXAMPLES_ph5example_FORMAT ph5example)
endif ()
#-----------------------------------------------------------------------------
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_EXAMPLES_${parallel_example}_FORMAT ${parallel_example})
endif ()
endforeach ()
endif ()

if (BUILD_TESTING AND HDF5_TEST_EXAMPLES)
Expand Down
40 changes: 22 additions & 18 deletions examples/CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,26 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND NOT WIN32)
# Ensure that 24 is a multiple of the number of processes.
# The number 24 corresponds to SPACE1_DIM1 and SPACE1_DIM2 defined in ph5example.c
math(EXPR NUMPROCS "24 / ((24 + ${MPIEXEC_MAX_NUMPROCS} - 1) / ${MPIEXEC_MAX_NUMPROCS})")
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5example> ${MPIEXEC_POSTFLAGS})
else ()
add_test (NAME MPI_TEST_EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5example>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
-D "TEST_OUTPUT=ph5example.out"
-D "TEST_REFERENCE:STRING=PHDF5 tests finished with no errors"
-D "TEST_FILTER:STRING=PHDF5 tests finished with no errors"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
endif ()
if (last_test)
set_tests_properties (MPI_TEST_EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "MPI_TEST_EXAMPLES-ph5example")

foreach (parallel_example ${parallel_examples})
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME MPI_TEST_EXAMPLES-${parallel_example} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${parallel_example}> ${MPIEXEC_POSTFLAGS})
else ()
add_test (NAME MPI_TEST_EXAMPLES-${parallel_example} COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:${parallel_example}>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
-D "TEST_OUTPUT=${parallel_example}.out"
-D "TEST_REFERENCE:STRING=PHDF5 example finished with no errors"
#-D "TEST_FILTER:STRING=PHDF5 tests finished with no errors"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
endif ()
if (last_test)
set_tests_properties (MPI_TEST_EXAMPLES-${parallel_example} PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "MPI_TEST_EXAMPLES-${parallel_example}")
endforeach ()
endif ()
6 changes: 4 additions & 2 deletions examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
include $(top_srcdir)/config/commence.am

if BUILD_PARALLEL_CONDITIONAL
EXAMPLE_PROG_PARA = ph5example
EXAMPLE_PROG_PARA = ph5example ph5_filtered_writes ph5_filtered_writes_no_sel
endif

INSTALL_SCRIPT_FILES = run-c-ex.sh
Expand Down Expand Up @@ -50,7 +50,7 @@ INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c h5_compou
h5_group.c h5_select.c h5_attribute.c h5_mount.c h5_drivers.c \
h5_reference_deprec.c h5_ref_extern.c h5_ref_compat.c h5_ref2reg_deprec.c \
h5_extlink.c h5_elink_unix2win.c h5_shared_mesg.c h5_debug_trace.c \
ph5example.c \
ph5example.c ph5_filtered_writes.c ph5_filtered_writes_no_sel.c \
h5_vds.c h5_vds-exc.c h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c \
h5_vds-percival.c h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c

Expand Down Expand Up @@ -119,6 +119,8 @@ h5_reference_deprec: $(srcdir)/h5_reference_deprec.c
h5_ref2reg_deprec: $(srcdir)/h5_ref2reg_deprec.c
h5_drivers: $(srcdir)/h5_drivers.c
ph5example: $(srcdir)/ph5example.c
ph5_filtered_writes: $(srcdir)/ph5_filtered_writes.c
ph5_filtered_writes_no_sel: $(srcdir)/ph5_filtered_writes_no_sel.c
h5_dtransform: $(srcdir)/h5_dtransform.c
h5_extlink: $(srcdir)/h5_extlink.c $(EXTLINK_DIRS)
h5_elink_unix2win: $(srcdir)/h5_elink_unix2win.c $(EXTLINK_DIRS)
Expand Down
Loading

0 comments on commit 95b2c3b

Please sign in to comment.