Commit e17252ad authored by Shane Snyder's avatar Shane Snyder

add detailed H5F/H5D instrumentation to Darshan

parent 92f6d7d3
......@@ -7,53 +7,246 @@
#ifndef __DARSHAN_HDF5_LOG_FORMAT_H
#define __DARSHAN_HDF5_LOG_FORMAT_H
/* current HDF5 log format version */
#define DARSHAN_HDF5_VER 2
/* current HDF5 log format versions */
#define DARSHAN_H5F_VER 3
#define DARSHAN_H5D_VER 1
#define HDF5_COUNTERS \
/* count of HDF5 opens */\
X(HDF5_OPENS) \
#define H5D_MAX_NDIMS 5
#define H5F_COUNTERS \
/* count of HDF5 file opens/creates */\
X(H5F_OPENS) \
/* count of HDF5 file flushes */\
X(H5F_FLUSHES) \
/* flag indicating whether MPI-IO is used for accessing this file */\
X(H5F_USE_MPIIO) \
/* end of counters */\
X(HDF5_NUM_INDICES)
#define HDF5_F_COUNTERS \
/* timestamp of first open */\
X(HDF5_F_OPEN_START_TIMESTAMP) \
/* timestamp of first close */\
X(HDF5_F_CLOSE_START_TIMESTAMP) \
/* timestamp of last open */\
X(HDF5_F_OPEN_END_TIMESTAMP) \
/* timestamp of last close */\
X(HDF5_F_CLOSE_END_TIMESTAMP) \
X(H5F_NUM_INDICES)
#define H5F_F_COUNTERS \
/* timestamp of first file open */\
X(H5F_F_OPEN_START_TIMESTAMP) \
/* timestamp of first file close */\
X(H5F_F_CLOSE_START_TIMESTAMP) \
/* timestamp of last file open */\
X(H5F_F_OPEN_END_TIMESTAMP) \
/* timestamp of last file close */\
X(H5F_F_CLOSE_END_TIMESTAMP) \
/* cumulative H5F meta time */\
X(H5F_F_META_TIME) \
/* end of counters*/\
X(HDF5_F_NUM_INDICES)
X(H5F_F_NUM_INDICES)
#define H5D_COUNTERS \
/* count of HDF5 dataset opens/creates */\
X(H5D_OPENS) \
/* count of HDF5 datset reads */\
X(H5D_READS) \
/* count of HDF5 datset writes */\
X(H5D_WRITES) \
/* count of HDF5 dataset flushes */\
X(H5D_FLUSHES) \
/* total bytes read */\
X(H5D_BYTES_READ) \
/* total bytes written */\
X(H5D_BYTES_WRITTEN) \
/* number of times switching between H5D read and write */\
X(H5D_RW_SWITCHES) \
/* number of read/write ops with regular hyperslab selections */\
X(H5D_REGULAR_HYPERSLAB_SELECTS) \
/* number of read/write ops with irregular hyperslab selections */\
X(H5D_IRREGULAR_HYPERSLAB_SELECTS) \
/* number of read/write ops with point selections */\
X(H5D_POINT_SELECTS) \
/* sizes of the maximum read/write operations */\
X(H5D_MAX_READ_TIME_SIZE) \
X(H5D_MAX_WRITE_TIME_SIZE) \
/* buckets for H5D read size ranges */\
X(H5D_SIZE_READ_AGG_0_100) \
X(H5D_SIZE_READ_AGG_100_1K) \
X(H5D_SIZE_READ_AGG_1K_10K) \
X(H5D_SIZE_READ_AGG_10K_100K) \
X(H5D_SIZE_READ_AGG_100K_1M) \
X(H5D_SIZE_READ_AGG_1M_4M) \
X(H5D_SIZE_READ_AGG_4M_10M) \
X(H5D_SIZE_READ_AGG_10M_100M) \
X(H5D_SIZE_READ_AGG_100M_1G) \
X(H5D_SIZE_READ_AGG_1G_PLUS) \
/* buckets for H5D write size ranges */\
X(H5D_SIZE_WRITE_AGG_0_100) \
X(H5D_SIZE_WRITE_AGG_100_1K) \
X(H5D_SIZE_WRITE_AGG_1K_10K) \
X(H5D_SIZE_WRITE_AGG_10K_100K) \
X(H5D_SIZE_WRITE_AGG_100K_1M) \
X(H5D_SIZE_WRITE_AGG_1M_4M) \
X(H5D_SIZE_WRITE_AGG_4M_10M) \
X(H5D_SIZE_WRITE_AGG_10M_100M) \
X(H5D_SIZE_WRITE_AGG_100M_1G) \
X(H5D_SIZE_WRITE_AGG_1G_PLUS) \
/* the four most frequently appearing H5D accesses, identified by
* access size and access lengths (count * block) and strides
* in last 5 hyperslab dimensions */\
X(H5D_ACCESS1_ACCESS) \
X(H5D_ACCESS1_LENGTH_D1) \
X(H5D_ACCESS1_LENGTH_D2) \
X(H5D_ACCESS1_LENGTH_D3) \
X(H5D_ACCESS1_LENGTH_D4) \
X(H5D_ACCESS1_LENGTH_D5) \
X(H5D_ACCESS1_STRIDE_D1) \
X(H5D_ACCESS1_STRIDE_D2) \
X(H5D_ACCESS1_STRIDE_D3) \
X(H5D_ACCESS1_STRIDE_D4) \
X(H5D_ACCESS1_STRIDE_D5) \
X(H5D_ACCESS2_ACCESS) \
X(H5D_ACCESS2_LENGTH_D1) \
X(H5D_ACCESS2_LENGTH_D2) \
X(H5D_ACCESS2_LENGTH_D3) \
X(H5D_ACCESS2_LENGTH_D4) \
X(H5D_ACCESS2_LENGTH_D5) \
X(H5D_ACCESS2_STRIDE_D1) \
X(H5D_ACCESS2_STRIDE_D2) \
X(H5D_ACCESS2_STRIDE_D3) \
X(H5D_ACCESS2_STRIDE_D4) \
X(H5D_ACCESS2_STRIDE_D5) \
X(H5D_ACCESS3_ACCESS) \
X(H5D_ACCESS3_LENGTH_D1) \
X(H5D_ACCESS3_LENGTH_D2) \
X(H5D_ACCESS3_LENGTH_D3) \
X(H5D_ACCESS3_LENGTH_D4) \
X(H5D_ACCESS3_LENGTH_D5) \
X(H5D_ACCESS3_STRIDE_D1) \
X(H5D_ACCESS3_STRIDE_D2) \
X(H5D_ACCESS3_STRIDE_D3) \
X(H5D_ACCESS3_STRIDE_D4) \
X(H5D_ACCESS3_STRIDE_D5) \
X(H5D_ACCESS4_ACCESS) \
X(H5D_ACCESS4_LENGTH_D1) \
X(H5D_ACCESS4_LENGTH_D2) \
X(H5D_ACCESS4_LENGTH_D3) \
X(H5D_ACCESS4_LENGTH_D4) \
X(H5D_ACCESS4_LENGTH_D5) \
X(H5D_ACCESS4_STRIDE_D1) \
X(H5D_ACCESS4_STRIDE_D2) \
X(H5D_ACCESS4_STRIDE_D3) \
X(H5D_ACCESS4_STRIDE_D4) \
X(H5D_ACCESS4_STRIDE_D5) \
/* count of each of the most frequent H5D access sizes */\
X(H5D_ACCESS1_COUNT) \
X(H5D_ACCESS2_COUNT) \
X(H5D_ACCESS3_COUNT) \
X(H5D_ACCESS4_COUNT) \
/* number of dimensions in dataset's dataspace */\
X(H5D_DATASPACE_NDIMS) \
/* number of points in dataset's dataspace */\
X(H5D_DATASPACE_NPOINTS) \
/* size of dataset elements in bytes */\
X(H5D_DATATYPE_SIZE) \
/* chunk sizes in the last 5 dimensions of the dataset */\
/* NOTE: D1 is the last dimension (i.e., row) , D2 is 2nd to last (i.e., column), and so on */\
X(H5D_CHUNK_SIZE_D1) \
X(H5D_CHUNK_SIZE_D2) \
X(H5D_CHUNK_SIZE_D3) \
X(H5D_CHUNK_SIZE_D4) \
X(H5D_CHUNK_SIZE_D5) \
/* flag indicating use of MPI-IO collectives */\
X(H5D_USE_MPIIO_COLLECTIVE) \
/* flag indicating whether deprecated create/open calls were used */\
X(H5D_USE_DEPRECATED) \
/* rank and number of bytes moved for fastest/slowest ranks */\
X(H5D_FASTEST_RANK) \
X(H5D_FASTEST_RANK_BYTES) \
X(H5D_SLOWEST_RANK) \
X(H5D_SLOWEST_RANK_BYTES) \
/* end of counters */\
X(H5D_NUM_INDICES)
#define H5D_F_COUNTERS \
/* timestamp of first dataset open */\
X(H5D_F_OPEN_START_TIMESTAMP) \
/* timestamp of first dataset read */\
X(H5D_F_READ_START_TIMESTAMP) \
/* timestamp of first dataset write */\
X(H5D_F_WRITE_START_TIMESTAMP) \
/* timestamp of first dataset close */\
X(H5D_F_CLOSE_START_TIMESTAMP) \
/* timestamp of last dataset open */\
X(H5D_F_OPEN_END_TIMESTAMP) \
/* timestamp of last dataset read */\
X(H5D_F_READ_END_TIMESTAMP) \
/* timestamp of last dataset write */\
X(H5D_F_WRITE_END_TIMESTAMP) \
/* timestamp of last dataset close */\
X(H5D_F_CLOSE_END_TIMESTAMP) \
/* cumulative H5D read time */\
X(H5D_F_READ_TIME) \
/* cumulative H5D write time */\
X(H5D_F_WRITE_TIME) \
/* cumulative H5D meta time */\
X(H5D_F_META_TIME) \
/* maximum H5D read duration */\
X(H5D_F_MAX_READ_TIME) \
/* maximum H5D write duration */\
X(H5D_F_MAX_WRITE_TIME) \
/* total i/o and meta time for fastest/slowest ranks */\
X(H5D_F_FASTEST_RANK_TIME) \
X(H5D_F_SLOWEST_RANK_TIME) \
/* variance of total i/o time and bytes moved across all ranks */\
/* NOTE: for shared records only */\
X(H5D_F_VARIANCE_RANK_TIME) \
X(H5D_F_VARIANCE_RANK_BYTES) \
/* end of counters*/\
X(H5D_F_NUM_INDICES)
#define X(a) a,
/* integer statistics for HDF5 file records */
enum darshan_hdf5_indices
enum darshan_h5f_indices
{
H5F_COUNTERS
};
/* integer statistics for HDF5 dataset records */
enum darshan_h5d_indices
{
HDF5_COUNTERS
H5D_COUNTERS
};
/* floating point statistics for HDF5 file records */
enum darshan_hdf5_f_indices
enum darshan_h5f_f_indices
{
HDF5_F_COUNTERS
H5F_F_COUNTERS
};
/* floating point statistics for HDF5 dataset records */
enum darshan_h5d_f_indices
{
H5D_F_COUNTERS
};
#undef X
/* file record structure for HDF5 files. a record is created and stored for
/* record structure for HDF5 files. a record is created and stored for
* every HDF5 file opened by the original application. For the HDF5 module,
* the record includes:
* - a darshan_base_record structure, which contains the record id & rank
* - integer file I/O statistics (open, read/write counts, etc)
* - floating point I/O statistics (timestamps, cumulative timers, etc.)
* - floating point file I/O statistics (timestamps, cumulative timers, etc.)
*/
struct darshan_hdf5_file
{
struct darshan_base_record base_rec;
int64_t counters[HDF5_NUM_INDICES];
double fcounters[HDF5_F_NUM_INDICES];
int64_t counters[H5F_NUM_INDICES];
double fcounters[H5F_F_NUM_INDICES];
};
/* record structure for HDF5 datasets. a record is created and stored for
* every HDF5 dataset opened by the original application. For the HDF5 module,
* the record includes:
* - a darshan_base_record structure, which contains the record id & rank
* - integer dataset I/O statistics (open, read/write counts, etc)
* - floating point dataset I/O statistics (timestamps, cumulative timers, etc.)
*/
struct darshan_hdf5_dataset
{
struct darshan_base_record base_rec;
int64_t counters[H5D_NUM_INDICES];
double fcounters[H5D_F_NUM_INDICES];
};
#endif /* __DARSHAN_HDF5_LOG_FORMAT_H */
......@@ -24,7 +24,7 @@
* log format version, NOT when a new version of a module record is
* introduced -- we have module-specific versions to handle that
*/
#define DARSHAN_LOG_VERSION "3.10"
#define DARSHAN_LOG_VERSION "3.20"
/* magic number for validating output files and checking byte order */
#define DARSHAN_MAGIC_NR 6567223
......@@ -135,7 +135,8 @@ struct darshan_base_record
X(DARSHAN_NULL_MOD, "NULL", DARSHAN_NULL_VER, NULL) \
X(DARSHAN_POSIX_MOD, "POSIX", DARSHAN_POSIX_VER, &posix_logutils) \
X(DARSHAN_MPIIO_MOD, "MPI-IO", DARSHAN_MPIIO_VER, &mpiio_logutils) \
X(DARSHAN_HDF5_MOD, "HDF5", DARSHAN_HDF5_VER, &hdf5_logutils) \
X(DARSHAN_H5F_MOD, "H5F", DARSHAN_H5F_VER, &hdf5_file_logutils) \
X(DARSHAN_H5D_MOD, "H5D", DARSHAN_H5D_VER, &hdf5_dataset_logutils) \
X(DARSHAN_PNETCDF_MOD, "PNETCDF", DARSHAN_PNETCDF_VER, &pnetcdf_logutils) \
X(DARSHAN_BGQ_MOD, "BG/Q", DARSHAN_BGQ_VER, &bgq_logutils) \
X(DARSHAN_LUSTRE_MOD, "LUSTRE", DARSHAN_LUSTRE_VER, &lustre_logutils) \
......
......@@ -245,7 +245,7 @@ ifdef BUILD_PNETCDF_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts
endif
ifdef BUILD_HDF5_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-hdf5-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-hdf5-ld-opts
install -m 644 share/ld-opts/darshan-hdf5-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-hdf5-ld-opts
endif
ifdef BUILD_MDHIM_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-mdhim-ld-opts $(DESTDIR)$(datarootdir)/ld-opts/darshan-mdhim-ld-opts
......
......@@ -621,10 +621,12 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
DARSHAN_HDF5_LD_FLAGS
DARSHAN_MDHIM_LD_OPTS
BUILD_MDHIM_MODULE
BUILD_LUSTRE_MODULE
BUILD_BGQ_MODULE
DARSHAN_HDF5_ADD_DFLUSH_LD_OPTS
DARSHAN_HDF5_LD_OPTS
BUILD_HDF5_MODULE
DARSHAN_PNETCDF_LD_OPTS
......@@ -722,9 +724,8 @@ enable_posix_mod
enable_stdio_mod
enable_dxt_mod
enable_mpiio_mod
enable_hdf5_mod
enable_pnetcdf_mod
enable_HDF5_post_1_10
enable_HDF5_pre_1_10
enable_bgq_mod
enable_lustre_mod
enable_mdhim
......@@ -1370,12 +1371,9 @@ Optional Features:
--disable-dxt-mod Disables compilation and use of DXT module
--disable-mpiio-mod Disables compilation and use of MPI-IO module
(requires MPI)
--enable-hdf5-mod Enables compilation and use of HDF5 module
--disable-pnetcdf-mod Disables compilation and use of PnetCDF module
(requires MPI)
--enable-HDF5-post-1.10
Enable HDF5 module for HDF5 version 1.10 or later
--enable-HDF5-pre-1.10
Enable HDF5 module for HDF5 versions earlier than 1.10
--disable-bgq-mod Disables compilation and use of BG/Q module (for
BG/Q systems)
--disable-lustre-mod Disables compilation and use of Lustre module
......@@ -4111,53 +4109,68 @@ if test "x$enable_mpiio_mod" = "xno" || test "x$ENABLE_MPI" = "x"; then :
DARSHAN_MPIIO_LD_OPTS=
fi
# PNETCDF module
BUILD_PNETCDF_MODULE=1
DARSHAN_PNETCDF_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-pnetcdf-ld-opts"
# Check whether --enable-pnetcdf-mod was given.
if test "${enable_pnetcdf_mod+set}" = set; then :
enableval=$enable_pnetcdf_mod;
# HDF5 module (disabled by default)
BUILD_HDF5_MODULE=
DARSHAN_HDF5_LD_OPTS=
# Check whether --enable-hdf5-mod was given.
if test "${enable_hdf5_mod+set}" = set; then :
enableval=$enable_hdf5_mod;
else
enable_hdf5_mod=no
fi
if test "x$enable_pnetcdf_mod" = "xno" || test "x$ENABLE_MPI" = "x"; then :
BUILD_PNETCDF_MODULE=
DARSHAN_PNETCDF_LD_OPTS=
if test "x$enable_hdf5_mod" != "xno"; then :
if test -d "$enable_hdf5_mod"; then :
CFLAGS="${CFLAGS} -I${enable_hdf5_mod}/include"
DARSHAN_HDF5_LD_FLAGS="-L${enable_hdf5_mod}/lib -Wl,-rpath=${enable_hdf5_mod}/lib -lhdf5"
else
as_fn_error $? "enableval for hdf5-mod is required and must be a valid install prefix path for HDF5 library" "$LINENO" 5
fi
BUILD_HDF5_MODULE=1
DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# HDF5 module
BUILD_HDF5_MODULE=
BUILD_HDF5_POST110=
DARSHAN_HDF5_LD_OPTS=
#include <hdf5.h>
# see if user explicitly enabled support for an HDF5 API
# Check whether --enable-HDF5-post-1.10 was given.
if test "${enable_HDF5_post_1_10+set}" = set; then :
enableval=$enable_HDF5_post_1_10; if test "x$enableval" = "xyes" ; then
int
main ()
{
$as_echo "#define __DARSHAN_ENABLE_HDF5110 1" >>confdefs.h
#if (H5_VERS_MAJOR > 1) || ((H5_VERS_MAJOR == 1) && (H5_VERS_MINOR >= 10))
#error H5_VERS 1.10+
#endif
if test "x$BUILD_HDF5_MODULE" = "x1"; then
as_fn_error $? "Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10" "$LINENO" 5
fi
BUILD_HDF5_MODULE=1
BUILD_HDF5_POST110=1
DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
fi
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
DARSHAN_HDF5_ADD_DFLUSH_LD_OPTS=""
else
$as_echo "#define DARSHAN_HDF5_VERS_1_10_PLUS 1" >>confdefs.h
DARSHAN_HDF5_ADD_DFLUSH_LD_OPTS="--undefined=H5Dflush --wrap=H5Dflush"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# Check whether --enable-HDF5-pre-1.10 was given.
if test "${enable_HDF5_pre_1_10+set}" = set; then :
enableval=$enable_HDF5_pre_1_10; if test "x$enableval" = "xyes" ; then
if test "x$BUILD_HDF5_MODULE" = "x1"; then
as_fn_error $? "Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10" "$LINENO" 5
fi
BUILD_HDF5_MODULE=1
DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
fi
# PNETCDF module
BUILD_PNETCDF_MODULE=1
DARSHAN_PNETCDF_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-pnetcdf-ld-opts"
# Check whether --enable-pnetcdf-mod was given.
if test "${enable_pnetcdf_mod+set}" = set; then :
enableval=$enable_pnetcdf_mod;
fi
if test "x$enable_pnetcdf_mod" = "xno" || test "x$ENABLE_MPI" = "x"; then :
BUILD_PNETCDF_MODULE=
DARSHAN_PNETCDF_LD_OPTS=
fi
# BG/Q module
BUILD_BGQ_MODULE=
......@@ -4896,7 +4909,8 @@ DARSHAN_VERSION="3.2.0-pre1"
ac_config_files="$ac_config_files Makefile darshan-mk-log-dirs.pl darshan-gen-cc.pl darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-config share/craype-1.x/darshan-module share/craype-2.x/darshan-module lib/pkgconfig/darshan-runtime.pc share/mpi-profile/darshan-cc.conf share/mpi-profile/darshan-cxx.conf share/mpi-profile/darshan-f.conf share/mpi-profile/darshan-cc-static.conf share/mpi-profile/darshan-cxx-static.conf share/mpi-profile/darshan-f-static.conf share/ld-opts/darshan-base-ld-opts share/ld-opts/darshan-stdio-ld-opts"
ac_config_files="$ac_config_files Makefile darshan-mk-log-dirs.pl darshan-gen-cc.pl darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-config share/craype-1.x/darshan-module share/craype-2.x/darshan-module lib/pkgconfig/darshan-runtime.pc share/mpi-profile/darshan-cc.conf share/mpi-profile/darshan-cxx.conf share/mpi-profile/darshan-f.conf share/mpi-profile/darshan-cc-static.conf share/mpi-profile/darshan-cxx-static.conf share/mpi-profile/darshan-f-static.conf share/ld-opts/darshan-base-ld-opts share/ld-opts/darshan-stdio-ld-opts share/ld-opts/darshan-hdf5-ld-opts"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
......@@ -5608,6 +5622,7 @@ do
"share/mpi-profile/darshan-f-static.conf") CONFIG_FILES="$CONFIG_FILES share/mpi-profile/darshan-f-static.conf" ;;
"share/ld-opts/darshan-base-ld-opts") CONFIG_FILES="$CONFIG_FILES share/ld-opts/darshan-base-ld-opts" ;;
"share/ld-opts/darshan-stdio-ld-opts") CONFIG_FILES="$CONFIG_FILES share/ld-opts/darshan-stdio-ld-opts" ;;
"share/ld-opts/darshan-hdf5-ld-opts") CONFIG_FILES="$CONFIG_FILES share/ld-opts/darshan-hdf5-ld-opts" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
......@@ -6233,25 +6248,19 @@ else
{ $as_echo "$as_me:${as_lineno-$LINENO}: MPIIO module support: yes" >&5
$as_echo "$as_me: MPIIO module support: yes" >&6;}
fi
if test "x$BUILD_HDF5_MODULE" = "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support: no" >&5
$as_echo "$as_me: HDF5 module support: no" >&6;}
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support: yes" >&5
$as_echo "$as_me: HDF5 module support: yes" >&6;}
fi
if test "x$BUILD_PNETCDF_MODULE" = "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: PnetCDF module support: no" >&5
$as_echo "$as_me: PnetCDF module support: no" >&6;}
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: PnetCDF module support: yes" >&5
$as_echo "$as_me: PnetCDF module support: yes" >&6;}
fi
if test "x$BUILD_HDF5_MODULE" = "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support: no" >&5
$as_echo "$as_me: HDF5 module support: no" >&6;}
elif if test "x$BUILD_HDF5_POST110" = "x1"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support: 1.10+" >&5
$as_echo "$as_me: HDF5 module support: 1.10+" >&6;}
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: HDF5 module support: pre-1.10" >&5
$as_echo "$as_me: HDF5 module support: pre-1.10" >&6;}
fi; then :
fi
if test "x$BUILD_BGQ_MODULE" = "x"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: BG/Q module support: no" >&5
......
......@@ -219,6 +219,36 @@ AS_IF([test "x$enable_mpiio_mod" = "xno" || test "x$ENABLE_MPI" = "x"],
BUILD_MPIIO_MODULE=
DARSHAN_MPIIO_LD_OPTS=)
# HDF5 module (disabled by default)
BUILD_HDF5_MODULE=
DARSHAN_HDF5_LD_OPTS=
AC_ARG_ENABLE(hdf5-mod,
AS_HELP_STRING([--enable-hdf5-mod], [Enables compilation and use of HDF5 module]),
[],
[enable_hdf5_mod=no])
AS_IF([test "x$enable_hdf5_mod" != "xno"],
AS_IF([test -d "$enable_hdf5_mod"],
[CFLAGS="${CFLAGS} -I${enable_hdf5_mod}/include"
DARSHAN_HDF5_LD_FLAGS="-L${enable_hdf5_mod}/lib [-Wl,-rpath=${enable_hdf5_mod}/lib -lhdf5]"],
AC_MSG_ERROR(enableval for hdf5-mod is required and must be a valid install prefix path for HDF5 library)
)
BUILD_HDF5_MODULE=1
DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
AC_TRY_COMPILE(
[
#include <hdf5.h>
],
[
#if (H5_VERS_MAJOR > 1) || ((H5_VERS_MAJOR == 1) && (H5_VERS_MINOR >= 10))
#error H5_VERS 1.10+
#endif
],
DARSHAN_HDF5_ADD_DFLUSH_LD_OPTS="",
AC_DEFINE(DARSHAN_HDF5_VERS_1_10_PLUS, 1, Define if HDF5 module built with version 1.10+)
DARSHAN_HDF5_ADD_DFLUSH_LD_OPTS="--undefined=H5Dflush --wrap=H5Dflush"
)
)
# PNETCDF module
BUILD_PNETCDF_MODULE=1
DARSHAN_PNETCDF_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-pnetcdf-ld-opts"
......@@ -228,37 +258,6 @@ AS_IF([test "x$enable_pnetcdf_mod" = "xno" || test "x$ENABLE_MPI" = "x"],
BUILD_PNETCDF_MODULE=
DARSHAN_PNETCDF_LD_OPTS=)
# HDF5 module
BUILD_HDF5_MODULE=
BUILD_HDF5_POST110=
DARSHAN_HDF5_LD_OPTS=
# see if user explicitly enabled support for an HDF5 API
AC_ARG_ENABLE(HDF5-post-1.10,
[ --enable-HDF5-post-1.10
Enable HDF5 module for HDF5 version 1.10 or later],
[if test "x$enableval" = "xyes" ; then
AC_DEFINE(__DARSHAN_ENABLE_HDF5110, 1, Set for compatibility with HDF5 1.10.x, breaks use with versions earlier than 1.10)
if test "x$BUILD_HDF5_MODULE" = "x1"; then
AC_MSG_ERROR([Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10])
fi
BUILD_HDF5_MODULE=1
BUILD_HDF5_POST110=1
DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
fi]
,)
AC_ARG_ENABLE(HDF5-pre-1.10,
[ --enable-HDF5-pre-1.10
Enable HDF5 module for HDF5 versions earlier than 1.10],
[if test "x$enableval" = "xyes" ; then
if test "x$BUILD_HDF5_MODULE" = "x1"; then
AC_MSG_ERROR([Cannot set both --enable-HDF5-post-1.10 and --enable-HDF5-pre-1.10])
fi
BUILD_HDF5_MODULE=1
DARSHAN_HDF5_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-hdf5-ld-opts"
fi]
,)
# BG/Q module
BUILD_BGQ_MODULE=
AC_ARG_ENABLE(bgq-mod,
......@@ -519,6 +518,8 @@ AC_SUBST(BUILD_PNETCDF_MODULE)
AC_SUBST(DARSHAN_PNETCDF_LD_OPTS)
AC_SUBST(BUILD_HDF5_MODULE)
AC_SUBST(DARSHAN_HDF5_LD_OPTS)
AC_SUBST(DARSHAN_HDF5_ADD_DFLUSH_LD_OPTS)
AC_SUBST(DARSHAN_HDF5_LD_FLAGS)
AC_SUBST(BUILD_BGQ_MODULE)
AC_SUBST(BUILD_LUSTRE_MODULE)
AC_SUBST(BUILD_MDHIM_MODULE)
......@@ -540,6 +541,7 @@ share/mpi-profile/darshan-cxx-static.conf
share/mpi-profile/darshan-f-static.conf
share/ld-opts/darshan-base-ld-opts
share/ld-opts/darshan-stdio-ld-opts
share/ld-opts/darshan-hdf5-ld-opts
)
msg="Building Darshan with CC=$CC and with the following features:"
......@@ -549,16 +551,8 @@ AS_IF([test "x$BUILD_POSIX_MODULE" = "x"], [AC_MSG_NOTICE(POSIX module support
AS_IF([test "x$BUILD_STDIO_MODULE" = "x"], [AC_MSG_NOTICE(STDIO module support: no)], [AC_MSG_NOTICE(STDIO module support: yes)])
AS_IF([test "x$BUILD_DXT_MODULE" = "x"], [AC_MSG_NOTICE(DXT module support: no)], [AC_MSG_NOTICE(DXT module support: yes)])
AS_IF([test "x$BUILD_MPIIO_MODULE" = "x"], [AC_MSG_NOTICE(MPIIO module support: no)], [AC_MSG_NOTICE(MPIIO module support: yes)])
AS_IF([test "x$BUILD_HDF5_MODULE" = "x"], [AC_MSG_NOTICE(HDF5 module support: no)], [AC_MSG_NOTICE(HDF5 module support: yes)])
AS_IF([test "x$BUILD_PNETCDF_MODULE" = "x"], [AC_MSG_NOTICE(PnetCDF module support: no)], [AC_MSG_NOTICE(PnetCDF module support: yes)])
AS_IF(
[test "x$BUILD_HDF5_MODULE" = "x"],
[AC_MSG_NOTICE(HDF5 module support: no)],
[AS_IF(
[test "x$BUILD_HDF5_POST110" = "x1"],
[AC_MSG_NOTICE(HDF5 module support: 1.10+)],
[AC_MSG_NOTICE(HDF5 module support: pre-1.10)]
)],
)
AS_IF([test "x$BUILD_BGQ_MODULE" = "x"], [AC_MSG_NOTICE(BG/Q module support: no)], [AC_MSG_NOTICE(BG/Q module support: yes)])
AS_IF([test "x$BUILD_LUSTRE_MODULE" = "x"], [AC_MSG_NOTICE(Lustre module support: no)], [AC_MSG_NOTICE(Lustre module support: yes)])
AS_IF([test "x$BUILD_MDHIM_MODULE" = "x"], [AC_MSG_NOTICE(MDHIM module support: no)], [AC_MSG_NOTICE(MDHIM module support: yes)])
......@@ -67,8 +67,13 @@
*(__bucket_base_p + 9) += 1; \
} while(0)
/* potentially set or increment a common value counter, depending on the __count
* for the given __value. This macro ensures common values are stored first in
/* maximum number of common values that darshan will track per file at runtime */
#define DARSHAN_COMMON_VAL_MAX_RUNTIME_COUNT 32
/* maximum number of counters in each common value */
#define DARSHAN_COMMON_VAL_MAX_NCOUNTERS 12
/* potentially set or add common value counters, depending on the __val_count
* for the given __vals. This macro ensures common values are stored first in
* decreasing order of their total count, and second by decreasing order of
* their value.
......@@ -79,33 +84,32 @@
* counters) and __cnt_p is a pointer to the base of the count counters (i.e.
* the first of 4 contiguous common count counters). It is assumed your counters
* are stored as int64_t types. __add_flag is set if the given count should be
* added to the common access counter, rather than just incrementing it.
* added to the common access counter, rather than just setting it.
*/
#define DARSHAN_COMMON_VAL_COUNTER_INC(__val_p, __cnt_p, __value, __count, __add_flag) do {\
#define DARSHAN_UPDATE_COMMON_VAL_COUNTERS(__val_p, __cnt_p, __vals, __val_size, __val_count, __add_flag) do {\
int i_; \
int inc_count, total_count; \
int64_t tmp_val[4] = {0}; \
int total_count = __val_count; \
int64_t tmp_val[4*DARSHAN_COMMON_VAL_MAX_NCOUNTERS] = {0}; \
int64_t tmp_cnt[4] = {0}; \
int tmp_ndx = 0; \
if(__value == 0) break; \
if(__add_flag) \
inc_count = 1; \
else \
inc_count = __count; \
if(*(int64_t *)__vals == 0) break; \
for(i_=0; i_<4; i_++) { \
if(*(__val_p + i_) == __value) { \
total_count = *(__cnt_p + i_) + inc_count; \
if(__add_flag && \
!memcmp(__val_p + (i_ * sizeof(*__vals) * __val_size), \
__vals, sizeof(*__vals) * __val_size)) { \
total_count += *(__cnt_p + i_); \
break; \
} \
} \
if(i_ == 4) total_count = __count; \
/* first, copy over any counters that should be sorted above this one \
* (counters with higher counts or equal counts and larger values) \
*/ \
for(i_=0;i_ < 4; i_++) { \
for(i_=0; i_ < 4; i_++) { \
if((*(__cnt_p + i_) > total_count) || \
((*(__cnt_p + i_) == total_count) && (*(__val_p + i_) > __value))) { \
tmp_val[tmp_ndx] = *(__val_p + i_); \
((*(__cnt_p + i_) == total_count) && \
(*(__val_p + (i_ * sizeof(*__vals) * __val_size)) > *(int64_t *)__vals))) { \
memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i_ * sizeof(*__vals) * __val_size), \
sizeof(*__vals) * __val_size); \
tmp_cnt[tmp_ndx] = *(__cnt_p + i_); \
tmp_ndx++; \
} \
......@@ -113,27 +117,28 @@
} \
if(tmp_ndx == 4) break; /* all done, updated counter is not added */ \
/* next, add the updated counter */ \
tmp_val[tmp_ndx] = __value; \
memcpy(&tmp_val[tmp_ndx * __val_size], __vals, sizeof(*__vals) * __val_size); \
tmp_cnt[tmp_ndx] = total_count; \
tmp_ndx++; \
/* last, copy over any remaining counters to make sure we have 4 sets total */ \
while(tmp_ndx != 4) { \
if(*(__val_p + i_) != __value) { \
tmp_val[tmp_ndx] = *(__val_p + i_); \
if(memcmp(__val_p + (i_ * sizeof(*__vals) * __val_size), \
__vals, sizeof(*__vals) * __val_size)) { \
memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i_ * sizeof(*__vals) * __val_size), \
sizeof(*__vals) * __val_size); \
tmp_cnt[tmp_ndx] = *(__cnt_p + i_); \
tmp_ndx++; \
} \
i_++; \
} \
memcpy(__val_p, tmp_val, 4*sizeof(int64_t)); \
memcpy(__val_p, tmp_val, 4*sizeof(int64_t)*__val_size); \
memcpy(__cnt_p, tmp_cnt, 4*sizeof(int64_t)); \
} while(0)
/* maximum number of common values that darshan will track per file at runtime */
#define DARSHAN_COMMON_VAL_MAX_RUNTIME_COUNT 32
struct darshan_common_val_counter
{
int64_t val;
int64_t vals[DARSHAN_COMMON_VAL_MAX_NCOUNTERS];
int nvals;
int freq;
};
......@@ -245,7 +250,7 @@ void darshan_record_sort(
int rec_count,
int rec_size);
/* darshan_common_val_counter()
/* darshan_track_common_val_counters()
*
* Potentially increment an existing common value counter or allocate
* a new one to keep track of commonly occuring values. Example use
......@@ -253,19 +258,15 @@ void darshan_record_sort(
* used by a specific module, for instance. 'common_val_root' is the
* root pointer for the tree which stores common value info,
* 'common_val_count' is a pointer to the number of nodes in the
* tree (i.e., the number of allocated common value counters), 'val'
* is the new value to attempt to add, 'val_p' is a pointer to the
* base counter (i.e., the first) of the common values (which are
* assumed to be 4 total and contiguous in memory), and 'cnt_p' is
* a pointer to the base counter of the common counts (which are
* again expected to be contiguous in memory).
* tree (i.e., the number of allocated common value counters), 'vals'
* is the set of new values to attempt to add, and 'nvals' is the
* total number of values in the 'vals' pointer.
*/
void darshan_common_val_counter(
struct darshan_common_val_counter *darshan_track_common_val_counters(
void **common_val_root,
int *common_val_count,
int64_t val,
int64_t *val_p,
int64_t *cnt_p);
int64_t *vals,
int nvals,
int *common_val_count);
#ifdef HAVE_MPI
/* darshan_variance_reduce()
......
......@@ -20,7 +20,7 @@ POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -ldarshan -lz -lrt -lpthread"
# - when dynamic linking there is no need for wrapping options, we simply
# need to get the darshan symbol definitions early enough in the link
# order. We also set no-as-needed for linkers that may not identify
DYN_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -Wl,-rpath=$DARSHAN_LIB_PATH -Wl,-no-as-needed -ldarshan"
DYN_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -Wl,-rpath=$DARSHAN_LIB_PATH -Wl,-no-as-needed -ldarshan @DARSHAN_HDF5_LD_FLAGS@"
# NOTE:
# - construct complete list of log path options, separated by commas.
......
......@@ -3,6 +3,9 @@
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define if HDF5 module built with version 1.10+ */
#undef DARSHAN_HDF5_VERS_1_10_PLUS
/* Define if struct aiocb64 type is defined */