Skip to content
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

Barriers are always team local only #114

Closed
fmoessbauer opened this issue Nov 16, 2016 · 6 comments
Closed

Barriers are always team local only #114

fmoessbauer opened this issue Nov 16, 2016 · 6 comments
Assignees
Milestone

Comments

@fmoessbauer
Copy link
Member

Currently it is not possible to use barriers which block all units if a team is split. Each barrier only blocks the units of the current team. See this example

auto & team = dash::Team::All();
auto & myteam = team.locality_split(dash::util::Locality::Scope::Core, 2);                                    if(myteam.dart_id() == 1){                                                       
  {                                                                              
      // Do somethings in team 1  
  }                                                                              
}
// does not work                                         
myteam.parent().barrier();
// does not work too
dash::Team::All().barrier();

  if(myteam.dart_id() == 2){                                                       
    // do something else after team 1 has finished                          
  } 
@fmoessbauer
Copy link
Member Author

This bug is really strange. In branch bug-114-team the new team split unit tests work as expected. However almost the same case in feat-hdf5-team does not work.
And for debugging, keep in mind that the bug does not occur on CI, as there the team is not splitted.

For details see HDF5ArrayTest and TeamTest

@fuchsto
Copy link
Member

fuchsto commented Nov 17, 2016

Hm. Also, the question is what Team::All() should refer to. I think there is some specification missing.
Will get back to this soon.

@fuerlinger
Copy link
Contributor

dash::Team::All() always refers to all units with which the program has been started. dash::Team::All().barrier() is synonymous with dash::barrier() and should work as intended (barrier on all units) regardless of what sub-teams have been created.

@fuerlinger
Copy link
Contributor

I have not tested with locality split, but with the simple regular split things work as expected:

  auto myid = dash::myid();

  auto& team = dash::Team::All();
  auto& myteam = team.split(2);

  if( myteam.position()==1 ) {
    cout << myid << " is member of team 1 (local id:"
     << myteam.myid() << ")"  << endl;
    sleep(1);
  }

  cout << myid << " before barrier"<< endl;
  myteam.parent().barrier();
  cout << myid << " after barrier"<< endl;

Note the usage of position() to distinguish the teams after the split. position might not be the best name, we should probably rename it to either rank() or id() or something.

@fuchsto
Copy link
Member

fuchsto commented Nov 18, 2016

@fuerlinger Okay, that's what one would expect. We will extend unit tests for this then.
@fmoessbauer Does it depend on locality_split perhaps? The underlying mechanism for splitting is the same, though.

I suggest renaming position() to relative_id. The term local is misleading because units in a child
team may be spread among non-local domains.
In the DART locality module, I use id. global_id and relative_id.

@fmoessbauer
Copy link
Member Author

fmoessbauer commented Nov 19, 2016

Ok, the team splits work properly. However, for locality_splits it is not guaranteed to get the requested number of teams (Bug #127).
The bug itself is a symptom of #125, #126 and #127

IMO the ticket can be closed.

@fuchsto fuchsto closed this as completed Nov 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants