Skip to content

Commit

Permalink
Merge pull request #99 from dash-project/bug-56-local-team
Browse files Browse the repository at this point in the history
Use correct root unit for team-local broadcast. Fixes #61
  • Loading branch information
devreal authored Nov 14, 2016
2 parents 72b25f5 + abd966d commit e51a8ed
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions dart-impl/base/src/internal/host_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ dart_ret_t dart__base__host_topology__update_module_locations(
dart_group_t * leader_group = malloc(sizeof(group_t_size));
dart_group_t * local_group = malloc(sizeof(group_t_size));
dart_team_t leader_team; /* team of all node leaders */
dart_team_t local_team; /* team of units at this node */

DART_ASSERT_RETURNS(
dart_team_myid(team, &my_id),
Expand Down Expand Up @@ -384,26 +383,32 @@ dart_ret_t dart__base__host_topology__update_module_locations(
* Broadcast updated host topology data from leader to all units at
* local node:
*/
DART_LOG_TRACE("dart__base__host_topology__init: "
"broadcasting module locations from leader unit %d "
"to units in team %d",
local_leader_unit_id, team);

if (DART_UNDEFINED_UNIT_ID != local_leader_unit_id) {
dart_team_t local_team;
dart_unit_t host_topo_bcast_root = local_leader_unit_id;
dart_team_t host_topo_bcast_team = team;
if (num_hosts > 1) {
DART_LOG_TRACE("dart__base__host_topology__init: create local team");
DART_ASSERT_RETURNS(
dart_team_create(team, local_group, &local_team),
DART_OK);
host_topo_bcast_team = local_team;
DART_ASSERT_RETURNS(
dart_team_unit_g2l(local_team, local_leader_unit_id, &host_topo_bcast_root),
DART_OK);
}

DART_LOG_TRACE("dart__base__host_topology__init: "
"broadcasting module locations from leader unit %d "
"to units in team %d",
local_leader_unit_id, host_topo_bcast_team);


DART_ASSERT_RETURNS(
dart_bcast(
topo->host_domains,
sizeof(dart_host_domain_t) * num_hosts,
local_leader_unit_id,
host_topo_bcast_root,
host_topo_bcast_team),
DART_OK);

Expand Down

0 comments on commit e51a8ed

Please sign in to comment.