...
 
Commits (99)
stages:
- build
- test
build_darshan:
tags:
- shell
- ecp-theta
stage: build
script:
- source darshan-test/automated/common/setup.sh
- source darshan-test/automated/common/configure.sh
- source darshan-test/automated/common/build.sh
test_darshan:
variables:
# XXX this info is hard-coded in our regression scripts
#SCHEDULER_PARAMETERS: "-A radix-io -n 1 -t 10 -q default"
tags:
- batch
- ecp-theta
stage: test
script:
- darshan-test/regression/run-all.sh install scratch cray-module-alcf
......@@ -2,6 +2,50 @@
Darshan Release Change Log
--------------------------
Darshan-3.1.7
=============
* bug fix for handling DXT data in darshan-convert utility. Bug reported
by Mahzad Khoshlessan.
* bug fix for darshan-parser backwards compatibility: Darshan logs generated
by Darshan versions prior to 3.1.0 may have included stdio counters that
were not properly up-converted. Reported by Teng Wang.
* bug fix to MiB reported in I/O performance estimate of
darshan-job-summary.pl when both posix and stdio access is present
* added wrapper for __open_2(), bug reported by Cormac Garvey in which open
calls are not intercepted with some versions of glibc/gcc
* added an instrumentation module for the MDHIM key/val storage system
* added support for properly instrumenting dup(), fileno(), fdopen(), and
rename() calls
Darshan-3.1.6
=============
* bug fix for linker failures caused when linking external libraries
that use MPI internally (e.g., PETSc). Reported by Bilel Hadri.
* bug fix in mapping of Darshan's MPI_File_read_all wrapper to the
underlying MPI library call in dynamic linking case
Darshan-3.1.5
=============
* modify Darshan MPI instrumentation method to intercept both MPI and
PMPI symbols to workaround MPI implementations that are calling
PMPI routines directly (e.g., the Fortran bindings of OpenMPI2).
Contributed in part by Chris Zimmer.
* add a new python utility for analzying DXT trace files (dxt_analyzer).
Contributed by Alex Sim.
* bug fix to disable Darshan module instrumentation after the
Darshan shutdown procedure has began, an issue that was
leading to negative timers in some cases
* bug fix for autoconf ignoring specified libbz2 location. Contributed
by Glenn Lockwood.
* add regression tests harnesses for Cray systems at ALCF & NERSC
* add support for DARSHAN_EXCLUDE_DIRS environment variable to
explicitly disable instrumentation for files in given
directories. Contributed by Cristian Simarro.
* correct "undefined reference to `__wrap_H5get_libversion'" linker failure
when compiling some HDF5 programs, reported by Jialin Liu
* bug fix in darshan-merge utility related to logs containing DXT trace
data. Reported by Glenn Lockwood.
Darshan-3.1.4
=============
* bug fix to prevent darshan-parser segfault when parsing logs with
......
......@@ -8,7 +8,7 @@
#define __DARSHAN_HDF5_LOG_FORMAT_H
/* current HDF5 log format version */
#define DARSHAN_HDF5_VER 1
#define DARSHAN_HDF5_VER 2
#define HDF5_COUNTERS \
/* count of HDF5 opens */\
......@@ -18,9 +18,13 @@
#define HDF5_F_COUNTERS \
/* timestamp of first open */\
X(HDF5_F_OPEN_TIMESTAMP) \
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_TIMESTAMP) \
X(HDF5_F_CLOSE_END_TIMESTAMP) \
/* end of counters*/\
X(HDF5_F_NUM_INDICES)
......
......@@ -119,6 +119,7 @@ struct darshan_base_record
#include "darshan-stdio-log-format.h"
/* DXT */
#include "darshan-dxt-log-format.h"
#include "darshan-mdhim-log-format.h"
/* X-macro for keeping module ordering consistent */
/* NOTE: first val used to define module enum values,
......@@ -141,7 +142,9 @@ struct darshan_base_record
X(DARSHAN_STDIO_MOD, "STDIO", DARSHAN_STDIO_VER, &stdio_logutils) \
/* DXT */ \
X(DXT_POSIX_MOD, "DXT_POSIX", DXT_POSIX_VER, &dxt_posix_logutils) \
X(DXT_MPIIO_MOD, "DXT_MPIIO", DXT_MPIIO_VER, &dxt_mpiio_logutils)
X(DXT_MPIIO_MOD, "DXT_MPIIO", DXT_MPIIO_VER, &dxt_mpiio_logutils) \
X(DARSHAN_MDHIM_MOD, "MDHIM", DARSHAN_MDHIM_VER, &mdhim_logutils)
/* unique identifiers to distinguish between available darshan modules */
/* NOTES: - valid ids range from [0...DARSHAN_MAX_MODS-1]
......
/*
* Copyright (C) 2015 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef __DARSHAN_MDHIM_LOG_FORMAT_H
#define __DARSHAN_MDHIM_LOG_FORMAT_H
/* current log format version, to support backwards compatibility */
#define DARSHAN_MDHIM_VER 1
#define MDHIM_COUNTERS \
/* number of 'put' function calls */\
X(MDHIM_PUTS) \
/* larget payload for a 'put' */ \
X(MDHIM_GETS) \
/* largest get */ \
X(MDHIM_PUT_MAX_SIZE)\
/* number of 'get' function calls */\
X(MDHIM_GET_MAX_SIZE) \
/* how many servers? */ \
X(MDHIM_SERVERS) \
/* end of counters */ \
X(MDHIM_NUM_INDICES)
#define MDHIM_F_COUNTERS \
/* timestamp of the first call to a 'put' function */\
X(MDHIM_F_PUT_TIMESTAMP) \
X(MDHIM_F_GET_TIMESTAMP) \
/* timer indicating longest (slowest) call to put/get */\
X(MDHIM_F_PUT_MAX_DURATION) \
X(MDHIM_F_GET_MAX_DURATION) \
/* end of counters */\
X(MDHIM_F_NUM_INDICES)
#define X(a) a,
/* integer counters for the "NULL" example module */
enum darshan_mdhim_indices
{
MDHIM_COUNTERS
};
/* floating point counters for the "NULL" example module */
enum darshan_mdhim_f_indices
{
MDHIM_F_COUNTERS
};
#undef X
/* the darshan_mdhim_record structure encompasses the high-level data/counters
* which would actually be logged to file by Darshan for the "MDHIM"
* module. This implementation logs the following data for each
* record:
* - a darshan_base_record structure, which contains the record id & rank
* - integer I/O counters (operation counts, I/O sizes, etc.)
* - floating point I/O counters (timestamps, cumulative timers, etc.)
*/
struct darshan_mdhim_record
{
struct darshan_base_record base_rec;
int64_t counters[MDHIM_NUM_INDICES];
double fcounters[MDHIM_F_NUM_INDICES];
/* when we allocate this struct, we'll do so with enough extra memory to
* hold N servers. Compare to approach taken with darshan_lustre_record */
/* be mindful of struct alignment here: If one reads "sizeof(struct
* darshan_mdhim_record)", one might end up reading more than expected.
* Second read will then end up reading less than needed */
int64_t server_histogram[1];
};
/* '-1' because d_m_r already allocated with space for one */
#define MDHIM_RECORD_SIZE(servers) (sizeof(struct darshan_mdhim_record) + sizeof(int64_t) * ((servers) - 1) )
#endif /* __DARSHAN_MDHIM_LOG_FORMAT_H */
......@@ -8,7 +8,7 @@
#define __DARSHAN_MPIIO_LOG_FORMAT_H
/* current MPI-IO log format version */
#define DARSHAN_MPIIO_VER 2
#define DARSHAN_MPIIO_VER 3
/* TODO: maybe use a counter to track cases in which a derived datatype is used? */
......@@ -92,17 +92,21 @@
#define MPIIO_F_COUNTERS \
/* timestamp of first open */\
X(MPIIO_F_OPEN_TIMESTAMP) \
X(MPIIO_F_OPEN_START_TIMESTAMP) \
/* timestamp of first read */\
X(MPIIO_F_READ_START_TIMESTAMP) \
/* timestamp of first write */\
X(MPIIO_F_WRITE_START_TIMESTAMP) \
/* timestamp of first close */\
X(MPIIO_F_CLOSE_START_TIMESTAMP) \
/* timestamp of last open */\
X(MPIIO_F_OPEN_END_TIMESTAMP) \
/* timestamp of last read */\
X(MPIIO_F_READ_END_TIMESTAMP) \
/* timestamp of last write */\
X(MPIIO_F_WRITE_END_TIMESTAMP) \
/* timestamp of last close */\
X(MPIIO_F_CLOSE_TIMESTAMP) \
X(MPIIO_F_CLOSE_END_TIMESTAMP) \
/* cumulative MPI-IO read time */\
X(MPIIO_F_READ_TIME) \
/* cumulative MPI-IO write time */\
......
......@@ -8,7 +8,7 @@
#define __DARSHAN_PNETCDF_LOG_FORMAT_H
/* current PNETCDF log format version */
#define DARSHAN_PNETCDF_VER 1
#define DARSHAN_PNETCDF_VER 2
#define PNETCDF_COUNTERS \
/* count of PNETCDF independent opens */\
......@@ -20,9 +20,13 @@
#define PNETCDF_F_COUNTERS \
/* timestamp of first open */\
X(PNETCDF_F_OPEN_TIMESTAMP) \
X(PNETCDF_F_OPEN_START_TIMESTAMP) \
/* timestamp of first close */\
X(PNETCDF_F_CLOSE_START_TIMESTAMP) \
/* timestamp of last open */\
X(PNETCDF_F_OPEN_END_TIMESTAMP) \
/* timestamp of last close */\
X(PNETCDF_F_CLOSE_TIMESTAMP) \
X(PNETCDF_F_CLOSE_END_TIMESTAMP) \
/* end of counters*/\
X(PNETCDF_F_NUM_INDICES)
......
......@@ -7,11 +7,15 @@
#define __DARSHAN_POSIX_LOG_FORMAT_H
/* current POSIX log format version */
#define DARSHAN_POSIX_VER 3
#define DARSHAN_POSIX_VER 4
#define POSIX_COUNTERS \
/* count of posix opens */\
/* count of posix opens (INCLUDING fileno and dup operations) */\
X(POSIX_OPENS) \
/* count of number of filenos */\
X(POSIX_FILENOS) \
/* count of number of dups */\
X(POSIX_DUPS) \
/* count of posix reads */\
X(POSIX_READS) \
/* count of posix writes */\
......@@ -26,6 +30,12 @@
X(POSIX_FSYNCS) \
/* count of posix fdatasyncs */\
X(POSIX_FDSYNCS) \
/* count of renames (as source file) */\
X(POSIX_RENAME_SOURCES) \
/* count of renames (as target file) */\
X(POSIX_RENAME_TARGETS) \
/* Darshan record ID of first rename source */\
X(POSIX_RENAMED_FROM) \
/* mode of file */\
X(POSIX_MODE) \
/* total bytes read */\
......
......@@ -36,6 +36,7 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
LIBS = -lz @LIBBZ2@
BUILD_HDF5_MODULE = @BUILD_HDF5_MODULE@
BUILD_MDHIM_MODULE = @BUILD_MDHIM_MODULE@
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
......@@ -59,6 +60,13 @@ CFLAGS += -DDARSHAN_LUSTRE
CFLAGS_SHARED += -DDARSHAN_LUSTRE
endif
ifdef BUILD_MDHIM_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-mdhim.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-mdhim.po
CFLAGS += -DDARSHAN_MDHIM
CFLAGS_SHARED += -DDARSHAN_MDHIM
endif
lib::
@mkdir -p $@
......@@ -140,6 +148,13 @@ lib/darshan-dxt.o: lib/darshan-dxt.c darshan.h darshan-common.h $(DARSHAN_LOG_FO
lib/darshan-dxt.po: lib/darshan-dxt.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-dxt-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/darshan-mdhim.o: lib/darshan-mdhim.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mdhim-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-mdhim.po: lib/darshan-mdhim.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-mdhim-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/lookup3.o: lib/lookup3.c
$(CC) $(CFLAGS) -c $< -o $@
......@@ -196,6 +211,9 @@ endif
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
endif
ifdef BUILD_MDHIM_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-mdhim-ld-opts $(datarootdir)/ld-opts/darshan-mdhim-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-stdio-ld-opts $(datarootdir)/ld-opts/darshan-stdio-ld-opts
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for darshan-runtime 3.1.4.
# Generated by GNU Autoconf 2.69 for darshan-runtime 3.1.7.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
......@@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='darshan-runtime'
PACKAGE_TARNAME='darshan-runtime'
PACKAGE_VERSION='3.1.4'
PACKAGE_STRING='darshan-runtime 3.1.4'
PACKAGE_VERSION='3.1.7'
PACKAGE_STRING='darshan-runtime 3.1.7'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
......@@ -621,6 +621,8 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
DARSHAN_MDHIM_LD_OPTS
BUILD_MDHIM_MODULE
DARSHAN_HDF5_LD_OPTS
BUILD_HDF5_MODULE
DARSHAN_USE_LUSTRE
......@@ -703,6 +705,7 @@ with_jobid_env
with_mod_mem
enable_HDF5_post_1_10
enable_HDF5_pre_1_10
enable_mdhim
'
ac_precious_vars='build_alias
host_alias
......@@ -1263,7 +1266,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures darshan-runtime 3.1.4 to adapt to many kinds of systems.
\`configure' configures darshan-runtime 3.1.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1325,7 +1328,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of darshan-runtime 3.1.4:";;
short | recursive ) echo "Configuration of darshan-runtime 3.1.7:";;
esac
cat <<\_ACEOF
......@@ -1344,6 +1347,7 @@ Optional Features:
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
--enable-mdhim Enable mdhim module
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
......@@ -1439,7 +1443,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
darshan-runtime configure 3.1.4
darshan-runtime configure 3.1.7
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1791,7 +1795,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by darshan-runtime $as_me 3.1.4, which was
It was created by darshan-runtime $as_me 3.1.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3504,7 +3508,7 @@ ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_inclu
if test "x$ac_cv_header_zlib_h" = xyes; then :
else
as_fn_error $? "z.h not found" "$LINENO" 5
as_fn_error $? "zlib.h not found" "$LINENO" 5
fi
......@@ -3773,6 +3777,7 @@ fi
fi
if test x$GOT_ALIGNMENT != x1; then
as_fn_error $? "must provide --with-mem-align=<num> argument to configure." "$LINENO" 5
fi
......@@ -4235,6 +4240,33 @@ fi
fi
BUILD_MDHIM_MODULE=
DARSHAN_MDHIM_LD_OPTS=
# Check whether --enable-mdhim was given.
if test "${enable_mdhim+set}" = set; then :
enableval=$enable_mdhim;
fi
if test "x$enable_mdhim" = "xyes"; then :
BUILD_MDHIM_MODULE=1
DARSHAN_MDHIM_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-mdhim-ld-opts"
for ac_header in mdhim.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "mdhim.h" "ac_cv_header_mdhim_h" "$ac_includes_default"
if test "x$ac_cv_header_mdhim_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MDHIM_H 1
_ACEOF
else
as_fn_error $? "mdhim requested but headers cannot be found" "$LINENO" 5
fi
done
fi
# 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_n "checking for MPI-IO support in MPI... " >&6; }
......@@ -4400,7 +4432,9 @@ else
MPICH_LIB_OLD=0
fi
DARSHAN_VERSION="3.1.4"
DARSHAN_VERSION="3.1.7"
......@@ -4922,7 +4956,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by darshan-runtime $as_me 3.1.4, which was
This file was extended by darshan-runtime $as_me 3.1.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -4984,7 +5018,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
darshan-runtime config.status 3.1.4
darshan-runtime config.status 3.1.7
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -5,7 +5,7 @@ dnl Process this file with autoconf to produce a configure script.
dnl You may need to use autoheader as well if changing any DEFINEs
dnl sanity checks, output header, location of scripts used here
AC_INIT([darshan-runtime], [3.1.4])
AC_INIT([darshan-runtime], [3.1.7])
AC_CONFIG_SRCDIR([darshan.h])
AC_CONFIG_AUX_DIR(../maint/config)
AC_CONFIG_HEADER(darshan-runtime-config.h)
......@@ -162,6 +162,7 @@ if test x$enable_lustre_mod != xno; then
[]))
fi
if test x$GOT_ALIGNMENT != x1; then
AC_MSG_ERROR(must provide --with-mem-align=<num> argument to configure.)
fi
......@@ -283,6 +284,22 @@ AC_ARG_ENABLE(HDF5-pre-1.10,
fi]
,)
BUILD_MDHIM_MODULE=
DARSHAN_MDHIM_LD_OPTS=
AC_ARG_ENABLE([mdhim],
AS_HELP_STRING([--enable-mdhim], [Enable mdhim module]),
[],[] )
AS_IF([test "x$enable_mdhim" = "xyes"],
BUILD_MDHIM_MODULE=1
DARSHAN_MDHIM_LD_OPTS="@${darshan_share_path}/ld-opts/darshan-mdhim-ld-opts"
AC_CHECK_HEADERS([mdhim.h],
[],
AC_MSG_ERROR([mdhim requested but headers cannot be found]) ),
[]
)
# determine if the MPI library includes MPI-IO functions or not
AC_MSG_CHECKING(for MPI-IO support in MPI)
AC_TRY_LINK([#include <mpi.h>], [
......@@ -382,6 +399,8 @@ AC_SUBST(DARSHAN_USE_BGQ)
AC_SUBST(DARSHAN_USE_LUSTRE)
AC_SUBST(BUILD_HDF5_MODULE)
AC_SUBST(DARSHAN_HDF5_LD_OPTS)
AC_SUBST(BUILD_MDHIM_MODULE)
AC_SUBST(DARSHAN_MDHIM_LD_OPTS)
AC_OUTPUT(Makefile
darshan-mk-log-dirs.pl
darshan-gen-cc.pl
......
......@@ -210,12 +210,16 @@ void darshan_clear_record_refs(
*
* Iterate each record reference stored in the hash table pointed
* to by 'hash_head' and perform the given action 'iter_action'.
* The action function takes a single pointer which points to the
* corresponding record reference pointer.
* The action function takes two pointers as input: the first
* points to the corresponding record reference pointer and the
* second is a user-supplied pointer provided for the action.
* 'user_ptr' is the user-supplied pointer that will be passed
* as the 2nd argument to 'iter_action'.
*/
void darshan_iter_record_refs(
void *hash_head,
void (*iter_action)(void *));
void (*iter_action)(void *, void *),
void *user_ptr);
/* darshan_clean_file_path()
*
......
/*
* Copyright (C) 2019 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef __DARSHAN_DXT_H
#define __DARSHAN_DXT_H
/* dxt_load_trigger_conf()
*
* DXT function exposed to Darshan core to read in any trace triggers
* from the file path in 'trigger_conf_path' before module
* initialization occurs.
*/
void dxt_load_trigger_conf(
char *trigger_conf_path);
/* dxt_posix_runtime_initialize()
*
* DXT function exposed to POSIX module for initializing DXT-POSIX runtime.
*/
void dxt_posix_runtime_initialize(void);
/* dxt_mpiio_runtime_initialize()
*
* DXT function exposed to MPIIO module for initializing DXT-MPIIO runtime.
*/
void dxt_mpiio_runtime_initialize(void);
/* dxt_posix_write(), dxt_posix_read()
*
* DXT function to trace a POSIX write/read call to file record 'rec_id',
* at offset 'offset' and with 'length' size. 'start_time' and 'end_time'
* are starting and ending timestamps for the operation, respectively.
*/
void dxt_posix_write(darshan_record_id rec_id, int64_t offset,
int64_t length, double start_time, double end_time);
void dxt_posix_read(darshan_record_id rec_id, int64_t offset,
int64_t length, double start_time, double end_time);
/* dxt_mpiio_write(), dxt_mpiio_read()
*
* DXT function to trace a MPIIO write/read call to file record 'rec_id',
* with 'length' size. 'start_time' and 'end_time' are starting and ending
* timestamps for the operation, respectively.
*/
void dxt_mpiio_write(darshan_record_id rec_id, int64_t length,
double start_time, double end_time);
void dxt_mpiio_read(darshan_record_id rec_id, int64_t length,
double start_time, double end_time);
void dxt_posix_filter_dynamic_traces(
struct darshan_posix_file *(*rec_id_to_psx_file)(darshan_record_id));
#endif /* __DARSHAN_DXT_H */
......@@ -12,6 +12,9 @@
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <mdhim.h> header file. */
#undef HAVE_MDHIM_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
......
......@@ -47,7 +47,7 @@
{ \
__real_ ## __func = dlsym(RTLD_NEXT, #__func); \
if(!(__real_ ## __func)) { \
fprintf(stderr, "Darshan failed to map symbol: %s\n", #__func); \
darshan_core_fprintf(stderr, "Darshan failed to map symbol: %s\n", #__func); \
exit(1); \
} \
}
......@@ -178,6 +178,14 @@ void *darshan_core_register_record(
int rec_len,
struct darshan_fs_info *fs_info);
/* darshan_core_lookup_record_name()
*
* Looks up the name associated with a given Darshan record ID.
*/
char *darshan_core_lookup_record_name(
darshan_record_id rec_id);
/* darshan_core_wtime()
*
* Returns the elapsed time relative to (roughly) the start of
......@@ -185,6 +193,15 @@ void *darshan_core_register_record(
*/
double darshan_core_wtime(void);
/* darshan_core_fprintf()
*
* Prints internal Darshan output on a given stream.
*/
void darshan_core_fprintf(
FILE *stream,
const char *format,
...);
/* darshan_core_excluded_path()
*
* Returns true (1) if the given file path 'path' is in Darshan's
......
......@@ -555,6 +555,7 @@ behavior at runtime:
* DARSHAN_LOGFILE: specifies the path (directory + Darshan log file name) to write the output Darshan log to. This overrides the default Darshan behavior of automatically generating a log file name and adding it to a log file directory formatted using darshan-mk-log-dirs script.
* DARSHAN_MODMEM: specifies the maximum amount of memory (in MiB) Darshan instrumentation modules can collectively consume at runtime (if not specified, Darshan uses a default quota of 2 MiB).
* DARSHAN_MMAP_LOGPATH: if Darshan's mmap log file mechanism is enabled, this variable specifies what path the mmap log files should be stored in (if not specified, log files will be stored in `/tmp`).
* DARSHAN_EXCLUDE_DIRS: specifies a list of comma-separated paths that Darshan will not instrument at runtime (in addition to Darshan's default blacklist)
* DXT_ENABLE_IO_TRACE: setting this environment variable enables the DXT (Darshan eXtended Tracing) modules at runtime. Users can specify a numeric value for this variable to set the number of MiB to use for tracing per process; if no value is specified, Darshan will use a default value of 4 MiB.
== Debugging
......
......@@ -103,7 +103,8 @@ void darshan_clear_record_refs(void **hash_head_p, int free_flag)
return;
}
void darshan_iter_record_refs(void *hash_head, void (*iter_action)(void *))
void darshan_iter_record_refs(void *hash_head, void (*iter_action)(void *, void *),
void *user_ptr)
{
struct darshan_record_ref_tracker *ref_tracker, *tmp;
struct darshan_record_ref_tracker *ref_tracker_head =
......@@ -114,7 +115,7 @@ void darshan_iter_record_refs(void *hash_head, void (*iter_action)(void *))
*/
HASH_ITER(hlink, ref_tracker_head, ref_tracker, tmp)
{
iter_action(ref_tracker->rec_ref_p);
iter_action(ref_tracker->rec_ref_p, user_ptr);
}
return;
......
......@@ -19,6 +19,7 @@
#include <limits.h>
#include <pthread.h>
#include <fcntl.h>
#include <stdarg.h>
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/types.h>
......@@ -33,6 +34,7 @@
#include "darshan.h"
#include "darshan-core.h"
#include "darshan-dynamic.h"
#include "darshan-dxt.h"
#ifdef DARSHAN_LUSTRE
#include <lustre/lustre_user.h>
......@@ -307,6 +309,13 @@ void darshan_core_initialize(int argc, char **argv)
/* collect information about command line and mounted file systems */
darshan_get_exe_and_mounts(init_core, argc, argv);
/* determine if/when DXT should be enabled by looking for triggers */
char *trigger_conf = getenv("DARSHAN_DXT_TRIGGER_CONF_PATH");
if(trigger_conf)
{
dxt_load_trigger_conf(trigger_conf);
}
/* if darshan was successfully initialized, set the global pointer
* and bootstrap any modules with static initialization routines
*/
......@@ -330,8 +339,8 @@ void darshan_core_initialize(int argc, char **argv)
MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD);
if(my_rank == 0)
{
fprintf(stderr, "#darshan:<op>\t<nprocs>\t<time>\n");
fprintf(stderr, "darshan:init\t%d\t%f\n", nprocs, init_max);
darshan_core_fprintf(stderr, "#darshan:<op>\t<nprocs>\t<time>\n");
darshan_core_fprintf(stderr, "darshan:init\t%d\t%f\n", nprocs, init_max);
}
}
......@@ -439,7 +448,7 @@ void darshan_core_shutdown()
if(strlen(logfile_name) == 0)
{
/* failed to generate log file name */
fprintf(stderr, "darshan library warning: unable to determine log file path\n");
darshan_core_fprintf(stderr, "darshan library warning: unable to determine log file path\n");
free(logfile_name);
darshan_core_cleanup(final_core);
return;
......@@ -476,7 +485,7 @@ void darshan_core_shutdown()
{
if(my_rank == 0)
{
fprintf(stderr, "darshan library warning: unable to create log file %s\n",
darshan_core_fprintf(stderr, "darshan library warning: unable to create log file %s\n",
logfile_name);
}
free(logfile_name);
......@@ -498,7 +507,7 @@ void darshan_core_shutdown()
final_core->comp_buf, &comp_buf_sz);
if(all_ret)
{
fprintf(stderr, "darshan library warning: unable to compress job data\n");
darshan_core_fprintf(stderr, "darshan library warning: unable to compress job data\n");
unlink(logfile_name);
}
else
......@@ -509,7 +518,7 @@ void darshan_core_shutdown()
final_core->comp_buf, comp_buf_sz, MPI_BYTE, &status);
if(all_ret != MPI_SUCCESS)
{
fprintf(stderr,
darshan_core_fprintf(stderr,
"darshan library warning: unable to write job data to log file %s\n",
logfile_name);
unlink(logfile_name);
......@@ -544,7 +553,7 @@ void darshan_core_shutdown()
{
if(my_rank == 0)
{
fprintf(stderr,
darshan_core_fprintf(stderr,
"darshan library warning: unable to write record hash to log file %s\n",
logfile_name);
unlink(logfile_name);
......@@ -632,7 +641,7 @@ void darshan_core_shutdown()
{
if(my_rank == 0)
{
fprintf(stderr,
darshan_core_fprintf(stderr,
"darshan library warning: unable to write %s module data to log file %s\n",
darshan_module_names[i], logfile_name);
unlink(logfile_name);
......@@ -670,7 +679,7 @@ void darshan_core_shutdown()
sizeof(struct darshan_header), MPI_BYTE, &status);
if(all_ret != MPI_SUCCESS)
{
fprintf(stderr, "darshan library warning: unable to write header to log file %s\n",
darshan_core_fprintf(stderr, "darshan library warning: unable to write header to log file %s\n",
logfile_name);
unlink(logfile_name);
}
......@@ -776,18 +785,18 @@ void darshan_core_shutdown()
if(my_rank == 0)
{
fprintf(stderr, "#darshan:<op>\t<nprocs>\t<time>\n");
fprintf(stderr, "darshan:log_open\t%d\t%f\n", nprocs, open_slowest);
fprintf(stderr, "darshan:job_write\t%d\t%f\n", nprocs, job_slowest);
fprintf(stderr, "darshan:hash_write\t%d\t%f\n", nprocs, rec_slowest);
fprintf(stderr, "darshan:header_write\t%d\t%f\n", nprocs, header_slowest);
darshan_core_fprintf(stderr, "#darshan:<op>\t<nprocs>\t<time>\n");
darshan_core_fprintf(stderr, "darshan:log_open\t%d\t%f\n", nprocs, open_slowest);
darshan_core_fprintf(stderr, "darshan:job_write\t%d\t%f\n", nprocs, job_slowest);
darshan_core_fprintf(stderr, "darshan:hash_write\t%d\t%f\n", nprocs, rec_slowest);
darshan_core_fprintf(stderr, "darshan:header_write\t%d\t%f\n", nprocs, header_slowest);
for(i = 0; i < DARSHAN_MAX_MODS; i++)
{
if(global_mod_use_count[i])
fprintf(stderr, "darshan:%s_shutdown\t%d\t%f\n", darshan_module_names[i],
darshan_core_fprintf(stderr, "darshan:%s_shutdown\t%d\t%f\n", darshan_module_names[i],
nprocs, mod_slowest[i]);
}
fprintf(stderr, "darshan:core_shutdown\t%d\t%f\n", nprocs, all_slowest);
darshan_core_fprintf(stderr, "darshan:core_shutdown\t%d\t%f\n", nprocs, all_slowest);
}
}
......@@ -851,7 +860,7 @@ static void *darshan_init_mmap_log(struct darshan_core_runtime* core, int jobid)
mmap_fd = open(core->mmap_log_name, O_CREAT|O_RDWR|O_EXCL , 0644);
if(mmap_fd < 0)
{
fprintf(stderr, "darshan library warning: "
darshan_core_fprintf(stderr, "darshan library warning: "
"unable to create darshan log file %s\n", core->mmap_log_name);
return(NULL);
}
......@@ -861,7 +870,7 @@ static void *darshan_init_mmap_log(struct darshan_core_runtime* core, int jobid)
ret = ftruncate(mmap_fd, mmap_size);
if(ret < 0)
{
fprintf(stderr, "darshan library warning: "
darshan_core_fprintf(stderr, "darshan library warning: "
"unable to allocate darshan log file %s\n", core->mmap_log_name);
close(mmap_fd);
unlink(core->mmap_log_name);
......@@ -874,7 +883,7 @@ static void *darshan_init_mmap_log(struct darshan_core_runtime* core, int jobid)
mmap_p = mmap(NULL, mmap_size, PROT_WRITE, MAP_SHARED, mmap_fd, 0);
if(mmap_p == MAP_FAILED)
{
fprintf(stderr, "darshan library warning: "
darshan_core_fprintf(stderr, "darshan library warning: "
"unable to mmap darshan log file %s\n", core->mmap_log_name);
close(mmap_fd);
unlink(core->mmap_log_name);
......@@ -1078,13 +1087,13 @@ static void darshan_get_exe_and_mounts(struct darshan_core_runtime *core,
if(strncmp(env_exclusions,"none",strlen(env_exclusions))>=0)
{
if (my_rank == 0)
fprintf(stderr, "Darshan info: no system dirs will be excluded\n");
darshan_core_fprintf(stderr, "Darshan info: no system dirs will be excluded\n");
darshan_path_exclusions[0]=NULL;
}
else
{
if (my_rank == 0)
fprintf(stderr, "Darshan info: the following system dirs will be excluded: %s\n",
darshan_core_fprintf(stderr, "Darshan info: the following system dirs will be excluded: %s\n",
env_exclusions);
string = strdup(env_exclusions);
i = 0;
......@@ -1329,7 +1338,7 @@ static void darshan_get_logfile_name(char* logfile_name, int jobid, struct tm* s
{
if(strlen(user_logfile_name) >= (PATH_MAX-1))
{
fprintf(stderr, "darshan library warning: user log file name too long.\n");
darshan_core_fprintf(stderr, "darshan library warning: user log file name too long.\n");
logfile_name[0] = '\0';
}
else
......@@ -2107,6 +2116,21 @@ void *darshan_core_register_record(
return(rec_buf);;
}
char *darshan_core_lookup_record_name(darshan_record_id rec_id)
{
struct darshan_core_name_record_ref *ref;
char *name = NULL;
DARSHAN_CORE_LOCK();
HASH_FIND(hlink, darshan_core->name_hash, &rec_id,
sizeof(darshan_record_id), ref);
if(ref)
name = ref->name_record->name;
DARSHAN_CORE_UNLOCK();
return(name);
}
void darshan_instrument_fs_data(int fs_type, const char *path, int fd)
{
#ifdef DARSHAN_LUSTRE
......@@ -2133,6 +2157,25 @@ double darshan_core_wtime()
return(PMPI_Wtime() - darshan_core->wtime_offset);
}
#ifdef DARSHAN_PRELOAD
extern int (*__real_vfprintf)(FILE *stream, const char *format, va_list);
#else
extern int __real_vfprintf(FILE *stream, const char *format, va_list);
#endif
void darshan_core_fprintf(
FILE *stream, const char *format, ...)
{
va_list ap;
MAP_OR_FAIL(vfprintf);
va_start(ap, format);
__real_vfprintf(stream, format, ap);
va_end(ap);
return;
}
int darshan_core_excluded_path(const char *path)
{
char *exclude, *include;
......
This diff is collapsed.
......@@ -36,7 +36,11 @@ 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(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(H5get_libversion, herr_t, (unsigned *majnum, unsigned *minnum, unsigned *relnum));
/* prototype for HDF symbols that we will call directly from within other
* wrappers if HDF is linked in
*/
extern herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum);
/* structure that can track i/o stats for a given HDF5 file record at runtime */
struct hdf5_file_record_ref
......@@ -86,7 +90,7 @@ static int my_rank = -1;
HDF5_UNLOCK(); \
} while(0)
#define HDF5_RECORD_OPEN(__ret, __path, __tm1) do { \
#define HDF5_RECORD_OPEN(__ret, __path, __tm1, __tm2) do { \
darshan_record_id rec_id; \
struct hdf5_file_record_ref *rec_ref; \
char *newpath; \
......@@ -103,8 +107,10 @@ static int my_rank = -1;
if(newpath != __path) free(newpath); \
break; \
} \
if(rec_ref->file_rec->fcounters[HDF5_F_OPEN_TIMESTAMP] == 0) \
rec_ref->file_rec->fcounters[HDF5_F_OPEN_TIMESTAMP] = __tm1; \
if(rec_ref->file_rec->fcounters[HDF5_F_OPEN_START_TIMESTAMP] == 0 || \
rec_ref->file_rec->fcounters[HDF5_F_OPEN_START_TIMESTAMP] > __tm1) \
rec_ref->file_rec->fcounters[HDF5_F_OPEN_START_TIMESTAMP] = __tm1; \
rec_ref->file_rec->fcounters[HDF5_F_OPEN_END_TIMESTAMP] = __tm2; \
rec_ref->file_rec->counters[HDF5_OPENS] += 1; \
darshan_add_record_ref(&(hdf5_runtime->hid_hash), &__ret, sizeof(hid_t), rec_ref); \
if(newpath != __path) free(newpath); \
......@@ -119,11 +125,10 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
{
hid_t ret;
char* tmp;
double tm1;
double tm1, tm2;
unsigned majnum, minnum, relnum;
MAP_OR_FAIL(H5get_libversion);
__real_H5get_libversion(&majnum, &minnum, &relnum);
H5get_libversion(&majnum, &minnum, &relnum);
#ifdef __DARSHAN_ENABLE_HDF5110
if(majnum < 1 || (majnum == 1 && minnum < 10))
#else
......@@ -134,7 +139,7 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
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");
darshan_core_fprintf(stderr, "Darshan HDF5 module error: runtime library version does not match Darshan module.\n");
}
return(-1);
}
......@@ -143,6 +148,7 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
tm1 = darshan_core_wtime();
ret = __real_H5Fcreate(filename, flags, create_plist, access_plist);
tm2 = darshan_core_wtime();
if(ret >= 0)
{
/* use ROMIO approach to strip prefix if present */
......@@ -156,7 +162,7 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
}
HDF5_PRE_RECORD();
HDF5_RECORD_OPEN(ret, filename, tm1);
HDF5_RECORD_OPEN(ret, filename, tm1, tm2);
HDF5_POST_RECORD();
}
......@@ -168,11 +174,10 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
{
hid_t ret;
char* tmp;
double tm1;
double tm1, tm2;
unsigned majnum, minnum, relnum;
MAP_OR_FAIL(H5get_libversion);
__real_H5get_libversion(&majnum, &minnum, &relnum);
H5get_libversion(&majnum, &minnum, &relnum);
#ifdef __DARSHAN_ENABLE_HDF5110
if(majnum < 1 || (majnum == 1 && minnum < 10))
#else
......@@ -183,7 +188,7 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
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");
darshan_core_fprintf(stderr, "Darshan HDF5 module error: runtime library version does not match Darshan module.\n");
}
return(-1);
}
......@@ -192,6 +197,7 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
tm1 = darshan_core_wtime();
ret = __real_H5Fopen(filename, flags, access_plist);
tm2 = darshan_core_wtime();
if(ret >= 0)
{
/* use ROMIO approach to strip prefix if present */
......@@ -205,7 +211,7 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
}
HDF5_PRE_RECORD();
HDF5_RECORD_OPEN(ret, filename, tm1);
HDF5_RECORD_OPEN(ret, filename, tm1, tm2);
HDF5_POST_RECORD();
}
......@@ -216,19 +222,24 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
herr_t DARSHAN_DECL(H5Fclose)(hid_t file_id)
{
struct hdf5_file_record_ref *rec_ref;
double tm1, tm2;
herr_t ret;
MAP_OR_FAIL(H5Fclose);
tm1 = darshan_core_wtime();
ret = __real_H5Fclose(file_id);
tm2 = darshan_core_wtime();
HDF5_PRE_RECORD();
rec_ref = darshan_lookup_record_ref(hdf5_runtime->hid_hash,
&file_id, sizeof(hid_t));
if(rec_ref)
{
rec_ref->file_rec->fcounters[HDF5_F_CLOSE_TIMESTAMP] =
darshan_core_wtime();
if(rec_ref->file_rec->fcounters[HDF5_F_CLOSE_START_TIMESTAMP] == 0 ||
rec_ref->file_rec->fcounters[HDF5_F_CLOSE_START_TIMESTAMP] > tm1)
rec_ref->file_rec->fcounters[HDF5_F_CLOSE_START_TIMESTAMP] = tm1;
rec_ref->file_rec->fcounters[HDF5_F_CLOSE_END_TIMESTAMP] = tm2;
darshan_delete_record_ref(&(hdf5_runtime->hid_hash),
&file_id, sizeof(hid_t));
}
......@@ -347,7 +358,7 @@ static void hdf5_record_reduction_op(void* infile_v, void* inoutfile_v,
}
/* min non-zero (if available) value */
for(j=HDF5_F_OPEN_TIMESTAMP; j<=HDF5_F_OPEN_TIMESTAMP; j++)
for(j=HDF5_F_OPEN_START_TIMESTAMP; j<=HDF5_F_CLOSE_START_TIMESTAMP; j++)
{
if((infile->fcounters[j] < inoutfile->fcounters[j] &&
infile->fcounters[j] > 0) || inoutfile->fcounters[j] == 0)
......@@ -357,7 +368,7 @@ static void hdf5_record_reduction_op(void* infile_v, void* inoutfile_v,
}
/* max */
for(j=HDF5_F_CLOSE_TIMESTAMP; j<=HDF5_F_CLOSE_TIMESTAMP; j++)
for(j=HDF5_F_OPEN_END_TIMESTAMP; j<=HDF5_F_CLOSE_END_TIMESTAMP; j++)
{
if(infile->fcounters[j] > inoutfile->fcounters[j])
tmp_file.fcounters[j] = infile->fcounters[j];
......
......@@ -27,9 +27,9 @@
static void lustre_runtime_initialize(
void);
static void lustre_subtract_shared_rec_size(
void *rec_ref_p);
void *rec_ref_p, void *user_ptr);
static void lustre_set_rec_ref_pointers(
void *rec_ref_p);
void *rec_ref_p, void *user_ptr);
static int lustre_record_compare(
const void* a_p, const void* b_p);
int sort_lustre_records(
......@@ -242,9 +242,16 @@ static void lustre_shutdown(
{
rec_ref = darshan_lookup_record_ref(lustre_runtime->record_id_hash,
&shared_recs[i], sizeof(darshan_record_id));
assert(rec_ref);
rec_ref->record->base_rec.rank = -1;
/* As in other modules, it should not be possible to lose a
* record after we have already performed a collective to
* identify that it is shared with other ranks. We print an
* error msg and continue rather than asserting in this case,
* though, see #243.
*/
if(rec_ref)
rec_ref->record->base_rec.rank = -1;
else
darshan_core_fprintf(stderr, "WARNING: unexpected condition in Darshan, possibly triggered by memory corruption. Darshan log may be incorrect.\n");
}
/* sort the array of files descending by rank so that we get all of the
......@@ -259,7 +266,7 @@ static void lustre_shutdown(
if (my_rank != 0)
{
darshan_iter_record_refs(lustre_runtime->record_id_hash,
&lustre_subtract_shared_rec_size);
&lustre_subtract_shared_rec_size, NULL);
}
}
......@@ -275,7 +282,7 @@ static void lustre_shutdown(
return;
}
static void lustre_subtract_shared_rec_size(void *rec_ref_p)
static void lustre_subtract_shared_rec_size(void *rec_ref_p, void *user_ptr)
{
struct lustre_record_ref *l_rec_ref = (struct lustre_record_ref *)rec_ref_p;
......@@ -284,7 +291,7 @@ static void lustre_subtract_shared_rec_size(void *rec_ref_p)
LUSTRE_RECORD_SIZE( l_rec_ref->record->counters[LUSTRE_STRIPE_WIDTH] );
}
static void lustre_set_rec_ref_pointers(void *rec_ref_p)
static void lustre_set_rec_ref_pointers(void *rec_ref_p, void *user_ptr)
{
lustre_runtime->record_ref_array[lustre_runtime->record_ref_array_ndx] = rec_ref_p;
lustre_runtime->record_ref_array_ndx++;
......@@ -349,7 +356,7 @@ int sort_lustre_records()
/* build the array of record reference pointers we want to sort */
darshan_iter_record_refs(lustre_runtime->record_id_hash,
&lustre_set_rec_ref_pointers);
&lustre_set_rec_ref_pointers, NULL);
/* qsort breaks the hash table, so delete it now to free its memory buffers
* and prevent later confusion */
......
This diff is collapsed.
......@@ -24,6 +24,7 @@
#include "darshan.h"
#include "darshan-dynamic.h"
#include "darshan-dxt.h"
DARSHAN_FORWARD_DECL(PMPI_File_close, int, (MPI_File *fh));
DARSHAN_FORWARD_DECL(PMPI_File_iread_at, int, (MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, __D_MPI_REQUEST *request));
......@@ -159,7 +160,7 @@ static void mpiio_runtime_initialize(
static struct mpiio_file_record_ref *mpiio_track_new_file_record(
darshan_record_id rec_id, const char *path);
static void mpiio_finalize_file_records(
void *rec_ref_p);
void *rec_ref_p, void *user_ptr);
static void mpiio_record_reduction_op(
void* infile_v, void* inoutfile_v, int *len, MPI_Datatype *datatype);
static void mpiio_shared_record_variance(
......@@ -172,16 +173,9 @@ static void mpiio_shutdown(
MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **mpiio_buf, int *mpiio_buf_sz);
/* extern DXT function defs */
extern void dxt_mpiio_write(darshan_record_id rec_id, int64_t length,
double start_time, double end_time);
extern void dxt_mpiio_read(darshan_record_id rec_id, int64_t length,
double start_time, double end_time);
static struct mpiio_runtime *mpiio_runtime = NULL;
static pthread_mutex_t mpiio_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static int my_rank = -1;
static int enable_dxt_io_trace = 0;
#define MPIIO_LOCK() pthread_mutex_lock(&mpiio_runtime_mutex)
#define MPIIO_UNLOCK() pthread_mutex_unlock(&mpiio_runtime_mutex)
......@@ -229,9 +223,10 @@ static int enable_dxt_io_trace = 0;
rec_ref->file_rec->counters[MPIIO_COLL_OPENS] += 1; \
if(__info != MPI_INFO_NULL) \
rec_ref->file_rec->counters[MPIIO_HINTS] += 1; \
if(rec_ref->file_rec->fcounters[MPIIO_F_OPEN_TIMESTAMP] == 0 || \
rec_ref->file_rec->fcounters[MPIIO_F_OPEN_TIMESTAMP] > __tm1) \
rec_ref->file_rec->fcounters[MPIIO_F_OPEN_TIMESTAMP] = __tm1; \
if(rec_ref->file_rec->fcounters[MPIIO_F_OPEN_START_TIMESTAMP] == 0 || \
rec_ref->file_rec->fcounters[MPIIO_F_OPEN_START_TIMESTAMP] > __tm1) \
rec_ref->file_rec->fcounters[MPIIO_F_OPEN_START_TIMESTAMP] = __tm1; \
rec_ref->file_rec->fcounters[MPIIO_F_OPEN_END_TIMESTAMP] = __tm2; \
DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[MPIIO_F_META_TIME], \
__tm1, __tm2, rec_ref->last_meta_end); \
darshan_add_record_ref(&(mpiio_runtime->fh_hash), &__fh, sizeof(MPI_File), rec_ref); \
......@@ -248,9 +243,7 @@ static int enable_dxt_io_trace = 0;
PMPI_Type_size(__datatype, &size); \
size = size * __count; \
/* DXT to record detailed read tracing information */ \
if(enable_dxt_io_trace) { \
dxt_mpiio_read(rec_ref->file_rec->base_rec.id, size, __tm1, __tm2); \
} \
dxt_mpiio_read(rec_ref->file_rec->base_rec.id, size, __tm1, __tm2); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_READ_AGG_0_100]), size); \
darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, size, \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_ACCESS]), \
......@@ -280,10 +273,8 @@ static int enable_dxt_io_trace = 0;
if(!rec_ref) break; \
PMPI_Type_size(__datatype, &size); \
size = size * __count; \
/* DXT to record detailed write tracing information */ \
if(enable_dxt_io_trace) { \
dxt_mpiio_write(rec_ref->file_rec->base_rec.id, size, __tm1, __tm2); \
} \
/* DXT to record detailed write tracing information */ \
dxt_mpiio_write(rec_ref->file_rec->base_rec.id, size, __tm1, __tm2); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_WRITE_AGG_0_100]), size); \
darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, size, \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_ACCESS]), \
......@@ -459,7 +450,7 @@ int DARSHAN_DECL(MPI_File_read_all)(MPI_File fh, void * buf, int count, MPI_Data
int ret;
double tm1, tm2;
MAP_OR_FAIL(PMPI_File_write_at);
MAP_OR_FAIL(PMPI_File_read_all);
tm1 = darshan_core_wtime();
ret = __real_PMPI_File_read_all(fh, buf, count,
......@@ -1090,8 +1081,10 @@ int DARSHAN_DECL(MPI_File_close)(MPI_File *fh)
&tmp_fh, sizeof(MPI_File));
if(rec_ref)
{
rec_ref->file_rec->fcounters[MPIIO_F_CLOSE_TIMESTAMP] =
darshan_core_wtime();
if(rec_ref->file_rec->fcounters[MPIIO_F_CLOSE_START_TIMESTAMP] == 0 ||
rec_ref->file_rec->fcounters[MPIIO_F_CLOSE_START_TIMESTAMP] > tm1)
rec_ref->file_rec->fcounters[MPIIO_F_CLOSE_START_TIMESTAMP] = tm1;
rec_ref->file_rec->fcounters[MPIIO_F_CLOSE_END_TIMESTAMP] = tm2;
DARSHAN_TIMER_INC_NO_OVERLAP(
rec_ref->file_rec->fcounters[MPIIO_F_META_TIME],
tm1, tm2, rec_ref->last_meta_end);
......@@ -1139,10 +1132,8 @@ static void mpiio_runtime_initialize()
}
memset(mpiio_runtime, 0, sizeof(*mpiio_runtime));
/* check if DXT (Darshan extended tracing) should be enabled */
if (getenv("DXT_ENABLE_IO_TRACE")) {
enable_dxt_io_trace = 1;
}
/* allow DXT module to initialize if needed */
dxt_mpiio_runtime_initialize();
return;
}
......@@ -1195,7 +1186,7 @@ static struct mpiio_file_record_ref *mpiio_track_new_file_record(
return(rec_ref);
}
static void mpiio_finalize_file_records(void *rec_ref_p)
static void mpiio_finalize_file_records(void *rec_ref_p,</