Hi,
since two days I am fighting with X10 to formulate a simple matrix vector
multiply. Apparently I am thinking in the wrong direction. Perhaps someone can
correct me here.
My essential idea is the following.
def ClassicMatrixMultiply() {
finish ateach (p in v2.dist() ) {
[... some code...]
v2(p) = ((A|d)*linev).reduce(double.+,0);
}
finish v = (v2 as Array[double](v.dist()) );
}
Here
- A is a distributed Array[double], a square matrix of size n*n,
- v an Array[double] of rank 1, (v.size == n), placed at Places.FIRST_PLACE,
- v2 an Array[double] of rank 1, distributed the same way as any column of A.
- all are var (not val or const).
In clear text the line v2(p) should read "multiply the row of A that
corresponds to p with v. To make that happen, I tried to set up a distribution
that describes the "row of A that corresponds to p". My following attempt
looks very clumsy and the X10 compiler doesn't compile it either.
(The following lines go into [... some code...] above).
val j:Int = (p.coords())(0);
val r:Region = ( ([j..j] as Region(1))
* A.region.projection(1));
val d:Dist = A.dist().intersection(r);
val linev = (v as Array[double](d));
The compiler hick-ups on the expression A.dist().intersection(r). I frankly
don't understand, why. Both, A.dist() and r are having the same rank.
Shouldn't that suffice ? Any one any explanation ?
I would expect that there is a better way to do this. So I am happy with any
suggestions.
--
Mit freundlichen Grüßen / Kind regards
Dr. Christoph Pospiech
High Performance & Parallel Computing
Phone: +49-351 86269826
Mobile: +49-171-765 5871
E-Mail: [email protected]
-------------------------------------
IBM Deutschland GmbH
Vorsitzender des Aufsichtsrats: Erich Clementi
Geschäftsführung: Martin Jetter (Vorsitzender),
Reinhard Reschke, Christoph Grandpierre,
Klaus Lintelmann, Michael Diemer, Martina Koederitz
Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB
14562 WEEE-Reg.-Nr. DE 99369940
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users