diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-07-18 00:51:15 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-07-18 00:51:15 +0000 |
commit | 40bf4581924cc4f7dab9c0202c23a0bab3090118 (patch) | |
tree | 5bd9b13a9bb4166d92016ac57501d23a53b71514 | |
parent | 71a5bcaf01299bcf9bc733e509bd6ee924b45a3a (diff) |
#ifdef MPI changed into #ifdef CCTK_MPI
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1756 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | src/comm/CactusDefaultComm.c | 43 | ||||
-rw-r--r-- | src/main/CactusDefaultEvolve.c | 2 | ||||
-rw-r--r-- | src/main/CactusDefaultShutdown.c | 37 | ||||
-rw-r--r-- | src/main/ProcessEnvironment.c | 39 |
4 files changed, 71 insertions, 50 deletions
diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c index 9686515b..b9055027 100644 --- a/src/comm/CactusDefaultComm.c +++ b/src/comm/CactusDefaultComm.c @@ -22,7 +22,7 @@ #include "cctk_ParamCheck.h" -#ifdef MPI +#ifdef CCTK_MPI #include "mpi.h" #endif @@ -35,7 +35,7 @@ CCTK_FILEVERSION(comm_CactusDefaultComm_c) ********************************************************************/ /* FIXME: This should be in a header somewhere */ -#ifdef MPI +#ifdef CCTK_MPI extern char MPI_Active; #endif @@ -43,19 +43,26 @@ extern char MPI_Active; ********************* Local Definitions ********************** ********************************************************************/ -#ifdef MPI -#define CACTUS_MPI_ERROR(xf) do {int errcode; \ - if((errcode = xf) != MPI_SUCCESS) \ - { \ - char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ - int resultlen; \ - MPI_Error_string(errcode, mpi_error_string, &resultlen);\ - fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ - #xf, errcode, mpi_error_string); \ - fprintf(stderr, "At line %d of file %s\n", \ - __LINE__, __FILE__); \ - } \ - } while (0) +#ifdef CCTK_MPI +#define CACTUS_MPI_ERROR(xf) \ + do \ + { \ + int errcode; \ + \ + \ + if((errcode = xf) != MPI_SUCCESS) \ + { \ + char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ + int resultlen; \ + \ + \ + MPI_Error_string(errcode, mpi_error_string, &resultlen); \ + fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ + #xf, errcode, mpi_error_string); \ + fprintf(stderr, "At line %d of file %s\n", \ + __LINE__, __FILE__); \ + } \ + } while (0) #endif /******************************************************************** @@ -222,7 +229,7 @@ int CactusDefaultMyProc(cGH *GH) } else { -#ifdef MPI +#ifdef CCTK_MPI if(MPI_Active) { CACTUS_MPI_ERROR(MPI_Comm_rank(MPI_COMM_WORLD, &myproc)); @@ -260,7 +267,7 @@ int CactusDefaultnProcs(cGH *GH) } else { -#ifdef MPI +#ifdef CCTK_MPI if(MPI_Active) { CACTUS_MPI_ERROR(MPI_Comm_size(MPI_COMM_WORLD, &nprocs)); @@ -289,7 +296,7 @@ int CactusDefaultnProcs(cGH *GH) @@*/ int CactusDefaultExit(cGH *GH, int retval) { -#ifdef MPI +#ifdef CCTK_MPI if(MPI_Active) { CACTUS_MPI_ERROR(MPI_Finalize()); diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c index ed009925..908e8a69 100644 --- a/src/main/CactusDefaultEvolve.c +++ b/src/main/CactusDefaultEvolve.c @@ -304,7 +304,7 @@ void TerminationStepper(cGH *GH) #if 0 -#ifdef MPI +#ifdef CCTK_MPI MPI_Allreduce(&cactus_terminate,&cactus_terminate_global,1, MPI_INT,MPI_LOR,GH->PUGH_COMM_WORLD); #endif diff --git a/src/main/CactusDefaultShutdown.c b/src/main/CactusDefaultShutdown.c index e65b4a58..f86be197 100644 --- a/src/main/CactusDefaultShutdown.c +++ b/src/main/CactusDefaultShutdown.c @@ -15,7 +15,7 @@ #include "cctk_Comm.h" -#ifdef MPI +#ifdef CCTK_MPI #include "mpi.h" #endif @@ -23,23 +23,30 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_CactusDefaultShutdown_c) -#ifdef MPI +#ifdef CCTK_MPI extern char MPI_Active; #endif -#ifdef MPI -#define CACTUS_MPI_ERROR(xf) do {int errcode; \ - if((errcode = xf) != MPI_SUCCESS) \ - { \ - char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ - int resultlen; \ - MPI_Error_string(errcode, mpi_error_string, &resultlen);\ - fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ - #xf, errcode, mpi_error_string); \ - fprintf(stderr, "At line %d of file %s\n", \ - __LINE__, __FILE__); \ - } \ - } while (0) +#ifdef CCTK_MPI +#define CACTUS_MPI_ERROR(xf) \ + do \ + { \ + int errcode; \ + \ + \ + if((errcode = xf) != MPI_SUCCESS) \ + { \ + char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ + int resultlen; \ + \ + \ + MPI_Error_string(errcode, mpi_error_string, &resultlen); \ + fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ + #xf, errcode, mpi_error_string); \ + fprintf(stderr, "At line %d of file %s\n", \ + __LINE__, __FILE__); \ + } \ + } while (0) #endif /*@@ diff --git a/src/main/ProcessEnvironment.c b/src/main/ProcessEnvironment.c index b6b8793b..30d80197 100644 --- a/src/main/ProcessEnvironment.c +++ b/src/main/ProcessEnvironment.c @@ -12,23 +12,30 @@ #include "cctk_Flesh.h" -#ifdef MPI +#ifdef CCTK_MPI #include "mpi.h" #endif -#ifdef MPI -#define CACTUS_MPI_ERROR(xf) do {int errcode; \ - if((errcode = xf) != MPI_SUCCESS) \ - { \ - char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ - int resultlen; \ - MPI_Error_string(errcode, mpi_error_string, &resultlen);\ - fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ - #xf, errcode, mpi_error_string); \ - fprintf(stderr, "At line %d of file %s\n", \ - __LINE__, __FILE__); \ - } \ - } while (0) +#ifdef CCTK_MPI +#define CACTUS_MPI_ERROR(xf) \ + do \ + { \ + int errcode; \ + \ + \ + if((errcode = xf) != MPI_SUCCESS) \ + { \ + char mpi_error_string[MPI_MAX_ERROR_STRING+1]; \ + int resultlen; \ + \ + \ + MPI_Error_string(errcode, mpi_error_string, &resultlen); \ + fprintf(stderr, "MPI Call %s returned error code %d (%s)\n", \ + #xf, errcode, mpi_error_string); \ + fprintf(stderr, "At line %d of file %s\n", \ + __LINE__, __FILE__); \ + } \ + } while (0) #endif #include "cctk_Flesh.h" @@ -37,7 +44,7 @@ static char *rcsid = "$Header$"; CCTK_FILEVERSION(main_ProcessEnvironment_c) -#ifdef MPI +#ifdef CCTK_MPI char MPI_Active = 0; #endif @@ -46,7 +53,7 @@ int CCTKi_ProcessEnvironment(int *argc, char ***argv,tFleshConfig *ConfigData) /* Check if MPI compiled in but choosing not to use MPI. */ -#ifdef MPI +#ifdef CCTK_MPI if(!getenv("CACTUS_NOMPI")) { MPI_Active = 1; |