From 5b652fbca607d44de3931fbb073addf786a5e67d Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Tue, 4 Jun 2019 14:32:00 -0600 Subject: [PATCH] added PIOc_free_iosystem() --- src/clib/pio.h | 5 ++++- src/clib/pioc.c | 23 ++++++++++++++++++++--- tests/cunit/test_darray_async.c | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/clib/pio.h b/src/clib/pio.h index 8bc5f38542c..481898aa772 100644 --- a/src/clib/pio.h +++ b/src/clib/pio.h @@ -840,9 +840,12 @@ extern "C" { int PIOc_Init_Intracomm(MPI_Comm comp_comm, int num_iotasks, int stride, int base, int rearr, int *iosysidp); - /* Shut down iosystem and free all associated resources. */ + /* Shut down an iosystem and free all associated resources. */ int PIOc_finalize(int iosysid); + /* Shut down an iosystem and free all associated resources. */ + int PIOc_free_iosystem(int iosysid); + /* Set error handling for entire io system. */ int PIOc_Set_IOSystem_Error_Handling(int iosysid, int method); diff --git a/src/clib/pioc.c b/src/clib/pioc.c index 0d12225e9f7..d906fe6c5bc 100644 --- a/src/clib/pioc.c +++ b/src/clib/pioc.c @@ -1131,10 +1131,27 @@ PIOc_set_hint(int iosysid, const char *hint, const char *hintval) } /** - * Clean up internal data structures, free MPI resources, and exit the - * pio library. + * Clean up internal data structures, and free MPI resources, + * associated with an IOSystem. * - * @param iosysid: the io system ID provided by PIOc_Init_Intracomm(). + * @param iosysid: the io system ID provided by PIOc_Init_Intracomm() + * or PIOc_init_async(). + * @returns 0 for success or non-zero for error. + * @ingroup PIO_finalize_c + * @author Ed Hartnett + */ +int +PIOc_free_iosystem(int iosysid) +{ + return PIOc_finalize(iosysid); +} + +/** + * Clean up internal data structures, and free MPI resources, + * associated with an IOSystem. + * + * @param iosysid: the io system ID provided by PIOc_Init_Intracomm() + * or PIOc_init_async(). * @returns 0 for success or non-zero for error. * @ingroup PIO_finalize_c * @author Jim Edwards, Ed Hartnett diff --git a/tests/cunit/test_darray_async.c b/tests/cunit/test_darray_async.c index b5786d6299d..d8dd7a62334 100644 --- a/tests/cunit/test_darray_async.c +++ b/tests/cunit/test_darray_async.c @@ -542,7 +542,7 @@ int main(int argc, char **argv) return ret; /* Finalize PIO system. */ - if ((ret = PIOc_finalize(iosysid))) + if ((ret = PIOc_free_iosystem(iosysid))) return ret; /* Free the computation conomponent communicator. */