Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated H5VOL for HDF5 v1.13 #2945

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/user_guide/source/setting_up/source/cmake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ Notes:
.. code-block:: bash

# Several dependencies are installed under /opt/foo/bar and then a
# single dependency (HDF5 in this case) is installed in /opt/hdf5/1.12.0
# single dependency (HDF5 in this case) is installed in /opt/hdf5/1.13.0
$ export CMAKE_PREFIX_PATH=/opt/foo/bar
$ cmake -DHDF5_ROOT=/opt/hdf5/1.12.0 ../ADIOS2
$ cmake -DHDF5_ROOT=/opt/hdf5/1.13.0 ../ADIOS2

Example: the following configuration will build, test and install under /opt/adios2/2.7.1 an optimized (Release) version of ADIOS2.

Expand Down
16 changes: 8 additions & 8 deletions scripts/ci/images/power8-el7-leaf-smpi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ ENV MPI_ROOT=/opt/ibm/spectrum_mpi \
PATH=/opt/ibm/spectrum_mpi/bin:${PATH} \
LD_LIBRARY_PATH=/opt/ibm/spectrum_mpi/lib:${PATH}

# Install HDF5 1.12.0
# Install HDF5 1.13.0
WORKDIR /opt/hdf5
ARG HDF5_ARGS
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2 | \
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.0/src/hdf5-1.13.0.tar.bz2 | \
tar -xvj && \
mkdir build && \
cd build && \
cmake ${HDF5_ARGS} \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.12.0 \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.13.0 \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -29,13 +29,13 @@ RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0
-DBUILD_TESTING=OFF \
-DHDF5_BUILD_TOOLS=ON \
-DHDF5_ENABLE_PARALLEL=ON \
../hdf5-1.12.0 && \
../hdf5-1.13.0 && \
make -j$(grep -c '^processor' /proc/cpuinfo) install && \
cd .. && \
rm -rf hdf5-1.12.0 build
ENV PATH=/opt/hdf5/1.12.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.12.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.12.0:${CMAKE_PREFIX_PATH}
rm -rf hdf5-1.13.0 build
ENV PATH=/opt/hdf5/1.13.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.13.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.13.0:${CMAKE_PREFIX_PATH}

# Misc cleanup of unneeded files
RUN rm -rf /tmp/* && \
Expand Down
16 changes: 8 additions & 8 deletions scripts/ci/images/power8-el7-leaf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ARG COMPILER
FROM ornladios/adios2:ci-x86_64-power8-el7-${COMPILER}-base

# Install HDF5 1.12.0
# Install HDF5 1.13.0
WORKDIR /opt/hdf5
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2 | \
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.0/src/hdf5-1.13.0.tar.bz2 | \
tar -xvj && \
mkdir build && \
cd build && \
cmake \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.12.0 \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.13.0 \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -17,13 +17,13 @@ RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0
-DHDF5_BUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DHDF5_BUILD_TOOLS=OFF \
../hdf5-1.12.0 && \
../hdf5-1.13.0 && \
make -j$(grep -c '^processor' /proc/cpuinfo) install && \
cd .. && \
rm -rf hdf5-1.12.0 build
ENV PATH=/opt/hdf5/1.12.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.12.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.12.0:${CMAKE_PREFIX_PATH}
rm -rf hdf5-1.13.0 build
ENV PATH=/opt/hdf5/1.13.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.13.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.13.0:${CMAKE_PREFIX_PATH}

# Misc cleanup of unneeded files
RUN rm -rf /tmp/* && \
Expand Down
16 changes: 8 additions & 8 deletions scripts/ci/images/suse-nvhpcsdk-openmpi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM ornladios/adios2:ci-suse-nvhpcsdk-base

# Install HDF5 1.12.0
# Install HDF5 1.13.0
WORKDIR /opt/hdf5
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2 | \
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.0/src/hdf5-1.13.0.tar.bz2 | \
tar -xvj && \
mkdir build && \
cd build && \
source /etc/profile && \
module load nvhpc && \
/opt/cmake/bin/cmake \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.12.0 \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.13.0 \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -18,13 +18,13 @@ RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0
-DHDF5_BUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DHDF5_BUILD_TOOLS=OFF \
../hdf5-1.12.0 && \
../hdf5-1.13.0 && \
make -j$(grep -c '^processor' /proc/cpuinfo) install && \
cd .. && \
rm -rf hdf5-1.12.0 build
ENV PATH=/opt/hdf5/1.12.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.12.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.12.0:${CMAKE_PREFIX_PATH}
rm -rf hdf5-1.13.0 build
ENV PATH=/opt/hdf5/1.13.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.13.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.13.0:${CMAKE_PREFIX_PATH}

# Misc cleanup of unneeded files
RUN rm -rf /tmp/* && \
Expand Down
14 changes: 7 additions & 7 deletions scripts/ci/images/suse-nvhpcsdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ FROM ornladios/adios2:ci-suse-nvhpcsdk-base

# Install HDF5
WORKDIR /opt/hdf5
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2 | \
RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.0/src/hdf5-1.13.0.tar.bz2 | \
tar -xvj && \
mkdir build && \
cd build && \
source /etc/profile && \
module load nvhpc-nompi && \
/opt/cmake/bin/cmake \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.12.0 \
-DCMAKE_INSTALL_PREFIX=/opt/hdf5/1.13.0 \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_STATIC_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -18,13 +18,13 @@ RUN curl -L https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0
-DHDF5_BUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DHDF5_BUILD_TOOLS=OFF \
../hdf5-1.12.0 && \
../hdf5-1.13.0 && \
make -j$(grep -c '^processor' /proc/cpuinfo) install && \
cd .. && \
rm -rf hdf5-1.12.0 build
ENV PATH=/opt/hdf5/1.12.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.12.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.12.0:${CMAKE_PREFIX_PATH}
rm -rf hdf5-1.13.0 build
ENV PATH=/opt/hdf5/1.13.0/bin:${PATH} \
LD_LIBRARY_PATH=/opt/hdf5/1.13.0/lib:${LD_LIBRARY_PATH} \
CMAKE_PREFIX_PATH=/opt/hdf5/1.13.0:${CMAKE_PREFIX_PATH}

# Misc cleanup of unneeded files
RUN rm -rf /tmp/* && \
Expand Down
10 changes: 10 additions & 0 deletions source/h5vol/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ target_include_directories(adios2_h5vol PRIVATE ${HDF5_C_INCLUDE_DIRS})
target_link_libraries(adios2_h5vol PRIVATE
${HDF5_C_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
)

message(STATUS "HDF5_VERSION=${HDF5_VERSION}")
if (HDF5_VERSION)
if (HDF5_VERSION VERSION_LESS "1.13")
message(FATAL_ERROR "HDF5 version 1.13+ is required")
endif()
else()
message(WARNING "Version of HDF5 is unknown, but version 1.13+ is required.")
endif()

if(NOT HDF5_IS_PARALLEL)
target_link_libraries(adios2_h5vol PRIVATE adios2::c)
elseif(HDF5_IS_PARALLEL AND ADIOS2_HAVE_MPI)
Expand Down
6 changes: 3 additions & 3 deletions source/h5vol/H5VolReadWrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ H5VL_GroupDef_t *gCreateGroupDef(const char *name)
return grp;
}

ssize_t gGetBranchNameLength(H5VL_ObjDef_t *vol, size_t namelen)
size_t gGetBranchNameLength(H5VL_ObjDef_t *vol, size_t namelen)
{
if (vol->m_Path != NULL)
if ('/' == (vol->m_Path)[strlen(vol->m_Path) - 1])
Expand Down Expand Up @@ -654,7 +654,7 @@ void gGetBranchName(H5VL_ObjDef_t *vol, const char *fullPath, char *name)
//
// returns length of name
//
ssize_t gGetNameOfNthAttr(H5VL_ObjDef_t *vol, uint32_t idx, char *name)
size_t gGetNameOfNthAttr(H5VL_ObjDef_t *vol, uint32_t idx, char *name)
{
gLoadContent(vol);
if (0 == vol->m_NumAttrs)
Expand Down Expand Up @@ -689,7 +689,7 @@ ssize_t gGetNameOfNthAttr(H5VL_ObjDef_t *vol, uint32_t idx, char *name)
// called from: H5Gget_info, then H5Gget_objname_by_idx
// (which calls H5Lget_name.. )
//
ssize_t gGetNameOfNthItem(H5VL_ObjDef_t *vol, uint32_t idx, char *name)
size_t gGetNameOfNthItem(H5VL_ObjDef_t *vol, uint32_t idx, char *name)
{
gLoadContent(vol);

Expand Down
13 changes: 8 additions & 5 deletions source/h5vol/H5VolReadWrite.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ extern herr_t H5VL_adios2_beginstep(const char *engine_name,
extern herr_t H5VL_adios2_endstep(const char *engine_nane);

static herr_t H5VL_adios2_introspect_opt_query(void *obj, H5VL_subclass_t cls,
int opt_type, hbool_t *supported)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This old signature is actually the correct one, with the hbool_t * changed to a uint64_t * instead.

int opt_type,
uint64_t *supported)
{
*supported = 0;
return 0;
Expand All @@ -52,10 +53,11 @@ static herr_t H5VL_adios2_datatype_close(void *dt, hid_t H5_ATTR_UNUSED dxpl_id,
static const H5VL_class_t H5VL_adios2_def = {
H5VL_ADIOS2_VERSION,
(H5VL_class_value_t)H5VL_ADIOS2_VALUE,
H5VL_ADIOS2_NAME, /* name */
0,
H5VL_adios2_init, /* initialize */
H5VL_adios2_term, /* terminate */
H5VL_ADIOS2_NAME, /* name */
0, /* Version # of connector */
H5VL_CAP_FLAG_NONE, /* Capability flags for connector */
H5VL_adios2_init, /* initialize */
H5VL_adios2_term, /* terminate */
{
/* info_cls */
(size_t)0, /* info size */
Expand Down Expand Up @@ -118,6 +120,7 @@ static const H5VL_class_t H5VL_adios2_def = {
{
/* introspect_cls */
NULL, // H5VL_pass_through_introspect_get_conn_cls, /* get_conn_cls */
NULL, /* get_cap_flags */
H5VL_adios2_introspect_opt_query, /* opt_query */
},
{
Expand Down
53 changes: 35 additions & 18 deletions source/h5vol/H5Vol_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,29 +154,39 @@ void GetFromAttribute(void *attrObj, hid_t *ret_id, H5VL_attr_get_t get_type)
}
}

herr_t H5VL_adios2_attr_get(void *obj, H5VL_attr_get_t get_type, hid_t dxpl_id,
void **req, va_list arguments)
herr_t H5VL_adios2_attr_get(void *obj, H5VL_attr_get_args_t *args,
hid_t dxpl_id, void **req)
{
REQUIRE_NOT_NULL_ERR(obj, -1);
H5VL_ObjDef_t *vol = (H5VL_ObjDef_t *)obj;

if ((get_type == H5VL_ATTR_GET_SPACE) || (get_type == H5VL_ATTR_GET_TYPE))
switch (args->op_type)
{
hid_t *ret_id = va_arg(arguments, hid_t *);
GetFromAttribute((vol->m_ObjPtr), ret_id, get_type);
case H5VL_ATTR_GET_SPACE:
{
hid_t *ret_id = (hid_t *)args->args.get_space.space_id;
GetFromAttribute((vol->m_ObjPtr), ret_id, args->op_type);
return 0;
}
case H5VL_ATTR_GET_TYPE:
{
hid_t *ret_id = (hid_t *)args->args.get_type.type_id;
GetFromAttribute((vol->m_ObjPtr), ret_id, args->op_type);
return 0;
}
default:
break;
}

const H5VL_loc_params_t *loc_params =
va_arg(arguments, const H5VL_loc_params_t *);
REQUIRE_NOT_NULL_ERR(loc_params, -1);

switch (get_type)
switch (args->op_type)
{
case H5VL_ATTR_GET_NAME:
{
char *buf = va_arg(arguments, char *);
ssize_t *ret_val = va_arg(arguments, ssize_t *);
char *buf = args->args.get_name.buf;
size_t *ret_val = (size_t *)args->args.get_name.attr_name_len;

const H5VL_loc_params_t *loc_params = &args->args.get_name.loc_params;
REQUIRE_NOT_NULL_ERR(loc_params, -1);

if (H5VL_OBJECT_BY_SELF == loc_params->type)
{
Expand Down Expand Up @@ -222,19 +232,22 @@ herr_t H5VL_adios2_attr_close(void *attr, hid_t dxpl_id, void **req)
}

herr_t H5VL_adios2_attr_specific(void *obj, const H5VL_loc_params_t *loc_params,
H5VL_attr_specific_t specific_type,
hid_t dxpl_id, void **req, va_list arguments)
H5VL_attr_specific_args_t *args, hid_t dxpl_id,
void **req)
{
REQUIRE_NOT_NULL_ERR(obj, -1);
H5VL_ObjDef_t *vol = (H5VL_ObjDef_t *)obj;
const char *attr_name = va_arg(arguments, const char *);

adios2_attribute *attr = gLocateAttrFrom(vol, attr_name);
const char *attr_name;
adios2_attribute *attr;

switch (specific_type)
switch (args->op_type)
{
case H5VL_ATTR_DELETE:
{
attr_name = (const char *)args->args.del.name;
attr = gLocateAttrFrom(vol, attr_name);

if (NULL != attr)
{
if (NULL == vol->m_Path)
Expand All @@ -250,7 +263,11 @@ herr_t H5VL_adios2_attr_specific(void *obj, const H5VL_loc_params_t *loc_params,
}
case H5VL_ATTR_EXISTS:
{
htri_t *ret = va_arg(arguments, htri_t *);
hbool_t *ret = args->args.exists.exists;

attr_name = (const char *)args->args.exists.name;
attr = gLocateAttrFrom(vol, attr_name);

if (NULL == attr)
{
*ret = 0;
Expand Down
10 changes: 5 additions & 5 deletions source/h5vol/H5Vol_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,26 @@ herr_t H5VL_adios2_dataset_read(void *dset, hid_t mem_type_id,
return gADIOS2ReadVar(var);
}

herr_t H5VL_adios2_dataset_get(void *dset, H5VL_dataset_get_t get_type,
hid_t dxpl_id, void **req, va_list arguments)
herr_t H5VL_adios2_dataset_get(void *dset, H5VL_dataset_get_args_t *args,
hid_t dxpl_id, void **req)
{
REQUIRE_NOT_NULL_ERR(dset, -1);
H5VL_ObjDef_t *vol = (H5VL_ObjDef_t *)dset;
H5VL_VarDef_t *varDef = (H5VL_VarDef_t *)(vol->m_ObjPtr);

switch (get_type)
switch (args->op_type)
{
case H5VL_DATASET_GET_SPACE:
{
hid_t *ret_id = va_arg(arguments, hid_t *);
hid_t *ret_id = (hid_t *)args->args.get_space.space_id;
*ret_id = H5Scopy(varDef->m_ShapeID);
REQUIRE_SUCC_MSG((*ret_id >= 0), -1,
"H5VOL-ADIOS2: Unable to get space id.");
break;
}
case H5VL_DATASET_GET_TYPE:
{
hid_t *ret_id = va_arg(arguments, hid_t *);
hid_t *ret_id = (hid_t *)args->args.get_type.type_id;
*ret_id = H5Tcopy(varDef->m_TypeID);
break;
}
Expand Down
Loading