Commit a1637f82 authored by Shane Snyder's avatar Shane Snyder
Browse files

Merge branch 'issue-217-hdf5-abi-switch'

parents c49c9a1e 72750511
...@@ -4,15 +4,17 @@ Darshan Release Change Log ...@@ -4,15 +4,17 @@ Darshan Release Change Log
Darshan-3.1.3-pre1 Darshan-3.1.3-pre1
============= =============
* add --enable-HDF5_1.10 configure option to explicitly enable HDF5 1.10+
support, needed on some platforms for API compatibility
- contributed by Karl-Ulrich Bamberg
* skip instrumentation attempts for anonymous mmap() calls; this avoids a * skip instrumentation attempts for anonymous mmap() calls; this avoids a
potentential deadlock condition when used with hugepages on Cray systems. potentential deadlock condition when used with hugepages on Cray systems.
Reported by Glenn Lockwood and Cristian Simarro. Reported by Glenn Lockwood and Cristian Simarro.
* fix segmentation fault in statistics collection for applications that issue * fix segmentation fault in statistics collection for applications that issue
operations with a large number of distince access sizes or strides on the operations with a large number of distince access sizes or strides on the
same file. Reported by Glenn Lockwood. same file. Reported by Glenn Lockwood.
* disable HDF5 module by default unless enabled using --enable-HDF5-post-1.10
or --enable-HDF5-pre-1.10 configure arguments. These options
vary the wrapper prototypes to match the corresponding HDF5 library ABI.
The initial patch for HDF5 1.10 compatibility was contributed by
Karl-Ulrich Bamberg.
Darshan-3.1.2 Darshan-3.1.2
============= =============
......
...@@ -35,8 +35,15 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir) ...@@ -35,8 +35,15 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
LIBS = -lz @LIBBZ2@ LIBS = -lz @LIBBZ2@
DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o lib/darshan-stdio.o lib/darshan-dxt.o BUILD_HDF5_MODULE = @BUILD_HDF5_MODULE@
DARSHAN_DYNAMIC_MOD_OBJS = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po lib/darshan-stdio.po lib/darshan-dxt.po
DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-pnetcdf.o lib/darshan-stdio.o lib/darshan-dxt.o
DARSHAN_DYNAMIC_MOD_OBJS = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-pnetcdf.po lib/darshan-stdio.po lib/darshan-dxt.po
ifdef BUILD_HDF5_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-hdf5.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-hdf5.po
endif
ifdef DARSHAN_USE_BGQ ifdef DARSHAN_USE_BGQ
DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o
...@@ -151,8 +158,13 @@ lib/libdarshan.a: lib/darshan-core-init-finalize.o lib/darshan-core.o lib/darsha ...@@ -151,8 +158,13 @@ lib/libdarshan.a: lib/darshan-core-init-finalize.o lib/darshan-core.o lib/darsha
lib/libdarshan.so: lib/darshan-core-init-finalize.po lib/darshan-core.po lib/darshan-common.po $(DARSHAN_DYNAMIC_MOD_OBJS) lib/lookup3.po lib/lookup8.po lib/libdarshan.so: lib/darshan-core-init-finalize.po lib/darshan-core.po lib/darshan-common.po $(DARSHAN_DYNAMIC_MOD_OBJS) lib/lookup3.po lib/lookup8.po
$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl $(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl
ifdef BUILD_HDF5_MODULE
lib/libdarshan-stubs.a: lib/darshan-hdf5-stubs.o lib/darshan-pnetcdf-stubs.o lib/libdarshan-stubs.a: lib/darshan-hdf5-stubs.o lib/darshan-pnetcdf-stubs.o
ar rcs $@ $^ ar rcs $@ $^
else
lib/libdarshan-stubs.a: lib/darshan-pnetcdf-stubs.o
ar rcs $@ $^
endif
install:: all install:: all
...@@ -182,7 +194,9 @@ endif ...@@ -182,7 +194,9 @@ endif
install -d $(datarootdir)/ld-opts install -d $(datarootdir)/ld-opts
install -m 644 share/ld-opts/darshan-base-ld-opts $(datarootdir)/ld-opts/darshan-base-ld-opts install -m 644 share/ld-opts/darshan-base-ld-opts $(datarootdir)/ld-opts/darshan-base-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-posix-ld-opts $(datarootdir)/ld-opts/darshan-posix-ld-opts install -m 644 $(srcdir)/share/ld-opts/darshan-posix-ld-opts $(datarootdir)/ld-opts/darshan-posix-ld-opts
ifdef BUILD_HDF5_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-hdf5-ld-opts $(datarootdir)/ld-opts/darshan-hdf5-ld-opts install -m 644 $(srcdir)/share/ld-opts/darshan-hdf5-ld-opts $(datarootdir)/ld-opts/darshan-hdf5-ld-opts
endif
install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-stdio-ld-opts $(datarootdir)/ld-opts/darshan-stdio-ld-opts install -m 644 $(srcdir)/share/ld-opts/darshan-stdio-ld-opts $(datarootdir)/ld-opts/darshan-stdio-ld-opts
ifdef ENABLE_MMAP_LOGS ifdef ENABLE_MMAP_LOGS
......
...@@ -621,6 +621,8 @@ ac_includes_default="\ ...@@ -621,6 +621,8 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
DARSHAN_HDF5_LD_OPTS
BUILD_HDF5_MODULE
DARSHAN_USE_LUSTRE DARSHAN_USE_LUSTRE
DARSHAN_USE_BGQ DARSHAN_USE_BGQ
MPICH_LIB_OLD MPICH_LIB_OLD
...@@ -690,7 +692,6 @@ with_zlib ...@@ -690,7 +692,6 @@ with_zlib
enable_ld_preload enable_ld_preload
enable_cuserid enable_cuserid
enable_group_readable_logs enable_group_readable_logs
enable_HDF5_1_10
enable_bgq_mod enable_bgq_mod
enable_lustre_mod enable_lustre_mod
enable_mmap_logs enable_mmap_logs
...@@ -700,6 +701,8 @@ with_log_hints ...@@ -700,6 +701,8 @@ with_log_hints
with_log_path with_log_path
with_jobid_env with_jobid_env
with_mod_mem with_mod_mem
enable_HDF5_post_1_10
enable_HDF5_pre_1_10
' '
ac_precious_vars='build_alias ac_precious_vars='build_alias
host_alias host_alias
...@@ -1334,10 +1337,13 @@ Optional Features: ...@@ -1334,10 +1337,13 @@ Optional Features:
--disable-cuserid Disables attempted use of cuserid() at run time --disable-cuserid Disables attempted use of cuserid() at run time
--enable-group-readable-logs --enable-group-readable-logs
Set log files to be group readable Set log files to be group readable
--enable-HDF5_1.10 Compile for use with HDF5 1.10.x
--disable-bgq-mod Disables compilation and use of BG/Q module (for BG/Q systems) --disable-bgq-mod Disables compilation and use of BG/Q module (for BG/Q systems)
--disable-lustre-mod Disables compilation and use of the Lustre module --disable-lustre-mod Disables compilation and use of the Lustre module
--enable-mmap-logs Enables ability to mmap I/O data to log file --enable-mmap-logs Enables ability to mmap I/O data to log file
--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 version 1.8 or earlier
Optional Packages: Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
...@@ -3583,17 +3589,6 @@ fi ...@@ -3583,17 +3589,6 @@ fi
fi fi
# Check whether --enable-HDF5_1.10 was given.
if test "${enable_HDF5_1_10+set}" = set; then :
enableval=$enable_HDF5_1_10; if test "x$enableval" = "xyes" ; then
$as_echo "#define __DARSHAN_ENABLE_HDF5110 1" >>confdefs.h
fi
fi
# Check whether --enable-bgq-mod was given. # Check whether --enable-bgq-mod was given.
if test "${enable_bgq_mod+set}" = set; then : if test "${enable_bgq_mod+set}" = set; then :
enableval=$enable_bgq_mod; enableval=$enable_bgq_mod;
...@@ -4208,6 +4203,38 @@ eval darshan_share_path=$datarootdir ...@@ -4208,6 +4203,38 @@ eval darshan_share_path=$datarootdir
prefix=$savePrefix prefix=$savePrefix
exec_prefix=$saveExecprefix exec_prefix=$saveExecprefix
BUILD_HDF5_MODULE=
DARSHAN_HDF5_LD_OPTS=
# 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
$as_echo "#define __DARSHAN_ENABLE_HDF5110 1" >>confdefs.h
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
fi
# 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
fi
# determine if the MPI library includes MPI-IO functions or not # determine if the MPI library includes MPI-IO functions or not
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI-IO support in MPI" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI-IO support in MPI" >&5
$as_echo_n "checking for MPI-IO support in MPI... " >&6; } $as_echo_n "checking for MPI-IO support in MPI... " >&6; }
...@@ -4384,6 +4411,8 @@ DARSHAN_VERSION="3.1.2" ...@@ -4384,6 +4411,8 @@ DARSHAN_VERSION="3.1.2"
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-bg-cc.conf share/mpi-profile/darshan-bg-cxx.conf share/mpi-profile/darshan-bg-f.conf share/ld-opts/darshan-base-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-bg-cc.conf share/mpi-profile/darshan-bg-cxx.conf share/mpi-profile/darshan-bg-f.conf share/ld-opts/darshan-base-ld-opts"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
......
...@@ -46,13 +46,6 @@ AC_ARG_ENABLE(group-readable-logs, ...@@ -46,13 +46,6 @@ AC_ARG_ENABLE(group-readable-logs,
fi] fi]
,) ,)
AC_ARG_ENABLE(HDF5_1.10,
[ --enable-HDF5_1.10 Compile for use with HDF5 1.10.x],
[if test "x$enableval" = "xyes" ; then
AC_DEFINE(__DARSHAN_ENABLE_HDF5110, 1, Set for compatibility with HDF5_1.10.x, breaks use with 1.8.x)
fi]
,)
AC_ARG_ENABLE( AC_ARG_ENABLE(
[bgq-mod], [bgq-mod],
[ --disable-bgq-mod Disables compilation and use of BG/Q module (for BG/Q systems)], [ --disable-bgq-mod Disables compilation and use of BG/Q module (for BG/Q systems)],
...@@ -262,6 +255,34 @@ eval darshan_share_path=$datarootdir ...@@ -262,6 +255,34 @@ eval darshan_share_path=$datarootdir
prefix=$savePrefix prefix=$savePrefix
exec_prefix=$saveExecprefix exec_prefix=$saveExecprefix
BUILD_HDF5_MODULE=
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
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]
,)
# determine if the MPI library includes MPI-IO functions or not # determine if the MPI library includes MPI-IO functions or not
AC_MSG_CHECKING(for MPI-IO support in MPI) AC_MSG_CHECKING(for MPI-IO support in MPI)
AC_TRY_LINK([#include <mpi.h>], [ AC_TRY_LINK([#include <mpi.h>], [
...@@ -359,6 +380,8 @@ AC_SUBST(DARSHAN_VERSION) ...@@ -359,6 +380,8 @@ AC_SUBST(DARSHAN_VERSION)
AC_SUBST(MPICH_LIB_OLD) AC_SUBST(MPICH_LIB_OLD)
AC_SUBST(DARSHAN_USE_BGQ) AC_SUBST(DARSHAN_USE_BGQ)
AC_SUBST(DARSHAN_USE_LUSTRE) AC_SUBST(DARSHAN_USE_LUSTRE)
AC_SUBST(BUILD_HDF5_MODULE)
AC_SUBST(DARSHAN_HDF5_LD_OPTS)
AC_OUTPUT(Makefile AC_OUTPUT(Makefile
darshan-mk-log-dirs.pl darshan-mk-log-dirs.pl
darshan-gen-cc.pl darshan-gen-cc.pl
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
/* Define if cuserid() should be disabled */ /* Define if cuserid() should be disabled */
#undef __DARSHAN_DISABLE_CUSERID #undef __DARSHAN_DISABLE_CUSERID
/* Set for compatibility with HDF5_1.10.x */ /* Set for compatibility with HDF5 1.10.x */
#undef __DARSHAN_ENABLE_HDF5110 #undef __DARSHAN_ENABLE_HDF5110
/* Define if Darshan should mmap data structures to log file */ /* Define if Darshan should mmap data structures to log file */
......
...@@ -76,6 +76,10 @@ header and library. ...@@ -76,6 +76,10 @@ header and library.
and only builds if BG/Q environment detected). and only builds if BG/Q environment detected).
* `--enable-group-readable-logs`: sets darshan log file permissions to allow * `--enable-group-readable-logs`: sets darshan log file permissions to allow
group read access. group read access.
* `--enable-HDF5-pre-1.10`: enables the Darshan HDF5 instrumentation module,
with support for HDF5 versions prior to 1.10
* `--enable-HDF5-post-1.10`: enables the Darshan HDF5 instrumentation module,
with support for HDF5 versions 1.10 or higher
=== Cross compilation === Cross compilation
......
...@@ -70,6 +70,21 @@ herr_t H5Fclose(hid_t file_id) ...@@ -70,6 +70,21 @@ herr_t H5Fclose(hid_t file_id)
return(-1); return(-1);
} }
herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum) __attribute__((weak));
herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum)
{
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if(rank == 0)
{
fprintf(stderr, "WARNING: Darshan H5get_libversion() stub called; this is probably the result of a link-time problem.\n");
}
return(-1);
}
/* /*
* Local variables: * Local variables:
* c-indent-level: 4 * c-indent-level: 4
......
...@@ -36,6 +36,7 @@ typedef int herr_t; //hf5-1.10.0p1: H5public.h:126 ...@@ -36,6 +36,7 @@ typedef int herr_t; //hf5-1.10.0p1: H5public.h:126
DARSHAN_FORWARD_DECL(H5Fcreate, hid_t, (const char *filename, unsigned flags, hid_t create_plist, hid_t access_plist)); DARSHAN_FORWARD_DECL(H5Fcreate, hid_t, (const char *filename, unsigned flags, hid_t create_plist, hid_t access_plist));
DARSHAN_FORWARD_DECL(H5Fopen, hid_t, (const char *filename, unsigned flags, hid_t access_plist)); DARSHAN_FORWARD_DECL(H5Fopen, hid_t, (const char *filename, unsigned flags, hid_t access_plist));
DARSHAN_FORWARD_DECL(H5Fclose, herr_t, (hid_t file_id)); DARSHAN_FORWARD_DECL(H5Fclose, herr_t, (hid_t file_id));
DARSHAN_FORWARD_DECL(H5get_libversion, herr_t, (unsigned *majnum, unsigned *minnum, unsigned *relnum));
/* structure that can track i/o stats for a given HDF5 file record at runtime */ /* structure that can track i/o stats for a given HDF5 file record at runtime */
struct hdf5_file_record_ref struct hdf5_file_record_ref
...@@ -120,6 +121,24 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags, ...@@ -120,6 +121,24 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
hid_t ret; hid_t ret;
char* tmp; char* tmp;
double tm1; double tm1;
unsigned majnum, minnum, relnum;
MAP_OR_FAIL(H5get_libversion);
__real_H5get_libversion(&majnum, &minnum, &relnum);
#ifdef __DARSHAN_ENABLE_HDF5110
if(majnum < 1 || (majnum == 1 && minnum < 10))
#else
if(majnum > 1 || (majnum == 1 && minnum >= 10))
#endif
{
if(my_rank < 0)
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
if(my_rank == 0)
{
fprintf(stderr, "Darshan HDF5 module error: runtime library version does not match Darshan module.\n");
}
return(-1);
}
MAP_OR_FAIL(H5Fcreate); MAP_OR_FAIL(H5Fcreate);
...@@ -151,6 +170,24 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags, ...@@ -151,6 +170,24 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
hid_t ret; hid_t ret;
char* tmp; char* tmp;
double tm1; double tm1;
unsigned majnum, minnum, relnum;
MAP_OR_FAIL(H5get_libversion);
__real_H5get_libversion(&majnum, &minnum, &relnum);
#ifdef __DARSHAN_ENABLE_HDF5110
if(majnum < 1 || (majnum == 1 && minnum < 10))
#else
if(majnum > 1 || (majnum == 1 && minnum >= 10))
#endif
{
if(my_rank < 0)
MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
if(my_rank == 0)
{
fprintf(stderr, "Darshan HDF5 module error: runtime library version does not match Darshan module.\n");
}
return(-1);
}
MAP_OR_FAIL(H5Fopen); MAP_OR_FAIL(H5Fopen);
......
--undefined=MPI_Init --undefined=MPI_Init
--undefined=MPI_Wtime --undefined=MPI_Wtime
@@darshan_share_path@/ld-opts/darshan-posix-ld-opts @@darshan_share_path@/ld-opts/darshan-posix-ld-opts
@@darshan_share_path@/ld-opts/darshan-hdf5-ld-opts
@@darshan_share_path@/ld-opts/darshan-pnetcdf-ld-opts @@darshan_share_path@/ld-opts/darshan-pnetcdf-ld-opts
@@darshan_share_path@/ld-opts/darshan-stdio-ld-opts @@darshan_share_path@/ld-opts/darshan-stdio-ld-opts
@@DARSHAN_HDF5_LD_OPTS@
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
--wrap=H5Fcreate --wrap=H5Fcreate
--wrap=H5Fopen --wrap=H5Fopen
--wrap=H5Fclose --wrap=H5Fclose
--wrap=H5get_libversion
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment