Skip to content

Commit

Permalink
changed nc_init_decomp to nc_def_decomp
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 17, 2019
1 parent 233a8c9 commit 7408927
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
63 changes: 33 additions & 30 deletions src/clib/pio.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file
* Public headers for the PIO C interface.
* @author Jim Edwards
* @author Jim Edwards, Ed Hartnett
* @date 2014
*
* @see https://github.com/NCAR/ParallelIO
Expand Down Expand Up @@ -1256,65 +1256,68 @@ extern "C" {
/* Get the default IOsystem ID. */
int nc_get_iosystem(int *iosysid);

/* Release the resources associated with an iosystem. */
int nc_free_iosystem(int iosysid);

int nc_init_decomp(int iosysid, int pio_type, int ndims, const int *gdimlen,
int maplen, const size_t *compmap, int *ioidp,
int rearranger, const size_t *iostart,
const size_t *iocount);
/* Define a decomposition for distributed arrays. */
int nc_def_decomp(int iosysid, int pio_type, int ndims, const int *gdimlen,
int maplen, const size_t *compmap, int *ioidp,
int rearranger, const size_t *iostart,
const size_t *iocount);

/* Release resources associated with a decomposition. */
int nc_free_decomp(int ioid);

/* Data reads - vard. */
/* Data reads - read a distributed array. */
int nc_get_vard(int ncid, int varid, int decompid, const size_t recnum, void *buf);
int nc_get_vard_text(int ncid, int varid, int decompid, const size_t recnum,
char *buf);
char *buf);
int nc_get_vard_schar(int ncid, int varid, int decompid, const size_t recnum,
signed char *buf);
signed char *buf);
int nc_get_vard_short(int ncid, int varid, int decompid, const size_t recnum,
short *buf);
short *buf);
int nc_get_vard_int(int ncid, int varid, int decompid, const size_t recnum,
int *buf);
int *buf);
int nc_get_vard_float(int ncid, int varid, int decompid, const size_t recnum,
float *buf);
float *buf);
int nc_get_vard_double(int ncid, int varid, int decompid, const size_t recnum,
double *buf);
double *buf);
int nc_get_vard_uchar(int ncid, int varid, int decompid, const size_t recnum,
unsigned char *buf);
unsigned char *buf);
int nc_get_vard_ushort(int ncid, int varid, int decompid, const size_t recnum,
unsigned short *buf);
unsigned short *buf);
int nc_get_vard_uint(int ncid, int varid, int decompid, const size_t recnum,
unsigned int *buf);
unsigned int *buf);
int nc_get_vard_longlong(int ncid, int varid, int decompid, const size_t recnum,
long long *buf);
long long *buf);
int nc_get_vard_ulonglong(int ncid, int varid, int decompid, const size_t recnum,
unsigned long long *buf);
unsigned long long *buf);

/* Data writes - vard. */
/* Data writes - Write a distributed array. */
int nc_put_vard(int ncid, int varid, int decompid, const size_t recnum,
const void *buf);
const void *buf);
int nc_put_vard_text(int ncid, int varid, int decompid, const size_t recnum,
const char *op);
const char *op);
int nc_put_vard_schar(int ncid, int varid, int decompid, const size_t recnum,
const signed char *op);
const signed char *op);
int nc_put_vard_short(int ncid, int varid, int decompid, const size_t recnum,
const short *op);
const short *op);
int nc_put_vard_int(int ncid, int varid, int decompid, const size_t recnum,
const int *op);
const int *op);
int nc_put_vard_float(int ncid, int varid, int decompid, const size_t recnum,
const float *op);
const float *op);
int nc_put_vard_double(int ncid, int varid, int decompid, const size_t recnum,
const double *op);
const double *op);
int nc_put_vard_uchar(int ncid, int varid, int decompid, const size_t recnum,
const unsigned char *op);
const unsigned char *op);
int nc_put_vard_ushort(int ncid, int varid, int decompid, const size_t recnum,
const unsigned short *op);
const unsigned short *op);
int nc_put_vard_uint(int ncid, int varid, int decompid, const size_t recnum,
const unsigned int *op);
const unsigned int *op);
int nc_put_vard_longlong(int ncid, int varid, int decompid, const size_t recnum,
const long long *op);
const long long *op);
int nc_put_vard_ulonglong(int ncid, int varid, int decompid, const size_t recnum,
const unsigned long long *op);
const unsigned long long *op);

#if defined(__cplusplus)
}
Expand Down
6 changes: 3 additions & 3 deletions src/ncint/ncint_pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ nc_free_iosystem(int iosysid)
* @author Ed Hartnett
*/
int
nc_init_decomp(int iosysid, int pio_type, int ndims, const int *gdimlen,
nc_def_decomp(int iosysid, int pio_type, int ndims, const int *gdimlen,
int maplen, const size_t *compmap, int *ioidp,
int rearranger, const size_t *iostart,
const size_t *iocount)
int rearranger, const size_t *iostart,
const size_t *iocount)
{
return PIOc_init_decomp(iosysid, pio_type, ndims, gdimlen, maplen,
(const PIO_Offset *)compmap, ioidp, rearranger,
Expand Down
4 changes: 2 additions & 2 deletions tests/ncint/tst_pio_udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ main(int argc, char **argv)
compdof[i] = my_rank * elements_per_pe + i;

/* Create the PIO decomposition for this test. */
if (nc_init_decomp(iosysid, PIO_INT, NDIM2, &dimlen[1], elements_per_pe,
compdof, &ioid, 1, NULL, NULL)) ERR;
if (nc_def_decomp(iosysid, PIO_INT, NDIM2, &dimlen[1], elements_per_pe,
compdof, &ioid, 1, NULL, NULL)) ERR;
free(compdof);

/* Create some data on this processor. */
Expand Down

0 comments on commit 7408927

Please sign in to comment.