Skip to content

Commit

Permalink
added PIOc_free_iosystem()
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jun 4, 2019
1 parent ba3e18d commit 5b652fb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/clib/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
23 changes: 20 additions & 3 deletions src/clib/pioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/cunit/test_darray_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 5b652fb

Please sign in to comment.