Skip to content

Commit

Permalink
undo broken warning fix
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jan 8, 2018
1 parent 77273d2 commit e6b38f2
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/clib/pio_darray_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *
{
iosystem_desc_t *ios; /* Pointer to io system information. */
var_desc_t *vdesc; /* Pointer to var info struct. */
int dsize; /* Data size (for one region). */
int ierr = PIO_NOERR;

/* Check inputs. */
Expand Down Expand Up @@ -194,10 +195,13 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *
/* If this is an IO task write the data. */
if (ios->ioproc)
{
int rrcnt = 0; /* Number of subarray requests (pnetcdf only). */
void *bufptr;
size_t start[fndims];
size_t count[fndims];
int ndims = iodesc->ndims;
PIO_Offset *startlist[num_regions]; /* Array of start arrays for ncmpi_iput_varn(). */
PIO_Offset *countlist[num_regions]; /* Array of count arrays for ncmpi_iput_varn(). */

LOG((3, "num_regions = %d", num_regions));

Expand Down Expand Up @@ -237,12 +241,6 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *
#endif
#ifdef _PNETCDF
case PIO_IOTYPE_PNETCDF:
{
int dsize; /* Data size (for one region). */
int rrcnt = 0; /* Number of subarray requests (pnetcdf only). */
PIO_Offset *startlist[num_regions]; /* Array of start arrays for ncmpi_iput_varn(). */
PIO_Offset *countlist[num_regions]; /* Array of count arrays for ncmpi_iput_varn(). */

/* Get the total number of data elements we are
* writing for this region. */
dsize = 1;
Expand Down Expand Up @@ -322,7 +320,6 @@ int write_darray_multi_par(file_desc_t *file, int nvars, int fndims, const int *
}
}
break;
}
#endif
default:
return pio_err(ios, file, PIO_EBADIOTYPE, __FILE__, __LINE__);
Expand Down Expand Up @@ -797,7 +794,11 @@ int pio_read_darray_nc(file_desc_t *file, io_desc_t *iodesc, int vid, void *iobu
io_region *region;
size_t start[fndims];
size_t count[fndims];
size_t tmp_bufsize = 1;
void *bufptr;
int rrlen = 0;
PIO_Offset *startlist[iodesc->maxregions];
PIO_Offset *countlist[iodesc->maxregions];

/* buffer is incremented by byte and loffset is in terms of
the iodessc->mpitype so we need to multiply by the size of
Expand All @@ -813,6 +814,7 @@ int pio_read_darray_nc(file_desc_t *file, io_desc_t *iodesc, int vid, void *iobu
/* For each regions, read the data. */
for (int regioncnt = 0; regioncnt < iodesc->maxregions; regioncnt++)
{
tmp_bufsize = 1;
if (region == NULL || iodesc->llen == 0)
{
/* No data for this region. */
Expand Down Expand Up @@ -912,11 +914,7 @@ int pio_read_darray_nc(file_desc_t *file, io_desc_t *iodesc, int vid, void *iobu
#ifdef _PNETCDF
case PIO_IOTYPE_PNETCDF:
{
int rrlen = 0;
PIO_Offset *startlist[iodesc->maxregions];
PIO_Offset *countlist[iodesc->maxregions];
size_t tmp_bufsize = 1;

tmp_bufsize = 1;
for (int j = 0; j < fndims; j++)
tmp_bufsize *= count[j];

Expand Down Expand Up @@ -1279,12 +1277,12 @@ int pio_read_darray_nc_serial(file_desc_t *file, io_desc_t *iodesc, int vid,
*/
int flush_output_buffer(file_desc_t *file, bool force, PIO_Offset addsize)
{
int mpierr; /* Return code from MPI functions. */
int ierr = PIO_NOERR;

#ifdef _PNETCDF
var_desc_t *vdesc;
PIO_Offset usage = 0;
int mpierr; /* Return code from MPI functions. */

/* Check inputs. */
pioassert(file, "invalid input", __FILE__, __LINE__);
Expand Down

0 comments on commit e6b38f2

Please sign in to comment.