Skip to content

Commit

Permalink
added endianness
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Sep 3, 2020
1 parent f97e666 commit 73eaa0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ncint/ncintdispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,9 @@ PIO_NCINT_inq_var_all(int ncid, int varid, char *name, nc_type *xtypep,

if (!ret)
ret = PIOc_inq_var_deflate(ncid, varid, shufflep, deflatep, deflate_levelp);

if (!ret)
ret = PIOc_inq_var_endian(ncid, varid, endiannessp);

return ret;
}
Expand Down
5 changes: 5 additions & 0 deletions tests/ncint/tst_var_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ run_var_compress_test(int my_rank, int ntasks, int iosysid)
int shuffle_in, deflate_in, deflate_level_in, storage_in;
int *data_in;
size_t chunksizes_in[NDIM3];
int endian_in;
int d;

/* Open the file. */
Expand All @@ -87,6 +88,10 @@ run_var_compress_test(int my_rank, int ntasks, int iosysid)
for (d = 0; d < NDIM3; d++)
if (chunksizes_in[d] != chunksizes[d]) PERR;
if (storage_in != NC_CHUNKED) PERR;

/* Check the endianness. */
if (nc_inq_var_endian(ncid, 0, &endian_in)) PERR;
if (endian_in != NC_ENDIAN_BIG) PERR;

/* Read distributed arrays. */
if (!(data_in = malloc(elements_per_pe * sizeof(int)))) PERR;
Expand Down

0 comments on commit 73eaa0c

Please sign in to comment.