Compare commits

..

13 Commits

Author SHA1 Message Date
gsell c41bd6ec54 Merge branch '21-hdf5-1-12-and-newer-support' into 'master'
Resolve "hdf5 1.12 and newer support"

Closes #21

See merge request H5hut/src!6
2024-10-02 14:58:27 +02:00
gsell a69a88c49c version bumped to 2.0.0rc7 2024-10-02 14:57:51 +02:00
gsell 4088d02f55 hdf5 >=1.12.0 support added 2024-10-02 14:48:53 +02:00
gsell 5f57c23499 Merge branch '20-unknown-macro-ac_msg_erro' into 'master'
Resolve "unknown macro AC_MSG_ERROR"

Closes #20

See merge request H5hut/src!5
2020-08-18 09:52:31 +02:00
gsell b71fa8c9dc LT_INIT added to configure.ac, should fix unknown AC_MSG_ERROR 2020-08-18 09:51:44 +02:00
gsell 7e7a85f14f Merge branch '19-release-2-0-0rc6' into 'master'
Resolve "release 2.0.0rc6"

Closes #19

See merge request H5hut/src!4
2019-06-20 20:49:00 +02:00
gsell fc1322432c version set to 2.0.0rc6 2019-06-20 20:48:48 +02:00
gsell f5778e0197 Merge branch '18-memory-leaks-in-h5part' into 'master'
Resolve "memory leaks in H5Part"

Closes #18

See merge request H5hut/src!3
2019-06-20 20:42:33 +02:00
gsell fb084fdff4 memory leaks in H5Port core functions fixed 2019-06-20 20:42:42 +02:00
gsell be7cd1d471 Merge branch '17-in-configure-ac-exit-after-ac_msg_error-is-not-required' into 'master'
Resolve "in configure.ac: exit after AC_MSG_ERROR is not required"

Closes #17

See merge request H5hut/src!2
2019-06-20 19:01:02 +02:00
gsell f7b7a45a28 configure.ac: exit calls after ASC_MSG_ERROR removed 2019-06-20 19:01:17 +02:00
gsell e41db835eb Merge branch '15-move-dissolving-ghost-zones-into-dedicated-function' into 'master'
Resolve "move dissolving ghost-zones into dedicated function"

Closes #15

See merge request H5hut/src!1
2019-06-20 18:57:49 +02:00
gsell 8140378213 H5Block3dSetView() does not dissolve ghost-zones any more
- new API function H5Block3dSetViewDissolveGhostZones() added
2019-06-20 18:52:02 +02:00
14 changed files with 125 additions and 55 deletions
+5 -14
View File
@@ -6,10 +6,11 @@
#
# License: see file COPYING in top level of source distribution.
#
AC_INIT([H5hut], [2.0.0rc5], [h5part@lists.psi.ch], H5hut)
AC_INIT([H5hut], [2.0.0rc7], [h5part@lists.psi.ch], H5hut)
AC_PREREQ(2.60)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
LT_INIT
AM_INIT_AUTOMAKE
ENABLE_DEBUG='no'
@@ -138,7 +139,6 @@ fi
AC_PROG_CC($c_compilers)
if test "x$ac_cv_prog_cc_c89" = "xno"; then
AC_MSG_ERROR([C compiler not found!])
exit 1
fi
AC_PROG_CXX($cxx_compilers)
@@ -147,7 +147,6 @@ if test "X$ENABLE_FORTRAN" = "Xyes"; then
AC_PROG_FC($fc_compiler)
if test "x$FC" = "x"; then
AC_MSG_ERROR([Fortran compiler not found!])
exit 1
fi
fi
@@ -159,7 +158,6 @@ AX_CXX_COMPILE_STDCXX_11
AC_PROG_CC_C99
if test "x$ac_cv_prog_cc_c99" = "xno"; then
AC_MSG_ERROR([Cannot set C compiler to use C99 standard!])
exit 1
fi
@@ -281,8 +279,7 @@ if test -n "${HDF5_PREFIX}"; then
fi
AC_CHECK_LIB([hdf5], [H5open])
AS_IF([test "x$ac_cv_lib_hdf5_H5open" != xyes],
[AC_MSG_ERROR([Cannot compile and link a HDF5 program]);
exit 1])
[AC_MSG_ERROR([Cannot compile and link a HDF5 program])])
AC_MSG_CHECKING([checking whether hdf5 lib supports parallel IO])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include "hdf5.h"
@@ -429,12 +426,10 @@ if test "X$ENABLE_PARALLEL" = "Xyes"; then
AC_MSG_RESULT([yes])
AS_IF([test "x$H5_HAVE_PARALLEL" = "xno"],
[AC_MSG_ERROR([hdf5 does not support parallel IO!]);
exit 1])
[AC_MSG_ERROR([hdf5 does not support parallel IO!])])
if test "X$ENABLE_VTKCONVERTER" = "Xyes"; then
AC_MSG_ERROR([VTK to H5hut grid converter cannot be compiled parallel!])
exit 1
fi
CPPFLAGS="${CPPFLAGS} -DPARALLEL_IO -DMPICH_IGNORE_CXX_SEEK"
@@ -453,14 +448,12 @@ if test "X$ENABLE_PARALLEL" = "Xyes"; then
if test "X$r" = "Xno"; then
AC_MSG_ERROR([ParMETIS])
exit 1
fi
fi
else # --enable-parallel=no
AC_MSG_RESULT([no])
AS_IF([test "x$H5_HAVE_PARALLEL" = "xyes"],
[AC_MSG_ERROR([hdf5 with support for parallel IO cannot be used for non-parallel H5hut!]);
exit 1])
[AC_MSG_ERROR([hdf5 with support for parallel IO cannot be used for non-parallel H5hut!])])
fi
###############################################################################
@@ -481,7 +474,6 @@ if test "X$ENABLE_VTKCONVERTER" = "Xyes"; then
if test "X$?" != "X0"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Cannot compile VTK to H5hut converter])
exit 1
else
AC_MSG_RESULT([yes])
fi
@@ -490,7 +482,6 @@ if test "X$ENABLE_VTKCONVERTER" = "Xyes"; then
if test "X$?" != "X0"; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([Cannot compile VTK to H5hut converter]);
exit 1
else
AC_MSG_RESULT([yes])
fi
+2 -1
View File
@@ -69,7 +69,8 @@ h5bl_3d_setview (
f,
*i_start-1, *i_end-1,
*j_start-1, *j_end-1,
*k_start-1, *k_end-1 ));
*k_start-1, *k_end-1,
0));
}
#define h5bl_3d_getview FC_MANGLING ( \
+5 -5
View File
@@ -92,7 +92,7 @@ mpi_init (
TRY (hdf5_set_fapl_mpiposix_property (f->props->access_prop,
f->props->comm, use_gpfs));
} else if ((f->props->flags & H5_VFD_CORE)) {
} else if ((f->props->flags & H5_VFD_CORE_IO)) {
h5_info("Selecting CORE VFD");
TRY (hdf5_set_fapl_core (f->props->access_prop,
f->props->align, 1));
@@ -112,7 +112,7 @@ mpi_init (
}
#else
// VFD_MPIO_POSIX has been removed in HDF5 1.8.13
if ((f->props->flags & H5_VFD_CORE)) {
if ((f->props->flags & H5_VFD_CORE_IO)) {
h5_info("Selecting CORE VFD");
TRY (hdf5_set_fapl_core (f->props->access_prop,
f->props->align, 1));
@@ -197,7 +197,7 @@ h5_set_prop_file_mpio_collective (
(long long int)props->class);
}
#ifdef H5_HAVE_PARALLEL
props->flags &= ~(H5_VFD_MPIO_POSIX | H5_VFD_MPIO_INDEPENDENT | H5_VFD_CORE);
props->flags &= ~(H5_VFD_MPIO_POSIX | H5_VFD_MPIO_INDEPENDENT | H5_VFD_CORE_IO);
props->flags |= H5_VFD_MPIO_COLLECTIVE;
props->comm = *comm;
if (props->throttle > 0) {
@@ -225,7 +225,7 @@ h5_set_prop_file_mpio_independent (
(long long int)props->class);
}
#ifdef H5_HAVE_PARALLEL
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE);
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE_IO);
props->flags |= H5_VFD_MPIO_INDEPENDENT;
props->comm = *comm;
#else
@@ -250,7 +250,7 @@ h5_set_prop_file_mpio_posix (
(long long int)props->class);
}
#ifdef H5_HAVE_PARALLEL
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE);
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE_IO);
props->flags |= H5_VFD_MPIO_INDEPENDENT;
props->comm = *comm;
#else
+20 -17
View File
@@ -417,7 +417,6 @@ _dissolve_ghostzones (
p_el = p_save;
}
}
}
h5_free (p_begin);
H5_RETURN (H5_SUCCESS);
@@ -544,7 +543,8 @@ h5b_3d_set_view (
const h5_size_t j_start, /*!< IN: start index of \c j */
const h5_size_t j_end, /*!< IN: end index of \c j */
const h5_size_t k_start, /*!< IN: start index of \c k */
const h5_size_t k_end /*!< IN: end index of \c k */
const h5_size_t k_end, /*!< IN: end index of \c k */
const h5_int64_t dissolve_ghostzones /*!< IN: bool: dissolve ghost-zones */
) {
h5_file_p f = (h5_file_p)fh;
H5_CORE_API_ENTER (h5_err_t,
@@ -571,7 +571,6 @@ h5b_3d_set_view (
h5b_partition_t *write_layout;
TRY (user_layout = h5_calloc (f->nprocs, sizeof (*user_layout)));
TRY (write_layout = h5_calloc (f->nprocs, sizeof (*write_layout)));
user_layout[f->myproc] = b->user_layout[0];
@@ -580,11 +579,7 @@ h5b_3d_set_view (
user_layout, 1, f->b->partition_mpi_t, f->props->comm));
_get_max_dimensions(f, user_layout);
TRY (_dissolve_ghostzones (f, user_layout, write_layout));
b->user_layout[0] = user_layout[f->myproc];
b->write_layout[0] = write_layout[f->myproc];
//b->user_layout[0] = user_layout[f->myproc];
h5_debug (
"User layout: %lld:%lld, %lld:%lld, %lld:%lld",
(long long)b->user_layout[0].i_start,
@@ -594,17 +589,25 @@ h5b_3d_set_view (
(long long)b->user_layout[0].k_start,
(long long)b->user_layout[0].k_end );
h5_debug (
"Ghost-zone layout: %lld:%lld, %lld:%lld, %lld:%lld",
(long long)b->write_layout[0].i_start,
(long long)b->write_layout[0].i_end,
(long long)b->write_layout[0].j_start,
(long long)b->write_layout[0].j_end,
(long long)b->write_layout[0].k_start,
(long long)b->write_layout[0].k_end );
if (dissolve_ghostzones) {
TRY (write_layout = h5_calloc (f->nprocs, sizeof (*write_layout)));
TRY (_dissolve_ghostzones (f, user_layout, write_layout));
b->write_layout[0] = write_layout[f->myproc];
h5_debug (
"Ghost-zone layout: %lld:%lld, %lld:%lld, %lld:%lld",
(long long)b->write_layout[0].i_start,
(long long)b->write_layout[0].i_end,
(long long)b->write_layout[0].j_start,
(long long)b->write_layout[0].j_end,
(long long)b->write_layout[0].k_start,
(long long)b->write_layout[0].k_end );
h5_free(write_layout);
} else {
b->write_layout[0] = b->user_layout[0];
}
h5_free(user_layout);
h5_free(write_layout);
#else
b->write_layout[0] = b->user_layout[0];
b->i_max = b->user_layout->i_end;
+1
View File
@@ -254,5 +254,6 @@ h5u_write_dataset (
hid_t dset_id;
TRY (dset_id = h5u_open_dataset (fh, name, type));
TRY (h5u_write (fh, dset_id, type, data));
TRY (hdf5_close_dataset(dset_id));
H5_RETURN (H5_SUCCESS);
}
+4 -1
View File
@@ -152,6 +152,8 @@ h5u_set_num_items (
TRY (hdf5_close_dataspace (u->shape));
u->shape = H5S_ALL;
TRY (hdf5_close_dataspace (u->memshape));
u->memshape = H5S_ALL;
u->nparticles = (hsize_t)nparticles;
@@ -212,7 +214,8 @@ h5u_set_num_items (
TRY( u->shape = hdf5_create_dataspace(1, &count, NULL) );
/* declare overall data size but then will select a subset */
TRY( u->diskshape = hdf5_create_dataspace(1, &count, NULL) );
TRY (hdf5_close_dataspace (u->diskshape));
TRY (u->diskshape = hdf5_create_dataspace(1, &count, NULL));
count = nparticles;
if (count > 0) {
+2 -2
View File
@@ -99,7 +99,7 @@ h5priv_write_attrib (
attrib_name,
(long long int)attrib_type,
attrib_value,
attrib_nelem);
(long long unsigned)attrib_nelem);
hid_t space_id;
hid_t attrib_id;
hid_t hdf5_type;
@@ -147,7 +147,7 @@ h5priv_append_attrib (
attrib_name,
(long long int)attrib_type,
attrib_value,
attrib_nelem);
(long long unsigned)attrib_nelem);
h5_err_t exists;
TRY (exists = hdf5_attribute_exists (id, attrib_name));
if (exists) {
+1 -1
View File
@@ -9,7 +9,7 @@
#define H5_VFD_MPIO_POSIX 0x00000010
#define H5_VFD_MPIO_INDEPENDENT 0x00000020
#define H5_VFD_MPIO_COLLECTIVE 0x00000040
#define H5_VFD_CORE 0x00000080
#define H5_VFD_CORE_IO 0x00000080
#define H5_FLUSH_FILE 0x00001000
#define H5_FLUSH_ITERATION 0x00002000
+12 -2
View File
@@ -110,10 +110,18 @@ iter_op_get_obj_type (
name);
return H5O_TYPE_UNKNOWN;
}
#if H5_VERSION_GE(1,12,0)
herr = H5Oget_info(obj_id, &objinfo, H5O_INFO_ALL);
#else
herr = H5Oget_info(obj_id, &objinfo);
#endif
}
else { // H5L_TYPE_HARD
#if H5_VERSION_GE(1,12,0)
herr = H5Oget_info_by_name(g_id, name, &objinfo, H5O_INFO_BASIC, H5P_DEFAULT);
#else
herr = H5Oget_info_by_name(g_id, name, &objinfo, H5P_DEFAULT);
#endif
}
if (herr < 0) {
@@ -245,7 +253,8 @@ hdf5_get_name_of_group_by_idx (
HDF5_WRAPPER_ENTER (h5_err_t,
"loc_id=%lld (%s), idx=%llu, name=%p, len=%llu",
(long long int)loc_id, hdf5_get_objname (loc_id),
idx, name, (unsigned long long)len);
(long long unsigned)idx,
name, (unsigned long long)len);
op_data_t op_data;
memset (&op_data, 0, sizeof (op_data));
op_data.type = H5O_TYPE_GROUP;
@@ -304,7 +313,8 @@ hdf5_get_name_of_dataset_by_idx (
HDF5_WRAPPER_ENTER (h5_err_t,
"loc_id=%lld (%s), idx=%llu, name=%p, len=%llu",
(long long int)loc_id, hdf5_get_objname (loc_id),
idx, name, (unsigned long long)len);
(long long unsigned)idx,
name, (unsigned long long)len);
op_data_t op_data;
memset (&op_data, 0, sizeof (op_data));
op_data.type = H5O_TYPE_DATASET;
+19 -8
View File
@@ -718,7 +718,7 @@ hdf5_set_dataset_extent (
"dataset_id=%lld (%s), size=%llu",
(long long int)dataset_id,
hdf5_get_objname(dataset_id),
*size);
(long long unsigned int)*size);
if (H5Dset_extent(dataset_id, size) < 0) {
H5_RETURN_ERROR (
H5_ERR_HDF5,
@@ -873,7 +873,7 @@ static inline hid_t
hdf5_create_string_type(
const hsize_t len
) {
HDF5_WRAPPER_ENTER (hid_t, "len = %llu", len);
HDF5_WRAPPER_ENTER (hid_t, "len = %llu", (long long unsigned)len);
hid_t type_id = H5Tcopy (H5T_C_S1);
if (type_id < 0)
H5_RETURN_ERROR (
@@ -1003,7 +1003,7 @@ hdf5_set_chunk_property (
) {
HDF5_WRAPPER_ENTER (h5_err_t,
"plist=%lld, rank=%d, dims[0]=%llu ...",
(long long int)plist, rank, dims[0]);
(long long int)plist, rank, (long long unsigned)dims[0]);
if (H5Pset_chunk (plist, rank, dims) < 0)
H5_RETURN_ERROR (
H5_ERR_HDF5,
@@ -1146,7 +1146,8 @@ hdf5_set_btree_ik_property (
) {
HDF5_WRAPPER_ENTER (h5_err_t,
"fapl_id=%lld, btree_ik=%llu",
(long long int)fcpl_id, btree_ik);
(long long int)fcpl_id,
(long long unsigned)btree_ik);
if (H5Pset_istore_k (fcpl_id, btree_ik) < 0)
H5_RETURN_ERROR (
H5_ERR_HDF5,
@@ -1164,13 +1165,16 @@ hdf5_set_alignment_property (
) {
HDF5_WRAPPER_ENTER (h5_err_t,
"plist=%lld, threshold=%llu, alignment=%llu",
(long long int)plist, threshold, alignment);
(long long int)plist,
(long long unsigned)threshold,
(long long unsigned)alignment);
if (H5Pset_alignment (plist, threshold, alignment) < 0)
H5_RETURN_ERROR (
H5_ERR_HDF5,
"Cannot set alignment property to %llu "
"and threshold %llu",
alignment, threshold);
(long long unsigned)alignment,
(long long unsigned)threshold);
H5_RETURN (H5_SUCCESS);
}
@@ -1181,12 +1185,13 @@ hdf5_set_meta_block_size (
) {
HDF5_WRAPPER_ENTER (h5_err_t,
"fapl_id=%lld, size=%llu",
(long long int)fapl_id, size);
(long long int)fapl_id,
(long long unsigned)size);
if (H5Pset_meta_block_size (fapl_id, size) < 0)
H5_RETURN_ERROR (
H5_ERR_HDF5,
"Cannot set meta block size property to %llu",
size);
(long long unsigned)size);
H5_RETURN (H5_SUCCESS);
}
@@ -1292,9 +1297,15 @@ hdf5_close_file (
for (ssize_t i = 0; i < max_objs; i++) {
hid_t object_id = obj_id_list [i];
h5_debug ("Open object: %lld", (long long)object_id);
#if H5_VERSION_GE(1,12,0)
H5O_info_t object_info;
if (H5Oget_info (object_id, &object_info, H5O_INFO_ALL) < 0)
continue;
#else
H5O_info_t object_info;
if (H5Oget_info (object_id, &object_info) < 0)
continue;
#endif
switch (object_info.type) {
case H5O_TYPE_GROUP:
case H5O_TYPE_DATASET:
+45 -1
View File
@@ -220,7 +220,51 @@ H5Block3dSetView (
h5b_3d_set_view (f,
i_start, i_end,
j_start, j_end,
k_start, k_end));
k_start, k_end,
0
));
}
/**
Defines the partition of the field that this processor owns, using
Fortran ordering: the fastest moving index is \c i.
For writing ghost-zone are dissolved.
This routine uses an MPI_Allgather, so at large concurrency it should
be called as infrequently as possible. For instance, if several
steps/iteration use the same field dimensions, set the layout only
once.
\return \c H5_SUCCESS on success
\return \c H5_FAILURE on error
*/
static inline h5_err_t
H5Block3dSetViewDissolveGhostZones (
const h5_file_t f, ///< [in] File handle.
const h5_int64_t i_start, ///< [in] start index of \c i
const h5_int64_t i_end, ///< [in] end index of \c i
const h5_int64_t j_start, ///< [in] start index of \c j
const h5_int64_t j_end, ///< [in] end index of \c j
const h5_int64_t k_start, ///< [in] start index of \c k
const h5_int64_t k_end ///< [in] end index of \c k
) {
H5_API_ENTER (h5_err_t,
"f=%p, "
"i_start=%lld, i_end=%lld, "
"j_start=%lld, j_end=%lld, "
"k_start=%lld, k_end=%lld",
(h5_file_p)f,
(long long)i_start, (long long)i_end,
(long long)j_start, (long long)j_end,
(long long)k_start, (long long)k_end);
H5_API_RETURN (
h5b_3d_set_view (f,
i_start, i_end,
j_start, j_end,
k_start, k_end,
1
));
}
/**
+2 -1
View File
@@ -13,7 +13,8 @@
INTEGER*8, PARAMETER :: H5_VFD_MPIPOSIX = Z'00000010'
INTEGER*8, PARAMETER :: H5_VFD_MPIIO_IND = Z'00000020'
INTEGER*8, PARAMETER :: H5_VFD_CORE = Z'00000040'
INTEGER*8, PARAMETER :: H5_VFD_MPIIO_COL = Z'00000040'
INTEGER*8, PARAMETER :: H5_VFD_CORE_IO = Z'00000080'
INTEGER*8, PARAMETER :: H5_PROP_DEFAULT = 0
+2 -1
View File
@@ -51,7 +51,8 @@ h5b_3d_set_view (
const h5_file_t,
const h5_size_t, const h5_size_t,
const h5_size_t, const h5_size_t,
const h5_size_t, const h5_size_t);
const h5_size_t, const h5_size_t,
const h5_int64_t);
h5_err_t
h5b_3d_get_view (
+5 -1
View File
@@ -658,7 +658,11 @@ test_open_objects(h5_file_t file, int max_objects)
H5O_info_t info;
int i;
for (i=0; i<nopen; i++) {
H5Oget_info(list[i], &info);
#if H5_VERSION_GE(1,12,0)
H5Oget_info(list[i], &info, H5O_INFO_BASIC);
#else
H5Oget_info(list[i], &info);
#endif
switch (info.type) {
case H5O_TYPE_GROUP:
TestErrPrintf("obj%d has type GROUP\n", i);