46 template<
class T,
unsigned Dim,
class A,
class Op>
58 ASSIGNMSG(msg <<
"Checking for compressibility of LField with domain = ");
71 bool compress = c1 && c2 && ( c3 || c4 );
84 ASSIGNMSG(msg <<
"Yes we CAN compress, so do so now ... ");
99 if (*lf.
begin() == tmpval)
105 ASSIGNMSG(msg <<
"LHS and RHS are compressed, doing assign, and ");
106 ASSIGNMSG(msg << *lf.
begin() <<
" == " <<tmpval<<
", so result = 1");
120 ASSIGNMSG(msg <<
"No we cannot compress, so make sure we're ");
121 ASSIGNMSG(msg <<
"uncompressed. Fill domain? " << !(c3&&c2) <<
endl);
147 return (*Expr::Child)(Expr::Value.Arg);
151 return Expr::Child.offset(i)(Expr::Value.Arg);
155 return Expr::Child.offset(i,j)(Expr::Value.Arg);
159 return Expr::Child.offset(i,j,k)(Expr::Value.Arg);
164 return (*Expr::Child)(Expr::Value.Arg);
168 return Expr::Child.offset(i)(Expr::Value.Arg);
172 return Expr::Child.offset(i,j)(Expr::Value.Arg);
176 return Expr::Child.offset(i,j,k)(Expr::Value.Arg);
180 return Expr::Child.unit_offset(i)(Expr::Value.Arg);
184 return Expr::Child.unit_offset(i,j)(Expr::Value.Arg);
188 return Expr::Child.unit_offset(i,j,k)(Expr::Value.Arg);
197 Expr::Child.rewind(d);
201 return Expr::Child.size(d);
205 return Expr::Child.done(d);
209 return Expr::Child.Stride(d);
229 template<
class T1,
unsigned Dim,
class RHS,
class OP>
246 typename RHS::Wrapped& bb = b.PETE_unwrap();
250 ASSIGNMSG(msg <<
"Checking whether to fill GC's on RHS ..." <<
endl);
268 bool needFinalCompressCheck =
false;
277 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": making lfield copy.");
286 if ( ! local_domain.
empty() )
298 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": plugbase on ");
302 ASSIGNMSG(msg <<
"For lf " << lfcount <<
" with owned domain ");
309 ASSIGNMSG(msg <<
"compressed assign, changing ");
322 ExprT expr(lf->
begin(local_domain), bb);
332 ASSIGNMSG(msg <<
": doing extra post-compute ");
336 needFinalCompressCheck =
true;
342 ERRORMSG(
"All Fields in an expression must be aligned. ");
344 ERRORMSG(
"This error occurred while evaluating an expression ");
354 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": swapping lfield data.");
356 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": at beg, lfield=" << *lf);
358 (*la).second->swapData( *lf );
360 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": at end, lfield=");
375 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
382 if (fillGC && needFinalCompressCheck) {
383 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
405 template<
class A,
class RHS,
class OP,
class Tag,
class TP>
414 ASSIGNMSG(msg <<
"Computing assignment to IBF[" << lhs.Child.getDomain());
417 enum {
Dim = A::Dim_u };
418 typedef typename A::return_type T1;
427 const NDIndex<Dim> &total_domain = lhs.Child.getDomain();
430 ASSIGNMSG(msg <<
"Checking whether to fill GC's on RHS ..." <<
endl);
445 bool needFinalCompressCheck =
false;
457 if (!local_domain.
empty())
470 ASSIGNMSG(msg <<
"For lf " << lo <<
": plugbase on ");
486 ASSIGNMSG(msg <<
"Compressed assign on ");
503 LHS(lhs.Value, lf->
begin(local_domain));
504 ExprT expr2(ilhs, rhs, op);
510 ASSIGNMSG(msg <<
"Doing extra post-compute ");
514 needFinalCompressCheck =
true;
520 ERRORMSG(
"All Fields in an expression must be aligned. ");
522 ERRORMSG(
"This error occurred while evaluating an expression ");
523 ERRORMSG(
"for an LField with domain ");
534 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
542 if (fillGC && needFinalCompressCheck) {
543 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
567 template<
class T1,
unsigned Dim,
class RHS,
class OP>
599 bool needFinalCompressCheck =
false;
609 ASSIGNMSG(msg <<
"For lf " << lfcount <<
" with domain ");
622 ExprT expr(lf.
begin(),bb,op);
632 ASSIGNMSG(msg <<
": doing extra post-compute ");
636 needFinalCompressCheck =
true;
650 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
656 if (needFinalCompressCheck) {
657 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
PETE_Combiner< bool, OpOr > PETE_OrCombiner
Expr::PETE_Return_t PETE_Return_t
int done(unsigned d) const
const NDIndex< Dim > & getOwned() const
PETE_Return_t & offset(int i, int j) const
bool containsAllPoints(const NDIndex< Dim > &b) const
BareField< T, Dim > & getBareField()
bool compressible() const
PETE_Return_t & offset(int i, int j, int k) const
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
bool IsCompressed() const
void Uncompress(bool fill_domain=true)
PETE_Return_t & operator*() const
void assign(const BareField< T, Dim > &a, RHS b, OP op, ExprTag< true >)
PETE_Return_t & offset(int i)
void fillGuardCellsIfNotDirty() const
bool TryCompressLHS(LField< T, Dim > &, A &, Op, const NDIndex< Dim > &)
static bool extraCompressChecks
PETE_Return_t & offset(int i, int j)
const NDIndex< Dim > & getDomain() const
Inform & endl(Inform &inf)
int size(unsigned d) const
static type apply(const T &t)
ParensIterator(const Expr &e)
PETE_Return_t & offset(int i, int j, int k)
PETE_Combiner< bool, OpAnd > PETE_AndCombiner
void PETE_apply(const OpPeriodic< T > &, T &a, const T &b)
bool TryCompress(bool baseOnPhysicalCells=false)
PETE_Return_t & unit_offset(int i)
PETE_Return_t & unit_offset(int i, int j, int k)
PETE_Return_t & offset(int i) const
ac_id_larray::iterator iterator_if
constexpr double e
The value of .
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
PETE_Return_t & unit_offset(int i, int j)
static bool noFieldCompression
WrappedExpr & PETE_unwrap()
PETE_Return_t & operator*()
const NDIndex< Dim > & getDomain() const
static void abort(const char *=0)
const iterator & begin() const
FillGCIfNecessaryTag< D, T1 > FillGCIfNecessary(const BareField< T1, D > &bf)