Commit dbfa9a45 authored by Jakob Luettgau's avatar Jakob Luettgau
Browse files

Switch to no mpi module interface.

parent 4d306c71
......@@ -57,13 +57,13 @@
* statically or dynamically linked executables.
*/
#ifdef __cplusplus
extern "C" {
#endif
// Forward declarations not working for C++ modules, because of mangling
#ifdef __cplusplus
extern "C" {
#endif
/* The decaf_record_ref structure maintains necessary runtime metadata
* for the DECAF module record (darshan_decaf_record structure, defined in
......@@ -110,15 +110,14 @@ struct decaf_runtime
/* internal helper functions for the DECAF module */
static void decaf_runtime_initialize(void);
static struct decaf_record_ref *decaf_track_new_record(darshan_record_id rec_id, const char *name);
static struct decaf_record_ref *decaf_track_new_record(
darshan_record_id rec_id, const char *name);
static void decaf_cleanup_runtime(void);
/* forward declaration for DECAF shutdown function needed to interface
* with darshan-core
*/
static void decaf_shutdown(MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **decaf_buf, int *decaf_buf_sz);
static void decaf_shutdown(void **decaf_buf, int *decaf_buf_sz);
/* decaf_runtime is the global data structure encapsulating "DECAF" module state */
static struct decaf_runtime *decaf_runtime = NULL;
......@@ -137,9 +136,6 @@ static int my_rank = -1;
}
#endif
/* macros for obtaining/releasing the "DECAF" module lock */
#define DECAF_LOCK() pthread_mutex_lock(&decaf_runtime_mutex)
#define DECAF_UNLOCK() pthread_mutex_unlock(&decaf_runtime_mutex)
......@@ -168,8 +164,7 @@ static int my_rank = -1;
/* macro for instrumenting the "DECAF" module's foo function */
/* macro for instrumenting the "DECAF" module's put function */
#define DECAF_RECORD_PUT(__ret, __name, __dat, __tm1, __tm2) do{ \
darshan_record_id rec_id; \
struct decaf_record_ref *rec_ref; \
......@@ -199,7 +194,7 @@ static int my_rank = -1;
/* macro for instrumenting the "DECAF" module's foo function */
/* macro for instrumenting the "DECAF" module's get function */
#define DECAF_RECORD_GET(__ret, __name, __dat, __tm1, __tm2) do{ \
darshan_record_id rec_id; \
struct decaf_record_ref *rec_ref; \
......@@ -230,21 +225,11 @@ static int my_rank = -1;
/**********************************************************
* Wrappers for "DECAF" module functions of interest *
**********************************************************/
namespace decaf {
/*
......@@ -585,18 +570,32 @@ bool Decaf::get(vector< pConstructData >& containers)
/* Initialize internal DECAF module data structures and register with darshan-core. */
static void decaf_runtime_initialize()
{
int decaf_buf_size;
printf("darshan decaf init!\n");
std::cout << "I am c++! ;)\n";
int decaf_buf_size;
darshan_module_funcs mod_funcs = {
#ifdef HAVE_MPI
/* NOTE: the redux function can be used to run collective operations prior to
* shutting down the module. Typically, module developers will want to run a
* reduction on shared data records (passed in in the 'shared_recs' array),
* but other collective routines can be run here as well. For a detailed
* example illustrating how to run shared file reductions, consider the
* POSIX or MPIIO instrumentation modules, as they both implement this
* functionality.
*/
.mod_redux_func = NULL,
#endif
.mod_shutdown_func = &decaf_shutdown
};
/* try and store a default number of records for this module */
decaf_buf_size = DARSHAN_DEF_MOD_REC_COUNT * sizeof(struct darshan_decaf_record);
/* register the DECAF module with the darshan-core component */
darshan_core_register_module(
DARSHAN_DECAF_MOD, /* Darshan module identifier, defined in darshan-log-format.h */
&decaf_shutdown,
mod_funcs,
&decaf_buf_size,
&my_rank,
NULL);
......@@ -695,25 +694,12 @@ static void decaf_cleanup_runtime()
* and shutdown/free internal data structures.
*/
static void decaf_shutdown(
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
int shared_rec_count,
void **decaf_buf,
int *decaf_buf_sz)
{
DECAF_LOCK();
assert(decaf_runtime);
/* NOTE: this function can be used to run collective operations prior to
* shutting down the module, as implied by the MPI communicator passed in
* as the first agrument. Typically, module developers will want to run a
* reduction on shared data records (passed in in the 'shared_recs' array),
* but other collective routines can be run here as well. For a detailed
* example illustrating how to run shared file reductions, consider the
* POSIX or MPIIO instrumentation modules, as they both implement this
* functionality.
*/
/* Just set the output size according to the number of records currently
* being tracked. In general, the module can decide to throw out records
* that have been previously registered by shuffling around memory in
......@@ -729,8 +715,6 @@ static void decaf_shutdown(
return;
}
/*
* Local variables:
* c-indent-level: 4
......
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