64 template<
class T1,
class T2,
unsigned D1,
unsigned D2>
89 for (iproc=0; iproc<nprocs; ++iproc)
94 for (rf_i = rhs.
begin_if(); rf_i != rf_e; ++rf_i) {
109 range(lhs.getLayout().touch_range_rdv(lt,lhs.getGuardCellSizes()));
111 for (remote_i = range.first; remote_i != range.second; ++remote_i) {
116 int rnode = (*remote_i).second->getNode();
120 irhs.
getDomain().plugBase(left_intersect);
124 rf.
begin(right_intersect, compressed_value);
126 ASSIGNMSG(msg <<
"Sending IndexedField data from domain ");
127 ASSIGNMSG(msg << right_intersect <<
" to domain " << left_intersect);
132 rhs_i.
permute(right_intersect,left_intersect);
138 if (!mess[rnode]) mess[rnode] =
new Message;
147 for (iproc=0; iproc<nprocs; ++iproc) {
163 template<
class T1,
class T2,
unsigned D1,
unsigned D2,
class Container>
167 Container& recv_ac,
int& msgnum)
182 bool* recvmsg =
new bool[nprocs];
184 for (iproc=0; iproc<nprocs; ++iproc)
185 recvmsg[iproc] =
false;
188 for (lf_i = lhs.
begin_if(); lf_i != lf_e; ++lf_i) {
203 for (rv_i = range.first; rv_i != range.second; ++rv_i) {
208 ASSIGNMSG(msg <<
"Expecting IndexedField data from domain " << ri);
214 int rnode = (*rv_i).second->getNode();
215 recvmsg[rnode] =
true;
221 for (iproc=0; iproc<nprocs; ++iproc)
222 if (recvmsg[iproc]) ++msgnum;
234 template<
class T1,
class T2,
unsigned D1,
unsigned D2,
class Op>
244 ASSIGNMSG(msg <<
"Computing general local assignment to IBF[");
257 lf_i!=lhs.end_if(); ++lf_i)
268 ASSIGNMSG(msg <<
"Assigning to local LField with owned = " << lo);
273 ASSIGNMSG(msg <<
"Intersection lhs domain = " << lt <<
endl);
281 rf_i != rhs.
end_if(); ++rf_i)
310 ASSIGNMSG(msg <<
"Found touching rhs field: assigning ");
321 ASSIGNMSG(msg <<
"Checking for possible compressed-assign:");
322 ASSIGNMSG(msg <<
"\n rf.IsCompressed = " << c1);
323 ASSIGNMSG(msg <<
"\n lhs.contains(allocatd) = " << c2);
324 ASSIGNMSG(msg <<
"\n lf.IsCompressed = " << c4);
325 ASSIGNMSG(msg <<
"\n Doing assignment = " << c3);
326 ASSIGNMSG(msg <<
"\n Result = " << (c1&&c2&&(c3||c4)));
328 if ( lhs.compressible() && c1 && c2 && ( c3 || c4 ) )
330 ASSIGNMSG(msg <<
"Can do compressed assign from rhs ");
348 bool filldom = ((!c22) || (!c32));
349 ASSIGNMSG(msg <<
"Must uncompress, filldom = ");
362 lf.
begin(lhsDomain) ;
366 Expr(lhs_i,rhs_i,op).apply();
382 template<
class T1,
class T2,
unsigned D1,
unsigned D2,
383 class Op,
class Container>
388 Container& recv_ac,
int msgnum,
396 ASSIGNMSG(msg <<
"] = IBF[" << irhs.getDomain() <<
"] ..." <<
endl);
416 int ndoms = mess->
size() / (D1 + 3);
417 for (
int idom=0; idom<ndoms; ++idom) {
423 RFI rhs_i(compressed_data);
424 rhs_i.getMessage(*mess);
426 ASSIGNMSG(msg <<
"Received IndexedField data for domain " << domain);
431 PAssert( hit != recv_ac.end() );
438 bool c4 = lf.IsCompressed();
439 if ( lhs.compressible() && c1 && c2 && ( c3 || c4 ) ) {
450 lf.Uncompress( !(c2&&c3) );
452 LFI lhs_i = lf.begin(domain);
454 Expr(lhs_i,rhs_i,op).apply();
458 recv_ac.erase( hit );
474 template<
unsigned int D1,
unsigned int D2>
483 template<
unsigned int D1>
500 template<
class T1,
unsigned D1,
class RHS,
class Op>
507 typedef typename RHS::PETE_Return_t T2;
508 enum { D2=RHS::Dim_u };
513 if ( lhs.
getBareField().get_Id() == rhs.getBareField().get_Id() )
519 ERRORMSG(
"Overlapping domains in indexed assignment!"<<
endl);
543 std::multimap< NDIndex<D1> ,
LField<T1,D1>* , std::less< NDIndex<D1> > > recv_ac;
Message & putMessage(Message &m, bool makecopy=true)
void PETE_apply(const OpPeriodic< T > &e, T &a, const T &b)
bool containsAllPoints(const NDIndex< Dim > &b) const
Layout_t & getLayout() const
ac_id_larray::iterator iterator_if
BareField< T, Dim > & getBareField()
const NDIndex< Dim > & getOwned() const
touch_range_dv touch_range_rdv(const NDIndex< Dim > &domain, const GuardCellSizes< Dim > &gc=gc0()) const
const NDIndex< Dim > & getDomain() const
Message & getMessage(Message &m)
void Uncompress(bool fill_domain=true)
void assign(const BareField< T, Dim > &a, RHS b, OP op, ExprTag< true >)
int next_tag(int t, int s=1000)
const iterator & begin() const
NDIndex< Dim > plugBase(const NDIndex< 1 > &i) const
CompressedBrickIterator< T, 1 > permute(NDIndex< Dim > ¤t, NDIndex< 1 > &permuted) const
void CalcIndexedReceive(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &irhs, Container &recv_ac, int &msgnum)
bool touches(const NDIndex< Dim > &) const
PETE_TBTree< OpLT, Index::PETE_Expr_t, PETE_Scalar< double > > lt(const Index &idx, double x)
const NDIndex< Dim > & getAllocated() const
static bool apply(const NDIndex< D1 > &x, const NDIndex< D1 > &y)
bool IsCompressed() const
T * value_type(const SliceIterator< T > &)
void IndexedLocalAssign(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &irhs, Op &op)
FillGCIfNecessaryTag< D, T1 > FillGCIfNecessary(const BareField< T1, D > &bf)
void IndexedReceive(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &, Op &op, Container &recv_ac, int msgnum, int tag)
bool contains(const NDIndex< Dim > &a) const
static bool apply(const NDIndex< D1 > &, const NDIndex< D2 > &)
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
Message & putMessage(Message &m) const
std::string::iterator iterator
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Message * receive_block(int &node, int &tag)
static Communicate * Comm
void IndexedSend(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &irhs, int tag)
bool send(Message *, int node, int tag, bool delmsg=true)
std::pair< touch_iterator_dv, touch_iterator_dv > touch_range_dv
Inform & endl(Inform &inf)