Skip to content

Commit

Permalink
more progress adding mpe logging to test_async_perf
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jun 21, 2019
1 parent d751fe7 commit a01cea3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 20 deletions.
21 changes: 15 additions & 6 deletions src/clib/pioc_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,25 @@ PIOc_set_log_level(int level)
/* This array holds even numbers for MPE. */
int event_num[2][NUM_EVENTS];

/* This keeps track of whether MPE has been initialized. */
int mpe_logging_initialized = 0;

/** This will set up the MPE logging event numbers. The calling
* program must call MPE_Init_log() before this function is
* called. MPE must be installed, get it from
* https://www.mcs.anl.gov/research/projects/perfvis/software/MPE/.
* program does not need to call MPE_Init_log(), that is done by the
* mpe library in MPI_Init(). MPE must be installed, get it from
* https://www.mcs.anl.gov/research/projects/perfvis/software/MPE/. PIO
* and the whole I/O stack must be built with MPE.
*
* @param my_rank rank of processor in MPI_COMM_WORLD.
* @author Ed Hartnett
*/
int
init_mpe(int my_rank)
{
/* If we've already initialized MPE states, just return. */
if (mpe_logging_initialized++)
return 0;

/* Get a bunch of event numbers. */
event_num[START][INIT] = MPE_Log_get_event_number();
event_num[END][INIT] = MPE_Log_get_event_number();
Expand All @@ -195,11 +203,12 @@ init_mpe(int my_rank)
event_num[START][DARRAY_READ] = MPE_Log_get_event_number();
event_num[END][DARRAY_READ] = MPE_Log_get_event_number();

/* Available colors: "white", "black", "red", "yellow", "green",
"cyan", "blue", "magenta", "aquamarine", "forestgreen",
"orange", "marroon", "brown", "pink", "coral", "gray" */
/* On rank 0, set up the info states. */
if (!my_rank)
{
/* Available colors: "white", "black", "red", "yellow", "green",
"cyan", "blue", "magenta", "aquamarine", "forestgreen",
"orange", "marroon", "brown", "pink", "coral", "gray" */
MPE_Describe_info_state(event_num[START][INIT], event_num[END][INIT],
"PIO init", "green", "%s");
MPE_Describe_info_state(event_num[START][DECOMP],
Expand Down
22 changes: 19 additions & 3 deletions tests/cunit/test_async_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
#define LON_LEN 3

/* The length of our sample data along each dimension. */
#define X_DIM_LEN 1024
#define Y_DIM_LEN 1024
#define Z_DIM_LEN 256
#define X_DIM_LEN 128
#define Y_DIM_LEN 128
#define Z_DIM_LEN 32
/* #define X_DIM_LEN 1024 */
/* #define Y_DIM_LEN 1024 */
/* #define Z_DIM_LEN 256 */

/* The number of timesteps of data to write. */
#define NUM_TIMESTEPS 3
Expand All @@ -58,6 +61,11 @@ char dim_name[NDIM4][PIO_MAX_NAME + 1] = {"unlim", "x", "y", "z"};

#define NUM_VAR_SETS 2

#ifdef USE_MPE
/* This array holds even numbers for MPE. */
int test_event[2][TEST_NUM_EVENTS];
#endif /* USE_MPE */

/* Create the decomposition to divide the 4-dimensional sample data
* between the 4 tasks. For the purposes of decomposition we are only
* concerned with 3 dimensions - we ignore the unlimited dimension.
Expand Down Expand Up @@ -213,6 +221,14 @@ int main(int argc, char **argv)
/* Initialize test. */
if ((ret = pio_test_init2(argc, argv, &my_rank, &ntasks, 1, 0, -1, &test_comm)))
ERR(ERR_INIT);

#ifdef USE_MPE
/* If --enable-mpe was specified at configure, start MPE
* logging. */
if (init_mpe_test_logging(my_rank, test_event))
return ERR_AWFUL;
#endif /* USE_MPE */

if ((ret = PIOc_set_iosystem_error_handling(PIO_DEFAULT, PIO_RETURN_ERROR, NULL)))
return ret;

Expand Down
2 changes: 1 addition & 1 deletion tests/cunit/test_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ init_mpe_test_logging(int my_rank, int test_event[][TEST_NUM_EVENTS])
test_event[START][TEST_CALCULATE] = MPE_Log_get_event_number();
test_event[END][TEST_CALCULATE] = MPE_Log_get_event_number();

/* Set up MPE states. */
/* Set up MPE states. This only happens on rank 0. */
if (!my_rank)
{
MPE_Describe_info_state(test_event[START][TEST_INIT], test_event[END][TEST_INIT],
Expand Down
19 changes: 9 additions & 10 deletions tests/cunit/test_perf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
#define NDIM3 3

/* The length of our sample data along each dimension. */
/* #define X_DIM_LEN 128 */
/* #define Y_DIM_LEN 128 */
/* #define Z_DIM_LEN 32 */
#define X_DIM_LEN 1024
#define Y_DIM_LEN 1024
#define Z_DIM_LEN 128
#define X_DIM_LEN 128
#define Y_DIM_LEN 128
#define Z_DIM_LEN 32
/* #define X_DIM_LEN 1024 */
/* #define Y_DIM_LEN 1024 */
/* #define Z_DIM_LEN 128 */

/* The number of timesteps of data to write. */
#define NUM_TIMESTEPS 10
Expand Down Expand Up @@ -63,10 +63,8 @@ int dim_len[NDIM] = {NC_UNLIMITED, X_DIM_LEN, Y_DIM_LEN, Z_DIM_LEN};
#define NUM_REARRANGERS_TO_TEST 2

#ifdef USE_MPE

/* This array holds even numbers for MPE. */
int test_event[2][TEST_NUM_EVENTS];

#endif /* USE_MPE */

/* Create the decomposition to divide the 4-dimensional sample data
Expand Down Expand Up @@ -444,11 +442,12 @@ main(int argc, char **argv)
ERR(ERR_INIT);

#ifdef USE_MPE
if (init_mpe_test_logging(my_rank, test_event))
/* If --enable-mpe was specified at configure, start MPE
* logging. */
if (init_mpe_test_logging(my_rank, test_event))
return ERR_AWFUL;
#endif /* USE_MPE */


if ((ret = PIOc_set_iosystem_error_handling(PIO_DEFAULT, PIO_RETURN_ERROR, NULL)))
return ret;

Expand Down

0 comments on commit a01cea3

Please sign in to comment.