Skip to content

Commit

Permalink
adding more 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 2704459 commit 5b46dab
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
46 changes: 39 additions & 7 deletions tests/cunit/test_async_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,20 @@ int test_event[2][TEST_NUM_EVENTS];
* @param ioid a pointer that gets the ID of this decomposition.
* @returns 0 for success, error code otherwise.
**/
int create_decomposition_3d(int ntasks, int my_rank, int iosysid, int *ioid, PIO_Offset *elements_per_pe)
int
create_decomposition_3d(int ntasks, int my_rank, int iosysid, int *ioid,
PIO_Offset *elements_per_pe)
{
PIO_Offset my_elem_per_pe; /* Array elements per processing unit. */
PIO_Offset *compdof; /* The decomposition mapping. */
int dim_len_3d[NDIM3] = {X_DIM_LEN, Y_DIM_LEN, Z_DIM_LEN};
int my_proc_rank = my_rank - 1;
int ret;

#ifdef USE_MPE
test_start_mpe_log(TEST_DECOMP);
#endif /* USE_MPE */

/* How many data elements per task? */
my_elem_per_pe = X_DIM_LEN * Y_DIM_LEN * Z_DIM_LEN / ntasks;
if (elements_per_pe)
Expand All @@ -107,6 +113,14 @@ int create_decomposition_3d(int ntasks, int my_rank, int iosysid, int *ioid, PIO
/* Free the mapping. */
free(compdof);

#ifdef USE_MPE
{
char msg[MPE_MAX_MSG_LEN + 1];
sprintf(msg, "elements_per_pe %lld", my_elem_per_pe);
test_stop_mpe_log(TEST_DECOMP, msg);
}
#endif /* USE_MPE */

return 0;
}

Expand Down Expand Up @@ -157,7 +171,7 @@ run_darray_async_test(int iosysid, int fmt, int my_rank, int ntasks, int niotask

#ifdef USE_MPE
{
char msg[PIO_MAX_NAME + 1];
char msg[MPE_MAX_MSG_LEN + 1];
sprintf(msg, "iotype %d", flavor[fmt]);
test_stop_mpe_log(TEST_CREATE, msg);
}
Expand All @@ -182,6 +196,10 @@ run_darray_async_test(int iosysid, int fmt, int my_rank, int ntasks, int niotask

for (t = 0; t < NUM_TIMESTEPS; t++)
{
#ifdef USE_MPE
test_start_mpe_log(TEST_DARRAY_WRITE);
#endif /* USE_MPE */

/* Set the record number for the record vars. */
if ((ret = PIOc_setframe(ncid, varid, t)))
BAIL(ret);
Expand All @@ -191,13 +209,15 @@ run_darray_async_test(int iosysid, int fmt, int my_rank, int ntasks, int niotask
my_data_int, NULL)))
BAIL(ret);

/* Sync the file. */
if ((ret = PIOc_sync(ncid)))
BAIL(ret);

#ifdef USE_MPE
{
char msg[MPE_MAX_MSG_LEN + 1];
sprintf(msg, "timestep %d", t);
test_stop_mpe_log(TEST_DARRAY_WRITE, msg);
}
#endif /* USE_MPE */
}


/* Close the file. */
if ((ret = PIOc_closefile(ncid)))
BAIL(ret);
Expand Down Expand Up @@ -276,6 +296,10 @@ int main(int argc, char **argv)
float delta_in_sec;
float mb_per_sec;

#ifdef USE_MPE
test_start_mpe_log(TEST_INIT);
#endif /* USE_MPE */

/* Start the clock. */
if (!my_rank)
{
Expand All @@ -288,6 +312,14 @@ int main(int argc, char **argv)
PIO_REARR_BOX, &iosysid)))
ERR(ERR_INIT);

#ifdef USE_MPE
{
char msg[MPE_MAX_MSG_LEN + 1];
sprintf(msg, "num IO procs %d", num_io_procs[niotest]);
test_stop_mpe_log(TEST_INIT, msg);
}
#endif /* USE_MPE */

/* This code runs only on computation components. */
if (my_rank >= num_io_procs[niotest])
{
Expand Down
6 changes: 3 additions & 3 deletions tests/cunit/test_perf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ test_darray(int iosysid, int ioid, int num_flavors, int *flavor,

#ifdef USE_MPE
{
char msg[PIO_MAX_NAME + 1];
char msg[MPE_MAX_MSG_LEN + 1];
sprintf(msg, "iotype %d rearr %d", flavor[fmt], rearranger);
test_stop_mpe_log(TEST_CREATE, msg);
}
Expand Down Expand Up @@ -219,7 +219,7 @@ test_darray(int iosysid, int ioid, int num_flavors, int *flavor,

#ifdef USE_MPE
{
char msg[PIO_MAX_NAME + 1];
char msg[MPE_MAX_MSG_LEN + 1];
sprintf(msg, "write_darray timestep %d", t);
test_stop_mpe_log(TEST_DARRAY_WRITE, msg);
}
Expand All @@ -238,7 +238,7 @@ test_darray(int iosysid, int ioid, int num_flavors, int *flavor,

#ifdef USE_MPE
{
char msg[PIO_MAX_NAME + 1];
char msg[MPE_MAX_MSG_LEN + 1];
sprintf(msg, "closed ncid %d", ncid);
test_stop_mpe_log(TEST_CLOSE, msg);
}
Expand Down

0 comments on commit 5b46dab

Please sign in to comment.