aboutsummaryrefslogtreecommitdiff
path: root/src/slab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/slab.c')
-rw-r--r--src/slab.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/slab.c b/src/slab.c
index 27f6258..53bcabf 100644
--- a/src/slab.c
+++ b/src/slab.c
@@ -60,9 +60,11 @@ CCTK_FILEVERSION(TAT_Slab_slab_c);
#ifdef CCTK_MPI
# if defined CARPET_CARPET
# include "Carpet/Carpet/src/carpet_public.h"
-# elif defined CACTUSPUGH_PUGH
+# endif
+# if defined CACTUSPUGH_PUGH
# include "CactusPUGH/PUGH/src/include/pugh.h"
-# else
+# endif
+# if ! defined CARPET_CARPET && ! defined CACTUSPUGH_PUGH
# error "No supported driver thorn included"
# endif
#endif
@@ -160,12 +162,16 @@ static MPI_Comm get_mpi_comm (cGH * restrict const cctkGH)
{
#ifdef CCTK_MPI
# if defined CARPET_CARPET
- return CarpetMPIComm ();
-# elif defined CACTUSPUGH_PUGH
- return PUGH_pGH(cctkGH)->PUGH_COMM_WORLD;
-# else
-# error "No supported driver thorn included"
+ if (CCTK_IsThornActive ("Carpet")) {
+ return CarpetMPIComm ();
+ }
+# endif
+# if defined CACTUSPUGH_PUGH
+ if (CCTK_IsThornActive ("PUGH")) {
+ return PUGH_pGH(cctkGH)->PUGH_COMM_WORLD;
+ }
# endif
+ assert (0);
#else
return 0;
#endif