aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Hyperslab.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Hyperslab.c b/src/Hyperslab.c
index 7cee730..2870dc5 100644
--- a/src/Hyperslab.c
+++ b/src/Hyperslab.c
@@ -836,10 +836,14 @@ int Hyperslab_GetHyperslab (cGH *GH, int target_proc, int vindex, int vtimelvl,
i = 1;
}
- /* copy the line */
- for (linear_hoffset = 0, j = 1; j < hdim; j++)
+ /* get the linear offset */
+ linear_hoffset = hoffset_chunk [0];
+ for (j = 1; j < hdim; j++)
+ {
linear_hoffset += (hoffset_chunk [j] + point [j]) *
points_per_hdim [j];
+ }
+ /* copy the line */
memcpy (copy_to + linear_hoffset * vtypesize,
copy_from, hsize_chunk [0] * vtypesize);
copy_from += hsize_chunk [0] * vtypesize;