aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364>2003-06-19 14:13:58 +0000
committertradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364>2003-06-19 14:13:58 +0000
commit41ab724905b87dd698c3622acbe2d29491f1c7cd (patch)
tree60cf8980bc86e5dad2dea165eb8985f4da6e924a
parent044228adbc961a8fc3ac42582a4009e2bbf25b15 (diff)
Changed PUGH_Abort() to return with the given return code to abort with
(and not with 0 as it was before). This fixes PR CactusPUGH/1546. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@411 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r--src/SetupPGH.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/SetupPGH.c b/src/SetupPGH.c
index 4abb52e..459c4f2 100644
--- a/src/SetupPGH.c
+++ b/src/SetupPGH.c
@@ -95,13 +95,13 @@ pGH *PUGH_SetupPGH (void *callerid,
/* Allocate for myself */
- pughGH = (pGH *) malloc (sizeof (pGH));
+ pughGH = malloc (sizeof (pGH));
/* Set an identifier for my parent */
pughGH->callerid = callerid;
- pughGH->GFExtras = (pGExtras **) malloc (dim * sizeof (pGExtras *));
- pughGH->Connectivity = (pConnectivity **) malloc (dim*sizeof(pConnectivity*));
+ pughGH->GFExtras = malloc (dim * sizeof (pGExtras *));
+ pughGH->Connectivity = malloc (dim*sizeof(pConnectivity*));
/* Set the total number of processors */
Setup_nProcs (pughGH, dim);
@@ -109,7 +109,7 @@ pGH *PUGH_SetupPGH (void *callerid,
/* Set up connectivity and extras for each dimension */
for (idim = 1; idim <= dim; idim++)
{
- nprocs = (int *) malloc (idim * sizeof (int));
+ nprocs = malloc (idim * sizeof (int));
PUGH_SetupDefaultTopology (idim, nprocs);
@@ -451,7 +451,7 @@ int PUGH_Exit (cGH *GH, int retval)
@returntype int
@returndesc
This function should never return.
- But if it does it will return 0.
+ But if it does it will return the return code to abort with.
@endreturndesc
@@*/
int PUGH_Abort (cGH *GH, int retval)
@@ -466,13 +466,12 @@ int PUGH_Abort (cGH *GH, int retval)
#else
/* avoid compiler warning about unused parameter */
GH = GH;
- retval = retval;
/* FIXME */
/*abort();*/
#endif
- exit (0);
- return (0);
+ exit (retval);
+ return (retval);
}