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) {
111 for (remote_i = range.first; remote_i != range.second; ++remote_i) {
113 NDIndex<D1> left_intersect =
lt.intersect( (*remote_i).first );
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);
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)));
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() );
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 };
519 ERRORMSG(
"Overlapping domains in indexed assignment!"<<
endl);
543 std::multimap< NDIndex<D1> ,
LField<T1,D1>* , std::less< NDIndex<D1> > > recv_ac;
T * value_type(const SliceIterator< T > &)
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
void IndexedReceive(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &, Op &op, Container &recv_ac, int msgnum, int tag)
void CalcIndexedReceive(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &irhs, Container &recv_ac, int &msgnum)
void IndexedSend(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &irhs, int tag)
void assign(IndexedBareField< T1, D1, D1 > lhs, RHS rhsp, Op op, ExprTag< false >)
void IndexedLocalAssign(IndexedBareField< T1, D1, D1 > &ilhs, IndexedBareField< T2, D2, D2 > &irhs, Op &op)
FillGCIfNecessaryTag< D, T1 > FillGCIfNecessary(const BareField< T1, D > &bf)
void PETE_apply(const OpPeriodic< T > &, T &a, const T &b)
Inform & endl(Inform &inf)
std::string::iterator iterator
bool lt(double x, double y)
CompressedBrickIterator< T, 1 > permute(NDIndex< Dim > ¤t, NDIndex< 1 > &permuted) const
Message & putMessage(Message &m, bool makecopy=true)
Message & getMessage(Message &m)
bool touches(const NDIndex< Dim > &) const
bool contains(const NDIndex< Dim > &a) const
Message & putMessage(Message &m) const
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
bool containsAllPoints(const NDIndex< Dim > &b) const
ac_id_larray::iterator iterator_if
bool compressible() const
const GuardCellSizes< Dim > & getGuardCellSizes() const
Layout_t & getLayout() const
bool IsCompressed() const
const NDIndex< Dim > & getOwned() const
const NDIndex< Dim > & getAllocated() const
const iterator & begin() const
void Uncompress(bool fill_domain=true)
const NDIndex< Dim > & getDomain() const
BareField< T, Dim > & getBareField()
static bool apply(const NDIndex< D1 > &, const NDIndex< D2 > &)
static bool apply(const NDIndex< D1 > &x, const NDIndex< D1 > &y)
touch_range_dv touch_range_rdv(const NDIndex< Dim > &domain, const GuardCellSizes< Dim > &gc=gc0()) const
std::pair< touch_iterator_dv, touch_iterator_dv > touch_range_dv
bool send(Message *, int node, int tag, bool delmsg=true)
Message * receive_block(int &node, int &tag)
int next_tag(int t, int s=1000)
static Communicate * Comm