aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8>2006-10-28 17:51:37 +0000
committerschnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8>2006-10-28 17:51:37 +0000
commit24e51a0896f5d680d6281e24137d732136362c3d (patch)
tree6fc277c1d2599c61c4ea53e275803febd3f2b165
parent738e46497e17a6fe78b03e4c51fdd7eee4f185af (diff)
Add an optional parameter that enables using information from ghost
zones. When this parameter is used, one has to ensure that the input data have been synchronised. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Slab/trunk@51 2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8
-rw-r--r--src/slab.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/slab.c b/src/slab.c
index 698bdac..90feccf 100644
--- a/src/slab.c
+++ b/src/slab.c
@@ -676,6 +676,8 @@ int Slab_MultiTransfer (cGH const * const cctkGH,
struct info * restrict info;
size_t srclentot, dstlentot;
+ int useghosts;
+
struct info * restrict allinfo;
struct bbox * restrict srcdetail;
struct bbox * restrict dstdetail;
@@ -727,14 +729,14 @@ int Slab_MultiTransfer (cGH const * const cctkGH,
for (d=0; d<dim; ++d) {
global2bbox (&xferinfo[d].src, &info[d].src.global);
local2bbox (&xferinfo[d].src, &info[d].src.local);
- active2bbox (&xferinfo[d].src, &info[d].src.active, 0);
+ active2bbox (&xferinfo[d].src, &info[d].src.active, useghosts);
slab2bbox (&xferinfo[d].src, &info[d].src.slab);
check (bbox_iscontained (&info[d].src.active, &info[d].src.local));
check (bbox_iscontained (&info[d].src.local, &info[d].src.global));
global2bbox (&xferinfo[d].dst, &info[d].dst.global);
local2bbox (&xferinfo[d].dst, &info[d].dst.local);
- active2bbox (&xferinfo[d].dst, &info[d].dst.active, 1);
+ active2bbox (&xferinfo[d].dst, &info[d].dst.active, 1); /* fill ghosts */
slab2bbox (&xferinfo[d].dst, &info[d].dst.slab);
check (bbox_iscontained (&info[d].dst.active, &info[d].dst.local));
check (bbox_iscontained (&info[d].dst.local, &info[d].dst.global));
@@ -852,6 +854,22 @@ int Slab_MultiTransfer (cGH const * const cctkGH,
}
}
+ {
+ CCTK_INT tmp;
+ int const iret = Util_TableGetInt (options, &tmp, "useghosts");
+ if (iret == 1) {
+ /* There was an entry, use it */
+ useghosts = tmp;
+ } else if (iret == UTIL_ERROR_BAD_HANDLE
+ || iret == UTIL_ERROR_TABLE_NO_SUCH_KEY) {
+ /* There was no entry, use a default */
+ useghosts = 0;
+ } else {
+ /* Something went wrong, abort */
+ check (0);
+ }
+ }
+
ifcheck {
ifdebug fflush (stdout);
MPI_Barrier (comm);