Hi Josh, thak for your help !!
Is the use of the SparsePlaceGroup class scalable? I need the solution 
to work with a large number of nodes.

I tried to make some like this:

var headersGroup:PlaceGroup = PlaceGroup.make(configNodes.numElems_1);

var explorersGroup:PlaceGroup = PlaceGroup.make(numExplorers);

val headNodes = 
PlaceLocalHandle.make[CPLSNode(CPLSOptionsEnum.NodeRoles.HEAD_NODE as 
Int)](headersGroup,() => 
NodeFactory.make(CPLSOptionsEnum.NodeRoles.HEAD_NODE as Int));

val explorersNodes = 
PlaceLocalHandle.make[CPLSNode(CPLSOptionsEnum.NodeRoles.EXPLORER_NODE 
as Int)](refsToPlaces, () => 
NodeFactory.make(CPLSOptionsEnum.NodeRoles.EXPLORER_NODE as Int));

I make this because i need instance diferent class in each PlaceGroup 
(CPLSOptionsEnum.NodeRoles.EXPLORER_NODE or 
CPLSOptionsEnum.NodeRoles.MASTER_NODE define the class). Then, i invoque 
the correspond closure:

finish{
    for(p in headersGroup) at (p) async{
        headNodes().initialize();
    }
}

finish{
    for(p in explorersGroup) at (p) async{
        explorersNodes().initialize();
    }
}

But when i obtain the worker of each place, I see that some of the 
places have the same worker:

Place(0)(Headers group). x10.lang.Runtime.Worker@0x1fd2a80
Place(1)(Headers group). x10.lang.Runtime.Worker@0x21e9d20
Place(0)(Explorers group). x10.lang.Runtime.Worker@0x1fd2a80
Place(1)(Explorers group). x10.lang.Runtime.Worker@0x21e9d20
Place(3)(Explorers group). x10.lang.Runtime.Worker@0x11b9d20
Place(2)(Explorers group). x10.lang.Runtime.Worker@0x1acbd20
Place(4)(Explorers group). x10.lang.Runtime.Worker@0x19a7d20

Thanks for your help,
Succes !!

---
Jheisson A. López R.

On 2017-02-01 20:43, Josh Milthorpe wrote:
> 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 [3]
> 
> 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 [1]
>> _______________________________________________
>> X10-users mailing list
>> X10-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/x10-users [2]
> 
> 
> 
> Links:
> ------
> [1] http://sdm.link/slashdot
> [2] https://lists.sourceforge.net/lists/listinfo/x10-users
> [3] http://milthorpe.org
> 
> ------------------------------------------------------------------------------
> 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