From 5e6b42e3f9ea3bd55cd56b2b254d44d320f6f138 Mon Sep 17 00:00:00 2001 From: eschnett Date: Wed, 4 Jul 2012 01:29:29 +0000 Subject: Introduce cctk_ash, retire cctk_lssh Introduce cctk_ash, describing the process-local array shape that has been allocated. This may be larger than cctk_lsh, the process-local shape that should be used. Retire cctk_lssh and related infrastructure to handle staggered grid functions. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@156 10716dce-81a3-4424-a2c8-48026a0d3035 --- src/GetHyperslab.c | 15 +++++++-------- src/Mapping.c | 34 ++++++++++------------------------ 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/GetHyperslab.c b/src/GetHyperslab.c index e4b2016..30e09b3 100644 --- a/src/GetHyperslab.c +++ b/src/GetHyperslab.c @@ -331,8 +331,7 @@ static int GetLocalHyperslab (const cGH *GH, } else if (vinfo.grouptype != mapping->vinfo.grouptype || vinfo.disttype != mapping->vinfo.disttype || - vinfo.dim != mapping->vinfo.dim || - vinfo.stagtype != mapping->vinfo.stagtype) + vinfo.dim != mapping->vinfo.dim) { errormsg = "Group data for template variable in mapping and given variable " "don't match"; @@ -575,13 +574,13 @@ static int GetDiagonalFromFrom3D (const cGH *GH, i = mapping->global_startpoint[0] - extras->lb[myproc][0]; j = mapping->global_startpoint[1] - extras->lb[myproc][1]; k = mapping->global_startpoint[2] - extras->lb[myproc][2]; - while (i < extras->ownership[0][1][0] && - j < extras->ownership[0][1][1] && - k < extras->ownership[0][1][2]) + while (i < extras->ownership[1][0] && + j < extras->ownership[1][1] && + k < extras->ownership[1][2]) { - if (i >= extras->ownership[0][0][0] && - j >= extras->ownership[0][0][1] && - k >= extras->ownership[0][0][2]) + if (i >= extras->ownership[0][0] && + j >= extras->ownership[0][1] && + k >= extras->ownership[0][2]) { linear_idx = i + j*extras->hyper_volume[1] + k*extras->hyper_volume[2]; if (conversion_fn) diff --git a/src/Mapping.c b/src/Mapping.c index d0ebc42..20cac32 100644 --- a/src/Mapping.c +++ b/src/Mapping.c @@ -331,16 +331,6 @@ static CCTK_INT DefineMapping (const cGH *GH, } } - /* diagonals can be extracted from non-staggered 3D variables only */ - if (mapping->is_diagonal_in_3D && vinfo.stagtype != 0) - { - free (mapping->do_dir); free (mapping->global_hsize); free (mapping); - CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "PUGHlab_GlobalMappingByIndex: diagonals can be " - "extracted from non-staggered 3D variables only"); - return (-7); - } - for (vdim = 0; vdim < vinfo.dim; vdim++) { mapping->do_dir[vdim] = 0; @@ -466,13 +456,13 @@ static CCTK_INT DefineMapping (const cGH *GH, i = mapping->global_startpoint[0] - extras->lb[myproc][0]; j = mapping->global_startpoint[1] - extras->lb[myproc][1]; k = mapping->global_startpoint[2] - extras->lb[myproc][2]; - while (i < extras->ownership[0][1][0] && - j < extras->ownership[0][1][1] && - k < extras->ownership[0][1][2]) + while (i < extras->ownership[1][0] && + j < extras->ownership[1][1] && + k < extras->ownership[1][2]) { - if (i >= extras->ownership[0][0][0] && - j >= extras->ownership[0][0][1] && - k >= extras->ownership[0][0][2]) + if (i >= extras->ownership[0][0] && + j >= extras->ownership[0][1] && + k >= extras->ownership[0][2]) { mapping->totals++; } @@ -494,10 +484,8 @@ static CCTK_INT DefineMapping (const cGH *GH, /* compute this processor's global startpoint from the global ranges */ for (vdim = 0; vdim < vinfo.dim; vdim++) { - i = CCTK_StaggerDirIndex (vdim, vinfo.stagtype); - - my_local_startpoint = extras->ownership[i][0][vdim]; - my_local_endpoint = extras->ownership[i][1][vdim]; + my_local_startpoint = extras->ownership[0][vdim]; + my_local_endpoint = extras->ownership[1][vdim]; /* include ghostzones if explicitely requested, otherwise only for local hyperslabs */ @@ -527,11 +515,9 @@ static CCTK_INT DefineMapping (const cGH *GH, mapping->totals = 1; for (vdim = dim = 0; vdim < vinfo.dim; vdim++) { - i = CCTK_StaggerDirIndex (vdim, vinfo.stagtype); - /* only non-periodic local hyperslabs include ghostzones by default */ - my_local_startpoint = extras->ownership[i][0][vdim]; - my_local_endpoint = extras->ownership[i][1][vdim]; + my_local_startpoint = extras->ownership[0][vdim]; + my_local_endpoint = extras->ownership[1][vdim]; if (with_ghostzones || ! (is_global_hyperslab || GA->connectivity->perme[vdim])) { -- cgit v1.2.3