53void lcm(
int s1,
int s2,
int &s,
int &m1,
int &m2)
113 int rf = rhs.
first();
116 int f = lf > rf ? lf : rf;
117 int l = ll < rl ? ll : rl;
119 ret.
Length = ( (l>=f) ? l-f+1 : 0 );
140 newStride,a_mul,b_mul);
144 int a_i = (b.
first()-
a.first())/
a.stride();
145 int a_off =
a.first() + a_i*
a.stride();
146 if (a_off < b.
first())
155 for (
int a_m=0;(a_m<a_mul)&&(a_i<(
int)
a.length());a_m++,a_i++,a_off+=
a.stride())
157 int b_off = b.
first();
159 for (
int b_m=0; (b_m<b_mul)&&(b_m<(
int)b.
length()); b_m++,b_off+=b.
stride())
160 if ( a_off == b_off )
164 int m = am < bm ? am : bm;
165 return Index(a_off, m, newStride);
199 r = do_intersect(*
this,that);
201 r = do_intersect(that,*
this);
225 Ranges[p] =
Index(p*NL,(p+1)*NL-1);
228 cout << Ranges[p] <<
endl;
241 Index Src = Dest - 1;
251 cout <<
"Dest=" << Dest <<
endl;
252 cout <<
"Src =" << Src <<
endl;
257 cout <<
"On vp=" << p <<
", range=" << Ranges[p] <<
endl;
262 cout <<
"LDRange = " << LDRange <<
endl;
263 cout <<
"SDRange = " << SDRange <<
endl;
264 for (
int pp=0; pp<NP; pp++)
267 if (!LSDRange.
empty())
269 cout <<
" from proc=" << pp <<
", receive " << LSDRange <<
endl;
276 cout <<
"LSRange = " << LSRange <<
endl;
277 cout <<
"DSRange = " << DSRange <<
endl;
278 for (pp=0; pp<NP; pp++)
281 if (!LDSRange.
empty())
283 cout <<
" send to pp=" << pp <<
", the range=" << LDSRange <<
endl;
int main(int argc, char *argv[])
void lcm(int s1, int s2, int &s, int &m1, int &m2)
std::ostream & operator<<(std::ostream &out, const Index &I)
Inform & endl(Inform &inf)
Index intersect(const Index &) const
Index plugBase(const Index &) const
unsigned int length() const
Index general_intersect(const Index &) const