Hi Konstantina,
that message is only a warning, not an error. It means that a dynamic
check is required when accessing the elements of results:
finish for( p in results.dist.places()) {
at (p) async {
results(here.id)=new ArrayBuilder[Tup](); // dynamic check
inserted here
}
}
because the compiler can't determine that results(here.id) is located at
place p. To avoid this check, you could iterate over each Point in the
distribution of results:
finish for(p in results) {
at (results.dist(p)) async {
results(p) = new ArrayBuilder[Tup]();
}
}
or more succinctly:
finish ateach(p in results) {
results(p) = new ArrayBuilder[Tup]();
}
The latter form has the additional benefit that only a single message is
required for each place, compared to the first two forms which require a
separate message for each element in the DistArray.
Cheers,
Josh
------------------------------------------
Josh Milthorpe
Postdoctoral Fellow, Research School of Computer Science
Australian National University, Building 108
Canberra, ACT 0200
Australia
Phone: + 61 (0)2 61254478
Mobile: + 61 (0)407 940743
E-mail: josh.miltho...@anu.edu.au
Web: http://cs.anu.edu.au/~Josh.Milthorpe/
On 07/06/13 02:47, Konstantina Panagiotopoulou wrote:
Hello all,
I am new to x10 and currently I trying to develop a parallel version
of my program with a DistArray
So, I need to store objects of my own class "Tup" (instead of
primitive types) in the distributed array.
I tried to follow the code I found here:
http://sourceforge.net/mailarchive/forum.php?thread_name=CADmVTxxhj%2B29GRR2XF9aw9e7hA3AdSc8_ksA-aLsOAgFS9FaYQ%40mail.gmail.com&forum_name=x10-user
<http://sourceforge.net/mailarchive/forum.php?thread_name=CADmVTxxhj%2B29GRR2XF9aw9e7hA3AdSc8_ksA-aLsOAgFS9FaYQ%40mail.gmail.com&forum_name=x10-users>
and I 've got the following inside the caller - class
public var dimx: Int ;
public var R:Region(1);
public val D:Dist;
public var results: DistArray[ArrayBuilder[Tup]](D);
public def this(dimx: Int){
this.dimx = dimx;
this.R = 1..dimx;
this.D = Dist.makeBlock(R);
this.results = DistArray.make[ArrayBuilder[Tup]](D);
}
Till here it compiles ok, but then I try to populate the array...
public def fill(results:DistArray[ArrayBuilder[Tup]]){
finish for( p in results.dist.places()) {
at (p) async {
results(here.id <http://here.id>)=new ArrayBuilder[Tup]();
}
}
finish for( p in Place.places()){
at (p) async {
results(here.id <http://here.id>).add(new Tup(2, 6));
//processing the strings in Read(here.id
<http://here.id>);
}
}
}
And get an error:
x10:59: Generated a dynamic check for the method call.
So, my question is, how I can access my objects through the
ArrayBuilder in the DistArray.
Thanks,
Konstantina
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users