Hi Jheisson,

you can use x10.lang.SparsePlaceGroup to create a PlaceGroup from a
specific subset of places.  The method x10.xrx.Runtime.getName() gives
information about the process ID and hostname for a given place.  For
example:

// TestSparse.x10
import x10.xrx.Runtime;
public class TestSparse {
        public static def main(args:Rail[String]) {
                val x = new SparsePlaceGroup([Place(0), Place(2)]);
                val y = new SparsePlaceGroup([Place(1), Place(3)]);
                finish for (place in x) at(place) {
                        Console.OUT.println(here + " " + Runtime.getName()
+ " x");
                }
                finish for (place in y) at(place) {
                        Console.OUT.println(here + " " + Runtime.getName()
+ " y");
                }
        }
}

$ x10c TestSparse.x10
$ X10_NPLACES=4 x10 TestSparse
Place(0) 673@localhost x
Place(2) 676@localhost x
Place(1) 675@localhost y
Place(3) 677@localhost y

Cheers,

Josh

http://milthorpe.org


On 2 February 2017 at 07:10, Jheisson Argiro López Restrepo <
j...@openmailbox.org> wrote:

> Hi everyone,
> I'm working with 2-4-2 X10 language version and I need to create two
> groups of places so I can handle them with two different
> placelocalhandles, but I have a question, when I do the following:
>
> var group1:PlaceGroup = PlaceGroup.make(2);
> var group2:PlaceGroup = PlaceGroup.make(2);
>
> I get 4 diferent places or only 2? how can I make sure that the second
> sentence don't points to the same places of the first sentence? Hos can
> I obtain some id of the hardware platform that its executed each place?
>
> Many Thanks !!
>
> --
> Jheisson A. López R.
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> X10-users mailing list
> X10-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/x10-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to