summaryrefslogtreecommitdiff
path: root/src/comm/CactusDefaultComm.c
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-04-18 13:28:09 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-04-18 13:28:09 +0000
commitf3df548d78b6f84a2c4ede1c7f38320a42b7b97d (patch)
treed086c01bb0b8e547e22f9f0d5be1e63633d735a0 /src/comm/CactusDefaultComm.c
parent7e11e7778b2a9b8dd299a7bbbadb0000c074f408 (diff)
Stuff for cactus -x[n].
Cosmetic changes. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1576 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/comm/CactusDefaultComm.c')
-rw-r--r--src/comm/CactusDefaultComm.c77
1 files changed, 67 insertions, 10 deletions
diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c
index d52ac18d..3778609e 100644
--- a/src/comm/CactusDefaultComm.c
+++ b/src/comm/CactusDefaultComm.c
@@ -19,6 +19,8 @@
#include "cctk_GHExtensions.h"
#include "cctki_GHExtensions.h"
+#include "cctk_ParamCheck.h"
+
#ifdef MPI
#include "mpi.h"
#endif
@@ -27,10 +29,19 @@ static char *rcsid = "$Header$";
CCTK_FILEVERSION(comm_CactusDefaultComm_c)
+/********************************************************************
+ ********************* Global Data *****************************
+ ********************************************************************/
+
+/* FIXME: This should be in a header somewhere */
#ifdef MPI
extern char MPI_Active;
#endif
+/********************************************************************
+ ********************* Local Definitions **********************
+ ********************************************************************/
+
#ifdef MPI
#define CACTUS_MPI_ERROR(xf) do {int errcode; \
if((errcode = xf) != MPI_SUCCESS) \
@@ -46,6 +57,10 @@ extern char MPI_Active;
} while (0)
#endif
+/********************************************************************
+ ********************* External Routines **********************
+ ********************************************************************/
+
/*@@
@routine CactusDefaultSetupGH
@@ -200,14 +215,21 @@ int CactusDefaultMyProc(cGH *GH)
{
int myproc;
-#ifdef MPI
- if(MPI_Active)
+ if(CCTK_ParamChecking())
{
- CACTUS_MPI_ERROR(MPI_Comm_rank(MPI_COMM_WORLD, &myproc));
+ myproc = 0;
}
+ else
+ {
+#ifdef MPI
+ if(MPI_Active)
+ {
+ CACTUS_MPI_ERROR(MPI_Comm_rank(MPI_COMM_WORLD, &myproc));
+ }
#else
- myproc = 0;
+ myproc = 0;
#endif
+ }
return myproc;
}
@@ -231,18 +253,39 @@ int CactusDefaultnProcs(cGH *GH)
{
int nprocs;
-#ifdef MPI
- if(MPI_Active)
+ if(CCTK_ParamChecking())
{
- CACTUS_MPI_ERROR(MPI_Comm_size(MPI_COMM_WORLD, &nprocs));
+ nprocs = CCTK_ParamCheckNProcs();
}
+ else
+ {
+#ifdef MPI
+ if(MPI_Active)
+ {
+ CACTUS_MPI_ERROR(MPI_Comm_size(MPI_COMM_WORLD, &nprocs));
+ }
#else
- nprocs = 1;
+ nprocs = 1;
#endif
-
+ }
+
return nprocs;
}
+ /*@@
+ @routine CactusDefaultExit
+ @date Tue Apr 18 15:21:15 2000
+ @author Gerd Lanfermann
+ @desc
+ The default for when people call CCTK_Exit.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
int CactusDefaultExit(int retval, cGH *GH)
{
#ifdef MPI
@@ -254,7 +297,21 @@ int CactusDefaultExit(int retval, cGH *GH)
exit(retval);
}
+ /*@@
+ @routine CactusDefaultBarrier
+ @date Tue Apr 18 15:21:42 2000
+ @author Tom Goodale
+ @desc
+ The default for when people call CCTK_Barrier
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
int CactusDefaultBarrier(cGH *GH)
{
- return(0);
+ return 0;
}