[Darshan-commits] [Git][darshan/darshan][dev-no-mpi] port bgq mod to recent api changes
Shane Snyder
xgitlab at cels.anl.gov
Wed Dec 11 09:20:21 CST 2019
Shane Snyder pushed to branch dev-no-mpi at darshan / darshan
Commits:
e12c75c2 by Shane Snyder at 2019-12-11T15:19:40Z
port bgq mod to recent api changes
- - - - -
1 changed file:
- darshan-runtime/lib/darshan-bgq.c
Changes:
=====================================
darshan-runtime/lib/darshan-bgq.c
=====================================
@@ -49,8 +49,15 @@ static int my_rank = -1;
/* internal helper functions for the BGQ module */
void bgq_runtime_initialize(void);
-/* forward declaration for shutdown function needed to interface with darshan-core */
-static void bgq_shutdown(MPI_Comm mod_comm, darshan_record_id *shared_recs, int shared_rec_count, void **buffer, int *size);
+/* forward declaration for shutdown functions needed to interface with darshan-core */
+static void bgq_mpi_redux(
+ void *buffer,
+ MPI_Comm mod_comm,
+ darshan_record_id *shared_recs,
+ int shared_rec_count);
+static void bgq_shutdown(
+ void **buffer,
+ int *size);
/* macros for obtaining/releasing the BGQ module lock */
#define BGQ_LOCK() pthread_mutex_lock(&bgq_runtime_mutex)
@@ -102,6 +109,12 @@ void bgq_runtime_initialize()
{
int bgq_buf_size;
darshan_record_id rec_id;
+ darshan_module_funcs mod_funcs = {
+#ifdef HAVE_MPI
+ .mod_redux_func = &bgq_mpi_redux,
+#endif
+ .mod_shutdown_func = &bgq_shutdown
+ };
BGQ_LOCK();
@@ -118,7 +131,7 @@ void bgq_runtime_initialize()
/* register the BG/Q module with the darshan-core component */
darshan_core_register_module(
DARSHAN_BGQ_MOD,
- &bgq_shutdown,
+ mod_funcs,
&bgq_buf_size,
&my_rank,
NULL);
@@ -177,13 +190,11 @@ static int cmpr(const void *p1, const void *p2)
* shutdown function exported by this module for coordinating with darshan-core *
********************************************************************************/
-/* Pass output data for the BGQ module back to darshan-core to log to file. */
-static void bgq_shutdown(
+static void bgq_mpi_redux(
+ void *posix_buf,
MPI_Comm mod_comm,
darshan_record_id *shared_recs,
- int shared_rec_count,
- void **buffer,
- int *size)
+ int shared_rec_count)
{
int nprocs;
int result;
@@ -233,6 +244,19 @@ static void bgq_shutdown(
}
}
+ BGQ_UNLOCK();
+
+ return;
+}
+
+/* Pass output data for the BGQ module back to darshan-core to log to file. */
+static void bgq_shutdown(
+ void **buffer,
+ int *size)
+{
+ BGQ_LOCK();
+ assert(bgq_runtime);
+
/* non-zero ranks throw out their BGQ record */
if (my_rank != 0)
{
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/e12c75c207dc9c946cae9496db3b153bd5bf404f
--
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/e12c75c207dc9c946cae9496db3b153bd5bf404f
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20191211/ea57719d/attachment-0001.html>
More information about the Darshan-commits
mailing list