Skip to content

Commit

Permalink
fixed memory leak warning in test_rearr.c
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Mar 25, 2019
1 parent 92ab215 commit c2c8d29
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/cunit/pio_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,34 @@
#endif /* _NETCDF4 */

/** Handle MPI errors. This should only be used with MPI library
* function calls. */
* function calls. Finalize and return. */
#define MPIERR(e) do { \
MPI_Error_string(e, err_buffer, &resultlen); \
fprintf(stderr, "MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \
MPI_Finalize(); \
return ERR_AWFUL; \
} while (0)

/** Handle MPI errors. This should only be used with MPI library
* function calls. Finalize and goto exit. */
#define MPIBAIL(e) do { \
MPI_Error_string(e, err_buffer, &resultlen); \
fprintf(stderr, "MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \
MPI_Finalize(); \
ret = NC_EMPI; \
goto ecit; \
} while (0)

/** Handle non-MPI errors by finalizing the MPI library and exiting
* with an exit code. */
* with an exit code. Finalize and return. */
#define ERR(e) do { \
fprintf(stderr, "%d Error %d in %s, line %d\n", my_rank, e, __FILE__, __LINE__); \
MPI_Finalize(); \
return e; \
} while (0)

/** Handle non-MPI errors by finalizing the MPI library and goto
* exit. */
* exit. Finalize and goto exit. */
#define BAIL(e) do { \
fprintf(stderr, "%d Error %d in %s, line %d\n", my_rank, e, __FILE__, __LINE__); \
MPI_Finalize(); \
Expand Down

0 comments on commit c2c8d29

Please sign in to comment.