Skip to content

Commit

Permalink
more MPE logging
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jun 14, 2019
1 parent 4ce0b71 commit 3d9a113
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 14 additions & 0 deletions examples/c/darray_no_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include <gptl.h>
#endif

/* The name of this program. */
#define TEST_NAME "darray_no_async"

/* The number of possible output netCDF output flavors available to
* the ParallelIO library. */
#define NUM_NETCDF_FLAVORS 4
Expand Down Expand Up @@ -250,6 +253,12 @@ int main(int argc, char* argv[])
if ((ret = MPI_Comm_size(MPI_COMM_WORLD, &ntasks)))
MPIERR(ret);

#ifdef USE_MPE
/* If MPE logging is being used, then initialize it. */
if ((ret = MPE_Init_log()))
return ret;
#endif /* USE_MPE */

/* Check that a valid number of processors was specified. */
if (ntasks != TARGET_NTASKS)
fprintf(stderr, "Number of processors must be 16!\n");
Expand Down Expand Up @@ -368,6 +377,11 @@ int main(int argc, char* argv[])
if ((ret = PIOc_free_iosystem(iosysid)))
ERR(ret);

#ifdef USE_MPE
if ((ret = MPE_Finish_log(TEST_NAME)))
MPIERR(ret);
#endif /* USE_MPE */

/* Finalize the MPI library. */
MPI_Finalize();

Expand Down
7 changes: 5 additions & 2 deletions src/clib/pio_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,20 @@ void pio_log(int severity, const char *fmt, ...);
/* These are for the event numbers array used to log various events in
* the program with the MPE library, which produces output for the
* Jumpshot program. */
#define NUM_EVENTS 7

/* Each event has start and end. */
#define START 0
#define END 1

/* These are the events. */
#define NUM_EVENTS 7
#define INIT 0
#define DECOMP 1
#define CREATE 2
#define DARRAY_WRITE 3
#define CLOSE 4
#define CALCULATE 5
#define INGEST 6
#define ERR_LOGGING 99
#endif /* USE_MPE */

#if defined(__cplusplus)
Expand Down

0 comments on commit 3d9a113

Please sign in to comment.