From 188b8df98532c72b64f083e64a2c36541adfd1cf Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Thu, 3 May 2018 09:25:38 -0600 Subject: [PATCH] added some logging statements --- src/clib/pio_rearrange.c | 11 ++++++++++- src/clib/pioc.c | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/clib/pio_rearrange.c b/src/clib/pio_rearrange.c index 8ee13f411e6..10f1afe256c 100644 --- a/src/clib/pio_rearrange.c +++ b/src/clib/pio_rearrange.c @@ -1830,6 +1830,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma } /* Handle fill values if needed. */ + LOG((4, "ios->ioproc %d iodesc->needsfill %d", ios->ioproc, iodesc->needsfill)); if (ios->ioproc && iodesc->needsfill) { /* we need the list of offsets which are not in the union of iomap */ @@ -1844,6 +1845,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma thisgridsize[0] = totalgridsize / ios->num_iotasks; thisgridmax[0] = thisgridsize[0]; int xtra = totalgridsize - thisgridsize[0] * ios->num_iotasks; + LOG((4, "xtra %d", xtra)); for (nio = 0; nio < ios->num_iotasks; nio++) { @@ -1855,7 +1857,9 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma if (nio >= ios->num_iotasks - xtra) thisgridsize[nio]++; thisgridmin[nio] = thisgridmax[nio - 1] + 1; - thisgridmax[nio]= thisgridmin[nio] + thisgridsize[nio] - 1; + thisgridmax[nio] = thisgridmin[nio] + thisgridsize[nio] - 1; + LOG((4, "nio %d thisgridsize[nio] %d thisgridmin[nio] %d thisgridmax[nio] %d", + nio, thisgridsize[nio], thisgridmin[nio], thisgridmax[nio])); } for (int i = 0; i < iodesc->llen; i++) { @@ -1866,6 +1870,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma imin = i; } } + LOG((4, "cnt %d", cnt)); /* Gather cnt from all tasks in the IO communicator into array gcnt. */ if ((mpierr = MPI_Gather(&cnt, 1, MPI_INT, gcnt, 1, MPI_INT, nio, ios->io_comm))) @@ -1893,6 +1898,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma /* Allocate and initialize a grid to fill in missing values. ??? */ PIO_Offset grid[thisgridsize[ios->io_rank]]; + LOG((4, "thisgridsize[ios->io_rank] %d", thisgridsize[ios->io_rank])); for (i = 0; i < thisgridsize[ios->io_rank]; i++) grid[i] = 0; @@ -1902,6 +1908,7 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma int j = myusegrid[i] - thisgridmin[ios->io_rank]; pioassert(j < thisgridsize[ios->io_rank], "out of bounds array index", __FILE__, __LINE__); + LOG((4, "i %d myusegrid[i] %d j %d", i, myusegrid[i], j)); if (j >= 0) { grid[j] = 1; @@ -1912,6 +1919,8 @@ int subset_rearrange_create(iosystem_desc_t *ios, int maplen, PIO_Offset *compma free(myusegrid); iodesc->holegridsize = thisgridsize[ios->io_rank] - cnt; + LOG((3, "iodesc->holegridsize %d thisgridsize[%d] %d cnt %d", iodesc->holegridsize, ios->io_rank, + thisgridsize[ios->io_rank], cnt)); if (iodesc->holegridsize > 0) { /* Allocate space for the fillgrid. */ diff --git a/src/clib/pioc.c b/src/clib/pioc.c index f375621408e..037b64720ed 100644 --- a/src/clib/pioc.c +++ b/src/clib/pioc.c @@ -496,7 +496,10 @@ int PIOc_InitDecomp(int iosysid, int pio_type, int ndims, const int *gdimlen, in if (!(iodesc->map = malloc(sizeof(PIO_Offset) * maplen))) return pio_err(ios, NULL, PIO_ENOMEM, __FILE__, __LINE__); for (int m = 0; m < maplen; m++) + { iodesc->map[m] = compmap[m]; + LOG((4, "compmap[%d] = %d", m, compmap[m])); + } /* Remember the dim sizes. */ if (!(iodesc->dimlen = malloc(sizeof(int) * ndims)))