From 767492dec3002f3a708b00fb5888810f83b8d57b Mon Sep 17 00:00:00 2001 From: Jakub Domagala Date: Sat, 23 Jan 2021 22:36:45 +0100 Subject: [PATCH] #883: active: Remove the warn when sending data to current node --- src/vt/messaging/active.cc | 14 ++++++-------- tests/unit/active/test_active_bcast_put.cc | 4 +--- tests/unit/active/test_active_broadcast.cc | 4 +--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/vt/messaging/active.cc b/src/vt/messaging/active.cc index ae9198200a..04f9ca0927 100644 --- a/src/vt/messaging/active.cc +++ b/src/vt/messaging/active.cc @@ -186,6 +186,7 @@ EventType ActiveMessenger::sendMsgBytesWithPut( auto const& is_term = envelopeIsTerm(msg->env); auto const& is_put = envelopeIsPut(msg->env); auto const& is_put_packed = envelopeIsPackedPutType(msg->env); + auto const& is_bcast = envelopeIsBcast(msg->env); if (!is_term || vt_check_enabled(print_term_msgs)) { vt_debug_print( @@ -195,6 +196,11 @@ EventType ActiveMessenger::sendMsgBytesWithPut( ); } + vtWarnIf( + !(dest != theContext()->getNode() || is_bcast), + "Destination {} should != this node" + ); + MsgSizeType new_msg_size = msg_size; if (is_put && !is_put_packed) { @@ -388,10 +394,6 @@ EventType ActiveMessenger::sendMsgBytes( ); } - vtWarnIf( - !(dest != theContext()->getNode() || is_bcast), - "Destination {} should != this node" - ); vtAbortIf( dest >= theContext()->getNumNodes() || dest < 0, "Invalid destination: {}" ); @@ -520,10 +522,6 @@ SendInfo ActiveMessenger::sendData( data_ptr, num_bytes, dest, tag, send_tag ); - vtWarnIf( - dest == theContext()->getNode(), - "Destination {} should != this node" - ); vtAbortIf( dest >= theContext()->getNumNodes() || dest < 0, "Invalid destination: {}" diff --git a/tests/unit/active/test_active_bcast_put.cc b/tests/unit/active/test_active_bcast_put.cc index aec1461539..ff3da48a0b 100644 --- a/tests/unit/active/test_active_bcast_put.cc +++ b/tests/unit/active/test_active_bcast_put.cc @@ -131,9 +131,7 @@ TEST_P(TestActiveBroadcastPut, test_type_safe_active_fn_bcast2) { } }); - if (my_node != root) { - ASSERT_TRUE(handler_count == num_msg_sent); - } + ASSERT_TRUE(handler_count == num_msg_sent); } // Spin here so test_vec does not go out of scope before the send completes diff --git a/tests/unit/active/test_active_broadcast.cc b/tests/unit/active/test_active_broadcast.cc index 09962eb9f5..358479d12a 100644 --- a/tests/unit/active/test_active_broadcast.cc +++ b/tests/unit/active/test_active_broadcast.cc @@ -109,9 +109,7 @@ TEST_P(TestActiveBroadcast, test_type_safe_active_fn_bcast2) { } }); - if (my_node != root) { - ASSERT_TRUE(handler_count == num_msg_sent); - } + ASSERT_TRUE(handler_count == num_msg_sent); } }