GitLab maintenance scheduled for Today, 2019-12-05, from 17:00 to 18:00 CT - Services will be unavailable during this time.

Commit 1c1a9baa authored by Shane Snyder's avatar Shane Snyder

cleanup a bunch of code and stale comments

parent c371cdea
......@@ -177,11 +177,4 @@ struct darshan_posix_file
double fcounters[POSIX_F_NUM_INDICES];
};
/* This macro can be used to identify files that have been opened using
* pnetcdf, hdf5, or mpi-io, but were never opened at the posix level. As a
* result the record will not necessarily have all of the expected fields
* populated.
*/
#define POSIX_FILE_PARTIAL(__file)((((__file)->counters[POSIX_OPENS] || (__file)->counters[POSIX_FOPENS] || (__file)->counters[POSIX_STATS]) ? 0 : 1))
#endif /* __DARSHAN_POSIX_LOG_FORMAT_H */
......@@ -33,12 +33,12 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
LIBS = -lz @LIBBZ2@
static-mod-objs = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o
dynamic-mod-objs = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po
DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o
DARSHAN_DYNAMIC_MOD_OBJS = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po
ifdef DARSHAN_USE_BGQ
static-mod-objs += lib/darshan-bgq.o
dynamic-mod-objs += lib/darshan-bgq.po
DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-bgq.po
CFLAGS += -DDARSHAN_BGQ
CFLAGS_SHARED += -DDARSHAN_BGQ
endif
......@@ -118,10 +118,10 @@ lib/lookup8.o: lib/lookup8.c
lib/lookup8.po: lib/lookup8.c
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/libdarshan.a: lib/darshan-core-init-finalize.o lib/darshan-core.o lib/darshan-common.o $(static-mod-objs) lib/lookup3.o lib/lookup8.o
lib/libdarshan.a: lib/darshan-core-init-finalize.o lib/darshan-core.o lib/darshan-common.o $(DARSHAN_STATIC_MOD_OBJS) lib/lookup3.o lib/lookup8.o
ar rcs $@ $^
lib/libdarshan.so: lib/darshan-core-init-finalize.po lib/darshan-core.po lib/darshan-common.po $(dynamic-mod-objs) lib/lookup3.po lib/lookup8.po
lib/libdarshan.so: lib/darshan-core-init-finalize.po lib/darshan-core.po lib/darshan-common.po $(DARSHAN_DYNAMIC_MOD_OBJS) lib/lookup3.po lib/lookup8.po
$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ -lpthread -lrt -lz -ldl
lib/libdarshan-stubs.a: lib/darshan-hdf5-stubs.o lib/darshan-pnetcdf-stubs.o
......
......@@ -115,17 +115,17 @@ void darshan_core_unregister_module(
/* darshan_core_register_record()
*
* Register the Darshan record given by 'name' with the darshan-core
* runtime, allowing it to be properly tracked and (potentially)
* correlated with records from other modules. 'len' is the size of
* the name pointer (string length for string names), and 'printable_flag'
* indicates whether the name is a string. 'mod_limit_flag' is set if
* the calling module is out of memory (to prevent darshan-core from
* creating new records and to just search existing records) and 'mod_id'
* is the identifier of the calling module. 'rec_id' is an output pointer
* storing the correspoing Darshan record identifier and 'file_alignment'
* is an output pointer storing the file system alignment value for the
* given record.
* Register a record with the darshan-core runtime, allowing it to be
* properly tracked and (potentially) correlated with records from other
* modules. 'name' is the the name of the Darshan record (e.g., the full
* file path) and 'len' is the size of the name pointer (string length
* for string names). 'mod_id' is the identifier of the calling module,
* 'printable_flag' indicates whether the name is a string, and
* 'mod_limit_flag' is set if the calling module is out of memory (to
* prevent darshan-core from creating new records and to just search
* through existing records). 'rec_id' is an output pointer storing the
* correspoing Darshan record identifier and 'file_alignment' is an output
* pointer storing the file system alignment value for the given record.
*/
void darshan_core_register_record(
void *name,
......
......@@ -50,7 +50,7 @@ static int instrumentation_disabled = 0;
static int my_rank = -1;
static int darshan_mem_alignment = 1;
/* internal helper functions for the "NULL" module */
/* internal helper functions for the BGQ module */
void bgq_runtime_initialize(void);
/* forward declaration for module functions needed to interface with darshan-core */
......@@ -58,7 +58,7 @@ static void bgq_begin_shutdown(void);
static void bgq_get_output_data(MPI_Comm mod_comm, darshan_record_id *shared_recs, int shared_rec_count, void **buffer, int *size);
static void bgq_shutdown(void);
/* macros for obtaining/releasing the "NULL" module lock */
/* macros for obtaining/releasing the BGQ module lock */
#define BGQ_LOCK() pthread_mutex_lock(&bgq_runtime_mutex)
#define BGQ_UNLOCK() pthread_mutex_unlock(&bgq_runtime_mutex)
......@@ -133,13 +133,15 @@ void bgq_runtime_initialize()
if(mem_limit == 0)
{
instrumentation_disabled = 1;
BGQ_UNLOCK();
return;
}
/* no enough memory to fit bgq module */
/* not enough memory to fit bgq module */
if (mem_limit < sizeof(*bgq_runtime))
{
instrumentation_disabled = 1;
BGQ_UNLOCK();
return;
}
......@@ -148,6 +150,7 @@ void bgq_runtime_initialize()
if(!bgq_runtime)
{
instrumentation_disabled = 1;
BGQ_UNLOCK();
return;
}
memset(bgq_runtime, 0, sizeof(*bgq_runtime));
......@@ -180,7 +183,7 @@ void bgq_runtime_initialize()
return;
}
/* Perform any necessary steps prior to shutting down for the "NULL" module. */
/* Perform any necessary steps prior to shutting down for the BGQ module. */
static void bgq_begin_shutdown()
{
BGQ_LOCK();
......@@ -204,7 +207,7 @@ static int cmpr(const void *p1, const void *p2)
return ((*a == *b) ? 0 : ((*a < *b) ? -1 : 1));
}
/* Pass output data for the "BGQ" module back to darshan-core to log to file. */
/* Pass output data for the BGQ module back to darshan-core to log to file. */
static void bgq_get_output_data(
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
......@@ -212,7 +215,7 @@ static void bgq_get_output_data(
void **buffer,
int *size)
{
/* Just set the output buffer to point at the array of the "BGQ" module's
/* Just set the output buffer to point at the array of the BGQ module's
* I/O records, and set the output size according to the number of records
* currently being tracked.
*/
......@@ -273,7 +276,7 @@ static void bgq_get_output_data(
return;
}
/* Shutdown the "BGQ" module by freeing up all data structures. */
/* Shutdown the BGQ module by freeing up all data structures. */
static void bgq_shutdown()
{
BGQ_LOCK();
......
......@@ -39,8 +39,6 @@ typedef int64_t off64_t;
#define aiocb64 aiocb
#endif
/* TODO: more libc, fgetc, etc etc etc. */
DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...));
DARSHAN_FORWARD_DECL(open64, int, (const char *path, int flags, ...));
DARSHAN_FORWARD_DECL(creat, int, (const char* path, mode_t mode));
......@@ -1728,10 +1726,7 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
tmp_file.counters[j] = infile->counters[j] + inoutfile->counters[j];
}
if(POSIX_FILE_PARTIAL(infile))
tmp_file.counters[POSIX_MODE] = inoutfile->counters[POSIX_MODE];
else
tmp_file.counters[POSIX_MODE] = infile->counters[POSIX_MODE];
tmp_file.counters[POSIX_MODE] = infile->counters[POSIX_MODE];
/* sum */
for(j=POSIX_BYTES_READ; j<=POSIX_BYTES_WRITTEN; j++)
......@@ -1754,10 +1749,7 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
tmp_file.counters[j] = infile->counters[j] + inoutfile->counters[j];
}
if(POSIX_FILE_PARTIAL(infile))
tmp_file.counters[POSIX_MEM_ALIGNMENT] = inoutfile->counters[POSIX_MEM_ALIGNMENT];
else
tmp_file.counters[POSIX_MEM_ALIGNMENT] = infile->counters[POSIX_MEM_ALIGNMENT];
tmp_file.counters[POSIX_MEM_ALIGNMENT] = infile->counters[POSIX_MEM_ALIGNMENT];
/* sum */
for(j=POSIX_FILE_NOT_ALIGNED; j<=POSIX_FILE_NOT_ALIGNED; j++)
......@@ -1765,10 +1757,7 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
tmp_file.counters[j] = infile->counters[j] + inoutfile->counters[j];
}
if(POSIX_FILE_PARTIAL(infile))
tmp_file.counters[POSIX_FILE_ALIGNMENT] = inoutfile->counters[POSIX_FILE_ALIGNMENT];
else
tmp_file.counters[POSIX_FILE_ALIGNMENT] = infile->counters[POSIX_FILE_ALIGNMENT];
tmp_file.counters[POSIX_FILE_ALIGNMENT] = infile->counters[POSIX_FILE_ALIGNMENT];
/* skip POSIX_MAX_*_TIME_SIZE; handled in floating point section */
......
......@@ -15,6 +15,8 @@ pkgconfigdir = $(DESTDIR)$(libdir)/pkgconfig
DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
DARSHAN_MOD_LOG_FORMATS = $(srcdir)/../darshan-posix-log-format.h $(srcdir)/../darshan-mpiio-log-format.h $(srcdir)/../darshan-hdf5-log-format.h $(srcdir)/../darshan-pnetcdf-log-format.h
DARSHAN_MOD_LOGUTIL_HEADERS = darshan-posix-logutils.h darshan-mpiio-logutils.h darshan-hdf5-logutils.h darshan-pnetcdf-logutils.h
DARSHAN_STATIC_MOD_OBJS = darshan-posix-logutils.o darshan-mpiio-logutils.o darshan-hdf5-logutils.o darshan-pnetcdf-logutils.o darshan-bgq-logutils.o
DARSHAN_DYNAMIC_MOD_OBJS = darshan-posix-logutils.po darshan-mpiio-logutils.po darshan-hdf5-logutils.po darshan-pnetcdf-logutils.po darshan-bgq-logutils.po
DARSHAN_ENABLE_SHARED=@DARSHAN_ENABLE_SHARED@
......@@ -79,13 +81,12 @@ darshan-bgq-logutils.o: darshan-bgq-logutils.c darshan-logutils.h darshan-bgq-lo
darshan-bgq-logutils.po: darshan-bgq-logutils.c darshan-logutils.h darshan-bgq-logutils.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-bgq-log-format.h | uthash-1.9.2
$(CC) $(CFLAGS_SHARED) -c $< -o $@
libdarshan-util.a: darshan-logutils.o $(DARSHAN_STATIC_MOD_OBJS)
ar rcs libdarshan-util.a $^
libdarshan-util.so: darshan-logutils.po darshan-posix-logutils.po darshan-mpiio-logutils.po darshan-hdf5-logutils.po darshan-pnetcdf-logutils.po darshan-bgq-logutils.po
libdarshan-util.so: darshan-logutils.po $(DARSHAN_DYNAMIC_MOD_OBJS)
$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ $(LIBS)
libdarshan-util.a: darshan-logutils.o darshan-posix-logutils.o darshan-mpiio-logutils.o darshan-hdf5-logutils.o darshan-pnetcdf-logutils.o darshan-bgq-logutils.o
ar rcs libdarshan-util.a $^
jenkins-hash-gen: jenkins-hash-gen.c lookup3.o
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
......
......@@ -55,6 +55,9 @@ struct darshan_mod_logutil_funcs
/* retrieve a single module record from the log file.
* return 1 on successful read of record, 0 on no more
* module data, -1 on error
* - 'fd' is the file descriptor to get record from
* - 'buf' is the buffer to store the record in
* - 'rec_id' is the corresponding darshan record id
*/
int (*log_get_record)(
darshan_fd fd,
......@@ -63,13 +66,22 @@ struct darshan_mod_logutil_funcs
);
/* put a single module record into the log file.
* return 0 on success, -1 on error
* - 'fd' is the file descriptor to put record into
* - 'buf' is the buffer containing the record data
* - 'rec_id' is the corresponding darshan record id
*/
int (*log_put_record)(
darshan_fd fd,
void *buf,
int ver
);
/* print the counters for a given log file record */
/* print the counters for a given log record
* - 'file_rec' is the record's data buffer
* - 'file_name' is the file path string for the record
* - 'mnt-pt' is the file path mount point string
* - 'fs_type' is the file system type string
* - 'ver' is the version of the record
*/
void (*log_print_record)(
void *file_rec,
char *file_name,
......
......@@ -51,7 +51,8 @@ struct darshan_mod_logutil_funcs null_logutils =
/* retrieve a NULL record from log file descriptor 'fd', storing the
* buffer in 'null_buf' and the corresponding Darshan record id in
* 'rec_id'. Return 1 on successful record read, .
* 'rec_id'. Return 1 on successful record read, 0 on no more data,
* and -1 on error.
*/
static int darshan_log_get_null_record(darshan_fd fd, void* null_buf,
darshan_record_id* rec_id)
......
......@@ -690,8 +690,7 @@ void posix_accum_file(struct darshan_posix_file *pfile,
case POSIX_MODE:
case POSIX_MEM_ALIGNMENT:
case POSIX_FILE_ALIGNMENT:
if(POSIX_FILE_PARTIAL(tmp))
tmp->counters[i] = pfile->counters[i];
tmp->counters[i] = pfile->counters[i];
break;
case POSIX_MAX_BYTE_READ:
case POSIX_MAX_BYTE_WRITTEN:
......
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