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

Fixed random unit groups in TeamLocalityTest.GroupUnits #154

Merged
merged 1 commit into from
Nov 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions dash/test/TeamLocalityTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ TEST_F(TeamLocalityTest, SplitNUMA)
TEST_F(TeamLocalityTest, GroupUnits)
{
if (dash::size() < 4) {
return;
SKIP_TEST();
}
if (_dash_id != 0) {
return;
Expand All @@ -143,20 +143,22 @@ TEST_F(TeamLocalityTest, GroupUnits)
std::vector<std::string> group_2_tags;
std::vector<std::string> group_3_tags;

// Put the first 2 units in group 1:
group_1_units.push_back(0);
group_1_units.push_back(1);
// Put every third unit in group 2, starting at rank 3:
for (size_t u = 3; u < dash::size(); u += 3) {
group_2_units.push_back(u);
}
// Put every second unit in group 3, starting at center:
for (size_t u = dash::size() / 2; u < dash::size(); u += 2) {
// Domains must not be members of more than one group:
if (u % 3 != 0) {
group_3_units.push_back(u);
}
std::vector<dart_unit_t> shuffled_unit_ids;
for (size_t u = 0; u < dash::size(); u++) {
shuffled_unit_ids.push_back(u);
}
std::random_shuffle(shuffled_unit_ids.begin(), shuffled_unit_ids.end());

// Put the first 2 units in group 1:
group_1_units.push_back(shuffled_unit_ids.back());
shuffled_unit_ids.pop_back();
group_1_units.push_back(shuffled_unit_ids.back());
shuffled_unit_ids.pop_back();

group_2_units.push_back(shuffled_unit_ids.back());
shuffled_unit_ids.pop_back();

group_3_units = shuffled_unit_ids;

for (dart_unit_t u : group_1_units) {
group_1_tags.push_back(tloc.unit_locality(u).domain_tag());
Expand All @@ -168,9 +170,12 @@ TEST_F(TeamLocalityTest, GroupUnits)
group_3_tags.push_back(tloc.unit_locality(u).domain_tag());
}

DASH_LOG_DEBUG("TeamLocalityTest.GroupUnits", "group 1:", group_1_tags);
DASH_LOG_DEBUG("TeamLocalityTest.GroupUnits", "group 2:", group_2_tags);
DASH_LOG_DEBUG("TeamLocalityTest.GroupUnits", "group 3:", group_3_tags);
DASH_LOG_DEBUG("TeamLocalityTest.GroupUnits", "group 1:",
group_1_units, group_1_tags);
DASH_LOG_DEBUG("TeamLocalityTest.GroupUnits", "group 2:",
group_2_units, group_2_tags);
DASH_LOG_DEBUG("TeamLocalityTest.GroupUnits", "group 3:",
group_3_units, group_3_tags);

if (group_1_tags.size() > 1) {
DASH_LOG_DEBUG("TeamLocalityTest.GroupUnits", "group:", group_1_tags);
Expand Down