Commit 5db2a039 authored by Cong Xu's avatar Cong Xu

Change DXLT name to Darshan eXtended Tracing (DXT)

Signed-off-by: Cong Xu's avatarCong Xu <cong.xu@intel.com>
parent 9f1491bd
......@@ -3,15 +3,15 @@
* See COPYRIGHT in top-level directory.
*/
#ifndef __DARSHAN_DXLT_LOG_FORMAT_H
#define __DARSHAN_DXLT_LOG_FORMAT_H
#ifndef __DARSHAN_DXT_LOG_FORMAT_H
#define __DARSHAN_DXT_LOG_FORMAT_H
/* current DXLT log format version */
#define DXLT_POSIX_VER 1
#define DXLT_MPIIO_VER 1
/* current DXT log format version */
#define DXT_POSIX_VER 1
#define DXT_MPIIO_VER 1
/*
* DXLT, the segment_info structure maintains detailed Segment IO tracing
* DXT, the segment_info structure maintains detailed Segment IO tracing
* information
*/
typedef struct segment_info {
......@@ -24,14 +24,14 @@ typedef struct segment_info {
#define X(a) a,
#undef X
/* file record structure for DXLT files. a record is created and stored for
* every DXLT file opened by the original application. For the DXLT module,
/* file record structure for DXT files. a record is created and stored for
* every DXT file opened by the original application. For the DXT module,
* the record includes:
* - a darshan_base_record structure, which contains the record id & rank
* - integer file I/O statistics (open, read/write counts, etc)
* - floating point I/O statistics (timestamps, cumulative timers, etc.)
*/
struct dxlt_file_record {
struct dxt_file_record {
struct darshan_base_record base_rec;
int64_t shared_record; /* -1 means it is a shared file record */
......@@ -42,4 +42,4 @@ struct dxlt_file_record {
segment_info *read_traces;
};
#endif /* __DARSHAN_DXLT_LOG_FORMAT_H */
#endif /* __DARSHAN_DXT_LOG_FORMAT_H */
......@@ -117,8 +117,8 @@ struct darshan_base_record
#include "darshan-bgq-log-format.h"
#include "darshan-lustre-log-format.h"
#include "darshan-stdio-log-format.h"
/* DXLT */
#include "darshan-dxlt-log-format.h"
/* DXT */
#include "darshan-dxt-log-format.h"
/* X-macro for keeping module ordering consistent */
/* NOTE: first val used to define module enum values,
......@@ -139,9 +139,9 @@ struct darshan_base_record
X(DARSHAN_BGQ_MOD, "BG/Q", DARSHAN_BGQ_VER, &bgq_logutils) \
X(DARSHAN_LUSTRE_MOD, "LUSTRE", DARSHAN_LUSTRE_VER, &lustre_logutils) \
X(DARSHAN_STDIO_MOD, "STDIO", DARSHAN_STDIO_VER, &stdio_logutils) \
/* DXLT */ \
X(DXLT_POSIX_MOD, "X_POSIX", DXLT_POSIX_VER, &dxlt_posix_logutils) \
X(DXLT_MPIIO_MOD, "X_MPIIO", DXLT_MPIIO_VER, &dxlt_mpiio_logutils)
/* DXT */ \
X(DXT_POSIX_MOD, "X_POSIX", DXT_POSIX_VER, &dxt_posix_logutils) \
X(DXT_MPIIO_MOD, "X_MPIIO", DXT_MPIIO_VER, &dxt_mpiio_logutils)
/* unique identifiers to distinguish between available darshan modules */
/* NOTES: - valid ids range from [0...DARSHAN_MAX_MODS-1]
......
......@@ -35,8 +35,8 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
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-dxlt.o
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-dxlt.po
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
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
ifdef DARSHAN_USE_BGQ
DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o
......@@ -127,10 +127,10 @@ lib/darshan-stdio.o: lib/darshan-stdio.c darshan.h darshan-common.h $(DARSHAN_LO
lib/darshan-stdio.po: lib/darshan-stdio.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-stdio-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/darshan-dxlt.o: lib/darshan-dxlt.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-dxlt-log-format.h | lib
lib/darshan-dxt.o: lib/darshan-dxt.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-dxt-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-dxlt.po: lib/darshan-dxlt.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-dxlt-log-format.h | lib
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/lookup3.o: lib/lookup3.c
......
......@@ -38,7 +38,7 @@
#define DARSHAN_DEF_MMAP_LOG_PATH "/tmp"
#endif
/* DXLT */
/* DXT */
/* Maximum amount of memory per instrumentation module in MiB */
#ifdef __DARSHAN_MOD_MEM_MAX
#define DARSHAN_MOD_MEM_MAX (__DARSHAN_MOD_MEM_MAX * 1024 * 1024)
......
......@@ -1445,8 +1445,8 @@ static int darshan_log_open_all(char *logfile_name, MPI_File *log_fh)
hints = __DARSHAN_LOG_HINTS;
}
/* DXLT */
if(hints && strlen(hints) > 0 && !getenv("ENABLE_DXLT_IO_TRACE"))
/* DXT */
if(hints && strlen(hints) > 0 && !getenv("ENABLE_DXT_IO_TRACE"))
{
tok_str = strdup(hints);
if(tok_str)
......
......@@ -40,91 +40,91 @@ typedef int64_t off64_t;
#define IO_TRACE_BUF_SIZE 1024
struct dxlt_record_ref_tracker
struct dxt_record_ref_tracker
{
void *rec_ref_p;
UT_hash_handle hlink;
};
/* The dxlt_file_record_ref structure maintains necessary runtime metadata
* for the DXLT file record (dxlt_file_record structure, defined in
* darshan-dxlt-log-format.h) pointed to by 'file_rec'. This metadata
/* The dxt_file_record_ref structure maintains necessary runtime metadata
* for the DXT file record (dxt_file_record structure, defined in
* darshan-dxt-log-format.h) pointed to by 'file_rec'. This metadata
* assists with the instrumenting of specific statistics in the file record.
*
* NOTE: we use the 'darshan_record_ref' interface (in darshan-common) to
* associate different types of handles with this dxlt_file_record_ref struct.
* associate different types of handles with this dxt_file_record_ref struct.
* This allows us to index this struct (and the underlying file record) by using
* either the corresponding Darshan record identifier (derived from the filename)
* or by a generated file descriptor, for instance. Note that, while there should
* only be a single Darshan record identifier that indexes a dxlt_file_record_ref,
* only be a single Darshan record identifier that indexes a dxt_file_record_ref,
* there could be multiple open file descriptors that index it.
*/
struct dxlt_file_record_ref
struct dxt_file_record_ref
{
struct dxlt_file_record *file_rec;
struct dxt_file_record *file_rec;
int64_t write_available_buf;
int64_t read_available_buf;
int fs_type; /* same as darshan_fs_info->fs_type */
};
/* The dxlt_runtime structure maintains necessary state for storing
* DXLT file records and for coordinating with darshan-core at
/* The dxt_runtime structure maintains necessary state for storing
* DXT file records and for coordinating with darshan-core at
* shutdown time.
*/
struct dxlt_posix_runtime
struct dxt_posix_runtime
{
void *rec_id_hash;
void *fd_hash;
int file_rec_count;
};
struct dxlt_mpiio_runtime
struct dxt_mpiio_runtime
{
void *rec_id_hash;
void *fh_hash;
int file_rec_count;
};
void dxlt_posix_runtime_initialize(
void dxt_posix_runtime_initialize(
void);
void dxlt_mpiio_runtime_initialize(
void dxt_mpiio_runtime_initialize(
void);
void dxlt_posix_track_new_file_record(
void dxt_posix_track_new_file_record(
darshan_record_id rec_id, const char *path);
void dxlt_mpiio_track_new_file_record(
void dxt_mpiio_track_new_file_record(
darshan_record_id rec_id, const char *path);
void dxlt_posix_add_record_ref(darshan_record_id rec_id, int fd);
void dxlt_mpiio_add_record_ref(darshan_record_id rec_id, MPI_File fh);
void dxt_posix_add_record_ref(darshan_record_id rec_id, int fd);
void dxt_mpiio_add_record_ref(darshan_record_id rec_id, MPI_File fh);
#if 0
static void dxlt_instrument_fs_data(
darshan_record_id rec_id, int fs_type, struct dxlt_file_record *file_rec);
static void dxt_instrument_fs_data(
darshan_record_id rec_id, int fs_type, struct dxt_file_record *file_rec);
#endif
static void dxlt_posix_cleanup_runtime(
static void dxt_posix_cleanup_runtime(
void);
static void dxlt_mpiio_cleanup_runtime(
static void dxt_mpiio_cleanup_runtime(
void);
static void dxlt_posix_shutdown(
static void dxt_posix_shutdown(
MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **dxlt_buf, int *dxlt_buf_sz);
static void dxlt_mpiio_shutdown(
int shared_rec_count, void **dxt_buf, int *dxt_buf_sz);
static void dxt_mpiio_shutdown(
MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **dxlt_buf, int *dxlt_buf_sz);
int shared_rec_count, void **dxt_buf, int *dxt_buf_sz);
#ifdef DARSHAN_LUSTRE
/* XXX modules don't expose an API for other modules, so use extern to get
* Lustre instrumentation function
*/
extern void dxlt_get_lustre_stripe_info(
darshan_record_id rec_id, struct dxlt_file_record *file_rec);
extern void dxt_get_lustre_stripe_info(
darshan_record_id rec_id, struct dxt_file_record *file_rec);
#endif
static struct dxlt_posix_runtime *dxlt_posix_runtime = NULL;
static struct dxlt_mpiio_runtime *dxlt_mpiio_runtime = NULL;
static pthread_mutex_t dxlt_posix_runtime_mutex =
static struct dxt_posix_runtime *dxt_posix_runtime = NULL;
static struct dxt_mpiio_runtime *dxt_mpiio_runtime = NULL;
static pthread_mutex_t dxt_posix_runtime_mutex =
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static pthread_mutex_t dxlt_mpiio_runtime_mutex =
static pthread_mutex_t dxt_mpiio_runtime_mutex =
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static int posix_my_rank = -1;
......@@ -132,20 +132,20 @@ static int mpiio_my_rank = -1;
static int instrumentation_disabled = 0;
static int darshan_mem_alignment = 1;
#define DXLT_POSIX_LOCK() pthread_mutex_lock(&dxlt_posix_runtime_mutex)
#define DXLT_POSIX_UNLOCK() pthread_mutex_unlock(&dxlt_posix_runtime_mutex)
#define DXT_POSIX_LOCK() pthread_mutex_lock(&dxt_posix_runtime_mutex)
#define DXT_POSIX_UNLOCK() pthread_mutex_unlock(&dxt_posix_runtime_mutex)
#define DXLT_MPIIO_LOCK() pthread_mutex_lock(&dxlt_mpiio_runtime_mutex)
#define DXLT_MPIIO_UNLOCK() pthread_mutex_unlock(&dxlt_mpiio_runtime_mutex)
#define DXT_MPIIO_LOCK() pthread_mutex_lock(&dxt_mpiio_runtime_mutex)
#define DXT_MPIIO_UNLOCK() pthread_mutex_unlock(&dxt_mpiio_runtime_mutex)
/**********************************************************
* Wrappers for DXLT I/O functions of interest *
* Wrappers for DXT I/O functions of interest *
**********************************************************/
void check_io_trace_buf(struct dxlt_file_record_ref *rec_ref)
void check_io_trace_buf(struct dxt_file_record_ref *rec_ref)
{
struct dxlt_file_record *file_rec = rec_ref->file_rec;
struct dxt_file_record *file_rec = rec_ref->file_rec;
int write_count = file_rec->write_count;
int write_available_buf = rec_ref->write_available_buf;
......@@ -174,21 +174,21 @@ void check_io_trace_buf(struct dxlt_file_record_ref *rec_ref)
}
}
void dxlt_posix_write(int fd, int64_t offset, int64_t length,
void dxt_posix_write(int fd, int64_t offset, int64_t length,
double start_time, double end_time)
{
struct dxlt_file_record_ref* rec_ref = NULL;
struct dxlt_file_record *file_rec;
struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec;
rec_ref = darshan_lookup_record_ref(dxlt_posix_runtime->fd_hash,
rec_ref = darshan_lookup_record_ref(dxt_posix_runtime->fd_hash,
&fd, sizeof(int));
if (!rec_ref) {
fprintf(stderr, "Error: dxlt_posix_write unable to find rec_ref.\n");
fprintf(stderr, "Error: dxt_posix_write unable to find rec_ref.\n");
return;
}
file_rec = rec_ref->file_rec;
if (dxlt_posix_runtime) {
if (dxt_posix_runtime) {
check_io_trace_buf(rec_ref);
}
......@@ -199,21 +199,21 @@ void dxlt_posix_write(int fd, int64_t offset, int64_t length,
file_rec->write_count += 1;
}
void dxlt_posix_read(int fd, int64_t offset, int64_t length,
void dxt_posix_read(int fd, int64_t offset, int64_t length,
double start_time, double end_time)
{
struct dxlt_file_record_ref* rec_ref = NULL;
struct dxlt_file_record *file_rec;
struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec;
rec_ref = darshan_lookup_record_ref(dxlt_posix_runtime->fd_hash,
rec_ref = darshan_lookup_record_ref(dxt_posix_runtime->fd_hash,
&fd, sizeof(int));
if (!rec_ref) {
fprintf(stderr, "Error: dxlt_posix_read unable to find rec_ref.\n");
fprintf(stderr, "Error: dxt_posix_read unable to find rec_ref.\n");
return;
}
file_rec = rec_ref->file_rec;
if (dxlt_posix_runtime) {
if (dxt_posix_runtime) {
check_io_trace_buf(rec_ref);
}
......@@ -224,21 +224,21 @@ void dxlt_posix_read(int fd, int64_t offset, int64_t length,
file_rec->read_count += 1;
}
void dxlt_mpiio_write(MPI_File fh, int64_t length,
void dxt_mpiio_write(MPI_File fh, int64_t length,
double start_time, double end_time)
{
struct dxlt_file_record_ref* rec_ref = NULL;
struct dxlt_file_record *file_rec;
struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec;
rec_ref = darshan_lookup_record_ref(dxlt_mpiio_runtime->fh_hash,
rec_ref = darshan_lookup_record_ref(dxt_mpiio_runtime->fh_hash,
&fh, sizeof(MPI_File));
if (!rec_ref) {
fprintf(stderr, "Error: dxlt_mpiio_write unable to find rec_ref.\n");
fprintf(stderr, "Error: dxt_mpiio_write unable to find rec_ref.\n");
return;
}
file_rec = rec_ref->file_rec;
if (dxlt_mpiio_runtime) {
if (dxt_mpiio_runtime) {
check_io_trace_buf(rec_ref);
}
......@@ -248,21 +248,21 @@ void dxlt_mpiio_write(MPI_File fh, int64_t length,
file_rec->write_count += 1;
}
void dxlt_mpiio_read(MPI_File fh, int64_t length,
void dxt_mpiio_read(MPI_File fh, int64_t length,
double start_time, double end_time)
{
struct dxlt_file_record_ref* rec_ref = NULL;
struct dxlt_file_record *file_rec;
struct dxt_file_record_ref* rec_ref = NULL;
struct dxt_file_record *file_rec;
rec_ref = darshan_lookup_record_ref(dxlt_mpiio_runtime->fh_hash,
rec_ref = darshan_lookup_record_ref(dxt_mpiio_runtime->fh_hash,
&fh, sizeof(MPI_File));
if (!rec_ref) {
fprintf(stderr, "Error: dxlt_mpiio_read unable to find rec_ref.\n");
fprintf(stderr, "Error: dxt_mpiio_read unable to find rec_ref.\n");
return;
}
file_rec = rec_ref->file_rec;
if (dxlt_mpiio_runtime) {
if (dxt_mpiio_runtime) {
check_io_trace_buf(rec_ref);
}
......@@ -274,81 +274,81 @@ void dxlt_mpiio_read(MPI_File fh, int64_t length,
/**********************************************************
* Internal functions for manipulating DXLT module state *
* Internal functions for manipulating DXT module state *
**********************************************************/
/* initialize internal DXLT module data structures and register with darshan-core */
void dxlt_posix_runtime_initialize()
/* initialize internal DXT module data structures and register with darshan-core */
void dxt_posix_runtime_initialize()
{
int psx_buf_size;
/* try and store a default number of records for this module */
psx_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct dxlt_file_record);
psx_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct dxt_file_record);
/* register the DXLT module with darshan core */
/* register the DXT module with darshan core */
darshan_core_register_module(
DXLT_POSIX_MOD,
&dxlt_posix_shutdown,
DXT_POSIX_MOD,
&dxt_posix_shutdown,
&psx_buf_size,
&posix_my_rank,
&darshan_mem_alignment);
/* return if darshan-core does not provide enough module memory */
if(psx_buf_size < sizeof(struct dxlt_file_record))
if(psx_buf_size < sizeof(struct dxt_file_record))
{
darshan_core_unregister_module(DXLT_POSIX_MOD);
darshan_core_unregister_module(DXT_POSIX_MOD);
return;
}
dxlt_posix_runtime = malloc(sizeof(*dxlt_posix_runtime));
if(!dxlt_posix_runtime)
dxt_posix_runtime = malloc(sizeof(*dxt_posix_runtime));
if(!dxt_posix_runtime)
{
darshan_core_unregister_module(DXLT_POSIX_MOD);
darshan_core_unregister_module(DXT_POSIX_MOD);
return;
}
memset(dxlt_posix_runtime, 0, sizeof(*dxlt_posix_runtime));
memset(dxt_posix_runtime, 0, sizeof(*dxt_posix_runtime));
return;
}
void dxlt_mpiio_runtime_initialize()
void dxt_mpiio_runtime_initialize()
{
int psx_buf_size;
/* try and store a default number of records for this module */
psx_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct dxlt_file_record);
psx_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct dxt_file_record);
/* register the DXLT module with darshan core */
/* register the DXT module with darshan core */
darshan_core_register_module(
DXLT_MPIIO_MOD,
&dxlt_mpiio_shutdown,
DXT_MPIIO_MOD,
&dxt_mpiio_shutdown,
&psx_buf_size,
&mpiio_my_rank,
&darshan_mem_alignment);
/* return if darshan-core does not provide enough module memory */
if(psx_buf_size < sizeof(struct dxlt_file_record))
if(psx_buf_size < sizeof(struct dxt_file_record))
{
darshan_core_unregister_module(DXLT_MPIIO_MOD);
darshan_core_unregister_module(DXT_MPIIO_MOD);
return;
}
dxlt_mpiio_runtime = malloc(sizeof(*dxlt_mpiio_runtime));
if(!dxlt_mpiio_runtime)
dxt_mpiio_runtime = malloc(sizeof(*dxt_mpiio_runtime));
if(!dxt_mpiio_runtime)
{
darshan_core_unregister_module(DXLT_MPIIO_MOD);
darshan_core_unregister_module(DXT_MPIIO_MOD);
return;
}
memset(dxlt_mpiio_runtime, 0, sizeof(*dxlt_mpiio_runtime));
memset(dxt_mpiio_runtime, 0, sizeof(*dxt_mpiio_runtime));
return;
}
void dxlt_posix_track_new_file_record(
void dxt_posix_track_new_file_record(
darshan_record_id rec_id, const char *path)
{
struct dxlt_file_record_ref *rec_ref = NULL;
struct dxlt_file_record *file_rec = NULL;
struct dxt_file_record_ref *rec_ref = NULL;
struct dxt_file_record *file_rec = NULL;
struct darshan_fs_info fs_info;
int ret;
......@@ -358,7 +358,7 @@ void dxlt_posix_track_new_file_record(
memset(rec_ref, 0, sizeof(*rec_ref));
/* add a reference to this file record based on record id */
ret = darshan_add_record_ref(&(dxlt_posix_runtime->rec_id_hash), &rec_id,
ret = darshan_add_record_ref(&(dxt_posix_runtime->rec_id_hash), &rec_id,
sizeof(darshan_record_id), rec_ref);
if(ret == 0)
{
......@@ -372,13 +372,13 @@ void dxlt_posix_track_new_file_record(
file_rec = darshan_core_register_record(
rec_id,
path,
DXLT_POSIX_MOD,
sizeof(struct dxlt_file_record),
DXT_POSIX_MOD,
sizeof(struct dxt_file_record),
&fs_info);
if(!file_rec)
{
darshan_delete_record_ref(&(dxlt_posix_runtime->rec_id_hash),
darshan_delete_record_ref(&(dxt_posix_runtime->rec_id_hash),
&rec_id, sizeof(darshan_record_id));
free(rec_ref);
return;
......@@ -403,14 +403,14 @@ void dxlt_posix_track_new_file_record(
rec_ref->read_available_buf = IO_TRACE_BUF_SIZE;
rec_ref->fs_type = fs_info.fs_type;
dxlt_posix_runtime->file_rec_count++;
dxt_posix_runtime->file_rec_count++;
}
void dxlt_mpiio_track_new_file_record(
void dxt_mpiio_track_new_file_record(
darshan_record_id rec_id, const char *path)
{
struct dxlt_file_record *file_rec = NULL;
struct dxlt_file_record_ref *rec_ref = NULL;
struct dxt_file_record *file_rec = NULL;
struct dxt_file_record_ref *rec_ref = NULL;
struct darshan_fs_info fs_info;
int ret;
......@@ -420,7 +420,7 @@ void dxlt_mpiio_track_new_file_record(
memset(rec_ref, 0, sizeof(*rec_ref));
/* add a reference to this file record based on record id */
ret = darshan_add_record_ref(&(dxlt_mpiio_runtime->rec_id_hash), &rec_id,
ret = darshan_add_record_ref(&(dxt_mpiio_runtime->rec_id_hash), &rec_id,
sizeof(darshan_record_id), rec_ref);
if(ret == 0)
{
......@@ -434,13 +434,13 @@ void dxlt_mpiio_track_new_file_record(
file_rec = darshan_core_register_record(
rec_id,
path,
DXLT_MPIIO_MOD,
sizeof(struct dxlt_file_record),
DXT_MPIIO_MOD,
sizeof(struct dxt_file_record),
&fs_info);
if(!file_rec)
{
darshan_delete_record_ref(&(dxlt_mpiio_runtime->rec_id_hash),
darshan_delete_record_ref(&(dxt_mpiio_runtime->rec_id_hash),
&rec_id, sizeof(darshan_record_id));
free(rec_ref);
return;
......@@ -465,50 +465,50 @@ void dxlt_mpiio_track_new_file_record(
rec_ref->read_available_buf = IO_TRACE_BUF_SIZE;
rec_ref->fs_type = fs_info.fs_type;
dxlt_mpiio_runtime->file_rec_count++;
dxt_mpiio_runtime->file_rec_count++;
}
void dxlt_posix_add_record_ref(darshan_record_id rec_id, int fd)
void dxt_posix_add_record_ref(darshan_record_id rec_id, int fd)
{
struct dxlt_file_record_ref *rec_ref = NULL;
struct dxlt_file_record *file_rec;
struct dxt_file_record_ref *rec_ref = NULL;
struct dxt_file_record *file_rec;
int i;
rec_ref = darshan_lookup_record_ref(dxlt_posix_runtime->rec_id_hash, &rec_id,
rec_ref = darshan_lookup_record_ref(dxt_posix_runtime->rec_id_hash, &rec_id,
sizeof(darshan_record_id));
assert(rec_ref);
darshan_add_record_ref(&(dxlt_posix_runtime->fd_hash), &fd,
darshan_add_record_ref(&(dxt_posix_runtime->fd_hash), &fd,
sizeof(int), rec_ref);
#if 0
/* get Lustre stripe information */
file_rec = rec_ref->file_rec;
dxlt_instrument_fs_data(rec_id, rec_ref->fs_type, file_rec);
dxt_instrument_fs_data(rec_id, rec_ref->fs_type, file_rec);
#endif
}
void dxlt_mpiio_add_record_ref(darshan_record_id rec_id, MPI_File fh)
void dxt_mpiio_add_record_ref(darshan_record_id rec_id, MPI_File fh)
{
struct dxlt_file_record_ref *rec_ref = NULL;
struct dxt_file_record_ref *rec_ref = NULL;
rec_ref = darshan_lookup_record_ref(dxlt_mpiio_runtime->rec_id_hash, &rec_id,
rec_ref = darshan_lookup_record_ref(dxt_mpiio_runtime->rec_id_hash, &rec_id,
sizeof(darshan_record_id));
assert(rec_ref);
darshan_add_record_ref(&(dxlt_mpiio_runtime->fh_hash), &fh,
darshan_add_record_ref(&(dxt_mpiio_runtime->fh_hash), &fh,
sizeof(MPI_File), rec_ref);
}
#if 0
static void dxlt_instrument_fs_data(
darshan_record_id rec_id, int fs_type, struct dxlt_file_record *file_rec)
static void dxt_instrument_fs_data(
darshan_record_id rec_id, int fs_type, struct dxt_file_record *file_rec)
{
#ifdef DARSHAN_LUSTRE
/* allow lustre to generate a record if we configured with lustre support */
if(fs_type == LL_SUPER_MAGIC)
{
dxlt_get_lustre_stripe_info(rec_id, file_rec);
dxt_get_lustre_stripe_info(rec_id, file_rec);
return;
}
#endif
......@@ -516,13 +516,13 @@ static void dxlt_instrument_fs_data(
}
#endif
void dxlt_clear_record_refs(void **hash_head_p, int free_flag)
void dxt_clear_record_refs(void **hash_head_p, int free_flag)
{
struct dxlt_record_ref_tracker *ref_tracker, *tmp;
struct dxlt_record_ref_tracker *ref_tracker_head =
*(struct dxlt_record_ref_tracker **)hash_head_p;
struct dxlt_file_record_ref *rec_ref;
struct dxlt_file_record *file_rec;
struct dxt_record_ref_tracker *ref_tracker, *tmp;
struct dxt_record_ref_tracker *ref_tracker_head =
*(struct dxt_record_ref_tracker **)hash_head_p;
struct dxt_file_record_ref *rec_ref;
struct dxt_file_record *file_rec;
#if 0
/* iterate the hash table and remove/free all reference trackers */
......@@ -530,7 +530,7 @@ void dxlt_clear_record_refs(void **hash_head_p, int free_flag)
{
HASH_DELETE(hlink, ref_tracker_head, ref_tracker);
if (free_flag) {
rec_ref = (struct dxlt_file_record_ref *)ref_tracker->rec_ref_p;
rec_ref = (struct dxt_file_record_ref *)ref_tracker->rec_ref_p;
file_rec = rec_ref->file_rec;
if (file_rec->write_traces)
......@@ -549,24 +549,24 @@ void dxlt_clear_record_refs(void **hash_head_p, int free_flag)
return;
}
static void dxlt_posix_cleanup_runtime()
static void dxt_posix_cleanup_runtime()
{
dxlt_clear_record_refs(&(dxlt_posix_runtime->fd_hash), 0);
dxlt_clear_record_refs(&(dxlt_posix_runtime->rec_id_hash), 1);
dxt_clear_record_refs(&(dxt_posix_runtime->fd_hash), 0);
dxt_clear_record_refs(&(dxt_posix_runtime->rec_id_hash), 1);
free(dxlt_posix_runtime);
dxlt_posix_runtime = NULL;
free(dxt_posix_runtime);
dxt_posix_runtime = NULL;
return;
}
static void dxlt_mpiio_cleanup_runtime()
static void dxt_mpiio_cleanup_runtime()
{
dxlt_clear_record_refs(&(dxlt_mpiio_runtime->fh_hash), 0);
dxlt_clear_record_refs(&(dxlt_mpiio_runtime->rec_id_hash), 1);
dxt_clear_record_refs(&(dxt_mpiio_runtime->fh_hash), 0);
dxt_clear_record_refs(&(dxt_mpiio_runtime->rec_id_hash), 1);
free(dxlt_mpiio_runtime);
dxlt_mpiio_runtime = NULL;
free(dxt_mpiio_runtime);
dxt_mpiio_runtime = NULL;
return;
}
......@@ -576,15 +576,15 @@ static void dxlt_mpiio_cleanup_runtime()
* shutdown function exported by this module for coordinating with darshan-core *
********************************************************************************/
static void dxlt_posix_shutdown(
static void dxt_posix_shutdown(
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
int shared_rec_count,
void **dxlt_posix_buf,
int *dxlt_posix_buf_sz)
void **dxt_posix_buf,
int *dxt_posix_buf_sz)
{
struct dxlt_file_record_ref *rec_ref;
struct dxlt_file_record *file_rec;
struct dxt_file_record_ref *rec_ref;
struct dxt_file_record *file_rec;
int i, idx;
int64_t offset;
......@@ -596,20 +596,20 @@ static void dxlt_posix_shutdown(
int64_t record_size = 0;
int64_t record_write_count = 0;
int64_t record_read_count = 0;
void *tmp_buf_ptr = *dxlt_posix_buf;
void *tmp_buf_ptr = *dxt_posix_buf;
assert(dxlt_posix_runtime);
assert(dxt_posix_runtime);
DXLT_POSIX_LOCK();
int dxlt_rec_count = dxlt_posix_runtime->file_rec_count;
struct dxlt_record_ref_tracker *ref_tracker, *tmp;
struct dxlt_record_ref_tracker *ref_tracker_head =
(struct dxlt_record_ref_tracker *)(dxlt_posix_runtime->rec_id_hash);
DXT_POSIX_LOCK();
int dxt_rec_count = dxt_posix_runtime->file_rec_count;
struct dxt_record_ref_tracker *ref_tracker, *tmp;
struct dxt_record_ref_tracker *ref_tracker_head =
(struct dxt_record_ref_tracker *)(dxt_posix_runtime->rec_id_hash);
*dxlt_posix_buf_sz = 0;
*dxt_posix_buf_sz = 0;
HASH_ITER(hlink, ref_tracker_head, ref_tracker, tmp) {
rec_ref = (struct dxlt_file_record_ref *)ref_tracker->rec_ref_p;
rec_ref = (struct dxt_file_record_ref *)ref_tracker->rec_ref_p;
assert(rec_ref);
file_rec = rec_ref->file_rec;
......@@ -622,22 +622,22 @@ static void dxlt_posix_shutdown(