Hi everybody,

I have the following code (X10 v2.1.2):

        val array = new Array[Int](20,  3);
        val dist = Dist.makeBlock(array.region);
        val distArray = DistArray.make(dist, ([i]: Point) => array(i));
        
        Console.OUT.println("at Place print");
        for ([p]: Point in distArray.dist) {
            at(distArray.dist(p)) {Console.OUT.print(distArray(p) + " ");}
        }
        
        Console.OUT.println("\nprint at Place");
        for ([p]: Point in distArray.dist) {
            Console.OUT.print((at(distArray.dist(p)) distArray(p)) + " ");
        }
        Console.OUT.println("\nFinished");

If I run the code with X10_NPLACES=1 I get the following expected output:

at Place print
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 
print at Place
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 
Finished

However, running the same code with X10_NPLACES=4 prints this (not expected by 
me):

at Place print
3 3 3 3 3 
print at Place
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 
Finished

My possible explanation is that the use of Console.OUT is only allowed in the 
home place of the running program or is something different causing this 
behaviour?

I also have one other question.
To copy the values of a DistArray into a normal Array I am currently iterating 
over the DistArray and copying the values one after the other into the Array.
Does an easier/shorter way exist to achieve this?

Best Regards,

Manfred
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to