From 5cb313ab6b512420aeedc35f5a0398b2cd8bc776 Mon Sep 17 00:00:00 2001 From: eschnett Date: Mon, 9 May 2011 00:17:00 +0000 Subject: Use the new Slab API to set up the communication schedule only once (per regridding), which saves some communication time when applying symmetries. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@62 20f44201-0f4f-0410-9130-e5fc2714a787 --- src/rotatingsymmetry180.c | 69 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c index 1317f80..c12407c 100644 --- a/src/rotatingsymmetry180.c +++ b/src/rotatingsymmetry180.c @@ -1,19 +1,19 @@ -#include -#include -#include -#include - -#include "cctk.h" -#include "cctk_Arguments.h" -#include "cctk_Parameters.h" +#include +#include +#include -#include "util_ErrorCodes.h" -#include "util_Table.h" +#include +#include -#include "Slab.h" +#include #include "rotatingsymmetry180.h" +#include +#include +#include +#include + int BndRot180VI (cGH const * restrict const cctkGH, @@ -478,10 +478,49 @@ int BndRot180VI (cGH const * restrict const cctkGH, options = Util_TableCreateFromString ("useghosts=1"); assert (options>=0); - ierr = Slab_MultiTransfer - (cctkGH, group.dim, xferinfo, options, - nvars, vartypes, varptrs, vartypes, varptrs); - assert (!ierr); + /* Can we use the more efficient interface? */ + if (CCTK_IsFunctionAliased ("GetRegriddingEpoch")) { + static int old_epoch = -1; + static struct slabsetup *restrict *restrict slab_setups = NULL; + static int num_slab_setups = 0; + int const epoch = GetRegriddingEpoch (cctkGH); + if (epoch > old_epoch) { + old_epoch = epoch; + /* Delete old slabbing setups */ + for (int rl=0; rl=0 && reflevel