Commit ba451e9a authored by Shane Snyder's avatar Shane Snyder

rework header org. for module-specific versions

parent 8731ade9
......@@ -7,8 +7,8 @@
#ifndef __DARSHAN_BGQ_LOG_FORMAT_H
#define __DARSHAN_BGQ_LOG_FORMAT_H
#include "darshan-log-format.h"
/* current BGQ log format version */
#define DARSHAN_BGQ_VER 1
#define BGQ_COUNTERS \
X(BGQ_CSJOBID, "control system jobid") \
......
......@@ -7,7 +7,8 @@
#ifndef __DARSHAN_HDF5_LOG_FORMAT_H
#define __DARSHAN_HDF5_LOG_FORMAT_H
#include "darshan-log-format.h"
/* current HDF5 log format version */
#define DARSHAN_HDF5_VER 1
#define HDF5_COUNTERS \
/* count of HDF5 opens */\
......
......@@ -31,44 +31,9 @@
/* max length of exe string within job record (not counting '\0') */
#define DARSHAN_EXE_LEN (DARSHAN_JOB_RECORD_SIZE - sizeof(struct darshan_job) - 1)
/* max number of modules that can be used in a darshan log */
#define DARSHAN_MAX_MODS 16
/* X-macro for keeping module ordering consistent */
/* NOTE: first val used to define module enum values,
* second val used to define module name strings, and
* third val is used to provide the name of a
* corresponding logutils structure for parsing module
* data out of the log file (only used in darshan-util
* component -- NULL can be passed if there are no
* logutil definitions)
*/
#define DARSHAN_MODULE_IDS \
X(DARSHAN_NULL_MOD, "NULL", NULL) \
X(DARSHAN_POSIX_MOD, "POSIX", &posix_logutils) \
X(DARSHAN_MPIIO_MOD, "MPI-IO", &mpiio_logutils) \
X(DARSHAN_HDF5_MOD, "HDF5", &hdf5_logutils) \
X(DARSHAN_PNETCDF_MOD, "PNETCDF", &pnetcdf_logutils) \
X(DARSHAN_BGQ_MOD, "BG/Q", &bgq_logutils)
/* unique identifiers to distinguish between available darshan modules */
/* NOTES: - valid ids range from [0...DARSHAN_MAX_MODS-1]
* - order of ids control module shutdown order (and consequently, order in log file)
*/
#define X(a, b, c) a,
typedef enum
{
DARSHAN_MODULE_IDS
} darshan_module_id;
#undef X
/* module name strings */
#define X(a, b, c) b,
static char * const darshan_module_names[] =
{
DARSHAN_MODULE_IDS
};
#undef X
/* simple macros for accessing module flag bitfields */
#define DARSHAN_MOD_FLAG_SET(flags, id) flags = (flags | (1 << id))
#define DARSHAN_MOD_FLAG_UNSET(flags, id) flags = (flags & ~(1 << id))
......@@ -105,6 +70,7 @@ struct darshan_header
uint32_t partial_flag;
struct darshan_log_map rec_map;
struct darshan_log_map mod_map[DARSHAN_MAX_MODS];
uint32_t mod_ver[DARSHAN_MAX_MODS];
};
/* job-level metadata stored for this application */
......@@ -126,4 +92,61 @@ struct darshan_record
darshan_record_id id;
};
/************************************************
*** module-specific includes and definitions ***
************************************************/
#include "darshan-null-log-format.h"
#include "darshan-posix-log-format.h"
#include "darshan-mpiio-log-format.h"
#include "darshan-hdf5-log-format.h"
#include "darshan-pnetcdf-log-format.h"
#include "darshan-bgq-log-format.h"
/* X-macro for keeping module ordering consistent */
/* NOTE: first val used to define module enum values,
* second val used to define module name strings,
* third val is the log format version for the module,
* and fourth val is used to provide the name of a
* corresponding logutils structure for parsing module
* data out of the log file (only used in darshan-util
* component -- NULL can be passed if there are no
* logutil definitions)
*/
#define DARSHAN_MODULE_IDS \
X(DARSHAN_NULL_MOD, "NULL", DARSHAN_NULL_VER, NULL) \
X(DARSHAN_POSIX_MOD, "POSIX", DARSHAN_POSIX_VER, &posix_logutils) \
X(DARSHAN_MPIIO_MOD, "MPI-IO", DARSHAN_MPIIO_VER, &mpiio_logutils) \
X(DARSHAN_HDF5_MOD, "HDF5", DARSHAN_HDF5_VER, &hdf5_logutils) \
X(DARSHAN_PNETCDF_MOD, "PNETCDF", DARSHAN_PNETCDF_VER, &pnetcdf_logutils) \
X(DARSHAN_BGQ_MOD, "BG/Q", DARSHAN_BGQ_VER, &bgq_logutils)
/* unique identifiers to distinguish between available darshan modules */
/* NOTES: - valid ids range from [0...DARSHAN_MAX_MODS-1]
* - order of ids control module shutdown order (and consequently, order in log file)
*/
#define X(a, b, c, d) a,
typedef enum
{
DARSHAN_MODULE_IDS
} darshan_module_id;
#undef X
/* module name strings */
#define X(a, b, c, d) b,
static char * const darshan_module_names[] =
{
DARSHAN_MODULE_IDS
};
#undef X
/* module version numbers */
#define X(a, b, c, d) c,
static const int darshan_module_versions[] =
{
DARSHAN_MODULE_IDS
};
#undef X
#endif /* __DARSHAN_LOG_FORMAT_H */
......@@ -7,7 +7,8 @@
#ifndef __DARSHAN_MPIIO_LOG_FORMAT_H
#define __DARSHAN_MPIIO_LOG_FORMAT_H
#include "darshan-log-format.h"
/* current MPI-IO log format version */
#define DARSHAN_MPIIO_VER 1
/* TODO: maybe use a counter to track cases in which a derived datatype is used? */
......
......@@ -7,7 +7,8 @@
#ifndef __DARSHAN_NULL_LOG_FORMAT_H
#define __DARSHAN_NULL_LOG_FORMAT_H
#include "darshan-log-format.h"
/* current log format version, to support backwards compatibility */
#define DARSHAN_NULL_VER 1
#define NULL_COUNTERS \
/* count of number of 'bar' function calls */\
......
......@@ -7,7 +7,8 @@
#ifndef __DARSHAN_PNETCDF_LOG_FORMAT_H
#define __DARSHAN_PNETCDF_LOG_FORMAT_H
#include "darshan-log-format.h"
/* current PNETCDF log format version */
#define DARSHAN_PNETCDF_VER 1
#define PNETCDF_COUNTERS \
/* count of PNETCDF independent opens */\
......
......@@ -6,7 +6,8 @@
#ifndef __DARSHAN_POSIX_LOG_FORMAT_H
#define __DARSHAN_POSIX_LOG_FORMAT_H
#include "darshan-log-format.h"
/* current POSIX log format version */
#define DARSHAN_POSIX_VER 1
#define POSIX_COUNTERS \
/* count of posix opens */\
......
......@@ -16,7 +16,6 @@
#include "uthash.h"
#include "darshan.h"
#include "darshan-bgq-log-format.h"
#include "darshan-dynamic.h"
#include <mpix.h>
......
......@@ -22,7 +22,6 @@
#include "uthash.h"
#include "darshan.h"
#include "darshan-hdf5-log-format.h"
#include "darshan-dynamic.h"
/* hope this doesn't change any time soon */
......
......@@ -23,7 +23,6 @@
#include "uthash.h"
#include "darshan.h"
#include "darshan-mpiio-log-format.h"
#include "darshan-dynamic.h"
/* The mpiio_file_runtime structure maintains necessary runtime metadata
......
......@@ -16,7 +16,6 @@
#include "uthash.h"
#include "darshan.h"
#include "darshan-null-log-format.h"
/* The "NULL" module is an example instrumentation module implementation provided
* with Darshan, primarily to indicate how arbitrary modules may be integrated
......
......@@ -22,7 +22,6 @@
#include "uthash.h"
#include "darshan.h"
#include "darshan-pnetcdf-log-format.h"
#include "darshan-dynamic.h"
DARSHAN_FORWARD_DECL(ncmpi_create, int, (MPI_Comm comm, const char *path, int cmode, MPI_Info info, int *ncidp));
......
......@@ -30,7 +30,6 @@
#include "utlist.h"
#include "darshan.h"
#include "darshan-posix-log-format.h"
#include "darshan-dynamic.h"
#ifndef HAVE_OFF64_T
......
......@@ -93,10 +93,10 @@ lookup3.o: lookup3.c
$(CC) $(CFLAGS) -c $< -o $@
darshan-analyzer: darshan-analyzer.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS)
darshan-convert: darshan-convert.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) libdarshan-util.a lookup3.o | uthash-1.9.2
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) $< lookup3.o libdarshan-util.a -o $@ $(LIBS)
#darshan-diff: darshan-diff.o $(DARSHAN_LOG_FORMAT) darshan-logutils.o darshan-logutils.h
# $(CC) $(CFLAGS) $(LDFLAGS) $< darshan-logutils.o -o $@ $(LIBS)
......@@ -104,7 +104,7 @@ darshan-convert: darshan-convert.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) libd
# $(CC) $(CFLAGS) -c $< -o $@
darshan-parser: darshan-parser.c darshan-logutils.h $(DARSHAN_LOG_FORMAT) $(DARSHAN_MOD_LOGUTIL_HEADERS) $(DARSHAN_MOD_LOG_FORMATS) libdarshan-util.a | uthash-1.9.2
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) $< libdarshan-util.a -o $@ $(LIBS)
#test/gztest: test/gztest.c mktestdir
# $(CC) $(CFLAGS) $(LDFLAGS) -lz $< -o $@
......
......@@ -17,7 +17,7 @@
#include <fcntl.h>
#include <errno.h>
#include "darshan-bgq-logutils.h"
#include "darshan-logutils.h"
/* counter name strings for the POSIX module */
#define X(a, b) #a,
......
......@@ -7,9 +7,6 @@
#ifndef __DARSHAN_BGQ_LOG_UTILS_H
#define __DARSHAN_BGQ_LOG_UTILS_H
#include "darshan-logutils.h"
#include "darshan-bgq-log-format.h"
extern char *bgq_counter_names[];
extern char *bgq_f_counter_names[];
......
......@@ -17,7 +17,7 @@
#include <fcntl.h>
#include <errno.h>
#include "darshan-hdf5-logutils.h"
#include "darshan-logutils.h"
/* counter name strings for the HDF5 module */
#define X(a) #a,
......
......@@ -7,9 +7,6 @@
#ifndef __DARSHAN_HDF5_LOG_UTILS_H
#define __DARSHAN_HDF5_LOG_UTILS_H
#include "darshan-logutils.h"
#include "darshan-hdf5-log-format.h"
extern char *hdf5_counter_names[];
extern char *hdf5_f_counter_names[];
......
......@@ -87,7 +87,7 @@ static int darshan_log_dzload(darshan_fd fd, struct darshan_log_map map);
static int darshan_log_dzunload(darshan_fd fd, struct darshan_log_map *map_p);
/* each module's implementation of the darshan logutil functions */
#define X(a, b, c) c,
#define X(a, b, c, d) d,
struct darshan_mod_logutil_funcs *mod_logutils[DARSHAN_MAX_MODS] =
{
DARSHAN_MODULE_IDS
......
......@@ -17,7 +17,7 @@
#include <fcntl.h>
#include <errno.h>
#include "darshan-mpiio-logutils.h"
#include "darshan-logutils.h"
/* counter name strings for the MPI-IO module */
#define X(a) #a,
......
......@@ -7,9 +7,6 @@
#ifndef __DARSHAN_MPIIO_LOG_UTILS_H
#define __DARSHAN_MPIIO_LOG_UTILS_H
#include "darshan-logutils.h"
#include "darshan-mpiio-log-format.h"
extern char *mpiio_counter_names[];
extern char *mpiio_f_counter_names[];
......
......@@ -17,7 +17,7 @@
#include <fcntl.h>
#include <errno.h>
#include "darshan-null-logutils.h"
#include "darshan-logutils.h"
/* integer counter name strings for the NULL module */
#define X(a) #a,
......
......@@ -7,9 +7,6 @@
#ifndef __DARSHAN_NULL_LOG_UTILS_H
#define __DARSHAN_NULL_LOG_UTILS_H
#include "darshan-logutils.h"
#include "darshan-null-log-format.h"
/* declare NULL module counter name strings and logutil definition as
* extern variables so they can be used in other utilities
*/
......
......@@ -17,7 +17,7 @@
#include <fcntl.h>
#include <errno.h>
#include "darshan-pnetcdf-logutils.h"
#include "darshan-logutils.h"
/* counter name strings for the PNETCDF module */
#define X(a) #a,
......
......@@ -7,9 +7,6 @@
#ifndef __DARSHAN_PNETCDF_LOG_UTILS_H
#define __DARSHAN_PNETCDF_LOG_UTILS_H
#include "darshan-logutils.h"
#include "darshan-pnetcdf-log-format.h"
extern char *pnetcdf_counter_names[];
extern char *pnetcdf_f_counter_names[];
......
......@@ -17,7 +17,7 @@
#include <fcntl.h>
#include <errno.h>
#include "darshan-posix-logutils.h"
#include "darshan-logutils.h"
/* counter name strings for the POSIX module */
#define X(a) #a,
......
......@@ -7,9 +7,6 @@
#ifndef __DARSHAN_POSIX_LOG_UTILS_H
#define __DARSHAN_POSIX_LOG_UTILS_H
#include "darshan-logutils.h"
#include "darshan-posix-log-format.h"
extern char *posix_counter_names[];
extern char *posix_f_counter_names[];
......
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