-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dash::Array does not support teams properly #125
Comments
It looks like the problem is the absolute |
@dash-project/developers Just some thoughts: If they have global reference, then they are actually not that useful. No algorithm or data structure could use them because they refer to a global, possibly disjoint, set of units. For example, all containers use The interface design I know from several places is: make interfaces agnostic from unrelated states So when a team engages in a collective algorithm, the library interface provided to the algorithm Requesting the global state ( |
For applications that use explicit teams, things are more complex of course. A unit can be part of an arbitrary number of teams and therefore there is no alternative sensible default team a collective operation should refer to (there is no notion of a single active team, there can me multiple active teams in the sense that the Team object has been successfully constructed). There is no way around explicitly specifying the team in those cases. DASH containers are always allocated over a team and therefore container related operations can always choose the right team (as e.g., For DASH algorithms things might be more tricky of course because they work with global iterators and the team behind a global iterator might not be obvious (to the developer). |
I agree that the current behavior is unclear and misleading. However for me this is a matter of documentation and not implementation / behavior. There are several good reasons why the containers belong to team all if not specified. For example we currently do not provide any operation to join teams. Furthermore (as @fuerlinger stated) each unit can be part of an arbitrary number of teams. They might even be on the same tree level. IMO the user is in charge of specifying which team a container should belong to. However all algorithms provided by dash should work on the team, the memory belongs to. For me this is the "natural" behavior. |
A unit may be part of an arbitrary number of teams, right, but these are hierarchical. |
@fmoessbauer Part of two teams at the same level? How so? A split is a set operation. |
I did not verify that, but I guess the following creates such case:
For me it is not clear, how cases like this can be mapped to a single tree. |
I don't know, this use case just doesn't look right to me: dash::Array<int> arr_outer(1024);
auto my_child_team = dash::Team::All().split_somehow();
if (my_child_team.position() == 0) {
// calls dash::Team::All()::barrier() at lower level in global allocation
// that is not reached by units in other child team
dash::Array<int> arr_inner(512);
} else {
// ...
my_child_team.barrier(); // good luck with that
} |
@fmoessbauer Perhaps there is another way to make it harder to shoot yourself in the foot like in my example above. |
I'd say overall the details of team hierarchies are still up for discussion and we can see what makes the most sense. I think in the work of Amir Kamil they actually had a concept of lexically scoped teams for Titanium and then other things are possible / make sense than in our case with C++ but we can investigate further. In terms of multiple child-teams I'm not sure what is currently implemented but at some point the idea was as follows: Each team can only have one single sub-team, but teams can be cloned (same underlying DART team id, resources etc.) just a cloned object on the C++ side. So to support two sub-teams of parent, parent has to be cloned first. The main motivation for this was that it leads to simple stacks for team hierarchies and navigating up/down the team hierarchy is always well defined and trivial. So for a given team it would then make sense to ask "what's the team at the most refined / most local level?" As well as "what's the team two levels down from me?", etc. |
@fuerlinger I will need some minutes with you and a whiteboard for this, but if there is a so-called containment hierarchy (as in DART locality domains: a unit can be mapped to any domain, but exactly one at any time), then I would define Didn't you define the Application developers that do not explicitly construt teams would not notice any difference and we still could fix some otherwise counter-intuitive use cases. |
I think it is dangerous to assume that there is a containment hierarchy. As was already stated, a unit can be part of multiple teams and there does not have to be a single |
Sure, but that is unrelated. I was talking about default teams for containers. |
Unfortunately this is still not fixed. For unit tests see PR #135. In fact the old implementation in GlobMem.h was correct, but the bug was in Array.h, because there a relative team id is explicitly passed to In branch |
Bugs are fixed now. The |
If using the array constructor with a team other than
dash::Team::All()
, the array is only allocated for the first (akateam.position() == 0
) team. In all other teams, the array is not allocated.See this unit test in
bug-125-array-team
as showcase.The text was updated successfully, but these errors were encountered: