From ff6a067c34a776099e53f4fd069bb214e31f917e Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Fri, 5 Jul 2019 15:33:55 -0600 Subject: [PATCH] added nc_free_decomp --- src/clib/pio.h | 3 +++ src/ncint/ncint_pio.c | 13 ++++++++++++- tests/ncint/tst_pio_udf.c | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/clib/pio.h b/src/clib/pio.h index 94c2f1281e0..d203190042c 100644 --- a/src/clib/pio.h +++ b/src/clib/pio.h @@ -1256,6 +1256,9 @@ extern "C" { int maplen, const size_t *compmap, int *ioidp, int rearranger, const size_t *iostart, const size_t *iocount); + + int nc_free_decomp(int ioid); + #if defined(__cplusplus) } #endif diff --git a/src/ncint/ncint_pio.c b/src/ncint/ncint_pio.c index 495d593a023..e58e1866fad 100644 --- a/src/ncint/ncint_pio.c +++ b/src/ncint/ncint_pio.c @@ -46,7 +46,7 @@ nc_free_iosystem(int iosysid) } /** - * Same as PIOc_init_decomp() + * Same as PIOc_init_decomp(). * * @author Ed Hartnett */ @@ -61,3 +61,14 @@ nc_init_decomp(int iosysid, int pio_type, int ndims, const int *gdimlen, (const PIO_Offset *)iostart, (const PIO_Offset *)iocount); } + +/** + * Same as PIOc_freedecomp(). + * + * @author Ed Hartnett + */ +int +nc_free_decomp(int ioid) +{ + return PIOc_freedecomp(diosysid, ioid); +} diff --git a/tests/ncint/tst_pio_udf.c b/tests/ncint/tst_pio_udf.c index 9d79ae573ed..55758312dd6 100644 --- a/tests/ncint/tst_pio_udf.c +++ b/tests/ncint/tst_pio_udf.c @@ -83,6 +83,9 @@ main(int argc, char **argv) if (nc_open(FILE_NAME, NC_UDF0, &ncid)) ERR; if (nc_close(ncid)) ERR; + /* Free the decomposition. */ + if (nc_free_decomp(ioid)) ERR; + /* Close the iosystem. */ if (nc_free_iosystem(iosysid)) ERR; }