65 template<
class T,
unsigned Dim,
class A,
class Op>
77 ASSIGNMSG(msg <<
"Checking for compressibility of LField with domain = ");
90 bool compress = c1 && c2 && ( c3 || c4 );
103 ASSIGNMSG(msg <<
"Yes we CAN compress, so do so now ... ");
118 if (*lf.
begin() == tmpval)
124 ASSIGNMSG(msg <<
"LHS and RHS are compressed, doing assign, and ");
125 ASSIGNMSG(msg << *lf.
begin() <<
" == " <<tmpval<<
", so result = 1");
139 ASSIGNMSG(msg <<
"No we cannot compress, so make sure we're ");
140 ASSIGNMSG(msg <<
"uncompressed. Fill domain? " << !(c3&&c2) <<
endl);
166 return (*Expr::Child)(Expr::Value.Arg);
170 return Expr::Child.offset(i)(Expr::Value.Arg);
174 return Expr::Child.offset(i,j)(Expr::Value.Arg);
178 return Expr::Child.offset(i,j,k)(Expr::Value.Arg);
183 return (*Expr::Child)(Expr::Value.Arg);
187 return Expr::Child.offset(i)(Expr::Value.Arg);
191 return Expr::Child.offset(i,j)(Expr::Value.Arg);
195 return Expr::Child.offset(i,j,k)(Expr::Value.Arg);
199 return Expr::Child.unit_offset(i)(Expr::Value.Arg);
203 return Expr::Child.unit_offset(i,j)(Expr::Value.Arg);
207 return Expr::Child.unit_offset(i,j,k)(Expr::Value.Arg);
216 Expr::Child.rewind(d);
220 return Expr::Child.size(d);
224 return Expr::Child.done(d);
228 return Expr::Child.Stride(d);
248 template<
class T1,
unsigned Dim,
class RHS,
class OP>
265 typename RHS::Wrapped& bb = b.PETE_unwrap();
269 ASSIGNMSG(msg <<
"Checking whether to fill GC's on RHS ..." <<
endl);
286 bool needFinalCompressCheck =
false;
295 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": making lfield copy.");
304 if ( ! local_domain.
empty() )
316 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": plugbase on ");
320 ASSIGNMSG(msg <<
"For lf " << lfcount <<
" with owned domain ");
327 ASSIGNMSG(msg <<
"compressed assign, changing ");
340 ExprT expr(lf->
begin(local_domain), bb);
350 ASSIGNMSG(msg <<
": doing extra post-compute ");
354 needFinalCompressCheck =
true;
360 ERRORMSG(
"All Fields in an expression must be aligned. ");
362 ERRORMSG(
"This error occurred while evaluating an expression ");
372 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": swapping lfield data.");
374 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": at beg, lfield=" << *lf);
376 (*la).second->swapData( *lf );
378 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": at end, lfield=");
391 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
398 if (fillGC && needFinalCompressCheck) {
399 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
421 template<
class A,
class RHS,
class OP,
class Tag,
class TP>
430 ASSIGNMSG(msg <<
"Computing assignment to IBF[" << lhs.Child.getDomain());
433 enum {
Dim = A::Dim_u };
434 typedef typename A::return_type T1;
443 const NDIndex<Dim> &total_domain = lhs.Child.getDomain();
446 ASSIGNMSG(msg <<
"Checking whether to fill GC's on RHS ..." <<
endl);
461 bool needFinalCompressCheck =
false;
473 if (!local_domain.
empty())
486 ASSIGNMSG(msg <<
"For lf " << lo <<
": plugbase on ");
502 ASSIGNMSG(msg <<
"Compressed assign on ");
519 LHS(lhs.Value, lf->
begin(local_domain));
520 ExprT expr2(ilhs, rhs, op);
526 ASSIGNMSG(msg <<
"Doing extra post-compute ");
530 needFinalCompressCheck =
true;
536 ERRORMSG(
"All Fields in an expression must be aligned. ");
538 ERRORMSG(
"This error occurred while evaluating an expression ");
539 ERRORMSG(
"for an LField with domain ");
550 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
558 if (fillGC && needFinalCompressCheck) {
559 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
583 template<
class T1,
unsigned Dim,
class RHS,
class OP>
614 bool needFinalCompressCheck =
false;
624 ASSIGNMSG(msg <<
"For lf " << lfcount <<
" with domain ");
637 ExprT expr(lf.
begin(),bb,op);
647 ASSIGNMSG(msg <<
": doing extra post-compute ");
651 needFinalCompressCheck =
true;
663 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
669 if (needFinalCompressCheck) {
670 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
PETE_Return_t & offset(int i, int j, int k)
static type apply(const T &t)
static bool extraCompressChecks
void PETE_apply(const OpPeriodic< T > &e, T &a, const T &b)
bool containsAllPoints(const NDIndex< Dim > &b) const
bool TryCompress(bool baseOnPhysicalCells=false)
static void abort(const char *=0, int exitcode=(-1))
ac_id_larray::iterator iterator_if
constexpr double e
The value of .
PETE_Return_t & offset(int i, int j, int k) const
BareField< T, Dim > & getBareField()
const NDIndex< Dim > & getDomain() const
PETE_Return_t & offset(int i)
PETE_Return_t & operator*() const
const NDIndex< Dim > & getOwned() const
PETE_Return_t & offset(int i) const
const NDIndex< Dim > & getDomain() const
WrappedExpr & PETE_unwrap()
ParensIterator(const Expr &e)
void Uncompress(bool fill_domain=true)
void assign(const BareField< T, Dim > &a, RHS b, OP op, ExprTag< true >)
PETE_Return_t & operator*()
bool compressible() const
const iterator & begin() const
static bool noFieldCompression
PETE_Return_t & unit_offset(int i, int j)
PETE_Return_t & offset(int i, int j) const
PETE_Return_t & unit_offset(int i)
void fillGuardCellsIfNotDirty() const
Expr::PETE_Return_t PETE_Return_t
PETE_Return_t & offset(int i, int j)
bool IsCompressed() const
PETE_Combiner< bool, OpAnd > PETE_AndCombiner
FillGCIfNecessaryTag< D, T1 > FillGCIfNecessary(const BareField< T1, D > &bf)
bool TryCompressLHS(LField< T, Dim > &, A &, Op, const NDIndex< Dim > &)
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
PETE_Combiner< bool, OpOr > PETE_OrCombiner
PETE_Return_t & unit_offset(int i, int j, int k)
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
int done(unsigned d) const
int size(unsigned d) const
Inform & endl(Inform &inf)