diff options
author | schnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8> | 2002-10-23 13:21:35 +0000 |
---|---|---|
committer | schnetter <schnetter@2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8> | 2002-10-23 13:21:35 +0000 |
commit | faa526b62885a9e9f6ecad7c928cb4c89df39f66 (patch) | |
tree | cabf1a97dfc2137e99d78877c6f088d0126475b5 /src | |
parent | eb16cb1ac4a52cecc94e11e0f86168a9aca10c63 (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.c | 44 | ||||
-rw-r--r-- | src/slab.h | 14 |
2 files changed, 33 insertions, 25 deletions
@@ -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); @@ -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 */ |