Skip to content

Commit

Permalink
more test in test_async_1d
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Sep 4, 2019
1 parent 9682bb2 commit 5eaa61d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/clib/pio_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,10 @@ PIOc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp,
char my_name[NC_MAX_NAME + 1];
nc_type my_xtype;
int my_ndims = 0, my_dimids[ndims], my_natts = 0;
ierr = nc_inq_var(file->fh, varid, my_name, &my_xtype, &my_ndims, my_dimids, &my_natts);
PLOG((3, "my_name = %s my_xtype = %d my_ndims = %d my_natts = %d", my_name, my_xtype, my_ndims, my_natts));
ierr = nc_inq_var(file->fh, varid, my_name, &my_xtype, &my_ndims, my_dimids,
&my_natts);
PLOG((3, "my_name = %s my_xtype = %d my_ndims = %d my_natts = %d", my_name,
my_xtype, my_ndims, my_natts));
if (!ierr)
{
if (name)
Expand Down
17 changes: 16 additions & 1 deletion tests/cunit/test_async_1d.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ int main(int argc, char **argv)

PIOc_set_log_level(4);

/* Change error handling so we can test inval parameters. */
if ((ret = PIOc_set_iosystem_error_handling(PIO_DEFAULT, PIO_RETURN_ERROR, NULL)))
return ret;

/* Set up IO system. Task 0 will do IO, tasks 1-3 will be a single
* computational unit. Task 0 will stay in this function until the
* computational component calls PIOc_finalize(). */
Expand All @@ -82,6 +86,7 @@ int main(int argc, char **argv)
int gdimlen[NDIM1] = {DIM_LEN_1};
PIO_Offset compmap[MAPLEN];
int varid;
int data;
int ioid;

/* Create a file. */
Expand All @@ -93,6 +98,8 @@ int main(int argc, char **argv)
ERR(ret);
if ((ret = PIOc_def_var(ncid, VAR_NAME, PIO_INT, NDIM2, dimid, &varid)))
ERR(ret);
if ((ret = PIOc_def_var_fill(ncid, varid, PIO_NOFILL, NULL)))
ERR(ret);
if ((ret = PIOc_enddef(ncid)))
ERR(ret);

Expand All @@ -103,13 +110,21 @@ int main(int argc, char **argv)
if ((ret = PIOc_init_decomp(iosysid, PIO_INT, NDIM1, gdimlen, MAPLEN,
compmap, &ioid, PIO_REARR_BOX, NULL, NULL)))
ERR(ret);
if ((ret = PIOc_freedecomp(iosysid, ioid)))

/* Write a record of data. */
if ((ret = PIOc_setframe(ncid, 0, 0)))
ERR(ret);
if ((ret = PIOc_write_darray(ncid, 0, ioid, MAPLEN, &data, NULL)))
ERR(ret);

/* Close the file. */
if ((ret = PIOc_closefile(ncid)))
ERR(ret);

/* Free the decomposition. */
if ((ret = PIOc_freedecomp(iosysid, ioid)))
ERR(ret);

/* Shut down the IO system. */
if ((ret = PIOc_finalize(iosysid)))
ERR(ret);
Expand Down

0 comments on commit 5eaa61d

Please sign in to comment.