From c6219b0d08451f48a937ddac8093cc9514363ce7 Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 23 Feb 2007 21:57:35 +0000 Subject: Initialise useghosts before using it. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Slab/trunk@52 2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8 --- src/slab.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/slab.c b/src/slab.c index 90feccf..72c0e5c 100644 --- a/src/slab.c +++ b/src/slab.c @@ -723,6 +723,22 @@ int Slab_MultiTransfer (cGH const * const cctkGH, CCTK_TimerStartI (timer_init); + { + 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); + } + } + check (dim <= SLAB_MAXDIM); info = malloc (SLAB_MAXDIM * sizeof *info); check (info); @@ -854,22 +870,6 @@ 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); -- cgit v1.2.3