[Next] [Up] [Previous]
Next: Non-intrusive Groups Up: Object Groups Previous: Object Groups

Mapping

You can easily define your own mapping strategies because the GroupOf template only expects that the type used for mapping control can be subscripted like an array. Consequently you can even specify node numbers explicitly:

int my_mapping = { 17, 38, 45, 33 };
GroupOf<FlockMember> flock(4, my_mapping);
In this example rank 0 will be located at node 17 and rank 3 at node 33. You can also place multiple instances of Sheep on the same node, if you like. Each class that overloads the following subscript int operator[](int rank) can also be used to define the mapping of group members to nodes. Note, that mapping classes must always deliver legal node numbers between 0 and taco::nodes(). The latter function returns the number of nodes running this application.