Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
darshan
darshan
Commits
e12c75c2
Commit
e12c75c2
authored
Dec 11, 2019
by
Shane Snyder
Browse files
port bgq mod to recent api changes
parent
aff75f19
Changes
1
Show whitespace changes
Inline
Side-by-side
darshan-runtime/lib/darshan-bgq.c
View file @
e12c75c2
...
@@ -49,8 +49,15 @@ static int my_rank = -1;
...
@@ -49,8 +49,15 @@ static int my_rank = -1;
/* internal helper functions for the BGQ module */
/* internal helper functions for the BGQ module */
void
bgq_runtime_initialize
(
void
);
void
bgq_runtime_initialize
(
void
);
/* forward declaration for shutdown function needed to interface with darshan-core */
/* forward declaration for shutdown functions 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
);
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 */
/* macros for obtaining/releasing the BGQ module lock */
#define BGQ_LOCK() pthread_mutex_lock(&bgq_runtime_mutex)
#define BGQ_LOCK() pthread_mutex_lock(&bgq_runtime_mutex)
...
@@ -102,6 +109,12 @@ void bgq_runtime_initialize()
...
@@ -102,6 +109,12 @@ void bgq_runtime_initialize()
{
{
int
bgq_buf_size
;
int
bgq_buf_size
;
darshan_record_id
rec_id
;
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
();
BGQ_LOCK
();
...
@@ -118,7 +131,7 @@ void bgq_runtime_initialize()
...
@@ -118,7 +131,7 @@ void bgq_runtime_initialize()
/* register the BG/Q module with the darshan-core component */
/* register the BG/Q module with the darshan-core component */
darshan_core_register_module
(
darshan_core_register_module
(
DARSHAN_BGQ_MOD
,
DARSHAN_BGQ_MOD
,
&
bgq_shutdown
,
mod_funcs
,
&
bgq_buf_size
,
&
bgq_buf_size
,
&
my_rank
,
&
my_rank
,
NULL
);
NULL
);
...
@@ -177,13 +190,11 @@ static int cmpr(const void *p1, const void *p2)
...
@@ -177,13 +190,11 @@ static int cmpr(const void *p1, const void *p2)
* shutdown function exported by this module for coordinating with darshan-core *
* 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_mpi_redux
(
static
void
bgq_shutdown
(
void
*
posix_buf
,
MPI_Comm
mod_comm
,
MPI_Comm
mod_comm
,
darshan_record_id
*
shared_recs
,
darshan_record_id
*
shared_recs
,
int
shared_rec_count
,
int
shared_rec_count
)
void
**
buffer
,
int
*
size
)
{
{
int
nprocs
;
int
nprocs
;
int
result
;
int
result
;
...
@@ -233,6 +244,19 @@ static void bgq_shutdown(
...
@@ -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 */
/* non-zero ranks throw out their BGQ record */
if
(
my_rank
!=
0
)
if
(
my_rank
!=
0
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment