Dear David,
For the first proposal, I managed to get CopyTo to work, I was using localRail of type "ValRail" with a different size (smaller) of tempRail I think thats why it was blocked. but what about the second proposal? Thank you, Regards Mohammed @ KAUST On Tue, Jul 13, 2010 at 5:02 AM, mohammed elsaeedy < mohammed.elsae...@kaust.edu.sa> wrote: > Dear David, > > Thank you again for your reply, but I'm still facing some trouble > > 1) The first solution: > > Console.OUT.println("Before copying: "+ +here.id); > finish tempRail.copyTo(0,localRail,0,tempRail.length()); > Console.OUT.println("finished copying: "+ +here.id); > > this is all done in the scope of place 1, so tempRail is the Rail of the > Array at place 1, where as localRail is the Rail at place 0 > so when I run this it stops indefinitely at the copyTo function, and never > proceeds with execution. > > 2) the other proposal, which was using ValRail, the compiler gives me the > following errors, which I really don't get > > *x10c++: In file included from Hello.cc:4: > Hello.inc: In member function ‘void Hello__closure__13::apply()’: > Hello.inc:290: error: ‘class x10::lang::Rail<double>’ has no member > named ‘view’ > x10c++: Non-zero return code: 1 > 2 errors. > * > > at(matrix.dist()(0,1)) // PLACE 1 > { > val temp= new Array[double]([0..3],((i):Point)=>0.0); > > val x1 =((matrix(0,1)) as Array[double](1)); > val y =((vector(1)) as Array[double](1)); > > Hello.myRun(x1.raw(),y.raw(),temp.raw()); > > > val tempValRail= (temp.raw()as Rail[double]).view(); > > at(matrix.dist()(0,0)) //PLACE 0 > { > for(var i:int=0; i<2; i++) > { > Hello.result(i+2)+=tempValRail(i); > } > } > } > > Thanks a lot > Mohammed @ KAUST > > On Mon, Jul 12, 2010 at 10:32 PM, David P Grove <gro...@us.ibm.com> wrote: > >> >> >> mohammed elsaeedy <mohammed.elsae...@kaust.edu.sa> wrote on 07/12/2010 >> 03:43:36 PM: >> > >> > but my problem is when I want to sum up all the results in a global >> linear >> > array called result which is at place 0 >> > when ever i want to add those elements that reside at place 1 to the >> values >> > of the result array, a bad place exception occurs. >> > so how can I pass an array (or the values of the array) that resides at >> > place 1 to the result array that resides at place 0? >> > >> >> There isn't quite as much support for this in 2.0.4 as there should be. >> I'm hoping to make improved support for this kind of operation part of the >> Array API for 2.0.5 (was working on it this afternoon). >> >> In 2.0.4, what you need to do is the following series of steps. >> >> (1) call the raw() method on the array at place 1 to get the >> backing >> Rail. >> (2) either >> (a) use one of the Rail.copyTo/copyFrom methods to copy the >> Rail from place 1 to place 0 >> (b) convert the Rail to a ValRail, then capture the ValRail >> in >> an "at" to copy it to place 0. >> (3) at place 0, take the copied values from the Rail/ValRail and >> use >> them to update the Array. >> >> What I'm hoping to finish in time for 2.0.5 is to implement >> copyTo/copyFrom >> on Array so you can at least avoid having to know about the raw() method >> to >> copy an Array's data from an Array in one place to another Array in a >> second place. >> >> --dave >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> X10-users mailing list >> X10-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/x10-users >> > > > > -- > Thank you for your concern. > Regards, > Mohammed El Sayed > -- Thank you for your concern. Regards, Mohammed El Sayed ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users