...
 
Commits (149)
variables:
ANL_THETA_SCHEDULER_PARAMETERS: "-A radix-io"
ANL_THETA_PROJECT_SERVICE_USER: "darshan"
stages:
- build
- test
build_darshan:
tags:
- shell
- ecp-theta
stage: build
script:
- source darshan-test/automated/common/setup.sh
- cat setup-result.xml
- 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,63 @@
Darshan Release Change Log
--------------------------
Darshan-3.2.0-pre1
=============
* added support for non-MPI instrumenation to Darshan, using GCC
construct/destructor attributes for bootstrapping rather than
intercepting MPI_Init()/MPI_Finalize(). This mechanism only
works for Darshan's shared library instrumentation
Darshan-3.1.8
=============
* added dynamic trace triggering functionality, allowing Darshan to
decide at runtime whether or not to trace specific files with DXT,
with this decision based on triggers in a user-provided config file
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 */\
......
all: lib/libdarshan.a lib/libdarshan-stubs.a lib/darshan-null.o
#TODO: each module provides own makefile with module-specific objects, build options, etc.
DESTDIR =
......@@ -16,15 +14,17 @@ LDFLAGS = @LDFLAGS@
CC = @CC@
LD = @LD@
DISABLE_STATIC_LIB = @DISABLE_STATIC_LIB@
DISABLE_LDPRELOAD = @DISABLE_LDPRELOAD@
ENABLE_MMAP_LOGS = @ENABLE_MMAP_LOGS@
DARSHAN_USE_BGQ = @DARSHAN_USE_BGQ@
DARSHAN_USE_LUSTRE = @DARSHAN_USE_LUSTRE@
DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
DARSHAN_VERSION = @DARSHAN_VERSION@
ifndef DISABLE_STATIC_LIB
all: lib/libdarshan.a lib/libdarshan-stubs.a
endif
ifndef DISABLE_LDPRELOAD
all: lib/libdarshan.so lib/darshan-null.po
all: lib/libdarshan.so
endif
VPATH = $(srcdir)
......@@ -35,30 +35,76 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
LIBS = -lz @LIBBZ2@
BUILD_NULL_MODULE = @BUILD_NULL_MODULE@
BUILD_POSIX_MODULE = @BUILD_POSIX_MODULE@
BUILD_STDIO_MODULE = @BUILD_STDIO_MODULE@
BUILD_DXT_MODULE = @BUILD_DXT_MODULE@
BUILD_MPIIO_MODULE = @BUILD_MPIIO_MODULE@
BUILD_PNETCDF_MODULE = @BUILD_PNETCDF_MODULE@
BUILD_HDF5_MODULE = @BUILD_HDF5_MODULE@
BUILD_BGQ_MODULE = @BUILD_BGQ_MODULE@
BUILD_LUSTRE_MODULE = @BUILD_LUSTRE_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
DARSHAN_STATIC_MOD_OBJS =
DARSHAN_DYNAMIC_MOD_OBJS =
ifdef BUILD_NULL_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-null.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-null.po
endif
ifdef BUILD_POSIX_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-posix.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-posix.po
endif
ifdef BUILD_STDIO_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-stdio.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-stdio.po
endif
ifdef BUILD_DXT_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-dxt.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-dxt.po
endif
ifdef BUILD_MPIIO_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-mpiio.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-mpiio.po
endif
ifdef BUILD_PNETCDF_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-pnetcdf.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-pnetcdf.po
endif
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 BUILD_BGQ_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-bgq.po
CFLAGS += -DDARSHAN_BGQ
CFLAGS_SHARED += -DDARSHAN_BGQ
endif
ifdef DARSHAN_USE_LUSTRE
ifdef BUILD_LUSTRE_MODULE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-lustre.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-lustre.po
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 +186,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 $@
......@@ -169,8 +222,10 @@ endif
install:: all
install -d $(libdir)
ifndef DISABLE_STATIC_LIB
install -m 755 lib/libdarshan.a $(libdir)
install -m 755 lib/libdarshan-stubs.a $(libdir)
endif
ifndef DISABLE_LDPRELOAD
install -m 755 lib/libdarshan.so $(libdir)
endif
......@@ -193,13 +248,24 @@ endif
install -m 755 share/mpi-profile/darshan-bg-f.conf $(datarootdir)/mpi-profile/darshan-bg-f.conf
install -d $(datarootdir)/ld-opts
install -m 644 share/ld-opts/darshan-base-ld-opts $(datarootdir)/ld-opts/darshan-base-ld-opts
ifdef BUILD_POSIX_MODULE
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
install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts
ifdef BUILD_STDIO_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-stdio-ld-opts $(datarootdir)/ld-opts/darshan-stdio-ld-opts
endif
ifdef BUILD_MPIIO_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-mpiio-ld-opts $(datarootdir)/ld-opts/darshan-mpiio-ld-opts
endif
ifdef BUILD_PNETCDF_MODULE
install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts
endif
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
ifdef ENABLE_MMAP_LOGS
install -m 755 share/darshan-mmap-epilog.sh $(datarootdir)/darshan-mmap-epilog.sh
endif
......@@ -207,8 +273,8 @@ endif
install -m 644 lib/pkgconfig/darshan-runtime.pc $(libdir)/pkgconfig/darshan-runtime.pc
clean::
rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so
rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so
distclean:: clean
rm -f darshan-runtime-config.h darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-gen-cc.pl darshan-mk-log-dirs.pl darshan-config lib/pkgconfig/darshan-runtime.pc share/craype-1.x/darshan-module share/craype-2.x/darshan-module share/darshan-mmap-epilog.sh share/ld-opts/darshan-base-ld-opts share/mpi-profile/darshan-bg-cc.conf share/mpi-profile/darshan-bg-cxx.conf share/mpi-profile/darshan-bg-f.conf share/mpi-profile/darshan-cc.conf share/mpi-profile/darshan-cxx.conf share/mpi-profile/darshan-f.conf aclocal.m4 autom4te.cache/* config.status config.log Makefile
rm -f darshan-runtime-config.h darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-gen-cc.pl darshan-mk-log-dirs.pl darshan-config lib/pkgconfig/darshan-runtime.pc share/craype-1.x/darshan-module share/craype-2.x/darshan-module share/darshan-mmap-epilog.sh share/ld-opts/darshan-base-ld-opts share/mpi-profile/darshan-bg-cc.conf share/mpi-profile/darshan-bg-cxx.conf share/mpi-profile/darshan-bg-f.conf share/mpi-profile/darshan-cc.conf share/mpi-profile/darshan-cxx.conf share/mpi-profile/darshan-f.conf aclocal.m4 autom4te.cache/* config.status config.log Makefile
rm -rf autom4te.cache
This diff is collapsed.
This diff is collapsed.
......@@ -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()
*
......@@ -263,6 +267,7 @@ void darshan_common_val_counter(
int64_t *val_p,
int64_t *cnt_p);
#ifdef HAVE_MPI
/* darshan_variance_reduce()
*
* MPI reduction operation to calculate variances on counters in
......@@ -279,5 +284,6 @@ void darshan_variance_reduce(
void *inoutvec,
int *len,
MPI_Datatype *dt);
#endif
#endif /* __DARSHAN_COMMON_H */
......@@ -7,12 +7,19 @@
#ifndef __DARSHAN_CORE_H
#define __DARSHAN_CORE_H
#include "darshan-runtime-config.h"
#include <unistd.h>
#include <sys/types.h>
#include <stdint.h>
#include <limits.h>
#ifdef HAVE_MPI
#include <mpi.h>
#endif
#include "uthash.h"
#include "darshan.h"
#include "darshan-log-format.h"
/* Environment variable to override __DARSHAN_JOBID */
......@@ -30,6 +37,9 @@
/* Environment variable to override memory per module */
#define DARSHAN_MOD_MEM_OVERRIDE "DARSHAN_MODMEM"
/* Environment variable to enable profiling without MPI */
#define DARSHAN_ENABLE_NONMPI "DARSHAN_ENABLE_NONMPI"
#ifdef __DARSHAN_ENABLE_MMAP_LOGS
/* Environment variable to override default mmap log path */
#define DARSHAN_MMAP_LOG_PATH_OVERRIDE "DARSHAN_MMAP_LOGPATH"
......@@ -48,13 +58,32 @@
/* default name record buf can store 2048 records of size 100 bytes */
#define DARSHAN_NAME_RECORD_BUF_SIZE (2048 * 100)
typedef union
{
int nompi_fd;
#ifdef HAVE_MPI
MPI_File mpi_fh;
#endif
} darshan_core_log_fh;
/* FS mount information */
#define DARSHAN_MAX_MNTS 64
#define DARSHAN_MAX_MNT_PATH 256
#define DARSHAN_MAX_MNT_TYPE 32
struct darshan_core_mnt_data
{
char path[DARSHAN_MAX_MNT_PATH];
char type[DARSHAN_MAX_MNT_TYPE];
struct darshan_fs_info fs_info;
};
/* structure to track registered modules */
struct darshan_core_module
{
void *rec_buf_start;
void *rec_buf_p;
int rec_mem_avail;
darshan_module_shutdown mod_shutdown_func;
darshan_module_funcs mod_funcs;
};
/* strucutre for keeping a reference to registered name records */
......@@ -86,6 +115,9 @@ struct darshan_core_runtime
#ifdef __DARSHAN_ENABLE_MMAP_LOGS
char mmap_log_name[PATH_MAX];
#endif
#ifdef HAVE_MPI
MPI_Comm mpi_comm;
#endif
};
void darshan_core_initialize(int argc, char **argv);
......
/*
* 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,7 @@
#define DARSHAN_EXTERN_DECL(name,ret,args) \
extern ret (*__real_ ## name)args;
#ifdef HAVE_MPI
DARSHAN_EXTERN_DECL(PMPI_File_close, int, (MPI_File *fh));
DARSHAN_EXTERN_DECL(PMPI_File_iread_at, int, (MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, __D_MPI_REQUEST *request));
DARSHAN_EXTERN_DECL(PMPI_File_iread, int, (MPI_File fh, void *buf, int count, MPI_Datatype datatype, __D_MPI_REQUEST *request));
......@@ -131,6 +132,7 @@ DARSHAN_EXTERN_DECL(PMPI_Gather, int, (const void *sendbuf, int sendcount, MPI_D
DARSHAN_EXTERN_DECL(PMPI_Gather, int, (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm));
#endif
DARSHAN_EXTERN_DECL(PMPI_Barrier, int, (MPI_Comm comm));
#endif /* HAVE_MPI */
#endif
......
......@@ -12,12 +12,18 @@
/* 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
/* Define to 1 if you have the <mntent.h> header file. */
#undef HAVE_MNTENT_H
/* Define if build is MPI-enabled */
#undef HAVE_MPI
/* Define if MPI-IO prototypes use const qualifier */
#undef HAVE_MPIIO_CONST
......
......@@ -10,7 +10,10 @@
#include <unistd.h>
#include <sys/types.h>
#include <stdint.h>
#ifdef HAVE_MPI
#include <mpi.h>
#endif
#include "darshan-log-format.h"
#include "darshan-common.h"
......@@ -47,7 +50,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); \
} \
}
......@@ -76,22 +79,37 @@
/* default number of records to attempt to store for each module */
#define DARSHAN_DEF_MOD_REC_COUNT 1024
/* module developers must define a 'darshan_module_shutdown' function
#ifdef HAVE_MPI
/*
* module developers _can_ define a 'darshan_module_redux' function
* to run collective MPI operations at shutdown time. Typically this
* functionality has been used to reduce records shared globablly (given
* in the 'shared_recs' array) into a single data record. Set to NULL
* avoid any reduction steps.
*/
typedef void (*darshan_module_redux)(
void *mod_buf, /* input parameter indicating module's buffer address */
MPI_Comm mod_comm, /* MPI communicator to run collectives with */
darshan_record_id *shared_recs, /* list of shared data record ids */
int shared_rec_count /* count of shared data records */
);
#endif
/*
* module developers _must_ define a 'darshan_module_shutdown' function
* for allowing darshan-core to call into a module and retrieve final
* output data to be saved in the log.
*
* NOTE: module developers can use this function to run collective
* MPI operations at shutdown time. Typically this functionality
* has been used to reduce records shared globablly (given in the
* 'shared_recs' array) into a single data record.
*/
typedef void (*darshan_module_shutdown)(
MPI_Comm mod_comm, /* MPI communicator to run collectives with */
darshan_record_id *shared_recs, /* list of shared data record ids */
int shared_rec_count, /* count of shared data records */
void **mod_buf, /* output parameter to save module buffer address */
int *mod_buf_sz /* output parameter to save module buffer size */
);
typedef struct darshan_module_funcs
{
#ifdef HAVE_MPI
darshan_module_redux mod_redux_func;
#endif
darshan_module_shutdown mod_shutdown_func;
} darshan_module_funcs;
/* stores FS info from statfs calls for a given mount point */
struct darshan_fs_info
......@@ -124,19 +142,19 @@ void darshan_instrument_fs_data(
*
* Register module identifier 'mod_id' with the darshan-core runtime
* environment, allowing the module to store I/O characterization data.
* 'mod_shutdown_func is a pointer to a function responsible for
* shutting down the module and returning final output data to darshan-core.
* 'inout_mod_buf_size' is an input/output argument, with it being
* set to the requested amount of module memory on input, and set to
* the amount allocated by darshan-core on output. If given, 'rank' is
* a pointer to an integer which will contain the calling process's
* MPI rank on return. If given, 'sys_mem_alignment' is a pointer to
* an integer which will contain the memory alignment value Darshan
* 'mod_funcs' is a set of function pointers that implement module-specific
* shutdown functionality (including a possible data reduction step when
* using MPI). 'inout_mod_buf_size' is an input/output argument, with it
* being set to the requested amount of module memory on input, and set to
* the amount allocated by darshan-core on output. If Darshan is built with
* MPI support, 'rank' is a pointer to an integer which will contain the
* calling process's MPI rank on return. If given, 'sys_mem_alignment' is a
* pointer to an integer which will contain the memory alignment value Darshan
* was configured with on return.
*/
void darshan_core_register_module(
darshan_module_id mod_id,
darshan_module_shutdown mod_shutdown_func,
darshan_module_funcs mod_funcs,
int *inout_mod_buf_size,
int *rank,
int *sys_mem_alignment);
......@@ -178,6 +196,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 +211,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
......
This diff is collapsed.
......@@ -49,8 +49,15 @@ static int my_rank = -1;
/* internal helper functions for the BGQ module */
void bgq_runtime_initialize(void);
/* forward declaration for shutdown function needed to interface with darshan-core */
static void bgq_shutdown(MPI_Comm mod_comm, darshan_record_id *shared_recs, int shared_rec_count, void **buffer, int *size);
/* forward declaration for shutdown functions needed to interface with darshan-core */
static void bgq_mpi_redux(
void *buffer,
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
int shared_rec_count);
static void bgq_shutdown(
void **buffer,
int *size);
/* macros for obtaining/releasing the BGQ module lock */
#define BGQ_LOCK() pthread_mutex_lock(&bgq_runtime_mutex)
......@@ -102,6 +109,12 @@ void bgq_runtime_initialize()
{
int bgq_buf_size;
darshan_record_id rec_id;
darshan_module_funcs mod_funcs = {
#ifdef HAVE_MPI
.mod_redux_func = &bgq_mpi_redux,
#endif
.mod_shutdown_func = &bgq_shutdown
};
BGQ_LOCK();
......@@ -118,7 +131,7 @@ void bgq_runtime_initialize()
/* register the BG/Q module with the darshan-core component */
darshan_core_register_module(
DARSHAN_BGQ_MOD,
&bgq_shutdown,
mod_funcs,
&bgq_buf_size,
&my_rank,
NULL);
......@@ -177,13 +190,11 @@ static int cmpr(const void *p1, const void *p2)
* shutdown function exported by this module for coordinating with darshan-core *
********************************************************************************/
/* Pass output data for the BGQ module back to darshan-core to log to file. */
static void bgq_shutdown(
static void bgq_mpi_redux(
void *posix_buf,
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
int shared_rec_count,
void **buffer,
int *size)
int shared_rec_count)
{
int nprocs;
int result;
......@@ -233,6 +244,19 @@ static void bgq_shutdown(
}
}
BGQ_UNLOCK();
return;
}
/* Pass output data for the BGQ module back to darshan-core to log to file. */
static void bgq_shutdown(
void **buffer,
int *size)
{
BGQ_LOCK();
assert(bgq_runtime);
/* non-zero ranks throw out their BGQ record */
if (my_rank != 0)
{
......
......@@ -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;
......@@ -278,6 +279,7 @@ void darshan_common_val_counter(void **common_val_root, int *common_val_count,
return;
}
#ifdef HAVE_MPI
void darshan_variance_reduce(void *invec, void *inoutvec, int *len,
MPI_Datatype *dt)
{
......@@ -298,6 +300,7 @@ void darshan_variance_reduce(void *invec, void *inoutvec, int *len,
return;
}
#endif
/*
* Local variables:
......
......@@ -11,12 +11,15 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_MPI
#include <mpi.h>
#endif
#include "darshan.h"
#include "darshan-core.h"
#include "darshan-dynamic.h"
#ifdef HAVE_MPI
DARSHAN_FORWARD_DECL(PMPI_Finalize, int, ());
DARSHAN_FORWARD_DECL(PMPI_Init, int, (int *argc, char ***argv));
DARSHAN_FORWARD_DECL(PMPI_Init_thread, int, (int *argc, char ***argv, int required, int *provided));
......@@ -85,6 +88,30 @@ int DARSHAN_DECL(MPI_Finalize)(void)
return(ret);
}
DARSHAN_WRAPPER_MAP(PMPI_Finalize, int, (void), MPI_Finalize())
#endif
/*
* Initialization hook that does not rely on MPI
*/
#ifdef __GNUC__
__attribute__((constructor)) void serial_init(void)
{
char *no_mpi;
no_mpi = getenv(DARSHAN_ENABLE_NONMPI);
if (no_mpi)
darshan_core_initialize(0, NULL);
return;
}
__attribute__((destructor)) void serial_finalize(void)
{
char *no_mpi;
no_mpi = getenv(DARSHAN_ENABLE_NONMPI);
if (no_mpi)
darshan_core_shutdown();
return;
}
#endif
/*
* Local variables:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -87,8 +87,7 @@ static void null_cleanup_runtime(
/* forward declaration for NULL shutdown function needed to interface
* with darshan-core
*/
static void null_shutdown(MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **null_buf, int *null_buf_sz);
static void null_shutdown(void **null_buf, int *null_buf_sz);
/* null_runtime is the global data structure encapsulating "NULL" module state */
static struct null_runtime *null_runtime = NULL;
......@@ -141,7 +140,7 @@ static int my_rank = -1;
/* look up a record reference for this record id using darshan rec_ref interface */ \
rec_ref = darshan_lookup_record_ref(null_runtime->rec_id_hash, &rec_id, sizeof(darshan_record_id)); \
/* if no reference was found, track a new one for this record */ \
if(!rec_ref) null_track_new_record(rec_id, __name); \
if(!rec_ref) rec_ref = null_track_new_record(rec_id, __name); \
/* if we still don't have a valid reference, back out */ \
if(!rec_ref) break; \
/* increment counter indicating number of calls to 'foo' */ \
......@@ -199,6 +198,20 @@ int DARSHAN_DECL(foo)(const char* name, int arg1)
static void null_runtime_initialize()
{
int null_buf_size;
darshan_module_funcs mod_funcs = {
#ifdef HAVE_MPI
/* NOTE: the redux function can be used to run collective operations prior to
* shutting down the module. Typically, module developers will want to run a
* reduction on shared data records (passed in in the 'shared_recs' array),
* but other collective routines can be run here as well. For a detailed
* example illustrating how to run shared file reductions, consider the
* POSIX or MPIIO instrumentation modules, as they both implement this
* functionality.
*/
.mod_redux_func = NULL,
#endif
.mod_shutdown_func = &null_shutdown
};
/* try and store a default number of records for this module */
null_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct darshan_null_record);
......@@ -206,7 +219,7 @@ static void null_runtime_initialize()
/* register the NULL module with the darshan-core component */
darshan_core_register_module(
DARSHAN_NULL_MOD, /* Darshan module identifier, defined in darshan-log-format.h */
&null_shutdown,
mod_funcs,
&null_buf_size,
&my_rank,
NULL);
......@@ -305,25 +318,12 @@ static void null_cleanup_runtime()
* and shutdown/free internal data structures.
*/
static void null_shutdown(
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
int shared_rec_count,
void **null_buf,
int *null_buf_sz)
{
NULL_LOCK();
assert(null_runtime);
/* NOTE: this function can be used to run collective operations prior to
* shutting down the module, as implied by the MPI communicator passed in
* as the first agrument. Typically, module developers will want to run a
* reduction on shared data records (passed in in the 'shared_recs' array),
* but other collective routines can be run here as well. For a detailed
* example illustrating how to run shared file reductions, consider the
* POSIX or MPIIO instrumentation modules, as they both implement this
* functionality.
*/
/* Just set the output size according to the number of records currently
* being tracked. In general, the module can decide to throw out records
* that have been previously registered by shuffling around memory in
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--undefined=MPI_Init
--undefined=__wrap_MPI_Init
--undefined=MPI_Wtime
--wrap=MPI_Init
--wrap=MPI_Init_thread
......@@ -6,8 +7,9 @@
--wrap=PMPI_Init
--wrap=PMPI_Init_thread
--wrap=PMPI_Finalize
@@darshan_share_path@/ld-opts/darshan-posix-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-mpiio-ld-opts
@DARSHAN_POSIX_LD_OPTS@
@DARSHAN_STDIO_LD_OPTS@
@DARSHAN_MPIIO_LD_OPTS@
@DARSHAN_PNETCDF_LD_OPTS@
@DARSHAN_HDF5_LD_OPTS@
@DARSHAN_MDHIM_LD_OPTS@
......@@ -2,4 +2,3 @@
--wrap=H5Fcreate
--wrap=H5Fopen
--wrap=H5Fclose
--wrap=H5get_libversion
--wrap=open
--wrap=open64
--wrap=__open_2
--wrap=creat
--wrap=creat64
--wrap=dup
--wrap=dup2
--wrap=dup3
--wrap=mkstemp
--wrap=mkostemp
--wrap=mkstemps
......@@ -35,3 +39,5 @@
--wrap=aio_return64
--wrap=lio_listio
--wrap=lio_listio64
--wrap=fileno
--wrap=rename
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.