aboutsummaryrefslogtreecommitdiff
path: root/src/ConfMetric.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ConfMetric.c')
-rw-r--r--src/ConfMetric.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/ConfMetric.c b/src/ConfMetric.c
index db9fb98..ebbd0f0 100644
--- a/src/ConfMetric.c
+++ b/src/ConfMetric.c
@@ -138,10 +138,17 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal,
CCTK_REAL detrec_pm4, sqrtdet;
char *robin=NULL;
char *sor_accel=NULL;
-
-
+ const void* input_array[1];
+ void* reduction_value[1];
+ int input_array_dim[1];
+ int input_array_type_codes[1];
+
+ input_array[0] = &resnorm;
+ reduction_value[0] = &glob_residual;
+ input_array_type_codes[0] = CCTK_VARIABLE_REAL;
+
/* Get the reduction handle */
- sum_handle = CCTK_ReductionArrayHandle("sum");
+ sum_handle = CCTK_LocalArrayReductionHandle("sum");
if (sum_handle<0)
{
CCTK_WARN(1,"SORConfMetric3D: "
@@ -526,8 +533,14 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal,
}
/* reduction operation on processor-local residual values */
- if (CCTK_ReduceLocScalar(GH, -1, sum_handle,
- &resnorm, &glob_residual, CCTK_VARIABLE_REAL)<0)
+ ierr = CCTK_ReduceArraysGlobally(GH, -1,sum_handle, -1, 1,input_array,0,
+ input_array_dim,
+ input_array_type_codes,
+ 1,
+ input_array_type_codes,
+ reduction_value);
+
+ if (ierr<0)
{
CCTK_WARN(1,"SORConfMetric3D: Reduction of residual failed");
}