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 3d9a113 commit 6c20479
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/clib/pio_darray.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,12 @@ PIOc_read_darray(int ncid, int varid, int ioid, PIO_Offset arraylen,
int ierr; /* Return code. */
void *tmparray; /* unsorted copy of array buf if required */

#ifdef USE_MPE
if ((ierr = MPE_Log_event(event_num[START][DARRAY_READ], 0,
"PIOc_read_darray")))
return pio_err(NULL, NULL, PIO_EIO, __FILE__, __LINE__);
#endif /* USE_MPE */

/* Get the file info. */
if ((ierr = pio_get_file(ncid, &file)))
return pio_err(NULL, NULL, PIO_EBADID, __FILE__, __LINE__);
Expand Down Expand Up @@ -958,5 +964,11 @@ PIOc_read_darray(int ncid, int varid, int ioid, PIO_Offset arraylen,
if (rlen > 0)
brel(iobuf);

#ifdef USE_MPE
if ((ierr = MPE_Log_event(event_num[END][DARRAY_READ], 0,
"PIOc_read_darray")))
return pio_err(ios, file, PIO_EIO, __FILE__, __LINE__);
#endif /* USE_MPE */

return PIO_NOERR;
}
8 changes: 4 additions & 4 deletions src/clib/pio_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ void pio_log(int severity, const char *fmt, ...);
#define INIT 0
#define DECOMP 1
#define CREATE 2
#define DARRAY_WRITE 3
#define CLOSE 4
#define CALCULATE 5
#define INGEST 6
#define OPEN 3
#define DARRAY_WRITE 4
#define DARRAY_READ 5
#define CLOSE 6
#endif /* USE_MPE */

#if defined(__cplusplus)
Expand Down
20 changes: 10 additions & 10 deletions src/clib/pioc_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ init_mpe(int my_rank)
event_num[END][INIT] = MPE_Log_get_event_number();
event_num[START][DECOMP] = MPE_Log_get_event_number();
event_num[END][DECOMP] = MPE_Log_get_event_number();
event_num[START][INGEST] = MPE_Log_get_event_number();
event_num[END][INGEST] = MPE_Log_get_event_number();
event_num[START][CLOSE] = MPE_Log_get_event_number();
event_num[END][CLOSE] = MPE_Log_get_event_number();
event_num[START][CALCULATE] = MPE_Log_get_event_number();
event_num[END][CALCULATE] = MPE_Log_get_event_number();
event_num[START][CREATE] = MPE_Log_get_event_number();
event_num[END][CREATE] = MPE_Log_get_event_number();
event_num[START][OPEN] = MPE_Log_get_event_number();
event_num[END][OPEN] = MPE_Log_get_event_number();
event_num[START][DARRAY_WRITE] = MPE_Log_get_event_number();
event_num[END][DARRAY_WRITE] = MPE_Log_get_event_number();
event_num[START][DARRAY_READ] = MPE_Log_get_event_number();
event_num[END][DARRAY_READ] = MPE_Log_get_event_number();
event_num[START][CLOSE] = MPE_Log_get_event_number();
event_num[END][CLOSE] = MPE_Log_get_event_number();

/* You should track at least initialization and partitioning, data
* ingest, update computation, all communications, any memory
Expand All @@ -200,12 +200,12 @@ init_mpe(int my_rank)
if (!my_rank)
{
MPE_Describe_state(event_num[START][INIT], event_num[END][INIT], "init", "red");
MPE_Describe_state(event_num[START][INGEST], event_num[END][INGEST], "ingest", "yellow");
MPE_Describe_state(event_num[START][DECOMP], event_num[END][DECOMP], "decomposition", "green");
MPE_Describe_state(event_num[START][CALCULATE], event_num[END][CALCULATE], "calculate", "orange");
MPE_Describe_state(event_num[START][CREATE], event_num[END][CREATE], "create", "purple");
MPE_Describe_state(event_num[START][CLOSE], event_num[END][CLOSE], "close file", "blue");
MPE_Describe_state(event_num[START][CREATE], event_num[END][CREATE], "create file", "purple");
MPE_Describe_state(event_num[START][OPEN], event_num[END][OPEN], "open file", "orange");
MPE_Describe_state(event_num[START][DARRAY_WRITE], event_num[END][DARRAY_WRITE], "darray write", "pink");
MPE_Describe_state(event_num[START][DARRAY_READ], event_num[END][DARRAY_WRITE], "darray read", "brown");
MPE_Describe_state(event_num[START][CLOSE], event_num[END][CLOSE], "close file", "blue");
}
return 0;
}
Expand Down

0 comments on commit 6c20479

Please sign in to comment.