sarat poluri <sarat.pol...@gmail.com> wrote on 12/10/2009 04:34:38 PM:

> Hi,
> 
> I have a distributed array declare as follows:
>  val R1 = [0..n1, 0..n2,0..n3, 0..1, 0..1];
>         val D1 = Dist.makeBlock(R1, 0);
> 
>         ATF_rm000 = Array.make[Double](D1);
> 
> Later i use the ateach construct to initialize it:
>  ateach(val p(i,j,k,l,n): Point(5) in ATF_rm000.dist)
>         {
>             ATF_rm000(p) = 0.0;
> }
> 
> 
> Im trying to understand how many asyncs are created as a result of this
> action.
> Is it equal to the number of places or is it (n1+1)*(n2+1)*(n3+1)*2*2

An ateach loop will spawn one async per iteration (so it's the latter).
If you want to control the amount of parallelism, use

ateach ((z) in Dist.makeUnique()) {
    for (p: Point(5) in ATF_rm000.dist | here) {
        ATF_rm000(p) = 0.0;
    }
}

The above will spawn one async per place and do the updates within the
place sequentially.  You can also change that loop to a foreach to have
intra-place parallelism.
        Igor
-- 
Igor Peshansky  (note the spelling change!)
IBM T.J. Watson Research Center
XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/)
X10: Parallel Productivity and Performance (http://x10.sf.net/)


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to