aboutsummaryrefslogtreecommitdiff
path: root/src/Reduction.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Reduction.c')
-rw-r--r--src/Reduction.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Reduction.c b/src/Reduction.c
index bce75e9..8ac7dfd 100644
--- a/src/Reduction.c
+++ b/src/Reduction.c
@@ -382,17 +382,20 @@ static int PUGH_ReductionGA (cGH *GH, int index, int proc, CCTK_REAL *outval,
iterator = from + 2*GA->connectivity->dim;
points_per_dim = from + 3*GA->connectivity->dim;
- /* get the start and endpoint to iterate over, the total number of points,
+ /* get the start- and endpoint to iterate over, the total number of points,
and the points_per_dim[] vector */
num_points = 1;
points_per_dim[0] = 1;
for (i = 0; i < GA->connectivity->dim; i++)
{
+ /* find out whether the variable is staggered */
stagger_index = CCTK_StaggerDirIndex (i, GA->stagger);
+ /* get the start- and endpoint to iterate over in this dimension */
from[i] = GA->extras->ownership[stagger_index][0][i];
to[i] = GA->extras->ownership[stagger_index][1][i];
+ /* get the number of points in this dimension (excluding ghostzones) */
dir_points = GA->extras->nsize[i];
if (GA->connectivity->perme[i])
{
@@ -402,6 +405,8 @@ static int PUGH_ReductionGA (cGH *GH, int index, int proc, CCTK_REAL *outval,
{
dir_points--;
}
+
+ /* accumulate the total number of points the reduce */
num_points *= dir_points;
if (i > 0)