Commit 9007db12 authored by Shane Snyder's avatar Shane Snyder
Browse files

first cut at dxt trace triggers

dynamic triggers still not working
parent bb730ef0
......@@ -34,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>
......@@ -308,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
*/
......
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));
......@@ -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)
......@@ -249,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]), \
......@@ -281,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]), \
......@@ -1142,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;
}
......
......@@ -29,6 +29,7 @@
#include "utlist.h"
#include "darshan.h"
#include "darshan-dynamic.h"
#include "darshan-dxt.h"
#ifndef HAVE_OFF64_T
typedef int64_t off64_t;
......@@ -165,12 +166,6 @@ static void posix_shutdown(
MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **posix_buf, int *posix_buf_sz);
/* extern DXT function defs */
extern void dxt_posix_write(darshan_record_id rec_id, int64_t offset,
int64_t length, double start_time, double end_time);
extern void dxt_posix_read(darshan_record_id rec_id, int64_t offset,
int64_t length, double start_time, double end_time);
/* extern function def for querying record name from a STDIO stream */
extern char *darshan_stdio_lookup_record_name(FILE *stream);
......@@ -178,7 +173,6 @@ static struct posix_runtime *posix_runtime = NULL;
static pthread_mutex_t posix_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static int my_rank = -1;
static int darshan_mem_alignment = 1;
static int enable_dxt_io_trace = 0;
#define POSIX_LOCK() pthread_mutex_lock(&posix_runtime_mutex)
#define POSIX_UNLOCK() pthread_mutex_unlock(&posix_runtime_mutex)
......@@ -259,9 +253,7 @@ static int enable_dxt_io_trace = 0;
else \
this_offset = rec_ref->offset; \
/* DXT to record detailed read tracing information */ \
if(enable_dxt_io_trace) { \
dxt_posix_read(rec_ref->file_rec->base_rec.id, this_offset, __ret, __tm1, __tm2); \
} \
dxt_posix_read(rec_ref->file_rec->base_rec.id, this_offset, __ret, __tm1, __tm2); \
if(this_offset > rec_ref->last_byte_read) \
rec_ref->file_rec->counters[POSIX_SEQ_READS] += 1; \
if(this_offset == (rec_ref->last_byte_read + 1)) \
......@@ -317,9 +309,7 @@ static int enable_dxt_io_trace = 0;
else \
this_offset = rec_ref->offset; \
/* DXT to record detailed write tracing information */ \
if(enable_dxt_io_trace) { \
dxt_posix_write(rec_ref->file_rec->base_rec.id, this_offset, __ret, __tm1, __tm2); \
} \
dxt_posix_write(rec_ref->file_rec->base_rec.id, this_offset, __ret, __tm1, __tm2); \
if(this_offset > rec_ref->last_byte_written) \
rec_ref->file_rec->counters[POSIX_SEQ_WRITES] += 1; \
if(this_offset == (rec_ref->last_byte_written + 1)) \
......@@ -1506,10 +1496,8 @@ static void posix_runtime_initialize()
}
memset(posix_runtime, 0, sizeof(*posix_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_posix_runtime_initialize();
return;
}
......
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