aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8>2002-10-23 13:21:35 +0000
committerschnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8>2002-10-23 13:21:35 +0000
commitfaa526b62885a9e9f6ecad7c928cb4c89df39f66 (patch)
treecabf1a97dfc2137e99d78877c6f088d0126475b5 /src
parenteb16cb1ac4a52cecc94e11e0f86168a9aca10c63 (diff)
Added "TODO" point.
Added a bit more documentation. Added some restrict qualifiers. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Slab/trunk@7 2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8
Diffstat (limited to 'src')
-rw-r--r--src/slab.c44
-rw-r--r--src/slab.h14
2 files changed, 33 insertions, 25 deletions
diff --git a/src/slab.c b/src/slab.c
index af5e8f9..27f6258 100644
--- a/src/slab.c
+++ b/src/slab.c
@@ -7,6 +7,7 @@
Test slabbing without MPI
Allow using / not setting the ghost zones
Allow not using / not setting the boundaries
+ Allow different ghost zones at the lower and upper boundary
*/
@@ -155,6 +156,23 @@ MPI_Alltoallv (void * sendbuf, int * sendcnt, int * sendoff, int sendtype,
+static MPI_Comm get_mpi_comm (cGH * restrict const cctkGH)
+{
+#ifdef CCTK_MPI
+# if defined CARPET_CARPET
+ return CarpetMPIComm ();
+# elif defined CACTUSPUGH_PUGH
+ return PUGH_pGH(cctkGH)->PUGH_COMM_WORLD;
+# else
+# error "No supported driver thorn included"
+# endif
+#else
+ return 0;
+#endif
+}
+
+
+
struct bbox {
int off, len, str;
};
@@ -337,13 +355,13 @@ static void bbox_xform (struct bbox * restrict const ydst,
-int Slab_Transfer (cGH * const cctkGH,
- int const dim,
- struct xferinfo const * const xferinfo,
- int const srctype,
- void const * const srcptr,
- int const dsttype,
- void * const dstptr)
+int Slab_Transfer (cGH * restrict const cctkGH,
+ int const dim,
+ struct xferinfo const * const xferinfo,
+ int const srctype,
+ void const * const srcptr,
+ int const dsttype,
+ void * const dstptr)
{
struct info * restrict info;
size_t srclentot, dstlentot;
@@ -426,17 +444,7 @@ int Slab_Transfer (cGH * const cctkGH,
-#ifdef CCTK_MPI
-# if defined CARPET_CARPET
- comm = CarpetMPIComm ();
-# elif defined CACTUSPUGH_PUGH
- comm = PUGH_pGH(cctkGH)->PUGH_COMM_WORLD;
-# else
-# error "No supported driver thorn included"
-# endif
-#else
- comm = 0;
-#endif
+ comm = get_mpi_comm (cctkGH);
ifcheck {
ifdebug fflush (stdout);
diff --git a/src/slab.h b/src/slab.h
index 4e1051b..b79af0a 100644
--- a/src/slab.h
+++ b/src/slab.h
@@ -83,12 +83,12 @@ struct xferinfo {
The source and the destination arrays may be the same.
*/
-int Slab_Transfer (cGH * const cctkGH,
- int const dim,
- struct xferinfo const * const xferinfo,
- int const srctype,
- void const * const srcptr,
- int const dsttype,
- void * const dstptr);
+int Slab_Transfer (cGH * restrict const cctkGH,
+ int const dim,
+ struct xferinfo const * const xferinfo,
+ int const srctype,
+ void const * const srcptr,
+ int const dsttype,
+ void * const dstptr);
#endif /* defined SLAB_H */