aboutsummaryrefslogtreecommitdiff
path: root/src/ReductionSum.c
diff options
context:
space:
mode:
authortradke <tradke@d60812e6-3970-4df4-986e-c251b06effeb>2003-04-14 09:56:53 +0000
committertradke <tradke@d60812e6-3970-4df4-986e-c251b06effeb>2003-04-14 09:56:53 +0000
commit877563c30139297e78b0b41bc4d4727828958fc6 (patch)
tree1bc9a76c6872ddfc9c0dc227303f371cbecd2016 /src/ReductionSum.c
parentf69684d7aba78edce0e0465e8ba338ae19a1e4b7 (diff)
Handle all complex variable datatypes (not just the standard CCTK_COMPLEX).
This closes PR CactusPUGH/1475. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHReduce/trunk@36 d60812e6-3970-4df4-986e-c251b06effeb
Diffstat (limited to 'src/ReductionSum.c')
-rw-r--r--src/ReductionSum.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/ReductionSum.c b/src/ReductionSum.c
index ffeb39e..46053ac 100644
--- a/src/ReductionSum.c
+++ b/src/ReductionSum.c
@@ -212,8 +212,9 @@ static int ReductionSum (const cGH *GH,
CCTK_REAL outvals[/*num_inarrays*num_outvals*/])
{
int i, total_outvals;
+ const char *vtypename;
#ifdef CCTK_MPI
- pGH *pughGH;
+ const pGH *pughGH;
CCTK_REAL *local_outvals;
#endif
@@ -297,13 +298,17 @@ static int ReductionSum (const cGH *GH,
break;
#endif
- case CCTK_VARIABLE_COMPLEX:
- CCTK_WARN (1, "PUGH_ReductionSum: Don't know how to compute "
- "the sum of complex variables !!!");
- return (-1);
-
default:
- CCTK_WARN (1, "PUGH_ReductionSum: Unknown variable type");
+ vtypename = CCTK_VarTypeName (intypes[i]);
+ if (vtypename && strncmp (vtypename, "CCTK_VARIABLE_COMPLEX", 21) == 0)
+ {
+ CCTK_WARN (1, "PUGH_ReductionSum: Don't know how to compute "
+ "the sum of complex variables !!!");
+ }
+ else
+ {
+ CCTK_WARN (1, "PUGH_ReductionSum: Unknown variable type");
+ }
return (-1);
}
}