forked from CESM-Development/cime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdfbb41
commit 2695b4b
Showing
4 changed files
with
35 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @file | ||
* Macros to handle errors in tests or libray code. | ||
* @author Ed Hartnett | ||
* @date 2019 | ||
* | ||
* @see https://github.com/NCAR/ParallelIO | ||
*/ | ||
|
||
#ifndef __PIO_ERROR__ | ||
#define __PIO_ERROR__ | ||
|
||
#include <config.h> | ||
#include <pio.h> | ||
|
||
/** Handle non-MPI errors by finalizing the MPI library and goto | ||
* exit. Finalize and goto exit. */ | ||
#define BAIL(e) do { \ | ||
fprintf(stderr, "%d Error %d in %s, line %d\n", my_rank, e, __FILE__, __LINE__); \ | ||
goto exit; \ | ||
} while (0) | ||
|
||
/** Handle non-MPI errors by finalizing the MPI library and exiting | ||
* 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) | ||
|
||
#endif /* __PIO_ERROR__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters