Skip to content

Commit

Permalink
Merge pull request #1287 from DARMA-tasking/1286-fix-issues-after-bca…
Browse files Browse the repository at this point in the history
…st-changes

1286: Fix bcast issue introduced with #883
  • Loading branch information
lifflander authored and cz4rs committed Feb 25, 2021
2 parents 9cfc8b2 + a485ff5 commit c0f0141
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/rdma/rdma_simple_put.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int main(int argc, char** argv) {

auto msg = vt::makeMessage<HandleMsg>(this_node);
msg->han = my_handle;
vt::theMsg()->broadcastMsg<HandleMsg,put_data_fn>(msg);
vt::theMsg()->broadcastMsg<HandleMsg,put_data_fn>(msg, false);
}

vt::finalize();
Expand Down
13 changes: 8 additions & 5 deletions src/vt/group/global/group_default.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,16 @@ namespace vt { namespace group { namespace global {
bool const& send_to_root = is_root && !is_root_of_tree;
EventType event = no_event;

auto const this_node_dest = dest == node;
auto const first_send = from == uninitialized_destination;

vt_debug_print(
broadcast, node,
"DefaultGroup::broadcast msg={}, size={}, from={}, dest={}, is_root={}\n",
print_ptr(base.get()), size, from, dest, print_bool(is_root)
);

if (is_root || ((num_children > 0) && !is_root_of_tree) || send_to_root) {
if ((num_children > 0 || send_to_root) && (!this_node_dest || first_send)) {
auto const& send_tag = static_cast<messaging::MPI_TagType>(
messaging::MPITag::ActiveMsgTag
);
Expand All @@ -192,10 +195,6 @@ namespace vt { namespace group { namespace global {
});
}

if (is_root && envelopeGetDeliverBcast(msg->env)) {
*deliver = true;
}

// If not the root of the spanning tree, send to the root to propagate to
// the rest of the tree
if (send_to_root) {
Expand All @@ -210,6 +209,10 @@ namespace vt { namespace group { namespace global {
}
}

if (is_root) {
*deliver = envelopeGetDeliverBcast(msg->env);
}

return event;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/active/test_active_bcast_put.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ TEST_P(TestActiveBroadcastPut, test_type_safe_active_fn_bcast2) {
}
});

ASSERT_TRUE(handler_count == num_msg_sent);
ASSERT_EQ(num_msg_sent, handler_count);
}

// Spin here so test_vec does not go out of scope before the send completes
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/active/test_active_broadcast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ TEST_P(TestActiveBroadcast, test_type_safe_active_fn_bcast2) {
}
});

ASSERT_TRUE(handler_count == num_msg_sent);
ASSERT_EQ(num_msg_sent, handler_count);
}
}

Expand Down
11 changes: 6 additions & 5 deletions tests/unit/location/test_location.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,12 @@ TYPED_TEST_P(TestLocationRoute, test_entity_cache_migrated_entity) /* NOLINT */{
auto const nb_rounds = 5;
auto nb_received = 0;

// register entity
if (my_node == home) {
vt::theLocMan()->virtual_loc->registerEntity(entity, my_node);
}
vt::theCollective()->barrier();
::vt::runInEpochCollective([my_node, entity] {
// register entity
if (my_node == home) {
vt::theLocMan()->virtual_loc->registerEntity(entity, my_node);
}
});

if (my_node == home) {
// migrate entity: unregister it but keep its id in cache
Expand Down

0 comments on commit c0f0141

Please sign in to comment.