Commit 67b02ca5 authored by Shane Snyder's avatar Shane Snyder

x-macro the logutil defs

parent 991aaa2f
......@@ -33,23 +33,22 @@
#define DARSHAN_MAX_MODS 16
/* TODO: do we want the logutil defs here ? */
/* 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,
* just pass NULL (no quotes) if no log parsing
* functions are required).
* 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)
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]
......
......@@ -88,27 +88,13 @@ static int darshan_log_dzunload(darshan_fd fd, struct darshan_log_map *map_p);
/* TODO: check comments on functions to make sure they are right /cleanup */
/* TODO: can we make this s.t. we don't care about ordering (i.e., X macro it ) */
/* see gzip interface for ideas */
/* each module's implementation of the darshan logutil functions */
#define X(a, b, c) c,
struct darshan_mod_logutil_funcs *mod_logutils[DARSHAN_MAX_MODS] =
{
NULL, /* NULL */
&posix_logutils, /* POSIX */
&mpiio_logutils, /* MPI-IO */
&hdf5_logutils, /* HDF5 */
&pnetcdf_logutils, /* PNETCDF */
&bgq_logutils, /* BG/Q */
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
DARSHAN_MODULE_IDS
};
#undef X
/* darshan_log_open()
*
......
......@@ -68,7 +68,7 @@ struct darshan_mod_logutil_funcs
);
};
extern struct darshan_mod_logutil_funcs *mod_logutils[DARSHAN_MAX_MODS];
extern struct darshan_mod_logutil_funcs *mod_logutils[];
#include "darshan-posix-logutils.h"
#include "darshan-mpiio-logutils.h"
......
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