Hi again,

So what I actually need is a distributed array of Tup objects.
I am trying to understand distributions, and mainly I need BlockDist but I
do not understand how to declare such an array since the examples I have
found online, usually store  Ints or Strings in the dist arrays and not
objects of a class.

The problem is that

DistArray.make[Tup](D)

does not compile.
The msg is : Syntax error: Unexpected input ignored: "ERROR_TOKEN" .
That's why I turned to Array of Tup's and from that to ArrayBuilder.

but if there is a way to declare objects of my class in a dist array...it
works perfectly for me!!

Thanks for the help again
Konstantina



2013/6/7 Konstantina Panagiotopoulou <kwno...@hotmail.com>

> Hello again,
>
> So, I used the ateach statement and now I can fill the distributed array
> with my objects.
> BUT, I cannot access them.
> I tried the result() function of ArrayBuilder and just  tried to print it
> with :
>
> Console.OUT.println(results(p).result())
>
>  I get the reference of the object in the heap, but I cannot use the
> functions of my class (Tup) on it.
> So
>
> results(p).result().myfunct()
>
> does not compile.
>
> So, is there any other function apart from result() that would do the work?
>
> Cheers
>
>
>
> 2013/6/6 Konstantina Panagiotopoulou <kwno...@hotmail.com>
>
>> 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)=new ArrayBuilder[Tup]();
>> }
>>  }
>>
>> finish for( p in Place.places()){
>>         at (p) async {
>>  results(here.id).add(new Tup(2, 6));
>>                         //processing the strings in Read(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

Reply via email to