From 3edf9722d47b574a52a5f72e72feb8451dc4c43f Mon Sep 17 00:00:00 2001 From: schnetter Date: Wed, 19 May 2004 22:14:32 +0000 Subject: Fix segmentation fault on multiple processors git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@8 20f44201-0f4f-0410-9130-e5fc2714a787 --- src/rotatingsymmetry180.c | 23 +++++++++++++++-------- src/rotatingsymmetry180.h | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 src/rotatingsymmetry180.h diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c index 216dc78..c26c576 100644 --- a/src/rotatingsymmetry180.c +++ b/src/rotatingsymmetry180.c @@ -14,6 +14,8 @@ #include "Slab.h" +#include "rotatingsymmetry180.h" + int BndRot180VI (cGH const * restrict const cctkGH, @@ -288,17 +290,22 @@ int BndRot180VI (cGH const * restrict const cctkGH, parity = parities[0] * parities[1]; assert (abs(parity) == 1); if (parity == -1) { + int imin[3], imax[3]; int i, j, k; + for (d=0; d<3; ++d) { + imin[d] = xferinfo[d].dst.off; + imax[d] = xferinfo[d].dst.off + xferinfo[d].dst.len; + imin[d] -= cctk_lbnd[d]; + imax[d] -= cctk_lbnd[d]; + if (imin[d] < 0) imin[d] = 0; + if (imax[d] >= cctk_lsh[d]) imax[d] = cctk_lsh[d]; + } assert (group.dim == 3); assert (group.vartype == CCTK_VARIABLE_REAL); - for (k=0; k