aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2012-01-11 16:00:56 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2012-01-11 16:00:56 -0500
commit4f20697279ebdd4963f3650f200f25053bb40706 (patch)
treed65a828ee489b2dda40fba35f214c874d0e26a95
parentf848b3c1a64b9034cf485781f5ec1f9a691a3679 (diff)
CarpetLib: Extend operator API to allow hyperslabbing
Extend API of grid operators and of gdata::copy_from, gdata::transfer_from to allow hyperslabbing Implement hyperslabbing in copy_3d.cc
-rw-r--r--Carpet/CarpetLib/src/accumulate_3d.cc10
-rw-r--r--Carpet/CarpetLib/src/copy_3d.cc47
-rw-r--r--Carpet/CarpetLib/src/copy_4d.cc10
-rw-r--r--Carpet/CarpetLib/src/data.cc298
-rw-r--r--Carpet/CarpetLib/src/data.hh28
-rw-r--r--Carpet/CarpetLib/src/dh.hh1
-rw-r--r--Carpet/CarpetLib/src/gdata.cc73
-rw-r--r--Carpet/CarpetLib/src/gdata.hh35
-rw-r--r--Carpet/CarpetLib/src/gf.cc6
-rw-r--r--Carpet/CarpetLib/src/ggf.cc2
-rw-r--r--Carpet/CarpetLib/src/gh.cc5
-rw-r--r--Carpet/CarpetLib/src/interpolate_3d_2tl.cc10
-rw-r--r--Carpet/CarpetLib/src/interpolate_3d_3tl.cc10
-rw-r--r--Carpet/CarpetLib/src/interpolate_3d_4tl.cc10
-rw-r--r--Carpet/CarpetLib/src/interpolate_3d_5tl.cc10
-rw-r--r--Carpet/CarpetLib/src/interpolate_eno_3d_3tl.cc24
-rw-r--r--Carpet/CarpetLib/src/operator_prototypes_3d.hh92
-rw-r--r--Carpet/CarpetLib/src/operator_prototypes_4d.hh12
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc70
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc30
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_o5_monotone_rf2.cc43
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_rf2.cc30
-rw-r--r--Carpet/CarpetLib/src/prolongate_4d_o1_rf2.cc10
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc10
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_rf2.cc10
-rw-r--r--Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc38
-rw-r--r--Carpet/CarpetLib/src/restrict_4d_rf2.cc10
-rw-r--r--Carpet/CarpetLib/src/vect.cc1
28 files changed, 655 insertions, 280 deletions
diff --git a/Carpet/CarpetLib/src/accumulate_3d.cc b/Carpet/CarpetLib/src/accumulate_3d.cc
index e2b3883a7..084ad29f2 100644
--- a/Carpet/CarpetLib/src/accumulate_3d.cc
+++ b/Carpet/CarpetLib/src/accumulate_3d.cc
@@ -36,8 +36,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
if (any (srcbbox.stride() != regbbox.stride() or
dstbbox.stride() != regbbox.stride()))
{
@@ -138,7 +142,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/copy_3d.cc b/Carpet/CarpetLib/src/copy_3d.cc
index dee9dac70..81544a265 100644
--- a/Carpet/CarpetLib/src/copy_3d.cc
+++ b/Carpet/CarpetLib/src/copy_3d.cc
@@ -37,17 +37,24 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict srcregbbox1,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs)
{
- if (any (srcbbox.stride() != regbbox.stride() or
- dstbbox.stride() != regbbox.stride()))
+ islab const * restrict const slabinfo =
+ static_cast<islab const *> (extraargs);
+
+ if (any (srcbbox.stride() != dstregbbox.stride() or
+ dstbbox.stride() != dstregbbox.stride() or
+ srcregbbox1.stride() != dstregbbox.stride()))
{
#pragma omp critical
{
cout << "copy_3d.cc:" << endl
<< "srcbbox=" << srcbbox << endl
<< "dstbbox=" << dstbbox << endl
- << "regbbox=" << regbbox << endl;
+ << "srcregbbox=" << srcregbbox1 << endl
+ << "dstregbbox=" << dstregbbox << endl;
CCTK_WARN (0, "Internal error: strides disagree");
}
}
@@ -58,20 +65,30 @@ namespace CarpetLib {
// This could be handled, but is likely to point to an error
// elsewhere
- if (regbbox.empty()) {
+ if (dstregbbox.empty()) {
#pragma omp critical
CCTK_WARN (0, "Internal error: region extent is empty");
}
- if (not regbbox.is_contained_in(srcbbox) or
- not regbbox.is_contained_in(dstbbox))
+ ibbox const srcregbbox =
+ slabinfo ? dstregbbox.shift(slabinfo->offset) : dstregbbox;
+ assert (srcregbbox.is_contained_in(srcregbbox1));
+
+ assert(all(srcregbbox.shape() == dstregbbox.shape()));
+
+ if (not srcregbbox.is_contained_in(srcbbox) or
+ not dstregbbox.is_contained_in(dstbbox))
{
#pragma omp critical
{
cout << "copy_3d.cc:" << endl
<< "srcbbox=" << srcbbox << endl
<< "dstbbox=" << dstbbox << endl
- << "regbbox=" << regbbox << endl;
+ << "srcregbbox=" << srcregbbox << endl
+ << "dstregbbox=" << dstregbbox << endl;
+ if (slabinfo) {
+ cout << "slabinfo=" << *slabinfo << endl;
+ }
CCTK_WARN (0, "Internal error: region extent is not contained in array extent");
}
}
@@ -85,11 +102,11 @@ namespace CarpetLib {
- ivect3 const regext = regbbox.shape() / regbbox.stride();
- assert (all ((regbbox.lower() - srcbbox.lower()) % srcbbox.stride() == 0));
- ivect3 const srcoff = (regbbox.lower() - srcbbox.lower()) / srcbbox.stride();
- assert (all ((regbbox.lower() - dstbbox.lower()) % dstbbox.stride() == 0));
- ivect3 const dstoff = (regbbox.lower() - dstbbox.lower()) / dstbbox.stride();
+ ivect3 const regext = dstregbbox.shape() / dstregbbox.stride();
+ assert (all ((srcregbbox.lower() - srcbbox.lower()) % srcbbox.stride() == 0));
+ ivect3 const srcoff = (srcregbbox.lower() - srcbbox.lower()) / srcbbox.stride();
+ assert (all ((dstregbbox.lower() - dstbbox.lower()) % dstbbox.stride() == 0));
+ ivect3 const dstoff = (dstregbbox.lower() - dstbbox.lower()) / dstbbox.stride();
@@ -145,7 +162,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox, \
+ ibbox3 const & restrict dstregbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/copy_4d.cc b/Carpet/CarpetLib/src/copy_4d.cc
index 376b81428..232ab0914 100644
--- a/Carpet/CarpetLib/src/copy_4d.cc
+++ b/Carpet/CarpetLib/src/copy_4d.cc
@@ -36,8 +36,12 @@ namespace CarpetLib {
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox)
+ ibbox4 const & restrict,
+ ibbox4 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
if (any (srcbbox.stride() != regbbox.stride() or
dstbbox.stride() != regbbox.stride()))
{
@@ -133,7 +137,9 @@ namespace CarpetLib {
ivect4 const & restrict dstext, \
ibbox4 const & restrict srcbbox, \
ibbox4 const & restrict dstbbox, \
- ibbox4 const & restrict regbbox);
+ ibbox4 const & restrict, \
+ ibbox4 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/data.cc b/Carpet/CarpetLib/src/data.cc
index 4771601a4..c7eb52145 100644
--- a/Carpet/CarpetLib/src/data.cc
+++ b/Carpet/CarpetLib/src/data.cc
@@ -42,20 +42,26 @@ call_operator (void
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox),
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * const extraargs),
T const * restrict const src,
ivect3 const & restrict srcext,
T * restrict const dst,
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * const extraargs)
{
#ifndef _OPENMP
- (* the_operator) (src, srcext, dst, dstext, srcbbox, dstbbox, regbbox);
+ (* the_operator)
+ (src, srcext, dst, dstext, srcbbox, dstbbox,
+ srcregbbox, dstregbbox, slabinfo);
#else
# ifdef CARPET_DEBUG
- ibset allregbboxes;
+ ibset alldstregbboxes;
# endif
#pragma omp parallel
{
@@ -64,10 +70,10 @@ call_operator (void
// Parallelise in z direction
// int const dir = 2;
// Parallelise along longest extent
- int const dir = maxloc (regbbox.shape());
- int const stride = regbbox.stride()[dir];
- int const first_point = regbbox.lower()[dir];
- int const last_point = regbbox.upper()[dir] + stride;
+ int const dir = maxloc (dstregbbox.shape());
+ int const stride = dstregbbox.stride()[dir];
+ int const first_point = dstregbbox.lower()[dir];
+ int const last_point = dstregbbox.upper()[dir] + stride;
int const num_points = last_point - first_point;
assert (num_points >= 0);
assert (num_points % stride == 0);
@@ -78,24 +84,26 @@ call_operator (void
int const my_last_point =
min (last_point, my_first_point + my_num_points);
assert (my_last_point >= my_first_point);
- ibbox3 const myregbbox
- (regbbox.lower().replace (dir, my_first_point),
- regbbox.upper().replace (dir, my_last_point - stride),
- regbbox.stride());
- if (not myregbbox.empty()) {
- (* the_operator) (src, srcext, dst, dstext, srcbbox, dstbbox, myregbbox);
+ ibbox3 const mydstregbbox
+ (dstregbbox.lower().replace (dir, my_first_point),
+ dstregbbox.upper().replace (dir, my_last_point - stride),
+ dstregbbox.stride());
+ if (not mydstregbbox.empty()) {
+ (* the_operator)
+ (src, srcext, dst, dstext, srcbbox, dstbbox,
+ srcregbbox, mydstregbbox, extraargs);
# ifdef CARPET_DEBUG
#pragma omp critical
- allregbboxes += myregbbox;
+ alldstregbboxes += mydstregbbox;
# endif
}
}
# ifdef CARPET_DEBUG
- if (not (allregbboxes == ibset (regbbox))) {
- cout << "allregbboxes=" << allregbboxes << endl
- << "regbbox=" << regbbox << endl;
+ if (not (alldstregbboxes == ibset (dstregbbox))) {
+ cout << "alldstregbboxes=" << alldstregbboxes << endl
+ << "dstregbbox=" << dstregbbox << endl;
}
- assert (allregbboxes == ibset (regbbox));
+ assert (alldstregbboxes == ibset (dstregbbox));
# endif
#endif
}
@@ -110,20 +118,26 @@ call_operator (void
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox),
+ ibbox4 const & restrict srcregbbox,
+ ibbox4 const & restrict dstregbbox,
+ void * const extraargs),
T const * restrict const src,
ivect4 const & restrict srcext,
T * restrict const dst,
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox)
+ ibbox4 const & restrict srcregbbox,
+ ibbox4 const & restrict dstregbbox,
+ void * const extraargs)
{
#ifndef _OPENMP
- (* the_operator) (src, srcext, dst, dstext, srcbbox, dstbbox, regbbox);
+ (* the_operator)
+ (src, srcext, dst, dstext, srcbbox, dstbbox,
+ srcregbbox, dstregbbox, extraargs);
#else
# if ! defined (NDEBUG) && ! defined (CARPET_OPTIMISE)
- ibset allregbboxes;
+ ibset alldstregbboxes;
# endif
#pragma omp parallel
{
@@ -132,10 +146,10 @@ call_operator (void
// Parallelise in z direction
// int const dir = 2;
// Parallelise along longest extent
- int const dir = maxloc (regbbox.shape());
- int const stride = regbbox.stride()[dir];
- int const first_point = regbbox.lower()[dir];
- int const last_point = regbbox.upper()[dir] + stride;
+ int const dir = maxloc (dstregbbox.shape());
+ int const stride = dstregbbox.stride()[dir];
+ int const first_point = dstregbbox.lower()[dir];
+ int const last_point = dstregbbox.upper()[dir] + stride;
int const num_points = last_point - first_point;
assert (num_points >= 0);
assert (num_points % stride == 0);
@@ -146,24 +160,26 @@ call_operator (void
int const my_last_point =
min (last_point, my_first_point + my_num_points);
assert (my_last_point >= my_first_point);
- ibbox4 const myregbbox
- (regbbox.lower().replace (dir, my_first_point),
- regbbox.upper().replace (dir, my_last_point - stride),
- regbbox.stride());
- if (not myregbbox.empty()) {
- (* the_operator) (src, srcext, dst, dstext, srcbbox, dstbbox, myregbbox);
+ ibbox4 const mydstregbbox
+ (dstregbbox.lower().replace (dir, my_first_point),
+ dstregbbox.upper().replace (dir, my_last_point - stride),
+ dstregbbox.stride());
+ if (not mydstregbbox.empty()) {
+ (* the_operator)
+ (src, srcext, dst, dstext, srcbbox, dstbbox,
+ srcregbbox, mydstregbbox, extraargs);
# if ! defined (NDEBUG) && ! defined (CARPET_OPTIMISE)
#pragma omp critical
- allregbboxes += myregbbox;
+ alldstregbboxes += mydstregbbox;
# endif
}
}
# if ! defined (NDEBUG) && ! defined (CARPET_OPTIMISE)
- if (not (allregbboxes == ibset (regbbox))) {
- cout << "allregbboxes=" << allregbboxes << endl
- << "regbbox=" << regbbox << endl;
+ if (not (alldstregbboxes == ibset (dstregbbox))) {
+ cout << "alldstregbboxes=" << alldstregbboxes << endl
+ << "dstregbbox=" << dstregbbox << endl;
}
- assert (allregbboxes == ibset (regbbox));
+ assert (alldstregbboxes == ibset (dstregbbox));
# endif
#endif
}
@@ -180,7 +196,9 @@ prolongate_3d_eno (T const * restrict const /*src*/,
ivect3 const & /*dstext*/,
ibbox3 const & /*srcbbox*/,
ibbox3 const & /*dstbbox*/,
- ibbox3 const & /*regbbox*/)
+ ibbox3 const & /*srcregbbox*/,
+ ibbox3 const & /*dstregbbox*/,
+ void * /*extraargs*/)
{
CCTK_WARN (0, "Data type not supported");
}
@@ -195,7 +213,7 @@ CCTK_FCALL CCTK_FNAME(prolongate_3d_real8_eno)
const int& dstiext, const int& dstjext, const int& dstkext,
const int srcbbox[3][3],
const int dstbbox[3][3],
- const int regbbox[3][3]);
+ const int dstregbbox[3][3]);
template <>
void
@@ -205,8 +223,11 @@ prolongate_3d_eno (CCTK_REAL8 const * restrict const src,
ivect3 const & dstext,
ibbox3 const & srcbbox,
ibbox3 const & dstbbox,
- ibbox3 const & regbbox)
+ ibbox3 const & srcregbbox,
+ ibbox3 const & dstregbbox,
+ void * extraargs)
{
+ assert (not extraargs);
CCTK_FNAME(prolongate_3d_real8_eno)
(src,
srcext[0], srcext[1], srcext[2],
@@ -214,7 +235,7 @@ prolongate_3d_eno (CCTK_REAL8 const * restrict const src,
dstext[0], dstext[1], dstext[2],
reinterpret_cast <int const (*) [3]> (& srcbbox),
reinterpret_cast <int const (*) [3]> (& dstbbox),
- reinterpret_cast <int const (*) [3]> (& regbbox));
+ reinterpret_cast <int const (*) [3]> (& dstregbbox));
}
#endif
@@ -228,7 +249,9 @@ prolongate_3d_weno (T const * restrict const /*src*/,
ivect3 const & /*dstext*/,
ibbox3 const & /*srcbbox*/,
ibbox3 const & /*dstbbox*/,
- ibbox3 const & /*regbbox*/)
+ ibbox3 const & /*srcregbbox*/,
+ ibbox3 const & /*dstregbbox*/,
+ void * extraargs)
{
CCTK_WARN (0, "Data type not supported");
}
@@ -253,7 +276,9 @@ prolongate_3d_weno (CCTK_REAL8 const * restrict const src,
ivect3 const & dstext,
ibbox3 const & srcbbox,
ibbox3 const & dstbbox,
- ibbox3 const & regbbox)
+ ibbox3 const & srcregbbox,
+ ibbox3 const & dstregbbox,
+ void * extraargs)
{
CCTK_FNAME(prolongate_3d_real8_weno)
(src,
@@ -262,7 +287,7 @@ prolongate_3d_weno (CCTK_REAL8 const * restrict const src,
dstext[0], dstext[1], dstext[2],
reinterpret_cast <int const (*) [3]> (& srcbbox),
reinterpret_cast <int const (*) [3]> (& dstbbox),
- reinterpret_cast <int const (*) [3]> (& regbbox));
+ reinterpret_cast <int const (*) [3]> (& dstregbbox));
}
#endif
@@ -276,7 +301,9 @@ prolongate_3d_tvd (T const * restrict const /*src*/,
ivect3 const & /*dstext*/,
ibbox3 const & /*srcbbox*/,
ibbox3 const & /*dstbbox*/,
- ibbox3 const & /*regbbox*/)
+ ibbox3 const & /*srcregbbox*/,
+ ibbox3 const & /*dstregbbox*/,
+ void * /*extraargs*/)
{
CCTK_WARN (0, "Data type not supported");
}
@@ -301,8 +328,11 @@ prolongate_3d_tvd (CCTK_REAL8 const * restrict const src,
ivect3 const & dstext,
ibbox3 const & srcbbox,
ibbox3 const & dstbbox,
- ibbox3 const & regbbox)
+ ibbox3 const & srcregbbox,
+ ibbox3 const & dstregbbox,
+ void * const extraargs)
{
+ assert (not extraargs);
CCTK_FNAME(prolongate_3d_real8_tvd)
(src,
srcext[0], srcext[1], srcext[2],
@@ -310,7 +340,7 @@ prolongate_3d_tvd (CCTK_REAL8 const * restrict const src,
dstext[0], dstext[1], dstext[2],
reinterpret_cast <int const (*) [3]> (& srcbbox),
reinterpret_cast <int const (*) [3]> (& dstbbox),
- reinterpret_cast <int const (*) [3]> (& regbbox));
+ reinterpret_cast <int const (*) [3]> (& dstregbbox));
}
#endif
@@ -324,7 +354,9 @@ prolongate_3d_cc_tvd (T const * restrict const /*src*/,
ivect3 const & /*dstext*/,
ibbox3 const & /*srcbbox*/,
ibbox3 const & /*dstbbox*/,
- ibbox3 const & /*regbbox*/)
+ ibbox3 const & /*srcregbbox*/,
+ ibbox3 const & /*dstregbbox*/,
+ void * /*extraargs*/)
{
CCTK_WARN (0, "Data type not supported");
}
@@ -349,8 +381,11 @@ prolongate_3d_cc_tvd (CCTK_REAL8 const * restrict const src,
ivect3 const & dstext,
ibbox3 const & srcbbox,
ibbox3 const & dstbbox,
- ibbox3 const & regbbox)
+ ibbox3 const & srcregbbox,
+ ibbox3 const & dstregbbox,
+ void * const extraargs)
{
+ assert (not extraargs);
CCTK_FNAME(prolongate_3d_cc_real8_tvd)
(src,
srcext[0], srcext[1], srcext[2],
@@ -358,7 +393,7 @@ prolongate_3d_cc_tvd (CCTK_REAL8 const * restrict const src,
dstext[0], dstext[1], dstext[2],
reinterpret_cast <int const (*) [3]> (& srcbbox),
reinterpret_cast <int const (*) [3]> (& dstbbox),
- reinterpret_cast <int const (*) [3]> (& regbbox));
+ reinterpret_cast <int const (*) [3]> (& dstregbbox));
}
#endif
@@ -376,9 +411,9 @@ data<T>::data (const int varindex_,
vectorleader(vectorleader_)
{
assert (vectorlength>=1);
- assert (vectorindex>=0 && vectorindex<vectorlength);
- assert ((vectorindex==0 && not vectorleader)
- || (vectorindex!=0 && vectorleader));
+ assert (vectorindex>=0 and vectorindex<vectorlength);
+ assert ((vectorindex==0 and not vectorleader) or
+ (vectorindex!=0 and vectorleader));
}
template<typename T>
@@ -393,9 +428,9 @@ data<T>::data (const int varindex_,
vectorleader(vectorleader_)
{
assert (vectorlength>=1);
- assert (vectorindex>=0 && vectorindex<vectorlength);
- assert ((vectorindex==0 && not vectorleader)
- || (vectorindex!=0 && vectorleader));
+ assert (vectorindex>=0 and vectorindex<vectorlength);
+ assert ((vectorindex==0 and not vectorleader) or
+ (vectorindex!=0 and vectorleader));
allocate(extent_, proc_);
}
@@ -494,7 +529,9 @@ template <typename T>
void
data <T>::
copy_from_innerloop (gdata const * const gsrc,
- ibbox const & box)
+ ibbox const & dstregbox,
+ ibbox const & srcregbox,
+ islab const * restrict const slabinfo)
{
data const * const src = dynamic_cast <data const *> (gsrc);
assert (has_storage() and src->has_storage());
@@ -509,7 +546,7 @@ copy_from_innerloop (gdata const * const gsrc,
dstbox = this->extent();
break;
case cell_centered: {
- ivect const ioff = box.lower() - this->extent().lower();
+ ivect const ioff = dstbox.lower() - this->extent().lower();
ivect const is_centered = ioff % this->extent().stride() == 0;
// Shift bboxes to be face centred if necessary, since all grid
@@ -530,18 +567,16 @@ copy_from_innerloop (gdata const * const gsrc,
src->shape(),
static_cast <T *> (this->storage()),
this->shape(),
- srcbox,
- dstbox,
- box);
+ srcbox, dstbox,
+ srcregbox, dstregbox, (void*)slabinfo);
#elif CARPET_DIM == 4
call_operator<T> (& copy_4d,
static_cast <T const *> (src->storage()),
src->shape(),
static_cast <T *> (this->storage()),
this->shape(),
- srcbox,
- dstbox,
- box);
+ srcbox, dstbox,
+ srcregbox, dstregbox, (void*)slabinfo);
#else
# error "Value for CARPET_DIM not supported"
#endif
@@ -551,9 +586,8 @@ copy_from_innerloop (gdata const * const gsrc,
src->shape(),
static_cast <T *> (this->storage()),
this->shape(),
- srcbox,
- dstbox,
- box);
+ srcbox, dstbox,
+ srcregbox, dstregbox, (void*)slabinfo);
}
}
@@ -564,7 +598,9 @@ void
data <T>::
transfer_from_innerloop (vector <gdata const *> const & gsrcs,
vector <CCTK_REAL> const & times,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
CCTK_REAL const time,
int const order_space,
int const order_time)
@@ -578,7 +614,8 @@ transfer_from_innerloop (vector <gdata const *> const & gsrcs,
}
}
- transfer_time (gsrcs, times, box, time, order_space, order_time);
+ transfer_time
+ (gsrcs, times, dstbox, srcbox, slabinfo, time, order_space, order_time);
}
@@ -588,7 +625,9 @@ void
data <T>::
transfer_time (vector <gdata const *> const & gsrcs,
vector <CCTK_REAL> const & times,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
CCTK_REAL const time,
int const order_space,
int const order_time)
@@ -611,14 +650,15 @@ transfer_time (vector <gdata const *> const & gsrcs,
for (int tl = timelevel0; tl < timelevel0 + ntimelevels; ++ tl) {
tmps.AT(tl) =
new data (this->varindex, this->cent, this->transport_operator);
- tmps.AT(tl)->allocate (box, this->proc());
+ tmps.AT(tl)->allocate (srcbox, this->proc());
assert (gsrcs.AT(tl));
data const * const src = dynamic_cast <data const *> (gsrcs.AT(tl));
- tmps.AT(tl)->transfer_p_r (src, box, order_space);
+ assert (not slabinfo);
+ tmps.AT(tl)->transfer_p_r (src, dstbox, srcbox, NULL, order_space);
}
- time_interpolate (tmps, box, times, time, order_time);
+ time_interpolate (tmps, dstbox, dstbox, times, time, order_time);
for (int tl = timelevel0; tl < timelevel0 + ntimelevels; ++ tl) {
delete tmps.AT(tl);
@@ -632,7 +672,7 @@ transfer_time (vector <gdata const *> const & gsrcs,
data const * const src = dynamic_cast <data const *> (gsrcs.AT(timelevel0));
- transfer_p_r (src, box, order_space);
+ transfer_p_r (src, dstbox, srcbox, slabinfo, order_space);
} // if
}
@@ -643,21 +683,25 @@ template <typename T>
void
data <T>::
transfer_p_r (data const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
int const order_space)
{
if (all (src->extent().stride() == this->extent().stride())) {
// Copy
- copy_from_innerloop (src, box);
+ copy_from_innerloop (src, dstbox, srcbox, slabinfo);
} else if (all (src->extent().stride() > this->extent().stride())) {
// Prolongate
assert (transport_operator != op_sync and
transport_operator != op_restrict);
- transfer_p_vc_cc (src, box, order_space);
+ assert (not slabinfo);
+ transfer_p_vc_cc (src, dstbox, srcbox, order_space);
} else if (all (src->extent().stride() < this->extent().stride())) {
// Restrict
assert (transport_operator != op_sync);
- transfer_restrict (src, box, order_space);
+ assert (not slabinfo);
+ transfer_restrict (src, dstbox, srcbox, order_space);
} else {
assert (0);
}
@@ -669,17 +713,19 @@ template <typename T>
void
data <T>::
transfer_p_vc_cc (data const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
int const order_space)
{
- transfer_prolongate (src, box, order_space);
+ transfer_prolongate (src, dstbox, srcbox, order_space);
}
template <>
void
data <CCTK_INT>::
transfer_p_vc_cc (data const * const /*src*/,
- ibbox const & /*box*/,
+ ibbox const & /*dstbox*/,
+ ibbox const & /*srcbox*/,
int const /*order_space*/)
{
CCTK_WARN (0, "Data type not supported");
@@ -691,7 +737,8 @@ template <typename T>
void
data <T>::
transfer_prolongate (data const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
int const order_space)
{
static Timer total ("prolongate");
@@ -715,7 +762,9 @@ transfer_prolongate (data const * const src,
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox) =
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * const extraargs) =
{
NULL,
& prolongate_3d_rf2<T,1>,
@@ -743,7 +792,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
}
case cell_centered: {
@@ -754,7 +803,9 @@ transfer_prolongate (data const * const src,
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox) =
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * const extraargs) =
{
& prolongate_3d_cc_rf2<T,0>,
& prolongate_3d_cc_rf2<T,1>,
@@ -774,7 +825,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
}
default:
@@ -803,7 +854,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
case 5:
// There is only one parameter for the prolongation order, but
@@ -816,7 +867,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
CCTK_WARN (CCTK_WARN_ABORT,
@@ -828,12 +879,14 @@ transfer_prolongate (data const * const src,
case cell_centered: {
static
void (* the_operators[]) (T const * restrict const src,
- ivect3 const & restrict srcext,
- T * restrict const dst,
- ivect3 const & restrict dstext,
- ibbox3 const & restrict srcbbox,
- ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox) =
+ ivect3 const & restrict srcext,
+ T * restrict const dst,
+ ivect3 const & restrict dstext,
+ ibbox3 const & restrict srcbbox,
+ ibbox3 const & restrict dstbbox,
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * const extraargs) =
{
& prolongate_3d_cc_eno_rf2<T,2>,
& prolongate_3d_cc_eno_rf2<T,2>, // note that we cheat here: order is still 2 even though 3 was requested!
@@ -854,7 +907,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
}
break;
}
@@ -884,7 +937,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
CCTK_WARN (CCTK_WARN_ABORT,
@@ -919,7 +972,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
CCTK_WARN (CCTK_WARN_ABORT,
@@ -938,7 +991,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
CCTK_WARN (CCTK_WARN_ABORT,
@@ -972,7 +1025,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
CCTK_WARN (CCTK_WARN_ABORT,
@@ -1007,7 +1060,7 @@ transfer_prolongate (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
CCTK_WARN (CCTK_WARN_ABORT,
@@ -1036,7 +1089,8 @@ template <>
void
data <CCTK_INT>::
transfer_prolongate (data const * const /*src*/,
- ibbox const & /*box*/,
+ ibbox const & /*dstbox*/,
+ ibbox const & /*srcbox*/,
int const /*order_space*/)
{
CCTK_WARN (0, "Data type not supported");
@@ -1048,7 +1102,8 @@ template <typename T>
void
data <T>::
transfer_restrict (data const * const src,
- ibbox const & box,
+ ibbox const & dstregbox,
+ ibbox const & srcregbox,
int const /*order_space*/)
{
static Timer total ("restrict");
@@ -1075,11 +1130,11 @@ transfer_restrict (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcregbox, dstregbox, NULL);
break;
case cell_centered: {
- assert (all (box.stride() == this->extent().stride()));
- ivect const ioff = box.lower() - this->extent().lower();
+ assert (all (dstregbox.stride() == this->extent().stride()));
+ ivect const ioff = dstregbox.lower() - this->extent().lower();
ivect const is_centered = ioff % this->extent().stride() == 0;
// Shift bboxes to be face centred if necessary, since all grid
@@ -1095,7 +1150,7 @@ transfer_restrict (data const * const src,
this->shape(),
srcbox,
dstbox,
- box);
+ srcregbox, dstregbox, NULL);
} else if (all(is_centered == ivect(0,1,1))) {
call_operator<T> (& restrict_3d_vc_rf2<T,0,1,1>,
static_cast <T const *> (src->storage()),
@@ -1104,7 +1159,7 @@ transfer_restrict (data const * const src,
this->shape(),
srcbox,
dstbox,
- box);
+ srcregbox, dstregbox, NULL);
} else if (all(is_centered == ivect(1,0,1))) {
call_operator<T> (& restrict_3d_vc_rf2<T,1,0,1>,
static_cast <T const *> (src->storage()),
@@ -1113,7 +1168,7 @@ transfer_restrict (data const * const src,
this->shape(),
srcbox,
dstbox,
- box);
+ srcregbox, dstregbox, NULL);
} else if (all(is_centered == ivect(1,1,0))) {
call_operator<T> (& restrict_3d_vc_rf2<T,1,1,0>,
static_cast <T const *> (src->storage()),
@@ -1122,7 +1177,7 @@ transfer_restrict (data const * const src,
this->shape(),
srcbox,
dstbox,
- box);
+ srcregbox, dstregbox, NULL);
} else {
assert (0);
}
@@ -1153,7 +1208,7 @@ transfer_restrict (data const * const src,
this->shape(),
src->extent(),
this->extent(),
- box);
+ srcregbox, dstregbox, NULL);
break;
default:
assert (0);
@@ -1175,7 +1230,8 @@ template <>
void
data <CCTK_INT>::
transfer_restrict (data const * const /*src*/,
- ibbox const & /*box*/,
+ ibbox const & /*dstbox*/,
+ ibbox const & /*srcbox*/,
int const /*order_space*/)
{
CCTK_WARN (0, "Data type not supported");
@@ -1187,7 +1243,8 @@ template <typename T>
void
data <T>::
time_interpolate (vector <data *> const & srcs,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
vector <CCTK_REAL> const & times,
CCTK_REAL const time,
int const order_time)
@@ -1217,7 +1274,7 @@ time_interpolate (vector <data *> const & srcs,
this->shape(),
srcs.AT(0)->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
case 2:
@@ -1234,7 +1291,7 @@ time_interpolate (vector <data *> const & srcs,
this->shape(),
srcs.AT(0)->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
case 3:
@@ -1253,7 +1310,7 @@ time_interpolate (vector <data *> const & srcs,
this->shape(),
srcs.AT(0)->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
case 4:
@@ -1274,7 +1331,7 @@ time_interpolate (vector <data *> const & srcs,
this->shape(),
srcs.AT(0)->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
@@ -1306,7 +1363,7 @@ time_interpolate (vector <data *> const & srcs,
this->shape(),
srcs.AT(0)->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
case 2:
@@ -1323,7 +1380,7 @@ time_interpolate (vector <data *> const & srcs,
this->shape(),
srcs.AT(0)->extent(),
this->extent(),
- box);
+ srcbox, dstbox, NULL);
break;
default:
@@ -1352,7 +1409,8 @@ template <>
void
data <CCTK_INT>::
time_interpolate (vector <data *> const & /*srcs*/,
- ibbox const & /*box*/,
+ ibbox const & /*dstbox*/,
+ ibbox const & /*srcbox*/,
vector <CCTK_REAL> const & /*times*/,
CCTK_REAL const /*time*/,
int const /*order_time*/)
diff --git a/Carpet/CarpetLib/src/data.hh b/Carpet/CarpetLib/src/data.hh
index 1812f43a8..ddc645361 100644
--- a/Carpet/CarpetLib/src/data.hh
+++ b/Carpet/CarpetLib/src/data.hh
@@ -103,12 +103,16 @@ private:
void
copy_from_innerloop (gdata const * gsrc,
- ibbox const & box);
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * slabinfo);
void
transfer_from_innerloop (vector <gdata const *> const & gsrcs,
vector <CCTK_REAL> const & times,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
CCTK_REAL time,
int order_space,
int order_time);
@@ -116,34 +120,42 @@ private:
void
transfer_time (vector <gdata const *> const & gsrcs,
vector <CCTK_REAL> const & times,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
CCTK_REAL time,
int order_space,
int order_time);
void
transfer_p_r (data const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
int order_space);
void
transfer_p_vc_cc (data const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
int order_space);
void
transfer_prolongate (data const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
int order_space);
void
transfer_restrict (data const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
int order_space);
void
time_interpolate (vector <data *> const & srcs,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
vector <CCTK_REAL> const & times,
CCTK_REAL time,
int order_time);
diff --git a/Carpet/CarpetLib/src/dh.hh b/Carpet/CarpetLib/src/dh.hh
index fd4417bae..505196472 100644
--- a/Carpet/CarpetLib/src/dh.hh
+++ b/Carpet/CarpetLib/src/dh.hh
@@ -149,6 +149,7 @@ public:
srpvect fast_ref_bnd_prol_sendrecv;
// refluxing
+ // vect<vect<srpvect,2>,dim> fast_ref_refl_sendrecv;
srpvect fast_ref_refl_sendrecv_0_0;
srpvect fast_ref_refl_sendrecv_0_1;
srpvect fast_ref_refl_sendrecv_1_0;
diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc
index cba9f1796..9c79ed7a4 100644
--- a/Carpet/CarpetLib/src/gdata.cc
+++ b/Carpet/CarpetLib/src/gdata.cc
@@ -10,6 +10,7 @@
#include <iomanip>
#include <iostream>
#include <sstream>
+#include <typeinfo>
#ifdef CCTK_MPI
# include <mpi.h>
@@ -31,6 +32,51 @@ using namespace CarpetLib;
+template <typename T, int D>
+ostream& operator<< (ostream& os, slab<T,D> const & slabinfo)
+{
+ return os << "slab<" << typeid(T).name() << "," << D <<">"
+ << "{offset=" << slabinfo.offset << "}";
+}
+
+template ostream& operator<< (ostream& os, slab<int,dim> const & slabinfo);
+template ostream& operator<< (ostream& os, slab<double,dim> const & slabinfo);
+
+template<typename T,int D>
+MPI_Datatype mpi_datatype (slab<T,D> const&)
+{
+ static bool initialised = false;
+ static MPI_Datatype newtype;
+ if (not initialised) {
+ slab<T,D> const s;
+ typedef vect<T,D> avect;
+#define ENTRY(type, name) \
+ { \
+ sizeof s.name / sizeof(type), /* count elements */ \
+ (char*)&s.name - (char*)&s, /* offsetof doesn't work (why?) */ \
+ dist::mpi_datatype<type>(), /* find MPI datatype */ \
+ STRINGIFY(name), /* field name */ \
+ STRINGIFY(type), /* type name */ \
+ }
+ dist::mpi_struct_descr_t const descr[] = {
+ ENTRY(avect, offset),
+ {1, sizeof s, MPI_UB, "MPI_UB", "MPI_UB"}
+ };
+#undef ENTRY
+ ostringstream buf;
+ buf << "slab<" << typeid(T).name() << "," << D << ">";
+ newtype =
+ dist::create_mpi_datatype (sizeof descr / sizeof descr[0], descr,
+ buf.str().c_str(), sizeof s);
+ initialised = true;
+ }
+ return newtype;
+}
+
+template MPI_Datatype mpi_datatype (slab<int,dim> const&);
+
+
+
list<gdata*> gdata::allgdata;
@@ -143,18 +189,20 @@ void
gdata::
copy_from (comm_state & state,
gdata const * const src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
int const dstproc,
int const srcproc)
{
vector <gdata const *> const srcs (1, src);
CCTK_REAL const time = 0.0;
vector <CCTK_REAL> const times (1, time);
- int const order_space = cent == vertex_centered ? 1 : 0;
+ int const order_space = (this ? cent : src->cent) == vertex_centered ? 1 : 0;
int const order_time = 0;
transfer_from (state,
srcs, times,
- box, box,
+ dstbox, srcbox, slabinfo,
dstproc, srcproc,
time, order_space, order_time);
}
@@ -168,6 +216,7 @@ transfer_from (comm_state & state,
vector<CCTK_REAL> const & times,
ibbox const & dstbox,
ibbox const & srcbox,
+ islab const * restrict const slabinfo,
int const dstproc,
int const srcproc,
CCTK_REAL const time,
@@ -197,8 +246,10 @@ transfer_from (comm_state & state,
for (int t=0; t<(int)srcs.size(); ++t) {
assert (srcs.AT(t)->proc() == srcproc);
assert (srcs.AT(t)->has_storage());
- assert (all(srcbox.lower() >= srcs.AT(t)->extent().lower()));
- assert (all(srcbox.upper() <= srcs.AT(t)->extent().upper()));
+ if (not slabinfo) {
+ assert (all(srcbox.lower() >= srcs.AT(t)->extent().lower()));
+ assert (all(srcbox.upper() <= srcs.AT(t)->extent().upper()));
+ }
}
}
gdata const * const src = is_src ? srcs.AT(0) : NULL;
@@ -260,7 +311,8 @@ transfer_from (comm_state & state,
src->make_typed (src->varindex, src->cent, src->transport_operator);
buf->allocate (bufbox, srcproc, sendbuf, sendbufsize);
buf->transfer_from_innerloop
- (srcs, times, dstbox, time, order_space, order_time);
+ (srcs, times, dstbox, srcbox, slabinfo,
+ time, order_space, order_time);
delete buf;
state.commit_send_space
(src->c_datatype(), dstproc, prod(allocated_memory_shape(dstbox)));
@@ -275,7 +327,7 @@ transfer_from (comm_state & state,
src->make_typed (src->varindex, src->cent,
src->transport_operator);
buf->allocate (srcbox, srcproc, sendbuf, sendbufsize);
- buf->copy_from_innerloop (srcs.AT(tl), srcbox);
+ buf->copy_from_innerloop (srcs.AT(tl), srcbox, srcbox, NULL);
delete buf;
state.commit_send_space (src->c_datatype(), dstproc,
prod(allocated_memory_shape(srcbox)));
@@ -289,7 +341,7 @@ transfer_from (comm_state & state,
// handle the processor-local case
if (is_dst and is_src) {
transfer_from_innerloop
- (srcs, times, dstbox, time, order_space, order_time);
+ (srcs, times, dstbox, srcbox, slabinfo, time, order_space, order_time);
}
break;
@@ -307,7 +359,7 @@ transfer_from (comm_state & state,
buf->allocate (dstbox, dstproc, recvbuf, recvbufsize);
state.commit_recv_space (c_datatype(), srcproc,
prod(allocated_memory_shape(dstbox)));
- copy_from_innerloop (buf, dstbox);
+ copy_from_innerloop (buf, dstbox, dstbox, NULL);
delete buf;
} else {
if (cent == cell_centered) {
@@ -334,7 +386,8 @@ transfer_from (comm_state & state,
timebuf.AT(tl) = times.AT(timelevel0 + tl);
}
transfer_from_innerloop
- (bufs, timebuf, dstbox, time, order_space, order_time);
+ (bufs, timebuf, dstbox, srcbox, slabinfo,
+ time, order_space, order_time);
for (int tl = 0; tl < ntimelevels; ++ tl) {
delete bufs.AT(tl);
}
diff --git a/Carpet/CarpetLib/src/gdata.hh b/Carpet/CarpetLib/src/gdata.hh
index a06509bd7..6877b4974 100644
--- a/Carpet/CarpetLib/src/gdata.hh
+++ b/Carpet/CarpetLib/src/gdata.hh
@@ -22,6 +22,28 @@ using namespace std;
+// Slabbing description
+template <typename T, int D>
+struct slab {
+ vect<T,D> offset; // dst[ipos] = src[ipos + offset * box.stride];
+};
+typedef slab<int,dim> islab;
+
+template <typename T, int D>
+ostream& operator<< (ostream& os, slab<T,D> const & slabinfo);
+
+template <typename T, int D>
+MPI_Datatype mpi_datatype (slab<T,D> const &)
+ CCTK_ATTRIBUTE_CONST;
+namespace dist {
+ template<> inline MPI_Datatype mpi_datatype<islab> ()
+ CCTK_ATTRIBUTE_CONST;
+ template<> inline MPI_Datatype mpi_datatype<islab> ()
+ { islab dummy; return mpi_datatype(dummy); }
+}
+
+
+
// A generic data storage without type information
class gdata {
@@ -154,7 +176,9 @@ public:
void
copy_from (comm_state & state,
gdata const * src,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
int dstproc,
int srcproc);
@@ -164,6 +188,7 @@ public:
vector<CCTK_REAL> const & times,
ibbox const & dstbox,
ibbox const & srcbox,
+ islab const * restrict const slabinfo,
int dstproc,
int srcproc,
CCTK_REAL time,
@@ -183,14 +208,18 @@ private:
virtual
void
copy_from_innerloop (gdata const * gsrc,
- ibbox const & box)
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * slabinfo)
= 0;
virtual
void
transfer_from_innerloop (vector <gdata const *> const & gsrcs,
vector <CCTK_REAL> const & times,
- ibbox const & box,
+ ibbox const & dstbox,
+ ibbox const & srcbox,
+ islab const * restrict const slabinfo,
CCTK_REAL time,
int order_space,
int order_time)
diff --git a/Carpet/CarpetLib/src/gf.cc b/Carpet/CarpetLib/src/gf.cc
index 08d8715c7..c9b003efc 100644
--- a/Carpet/CarpetLib/src/gf.cc
+++ b/Carpet/CarpetLib/src/gf.cc
@@ -56,6 +56,12 @@ data<T>* gf<T>::operator() (int tl, int rl, int lc, int ml)
assert (rl>=0 and rl<h.reflevels());
assert (lc>=0 and lc<h.local_components(rl));
assert (ml>=0 and ml<h.mglevels());
+ if (not (tl>=0 and tl<timelevels(ml, rl))) {
+ cerr << "gf<T>::operator() "
+ << "vi=" << varindex << " name=" << (varindex>=0 ? CCTK_FullName(varindex) : "") << " "
+ << "pot=" << prolongation_order_time << " "
+ << "tl=" << tl << " rl=" << rl << " lc=" << lc << " ml=" << ml << "\n";
+ }
assert (tl>=0 and tl<timelevels(ml, rl));
return (data<T>*)storage.AT(ml).AT(rl).AT(lc).AT(tl);
}
diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc
index e0cce5e35..9908f0b0b 100644
--- a/Carpet/CarpetLib/src/ggf.cc
+++ b/Carpet/CarpetLib/src/ggf.cc
@@ -626,7 +626,7 @@ transfer_from_all (comm_state & state,
}
dst->transfer_from
- (state, gsrcs, times, recv, send, p1, p2 , time, pos, pot);
+ (state, gsrcs, times, recv, send, NULL, p1, p2 , time, pos, pot);
}
total.stop (0);
diff --git a/Carpet/CarpetLib/src/gh.cc b/Carpet/CarpetLib/src/gh.cc
index a99115147..5bcd64e34 100644
--- a/Carpet/CarpetLib/src/gh.cc
+++ b/Carpet/CarpetLib/src/gh.cc
@@ -462,6 +462,11 @@ locate_position (rvect const & rpos,
gh::cregs const & regs = superregions.AT(rl);
+ // TODO: Ignore this level if this point is not in the active
+ // region (i.e. if it is a buffer point or similar)
+#warning "TODO: check the level_bbox"
+#warning "TODO: (assume this gh has only one dh)"
+
// Search all superregions linearly. Each superregion corresponds
// to a "refined region", and the number of superregions is thus
// presumably independent of the number of processors.
diff --git a/Carpet/CarpetLib/src/interpolate_3d_2tl.cc b/Carpet/CarpetLib/src/interpolate_3d_2tl.cc
index 754b3a48c..9590632ad 100644
--- a/Carpet/CarpetLib/src/interpolate_3d_2tl.cc
+++ b/Carpet/CarpetLib/src/interpolate_3d_2tl.cc
@@ -41,8 +41,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
typedef typename typeprops<T>::real RT;
@@ -151,7 +155,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc
index f0b2a78a2..eaf24bea5 100644
--- a/Carpet/CarpetLib/src/interpolate_3d_3tl.cc
+++ b/Carpet/CarpetLib/src/interpolate_3d_3tl.cc
@@ -43,8 +43,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
typedef typename typeprops<T>::real RT;
@@ -158,7 +162,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/interpolate_3d_4tl.cc b/Carpet/CarpetLib/src/interpolate_3d_4tl.cc
index 0e5439893..16039c7d8 100644
--- a/Carpet/CarpetLib/src/interpolate_3d_4tl.cc
+++ b/Carpet/CarpetLib/src/interpolate_3d_4tl.cc
@@ -45,8 +45,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
typedef typename typeprops<T>::real RT;
@@ -168,7 +172,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/interpolate_3d_5tl.cc b/Carpet/CarpetLib/src/interpolate_3d_5tl.cc
index 2cb033f37..bb7f4d06d 100644
--- a/Carpet/CarpetLib/src/interpolate_3d_5tl.cc
+++ b/Carpet/CarpetLib/src/interpolate_3d_5tl.cc
@@ -47,8 +47,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
typedef typename typeprops<T>::real RT;
@@ -176,7 +180,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/interpolate_eno_3d_3tl.cc b/Carpet/CarpetLib/src/interpolate_eno_3d_3tl.cc
index ca667fc6c..969ec4bbf 100644
--- a/Carpet/CarpetLib/src/interpolate_eno_3d_3tl.cc
+++ b/Carpet/CarpetLib/src/interpolate_eno_3d_3tl.cc
@@ -61,8 +61,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
typedef typename typeprops<T>::real RT;
@@ -211,8 +215,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
CCTK_WARN (CCTK_WARN_ABORT, "ENO for complex numbers is not supported");
}
#endif
@@ -232,7 +240,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
CCTK_WARN (CCTK_WARN_ABORT, "ENO for complex numbers is not supported");
}
@@ -253,7 +263,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
CCTK_WARN (CCTK_WARN_ABORT, "ENO for complex numbers is not supported");
}
@@ -276,7 +288,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#define CARPET_NO_COMPLEX
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/operator_prototypes_3d.hh b/Carpet/CarpetLib/src/operator_prototypes_3d.hh
index 909622497..08d633d18 100644
--- a/Carpet/CarpetLib/src/operator_prototypes_3d.hh
+++ b/Carpet/CarpetLib/src/operator_prototypes_3d.hh
@@ -56,7 +56,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -66,7 +68,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
@@ -78,7 +82,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
#if 0
template <typename T>
@@ -89,7 +95,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -99,7 +107,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -109,7 +119,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -119,7 +131,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -129,7 +143,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -139,7 +155,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
#endif
@@ -152,7 +170,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
@@ -164,7 +184,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
#if 0
template <typename T>
@@ -175,7 +197,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -185,7 +209,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -195,7 +221,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
#endif
template <typename T, int ORDER>
@@ -206,7 +234,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
@@ -217,7 +247,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
@@ -233,7 +265,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -249,7 +283,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -267,7 +303,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -287,7 +325,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
template <typename T>
void
@@ -303,7 +343,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
@@ -315,7 +357,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
@@ -327,7 +371,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict srcregbbox,
+ ibbox3 const & restrict dstregbbox,
+ void * extraargs);
diff --git a/Carpet/CarpetLib/src/operator_prototypes_4d.hh b/Carpet/CarpetLib/src/operator_prototypes_4d.hh
index 59c1bc53f..d18f288cf 100644
--- a/Carpet/CarpetLib/src/operator_prototypes_4d.hh
+++ b/Carpet/CarpetLib/src/operator_prototypes_4d.hh
@@ -57,7 +57,9 @@ namespace CarpetLib {
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox);
+ ibbox4 const & restrict srcregbbox,
+ ibbox4 const & restrict dstregbbox,
+ void * extraargs);
@@ -69,7 +71,9 @@ namespace CarpetLib {
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox);
+ ibbox4 const & restrict srcregbbox,
+ ibbox4 const & restrict dstregbbox,
+ void * extraargs);
@@ -81,7 +85,9 @@ namespace CarpetLib {
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox);
+ ibbox4 const & restrict srcregbbox,
+ ibbox4 const & restrict dstregbbox,
+ void * extraargs);
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
index a1d3b2809..e9a64ecc8 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
@@ -950,8 +950,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
static_assert (ORDER>=0, "ORDER must be non-negative");
typedef typename typeprops<T>::real RT;
@@ -1274,7 +1278,6 @@ namespace CarpetLib {
#define TYPECASE(N,T) \
\
- \
template <> \
void \
prolongate_3d_cc_eno_rf2<T,2> (T const * restrict const src, \
@@ -1283,7 +1286,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox) \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs) \
{ \
CCTK_WARN (CCTK_WARN_ABORT, \
"ENO operators are not supported for CCTK_COMPLEX"); \
@@ -1297,12 +1302,13 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox) \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs) \
{ \
CCTK_WARN (CCTK_WARN_ABORT, \
"ENO operators are not supported for CCTK_COMPLEX"); \
- }
-
+ }
#define CARPET_COMPLEX
#include "typecase.hh"
@@ -1311,38 +1317,38 @@ namespace CarpetLib {
-#define TYPECASE(N,T) \
- \
- \
- template \
- void \
- prolongate_3d_cc_eno_rf2<T,2> (T const * restrict const src, \
- ivect3 const & restrict srcext, \
- T * restrict const dst, \
- ivect3 const & restrict dstext, \
- ibbox3 const & restrict srcbbox, \
- ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
- \
- \
- template \
- void \
- prolongate_3d_cc_eno_rf2<T,3> (T const * restrict const src, \
- ivect3 const & restrict srcext, \
- T * restrict const dst, \
- ivect3 const & restrict dstext, \
- ibbox3 const & restrict srcbbox, \
- ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
- \
+#define TYPECASE(N,T) \
+ \
+ template \
+ void \
+ prolongate_3d_cc_eno_rf2<T,2> (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
+ \
+ \
+ template \
+ void \
+ prolongate_3d_cc_eno_rf2<T,3> (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#define CARPET_NO_INT
#define CARPET_NO_COMPLEX
#include "typecase.hh"
#undef TYPECASE
-
-
} // namespace CarpetLib
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
index 19495a105..f3d717d77 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
@@ -320,8 +320,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
static_assert (ORDER>=0, "ORDER must be non-negative");
typedef typename typeprops<T>::real RT;
@@ -652,7 +656,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -662,7 +668,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -672,7 +680,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -682,7 +692,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -692,7 +704,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -702,7 +716,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/prolongate_3d_o5_monotone_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_o5_monotone_rf2.cc
index 8a3515e70..adc4d0693 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_o5_monotone_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_o5_monotone_rf2.cc
@@ -88,8 +88,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
typedef typename typeprops<T>::real RT;
@@ -820,21 +824,6 @@ namespace CarpetLib {
-#define TYPECASE(N,T) \
- template \
- void \
- prolongate_3d_o5_monotone_rf2 (T const * restrict const src, \
- ivect3 const & restrict srcext, \
- T * restrict const dst, \
- ivect3 const & restrict dstext, \
- ibbox3 const & restrict srcbbox, \
- ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
-#define CARPET_NO_COMPLEX
-#define CARPET_NO_INT
-#include "typecase.hh"
-#undef TYPECASE
-
template <>
void
prolongate_3d_o5_monotone_rf2 (CCTK_COMPLEX const * restrict const src,
@@ -843,10 +832,30 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
CCTK_WARN(0, "This should never be called!");
}
+#define TYPECASE(N,T) \
+ template \
+ void \
+ prolongate_3d_o5_monotone_rf2 (T const * restrict const src, \
+ ivect3 const & restrict srcext, \
+ T * restrict const dst, \
+ ivect3 const & restrict dstext, \
+ ibbox3 const & restrict srcbbox, \
+ ibbox3 const & restrict dstbbox, \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
+#define CARPET_NO_COMPLEX
+#define CARPET_NO_INT
+#include "typecase.hh"
+#undef TYPECASE
+
+
} // namespace CarpetLib
diff --git a/Carpet/CarpetLib/src/prolongate_3d_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_rf2.cc
index f36e79ef8..246cbf8a8 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_rf2.cc
@@ -465,8 +465,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
static_assert (ORDER>=0 and ORDER % 2 == 1,
"ORDER must be non-negative and odd");
@@ -789,7 +793,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -799,7 +805,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -809,7 +817,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -819,7 +829,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -829,7 +841,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
\
template \
void \
@@ -839,7 +853,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/prolongate_4d_o1_rf2.cc b/Carpet/CarpetLib/src/prolongate_4d_o1_rf2.cc
index af4b1696b..1f7e8203e 100644
--- a/Carpet/CarpetLib/src/prolongate_4d_o1_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_4d_o1_rf2.cc
@@ -35,8 +35,12 @@ namespace CarpetLib {
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox)
+ ibbox4 const & restrict,
+ ibbox4 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
typedef typename typeprops<T>::real RT;
@@ -594,7 +598,9 @@ namespace CarpetLib {
ivect4 const & restrict dstext, \
ibbox4 const & restrict srcbbox, \
ibbox4 const & restrict dstbbox, \
- ibbox4 const & restrict regbbox);
+ ibbox4 const & restrict, \
+ ibbox4 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc
index 29b574354..767476db3 100644
--- a/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_cc_rf2.cc
@@ -34,8 +34,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
DECLARE_CCTK_PARAMETERS;
typedef typename typeprops<T>::real RT;
@@ -146,7 +150,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/restrict_3d_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_rf2.cc
index 4286cd2ef..5fff24a3e 100644
--- a/Carpet/CarpetLib/src/restrict_3d_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_rf2.cc
@@ -36,8 +36,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
if (any (srcbbox.stride() >= regbbox.stride() or
dstbbox.stride() != regbbox.stride()))
{
@@ -127,7 +131,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc b/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
index 8d80b40e0..97047760c 100644
--- a/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_3d_vc_rf2.cc
@@ -135,8 +135,12 @@ namespace CarpetLib {
ivect3 const & restrict dstext,
ibbox3 const & restrict srcbbox,
ibbox3 const & restrict dstbbox,
- ibbox3 const & restrict regbbox)
+ ibbox3 const & restrict,
+ ibbox3 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
DECLARE_CCTK_PARAMETERS;
typedef typename typeprops<T>::real RT;
@@ -254,7 +258,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
template \
void \
restrict_3d_vc_rf2<T,0,0,1> (T const * restrict const src, \
@@ -263,7 +269,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
template \
void \
restrict_3d_vc_rf2<T,0,1,0> (T const * restrict const src, \
@@ -272,7 +280,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
template \
void \
restrict_3d_vc_rf2<T,0,1,1> (T const * restrict const src, \
@@ -281,7 +291,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
template \
void \
restrict_3d_vc_rf2<T,1,0,0> (T const * restrict const src, \
@@ -290,7 +302,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
template \
void \
restrict_3d_vc_rf2<T,1,0,1> (T const * restrict const src, \
@@ -299,7 +313,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
template \
void \
restrict_3d_vc_rf2<T,1,1,0> (T const * restrict const src, \
@@ -308,7 +324,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox); \
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs); \
template \
void \
restrict_3d_vc_rf2<T,1,1,1> (T const * restrict const src, \
@@ -317,7 +335,9 @@ namespace CarpetLib {
ivect3 const & restrict dstext, \
ibbox3 const & restrict srcbbox, \
ibbox3 const & restrict dstbbox, \
- ibbox3 const & restrict regbbox);
+ ibbox3 const & restrict, \
+ ibbox3 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/restrict_4d_rf2.cc b/Carpet/CarpetLib/src/restrict_4d_rf2.cc
index 8d4574278..10d84b890 100644
--- a/Carpet/CarpetLib/src/restrict_4d_rf2.cc
+++ b/Carpet/CarpetLib/src/restrict_4d_rf2.cc
@@ -36,8 +36,12 @@ namespace CarpetLib {
ivect4 const & restrict dstext,
ibbox4 const & restrict srcbbox,
ibbox4 const & restrict dstbbox,
- ibbox4 const & restrict regbbox)
+ ibbox4 const & restrict,
+ ibbox4 const & restrict regbbox,
+ void * extraargs)
{
+ assert (not extraargs);
+
if (any (srcbbox.stride() >= regbbox.stride() or
dstbbox.stride() != regbbox.stride()))
{
@@ -132,7 +136,9 @@ namespace CarpetLib {
ivect4 const & restrict dstext, \
ibbox4 const & restrict srcbbox, \
ibbox4 const & restrict dstbbox, \
- ibbox4 const & restrict regbbox);
+ ibbox4 const & restrict, \
+ ibbox4 const & restrict regbbox, \
+ void * extraargs);
#include "typecase.hh"
#undef TYPECASE
diff --git a/Carpet/CarpetLib/src/vect.cc b/Carpet/CarpetLib/src/vect.cc
index b8537a8eb..661fd0190 100644
--- a/Carpet/CarpetLib/src/vect.cc
+++ b/Carpet/CarpetLib/src/vect.cc
@@ -78,7 +78,6 @@ MPI_Datatype vect<T,D>::mpi_datatype () const
-
// Specialise some constructors for lower dimensions
// These functions are declared, but must not be used.