Skip to content

Commit

Permalink
added some logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed May 3, 2018
1 parent 377413b commit 188b8df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/clib/pio_rearrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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++)
{
Expand All @@ -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++)
{
Expand All @@ -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)))
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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. */
Expand Down
3 changes: 3 additions & 0 deletions src/clib/pioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 188b8df

Please sign in to comment.