aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ReductionNormInf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ReductionNormInf.c b/src/ReductionNormInf.c
index 4e0569a..b93ce49 100644
--- a/src/ReductionNormInf.c
+++ b/src/ReductionNormInf.c
@@ -216,8 +216,8 @@ static int PUGH_ReductionNormInf (cGH *GH,
CCTK_REAL outvals[/*num_inarrays*num_outvals*/])
{
int i, total_outvals;
- pGH *pughGH;
#ifdef CCTK_MPI
+ pGH *pughGH;
CCTK_REAL *local_outvals;
#endif
@@ -325,16 +325,15 @@ static int PUGH_ReductionNormInf (cGH *GH,
}
}
- pughGH = PUGH_pGH (GH);
-
#ifdef CCTK_MPI
/* do the global reduction from the processors' local reduction results */
- if (pughGH->nprocs > 1)
+ if (CCTK_nProcs (GH) > 1)
{
local_outvals = (CCTK_REAL *) malloc (total_outvals * sizeof (CCTK_REAL));
/* outvals[] contains now the local sum */
memcpy (local_outvals, outvals, total_outvals * sizeof (CCTK_REAL));
+ pughGH = PUGH_pGH (GH);
if (proc < 0)
{
CACTUS_MPI_ERROR (MPI_Allreduce (local_outvals, outvals, total_outvals,