diff options
author | lanfer <lanfer@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-17 15:44:13 +0000 |
---|---|---|
committer | lanfer <lanfer@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-17 15:44:13 +0000 |
commit | 9327965ee7c2b935f823cd82015949d44e458227 (patch) | |
tree | b33006d9e09f5e45af6c16cd40eb212cac12b323 | |
parent | 57df312b3027097a588b3782c9553471b82e3554 (diff) |
overloading CCTK_Exit with: int pugh_Exit(int retval, cGH *GH)
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@178 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r-- | src/Comm.c | 15 | ||||
-rw-r--r-- | src/pugh_Comm.h | 2 |
2 files changed, 13 insertions, 4 deletions
@@ -14,6 +14,8 @@ #include <stdio.h> #include <stdarg.h> #include <string.h> +#include <assert.h> +#include <unistd.h> #include "cctk.h" @@ -737,14 +739,21 @@ int pugh_ParallelInit(cGH *GH) return 0; } -int pugh_Exit(cGH *GH) +int pugh_Exit(int retval, cGH *GH) { - return 0; +#ifdef MPI + if(MPI_Active) + { + CACTUS_MPI_ERROR(MPI_Finalize()); + } +#endif + exit(retval); } int pugh_Abort(cGH *GH) { - return 0; + assert(0); + exit(0); } diff --git a/src/pugh_Comm.h b/src/pugh_Comm.h index e016d91..0ed74d6 100644 --- a/src/pugh_Comm.h +++ b/src/pugh_Comm.h @@ -43,7 +43,7 @@ int pugh_Interp(cGH *GH, ...); int pugh_ParallelInit(cGH *GH); -int pugh_Exit(cGH *GH); +int pugh_Exit(int retval, cGH *GH); int pugh_Abort(cGH *GH); int pugh_MyProc(cGH *GH); |