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

dash::Array storing the wrong team? #353

Closed
devreal opened this issue Mar 31, 2017 · 2 comments · Fixed by #354
Closed

dash::Array storing the wrong team? #353

devreal opened this issue Mar 31, 2017 · 2 comments · Fixed by #354
Assignees
Labels
Milestone

Comments

@devreal
Copy link
Member

devreal commented Mar 31, 2017

I am still debugging #292 (with increasing desperation). I found the following strange behavior

TEST_F(ArrayTest, TeamSplit)
{
  auto & team_all = dash::Team::All();
  auto   ext_x    = team_all.size();

  if(team_all.size() < 2){
    SKIP_TEST();
  }
  if(!team_all.is_leaf()){
    LOG_MESSAGE("team is already splitted. Skip test");
    SKIP_TEST();
  }

  dash::barrier();

  LOG_MESSAGE("Splitting team ...");
  auto & myteam = team_all.split(2);
  LOG_MESSAGE("... Team split finished");

  dash::Array<double> array_a(ext_x, myteam);
  ASSERT_EQ_U(array_a.team(), myteam); // << this test fails!

  array_a.barrier();
  // Check if array is allocated
  ASSERT_NE_U(array_a.lbegin(), nullptr);
  team_all.barrier();
}

I added the check ASSERT_EQ_U(array_a.team(), myteam), which surprisingly fails. My understanding is that array.team() should yield the team the array was created with so the check should succeed. Looking through the code, I don't see what could go wrong there. Ideas?

UPDATE: The error I get is

[  ERROR   ] [UNIT 0] in /home/joseph/src/dash/dash/dash/test/container/ArrayTest.cc:225
      Expected: array_a.team()
      Which is: dash::Team(0)
To be equal to: myteam
      Which is: dash::Team(1.0)
@devreal devreal added the bug label Mar 31, 2017
@devreal devreal added this to the dash-0.3.0 milestone Mar 31, 2017
@ddiefenthaler ddiefenthaler self-assigned this Apr 1, 2017
@ddiefenthaler
Copy link
Contributor

I think I found the cause of this strange behaviour,
If I'm right it is related to PR #304 and through the implicit conversion from dash::Team to dash::TeamSpec now the wrong contructor gets called during the construction of dash::Array (Code).

The fix for this should be simple.

@ddiefenthaler
Copy link
Contributor

Acctually it is not so simple, as the constructors of the different pattern types mismatch now.
For example the CSRPattern has no constructor which takes a TeamSpec.

@fuchsto Your feeling about the missing explicit was quite appropriate.

My best bet to fixing this issue is to revert PR #304 and just remove the default parameter definitions instead of the whole functions...
By the way who added those default parameters in the first hand? The TeamSpec should be dependend on the distribution which is not possible this way, if I got this right. For at least in line 336 of the deleted function it looks that way: diff #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants