aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Comm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Comm.c b/src/Comm.c
index fdcde7c..68e8fa7 100644
--- a/src/Comm.c
+++ b/src/Comm.c
@@ -510,7 +510,8 @@ int PUGH_DisableGArrayGroupComm(pGH *pughGH, int first_var, pComm *groupcomm)
int PUGH_Barrier(const cGH *GH)
{
#ifdef CCTK_MPI
- CACTUS_MPI_ERROR (MPI_Barrier (PUGH_pGH (GH)->PUGH_COMM_WORLD));
+ CACTUS_MPI_ERROR (MPI_Barrier (GH ? PUGH_pGH (GH)->PUGH_COMM_WORLD :
+ MPI_COMM_WORLD));
#else
GH = GH;
#endif