From 2f9078cce27666a02d25ad797c602b52d6855d16 Mon Sep 17 00:00:00 2001 From: eschnett Date: Mon, 9 May 2011 00:16:46 +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/RotatingSymmetry90/trunk@63 c3c03602-0f4f-0410-b3fa-d2c81c8a7dc5 --- src/rotatingsymmetry90.c | 75 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/rotatingsymmetry90.c b/src/rotatingsymmetry90.c index c58c7aa..cd59d46 100644 --- a/src/rotatingsymmetry90.c +++ b/src/rotatingsymmetry90.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 "rotatingsymmetry90.h" +#include +#include +#include +#include + /* This is pretty hard coded into all the tensor types and cannot be @@ -599,10 +599,55 @@ int BndRot90VI (cGH const * restrict const cctkGH, options = Util_TableCreateFromString ("useghosts=1"); assert (options>=0); - ierr = Slab_MultiTransfer - (cctkGH, group.dim, xferinfo, options, - nvars, vartypes, srcptrs, vartypes, varptrs); - assert (!ierr); + /* Can we use the more efficient interface? */ + if (CCTK_IsFunctionAliased ("GetRegriddingEpoch")) { + static int epoch = -1; + static struct slabsetup *restrict *restrict slab_setups[3] = + { NULL, NULL, NULL}; + static int num_reflevels = 0; + int const new_epoch = GetRegriddingEpoch (cctkGH); + if (new_epoch > epoch) { + epoch = new_epoch; + /* Delete old slabbing setups */ + for (int s=0; s<3; ++s) { + for (int rl=0; rl=0 && reflevel