Hi Ye,

the syntax for Region and Point has changed since that example was posted (I think it was in X10 2.1).

Points are now 'exploded' (separated into their component indices) using square brackets, as follows:

    for ([i,j] in (da|here)) {

Also, a Region can now be constructed simply as a product of integer ranges, for example:

    val r = 1..1000 * 1..1000;

The X10 Global Matrix Library implements many linear algebra operations (including matrix-vector multiply) over a variety of matrix formats. It may contain code examples that will be useful to you.

http://x10-lang.org/documentation/code-examples/global-matrix-library.html

Cheers,

Josh

On 20/04/12 09:01, Fan, Ye wrote:
Hi,

I'm new to X10 and currently coding with X10DT 2.2.2. Trying to implement some simple numerical analysis algorithm, which involves matrix vector multiplication. I've done it in the "concurrent" way (spawn thread using async) and the performance is not very good. Now I would like to try the "distributed" approach. However, I don't know how to create and traverse a 2-d DistArray.

I actually found the following code snippet in the mailing list regarding to "performance issue with matrix vector multiply program", which is exactly what I need.
......
     val r = [1..1000,1..1000] as Region;
     val d = Dist.makeBlock(r);
     val da = DistArray.make[float](d);
     val start = System.nanoTime();
     var tmp:float = 0;
     for ((i,j) in (da|here)) {
         tmp += da(i,j);
     }
......
However, when I did it in the same way, my Eclipse refused to take "for ((i,j) in (da|here))". Any idea where the problem is?

Thanks
Ye


------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2


_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to