Skip to content

Commit

Permalink
getting better
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Feb 15, 2018
1 parent d1d754b commit f8c9adc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/clib/pio_darray_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,20 +353,24 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *
gdims[0] = gdim0;
sa_ndims = fndims;
dim_offset = 0;
for (int i=1; i < fndims; i++)
gdims[i] = iodesc->dimlen[i-1];
}
else
{
sa_ndims = ndims;
dim_offset = 1;
for (int i=0; i < ndims; i++)
gdims[i] = iodesc->dimlen[i];
}
}
else
{
sa_ndims = fndims;
dim_offset = 0;
for (int i=0; i < fndims; i++)
gdims[i] = iodesc->dimlen[i];
}
for (int i=dim_offset; i<fndims; i++)
gdims[i] = iodesc->dimlen[i-dim_offset];

for (int i=dim_offset; i< fndims; i++)
{
Expand All @@ -379,7 +383,7 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *
sastart[0] = frame[nv];

for (int i=0; i< sa_ndims; i++)
LOG((3, "vard: sastart[%d]=%d sacount[%d]=%d", i,sastart[i], i,sacount[i]));
LOG((3, "vard: sastart[%d]=%d sacount[%d]=%d gdims[%d]=%d %ld %ld", i,sastart[i], i,sacount[i], i, gdims[i], start[i], count[i]));
if((mpierr = MPI_Type_create_subarray(sa_ndims, gdims,
sacount, sastart,MPI_ORDER_C
,iodesc->mpitype, subarray + rc)))
Expand Down Expand Up @@ -1459,7 +1463,7 @@ int flush_output_buffer(file_desc_t *file, bool force, PIO_Offset addsize)

/* If we are not forcing a flush, spread the usage to all IO
* tasks. */
if (!force && file->iosystem->io_comm != MPI_COMM_NULL)
if (!force && file->iosystem->ioproc)
{
usage += addsize;
if ((mpierr = MPI_Allreduce(MPI_IN_PLACE, &usage, 1, MPI_OFFSET, MPI_MAX,
Expand Down
2 changes: 1 addition & 1 deletion src/clib/pio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ int PIOc_sync(int ncid)
#ifdef _PNETCDF
case PIO_IOTYPE_PNETCDF:
flush_output_buffer(file, true, 0);
ierr = ncmpi_sync(file->fh);
/* ierr = ncmpi_sync(file->fh); */
break;
#endif
default:
Expand Down

0 comments on commit f8c9adc

Please sign in to comment.