diff --git a/docs/md/active-messenger.md b/docs/md/active-messenger.md index 49b8a395d4..8d5e9baa9a 100644 --- a/docs/md/active-messenger.md +++ b/docs/md/active-messenger.md @@ -74,10 +74,10 @@ int main(int argc, char** argv) { vec_to_send.push_back(54.); auto msg = vt::makeMessage(10, vec_to_send); - vt::theMsg()->sendMsg(1, msg.get()); // send to node 1 + vt::theMsg()->sendMsg(1, msg); // send to node 1 auto msg2 = vt::makeMessage(11, vec_to_send); - vt::theMsg()->sendMsg(1, msg2.get()); // send to node 1 + vt::theMsg()->sendMsg(1, msg2); // send to node 1 }); } diff --git a/docs/md/vt.md b/docs/md/vt.md index 0578c4f26c..1b22fd7313 100644 --- a/docs/md/vt.md +++ b/docs/md/vt.md @@ -97,7 +97,7 @@ management. if (this_node == 0) { auto msg = vt::makeMessage(this_node); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); done = true; } diff --git a/examples/callback/callback.cc b/examples/callback/callback.cc index a689a8fd52..3a1faab4f7 100644 --- a/examples/callback/callback.cc +++ b/examples/callback/callback.cc @@ -118,7 +118,7 @@ void colHan(TestMsg* msg, MyCol* col) { void bounceCallback(vt::Callback cb) { auto msg = vt::makeMessage(cb); - vt::theMsg()->sendMsg(1, msg.get()); + vt::theMsg()->sendMsg(1, msg); } int main(int argc, char** argv) { diff --git a/examples/callback/callback_context.cc b/examples/callback/callback_context.cc index eac49626e2..ecf1834643 100644 --- a/examples/callback/callback_context.cc +++ b/examples/callback/callback_context.cc @@ -107,7 +107,7 @@ int main(int argc, char** argv) { // Make a callback that triggers the callback with a context auto cb = vt::theCB()->makeFunc(&my_global_ctx, callbackFn); auto msg = vt::makeMessage(cb); - vt::theMsg()->sendMsg(1, msg.get()); + vt::theMsg()->sendMsg(1, msg); } vt::finalize(); diff --git a/examples/collection/transpose.cc b/examples/collection/transpose.cc index cc3b6fb472..82aeeda834 100644 --- a/examples/collection/transpose.cc +++ b/examples/collection/transpose.cc @@ -168,7 +168,7 @@ struct Block : vt::Collection { auto const from_idx = getIndex().x(); auto data_msg = vt::makeMessage(data_,from_idx); vt::theMsg()->sendMsg( - requesting_node, data_msg.get() + requesting_node, data_msg ); } @@ -176,7 +176,7 @@ struct Block : vt::Collection { if (getIndex().x() == 0) { auto proxy = this->getCollectionProxy(); auto proxy_msg = vt::makeMessage(proxy.getProxy()); - vt::theMsg()->broadcastMsg(proxy_msg.get()); + vt::theMsg()->broadcastMsg(proxy_msg); // Invoke it locally: broadcast sends to all other nodes auto proxy_msg_local = vt::makeMessage(proxy.getProxy()); SetupGroup()(proxy_msg_local.get()); @@ -319,7 +319,7 @@ static void solveGroupSetup(vt::NodeType this_node, vt::VirtualProxyType coll_pr if (this_node == 1) { auto msg = vt::makeMessage(coll_proxy); vt::envelopeSetGroup(msg->env, group_id); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } }, true ); diff --git a/examples/group/group_collective.cc b/examples/group/group_collective.cc index 6dc8191746..a967f22627 100644 --- a/examples/group/group_collective.cc +++ b/examples/group/group_collective.cc @@ -92,7 +92,7 @@ int main(int argc, char** argv) { if (this_node == 1) { auto msg = vt::makeMessage(); vt::envelopeSetGroup(msg->env, group); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } } ); diff --git a/examples/group/group_rooted.cc b/examples/group/group_rooted.cc index e2764cc902..02ed233c44 100644 --- a/examples/group/group_rooted.cc +++ b/examples/group/group_rooted.cc @@ -72,7 +72,7 @@ int main(int argc, char** argv) { if (this_node == 0) { auto msg = vt::makeMessage(this_node); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); using RangeType = vt::group::region::Range; auto list = std::make_unique(num_nodes / 2, num_nodes); @@ -80,7 +80,7 @@ int main(int argc, char** argv) { vt::theGroup()->newGroup(std::move(list), [=](vt::GroupType group){ auto gmsg = vt::makeMessage(this_node); vt::envelopeSetGroup(gmsg->env, group); - vt::theMsg()->broadcastMsg(gmsg.get()); + vt::theMsg()->broadcastMsg(gmsg); }); } diff --git a/examples/hello_world/hello_world.cc b/examples/hello_world/hello_world.cc index 2acec33261..b3dc561fbf 100644 --- a/examples/hello_world/hello_world.cc +++ b/examples/hello_world/hello_world.cc @@ -67,7 +67,7 @@ int main(int argc, char** argv) { if (this_node == 0) { auto msg = vt::makeMessage(this_node); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } vt::finalize(); diff --git a/examples/hello_world/hello_world_functor.cc b/examples/hello_world/hello_world_functor.cc index c70bce125e..0b4dacdbb9 100644 --- a/examples/hello_world/hello_world_functor.cc +++ b/examples/hello_world/hello_world_functor.cc @@ -70,7 +70,7 @@ int main(int argc, char** argv) { if (this_node == 0) { auto msg = vt::makeMessage(this_node); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } vt::finalize(); diff --git a/examples/hello_world/hello_world_virtual_context.cc b/examples/hello_world/hello_world_virtual_context.cc index d6709213f6..af0059b887 100644 --- a/examples/hello_world/hello_world_virtual_context.cc +++ b/examples/hello_world/hello_world_virtual_context.cc @@ -106,7 +106,7 @@ int main(int argc, char** argv) { // send out the proxy to all the nodes auto msg = vt::makeMessage(proxy); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } vt::finalize(); diff --git a/examples/hello_world/ring.cc b/examples/hello_world/ring.cc index d3679aac4e..9a99501527 100644 --- a/examples/hello_world/ring.cc +++ b/examples/hello_world/ring.cc @@ -76,7 +76,7 @@ static void sendToNext() { vt::NodeType next_node = this_node + 1 >= num_nodes ? 0 : this_node + 1; auto msg = vt::makeMessage(this_node); - vt::theMsg()->sendMsg(next_node, msg.get()); + vt::theMsg()->sendMsg(next_node, msg); } int main(int argc, char** argv) { diff --git a/examples/rdma/rdma_simple_get.cc b/examples/rdma/rdma_simple_get.cc index 2111d9ac3a..1756649106 100644 --- a/examples/rdma/rdma_simple_get.cc +++ b/examples/rdma/rdma_simple_get.cc @@ -113,7 +113,7 @@ int main(int argc, char** argv) { auto msg = vt::makeMessage(this_node); msg->han = my_handle; - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } vt::finalize(); diff --git a/examples/rdma/rdma_simple_get_direct.cc b/examples/rdma/rdma_simple_get_direct.cc index 990669e97f..321de07d1b 100644 --- a/examples/rdma/rdma_simple_get_direct.cc +++ b/examples/rdma/rdma_simple_get_direct.cc @@ -88,7 +88,7 @@ int main(int argc, char** argv) { auto msg = vt::makeMessage(this_node); msg->han = my_handle; - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } vt::finalize(); diff --git a/examples/rdma/rdma_simple_put.cc b/examples/rdma/rdma_simple_put.cc index f52e82d033..7b4dbe1b72 100644 --- a/examples/rdma/rdma_simple_put.cc +++ b/examples/rdma/rdma_simple_put.cc @@ -89,7 +89,7 @@ static void put_data_fn(HandleMsg* msg) { fmt::print("{}: after put: sending msg back to 0\n", this_node); auto msg2 = vt::makeMessage(this_node); msg2->han = handle; - vt::theMsg()->sendMsg(0, msg2.get()); + vt::theMsg()->sendMsg(0, msg2); } ); } @@ -145,7 +145,7 @@ int main(int argc, char** argv) { auto msg = vt::makeMessage(this_node); msg->han = my_handle; - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); } vt::finalize(); diff --git a/examples/rdma/rdma_simple_put_direct.cc b/examples/rdma/rdma_simple_put_direct.cc index ecb9cfdfba..2bddd30382 100644 --- a/examples/rdma/rdma_simple_put_direct.cc +++ b/examples/rdma/rdma_simple_put_direct.cc @@ -85,7 +85,7 @@ static void putDataFn(HandleMsg* msg) { ); auto back = vt::makeMessage(han); - vt::theMsg()->sendMsg(0, back.get()); + vt::theMsg()->sendMsg(0, back); }); } } @@ -118,8 +118,8 @@ int main(int argc, char** argv) { auto msg1 = vt::makeMessage(my_handle); auto msg2 = vt::makeMessage(my_handle); - vt::theMsg()->sendMsg(1, msg1.get()); - vt::theMsg()->sendMsg(2, msg2.get()); + vt::theMsg()->sendMsg(1, msg1); + vt::theMsg()->sendMsg(2, msg2); } vt::finalize(); diff --git a/examples/termination/termination_collective.cc b/examples/termination/termination_collective.cc index b3454e87d3..c93b2c7262 100644 --- a/examples/termination/termination_collective.cc +++ b/examples/termination/termination_collective.cc @@ -64,7 +64,7 @@ static void test_handler(TestMsg* msg) { num--; if (num > 0) { auto msg_send = vt::makeMessage(); - vt::theMsg()->sendMsg(nextNode(), msg_send.get()); + vt::theMsg()->sendMsg(nextNode(), msg_send); } } @@ -90,7 +90,7 @@ int main(int argc, char** argv) { { auto msg = vt::makeMessage(); vt::envelopeSetEpoch(msg->env, epoch); - vt::theMsg()->sendMsg(nextNode(), msg.get()); + vt::theMsg()->sendMsg(nextNode(), msg); } vt::theTerm()->finishedEpoch(epoch); diff --git a/examples/termination/termination_rooted.cc b/examples/termination/termination_rooted.cc index 828052815e..a112312caa 100644 --- a/examples/termination/termination_rooted.cc +++ b/examples/termination/termination_rooted.cc @@ -64,7 +64,7 @@ static void test_handler(TestMsg* msg) { num--; if (num > 0) { auto msg_send = vt::makeMessage(); - vt::theMsg()->sendMsg(nextNode(), msg_send.get()); + vt::theMsg()->sendMsg(nextNode(), msg_send); } } @@ -89,7 +89,7 @@ int main(int argc, char** argv) { auto msg = vt::makeMessage(); vt::envelopeSetEpoch(msg->env, epoch); - vt::theMsg()->sendMsg(nextNode(), msg.get()); + vt::theMsg()->sendMsg(nextNode(), msg); vt::theTerm()->finishedEpoch(epoch); } diff --git a/tests/perf/comm_cost_curve.cc b/tests/perf/comm_cost_curve.cc index 3fac004ae2..5d25a70c06 100644 --- a/tests/perf/comm_cost_curve.cc +++ b/tests/perf/comm_cost_curve.cc @@ -79,7 +79,7 @@ static void handler(PingMsg*) { count++; if (count == pings) { auto msg = vt::makeMessage(1); - vt::theMsg()->sendMsg(0, msg.get()); + vt::theMsg()->sendMsg(0, msg); count = 0; } } @@ -89,7 +89,7 @@ void sender() { auto start = vt::timing::Timing::getCurrentTime(); for (int i = 0; i < pings; i++) { auto msg = vt::makeMessage(bytes); - vt::theMsg()->sendMsg(1, msg.get()); + vt::theMsg()->sendMsg(1, msg); } while (not is_done) vt::runScheduler(); is_done = false; diff --git a/tests/perf/ping_pong.cc b/tests/perf/ping_pong.cc index c008553a52..a7d5e7bf0b 100644 --- a/tests/perf/ping_pong.cc +++ b/tests/perf/ping_pong.cc @@ -106,7 +106,7 @@ static void finishedPing(FinishedPingMsg* msg) { if (num_bytes != max_bytes) { auto pmsg = makeMessage>(); theMsg()->sendMsg, pingPong>( - pong_node, pmsg.get() + pong_node, pmsg ); } } @@ -134,7 +134,7 @@ static void pingPong(PingMsg* in_msg) { if (cnt >= num_pings) { auto msg = makeMessage>(num_bytes); theMsg()->sendMsg, finishedPing>( - 0, msg.get() + 0, msg ); } else { NodeType const next = @@ -146,7 +146,7 @@ static void pingPong(PingMsg* in_msg) { ); #else auto m = makeMessage>(cnt + 1); - theMsg()->sendMsg, pingPong>(next, m.get()); + theMsg()->sendMsg, pingPong>(next, m); #endif } } @@ -169,7 +169,7 @@ int main(int argc, char** argv) { if (my_node == 0) { auto m = makeMessage>(); - theMsg()->sendMsg, pingPong>(pong_node, m.get()); + theMsg()->sendMsg, pingPong>(pong_node, m); } while (!rt->isTerminated()) { diff --git a/tests/unit/active/test_active_bcast_put.cc b/tests/unit/active/test_active_bcast_put.cc index 03b7133301..c1943d5879 100644 --- a/tests/unit/active/test_active_bcast_put.cc +++ b/tests/unit/active/test_active_bcast_put.cc @@ -126,7 +126,7 @@ TEST_P(TestActiveBroadcastPut, test_type_safe_active_fn_bcast2) { for (int i = 0; i < num_msg_sent; i++) { auto msg = makeMessage(); msg->setPut(&put_payload[0], put_size * sizeof(int)); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } } }); diff --git a/tests/unit/active/test_active_broadcast.cc b/tests/unit/active/test_active_broadcast.cc index 0ce1f1302b..2c5fa48969 100644 --- a/tests/unit/active/test_active_broadcast.cc +++ b/tests/unit/active/test_active_broadcast.cc @@ -99,7 +99,7 @@ TEST_P(TestActiveBroadcast, test_type_safe_active_fn_bcast2) { if (my_node == root) { for (int i = 0; i < num_msg_sent; i++) { auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } } }); diff --git a/tests/unit/active/test_active_send.cc b/tests/unit/active/test_active_send.cc index 2ad575a35c..5f692b2175 100644 --- a/tests/unit/active/test_active_send.cc +++ b/tests/unit/active/test_active_send.cc @@ -138,7 +138,7 @@ TEST_F(TestActiveSend, test_type_safe_active_fn_send) { fmt::print("{}: sendMsg: i={}\n", my_node, i); #endif auto msg = makeMessage(); - theMsg()->sendMsg(1, msg.get()); + theMsg()->sendMsg(to_node, msg); } } else if (my_node == to_node) { theTerm()->addAction([=]{ @@ -168,9 +168,7 @@ TEST_F(TestActiveSend, test_type_safe_active_fn_send_small_put) { #if DEBUG_TEST_HARNESS_PRINT fmt::print("{}: sendMsg: (put) i={}\n", my_node, i); #endif - theMsg()->sendMsg( - 1, msg.get() - ); + theMsg()->sendMsg(to_node, msg); } } @@ -196,9 +194,7 @@ TEST_F(TestActiveSend, test_type_safe_active_fn_send_large_put) { #if DEBUG_TEST_HARNESS_PRINT fmt::print("{}: sendMsg: (put) i={}\n", my_node, i); #endif - theMsg()->sendMsg( - 1, msg.get() - ); + theMsg()->sendMsg(to_node, msg); } } diff --git a/tests/unit/active/test_active_send_put.cc b/tests/unit/active/test_active_send_put.cc index aff3b44603..88d65750c0 100644 --- a/tests/unit/active/test_active_send_put.cc +++ b/tests/unit/active/test_active_send_put.cc @@ -112,7 +112,7 @@ TEST_P(TestActiveSendPut, test_active_fn_send_put_param) { #if DEBUG_TEST_HARNESS_PRINT fmt::print("{}: sendMsg: (put) i={}\n", my_node, i); #endif - theMsg()->sendMsg(1, msg.get()); + theMsg()->sendMsg(1, msg); } // Spin here so test_vec does not go out of scope before the send completes diff --git a/tests/unit/active/test_pending_send.cc b/tests/unit/active/test_pending_send.cc index 5782afa45c..099daa3b65 100644 --- a/tests/unit/active/test_pending_send.cc +++ b/tests/unit/active/test_pending_send.cc @@ -62,7 +62,7 @@ struct TestPendingSend : TestParallelHarness { auto const num_nodes = theContext()->getNumNodes(); auto prev = this_node - 1 >= 0 ? this_node - 1 : num_nodes - 1; auto msg = vt::makeMessage(); - theMsg()->sendMsg(prev, msg.get()); + theMsg()->sendMsg(prev, msg); } static bool delivered; @@ -81,13 +81,15 @@ TEST_F(TestPendingSend, test_pending_send_hold) { theMsg()->pushEpoch(ep); auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; + auto msg = vt::makeMessage(); + auto msg_hold = promoteMsg(msg.get()); pending.emplace_back( - theMsg()->sendMsg(next, msg.get()) + theMsg()->sendMsg(next, msg) ); // Must be stamped with the current epoch - EXPECT_EQ(envelopeGetEpoch(msg->env), ep); + EXPECT_EQ(envelopeGetEpoch(msg_hold->env), ep); theMsg()->popEpoch(ep); theTerm()->addAction(ep, [&done] { done = true; }); diff --git a/tests/unit/collectives/test_mpi_collective.cc b/tests/unit/collectives/test_mpi_collective.cc index 5cd29ac905..43814363ae 100644 --- a/tests/unit/collectives/test_mpi_collective.cc +++ b/tests/unit/collectives/test_mpi_collective.cc @@ -249,7 +249,7 @@ TEST_F(TestMPICollective, test_mpi_collective_4) { // Broadcast out node 0's order to confirm with all other nodes if (this_node == 0) { auto msg = makeMessage(run_order); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } } diff --git a/tests/unit/group/test_group.cc b/tests/unit/group/test_group.cc index 0052097d01..7f0fb28613 100644 --- a/tests/unit/group/test_group.cc +++ b/tests/unit/group/test_group.cc @@ -83,7 +83,7 @@ TEST_F(TestGroup, test_group_range_construct_1) { fmt::print("Group is created: group={:x}\n", group); auto msg = makeMessage(); envelopeSetGroup(msg->env, group); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } ); } @@ -113,7 +113,7 @@ TEST_F(TestGroup, test_group_range_construct_2) { fmt::print("Group is created: group={:x}\n", group); auto msg = makeMessage(); envelopeSetGroup(msg->env, group); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } ); } @@ -141,7 +141,7 @@ TEST_F(TestGroup, test_group_collective_construct_1) { EXPECT_EQ(is_default_group, false); auto msg = makeMessage(); envelopeSetGroup(msg->env, group); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } ); }); diff --git a/tests/unit/location/test_location.cc b/tests/unit/location/test_location.cc index 433a507a24..fdb131296b 100644 --- a/tests/unit/location/test_location.cc +++ b/tests/unit/location/test_location.cc @@ -351,7 +351,7 @@ TYPED_TEST_P(TestLocationRoute, test_route_entity) { using MsgType = location::EntityMsg; bool is_long = std::is_same::value; auto msg = vt::makeMessage(entity, my_node, is_long); - vt::theMsg()->broadcastMsg>(msg.get()); + vt::theMsg()->broadcastMsg>(msg); while (msg_count < nb_nodes - 1) { vt::runScheduler(); } diff --git a/tests/unit/mapping/test_mapping_registry.cc b/tests/unit/mapping/test_mapping_registry.cc index bcb23a423f..69c3af57ac 100644 --- a/tests/unit/mapping/test_mapping_registry.cc +++ b/tests/unit/mapping/test_mapping_registry.cc @@ -113,11 +113,11 @@ TEST_F(TestMappingRegistry, test_mapping_block_1d_registry) { auto map_han = auto_registry::makeAutoHandlerMap(); auto msg = makeMessage(map_han); msg->is_block = true; - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); auto map_han2 = auto_registry::makeAutoHandlerMap(); auto msg2 = makeMessage(map_han2); - theMsg()->broadcastMsg(msg2.get()); + theMsg()->broadcastMsg(msg2); } } diff --git a/tests/unit/memory/test_memory_lifetime.cc b/tests/unit/memory/test_memory_lifetime.cc index 9d2c3a98d1..e74093a97a 100644 --- a/tests/unit/memory/test_memory_lifetime.cc +++ b/tests/unit/memory/test_memory_lifetime.cc @@ -116,7 +116,7 @@ static constexpr int32_t const num_msgs_sent = 32; //////////////////////////////////////////////////////////////////////////////// // Active message send, serialized //////////////////////////////////////////////////////////////////////////////// -TEST_F(TestMemoryLifetime, test_active_send_serial_lifetime_1) { +TEST_F(TestMemoryLifetime, test_active_send_serial_lifetime) { auto const& this_node = theContext()->getNode(); auto const& num_nodes = theContext()->getNumNodes(); @@ -125,11 +125,12 @@ TEST_F(TestMemoryLifetime, test_active_send_serial_lifetime_1) { auto const next_node = this_node + 1 < num_nodes ? this_node + 1 : 0; for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->sendMsg(next_node, msg.get()); + theMsg()->sendMsg(next_node, msg); } for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->sendMsg(next_node, msg.get()); + auto* rawptr = msg.get(); + theMsg()->sendMsg(next_node, rawptr); } }); @@ -141,18 +142,19 @@ TEST_F(TestMemoryLifetime, test_active_send_serial_lifetime_1) { //////////////////////////////////////////////////////////////////////////////// // Active message broadcast, serialized //////////////////////////////////////////////////////////////////////////////// -TEST_F(TestMemoryLifetime, test_active_bcast_serial_lifetime_1) { +TEST_F(TestMemoryLifetime, test_active_bcast_serial_lifetime) { auto const& num_nodes = theContext()->getNumNodes(); if (num_nodes > 1) { runInEpochCollective([&]{ for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); + auto* rawptr = msg.get(); + theMsg()->broadcastMsg(rawptr); } }); @@ -164,7 +166,7 @@ TEST_F(TestMemoryLifetime, test_active_bcast_serial_lifetime_1) { //////////////////////////////////////////////////////////////////////////////// // Active message send, non-serialized, MsgT* //////////////////////////////////////////////////////////////////////////////// -TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_1) { +TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_rawptr) { auto const& this_node = theContext()->getNode(); auto const& num_nodes = theContext()->getNumNodes(); @@ -172,7 +174,8 @@ TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_1) { auto const next_node = this_node + 1 < num_nodes ? this_node + 1 : 0; for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->sendMsg(next_node, msg.get()); + auto* rawptr = msg.get(); + theMsg()->sendMsg(next_node, rawptr); theTerm()->addAction([msg]{ // Call event cleanup all pending MPI requests to clear @@ -190,7 +193,7 @@ TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_1) { //////////////////////////////////////////////////////////////////////////////// // Active message send, non-serialized, MsgSharedPtr //////////////////////////////////////////////////////////////////////////////// -TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_2) { +TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_msgptr) { auto const& this_node = theContext()->getNode(); auto const& num_nodes = theContext()->getNumNodes(); @@ -198,12 +201,18 @@ TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_2) { auto const next_node = this_node + 1 < num_nodes ? this_node + 1 : 0; for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->sendMsg(next_node, msg.get()); - theTerm()->addAction([msg]{ + // sendMsg takes MsgPtr ownership - keep our own handle + EXPECT_EQ(envelopeGetRef(msg->env), 1); + auto msg_hold = promoteMsg(msg.get()); + EXPECT_EQ(envelopeGetRef(msg_hold->env), 2); + + theMsg()->sendMsg(next_node, msg); + + theTerm()->addAction([msg_hold]{ // Call event cleanup all pending MPI requests to clear theEvent()->finalize(); - EXPECT_EQ(envelopeGetRef(msg->env), 1); + EXPECT_EQ(envelopeGetRef(msg_hold->env), 1); }); } @@ -216,13 +225,14 @@ TEST_F(TestMemoryLifetime, test_active_send_normal_lifetime_2) { //////////////////////////////////////////////////////////////////////////////// // Active message broadcast, non-serialized, MsgT* //////////////////////////////////////////////////////////////////////////////// -TEST_F(TestMemoryLifetime, test_active_bcast_normal_lifetime_1) { +TEST_F(TestMemoryLifetime, test_active_bcast_normal_lifetime_rawptr) { auto const& num_nodes = theContext()->getNumNodes(); if (num_nodes > 1) { for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); + auto* rawptr = msg.get(); + theMsg()->broadcastMsg(rawptr); theTerm()->addAction([msg]{ // Call event cleanup all pending MPI requests to clear @@ -240,18 +250,24 @@ TEST_F(TestMemoryLifetime, test_active_bcast_normal_lifetime_1) { //////////////////////////////////////////////////////////////////////////////// // Active message broadcast, non-serialized, MsgSharedPtr //////////////////////////////////////////////////////////////////////////////// -TEST_F(TestMemoryLifetime, test_active_bcast_normal_lifetime_2) { +TEST_F(TestMemoryLifetime, test_active_bcast_normal_lifetime_msgptr) { auto const& num_nodes = theContext()->getNumNodes(); if (num_nodes > 1) { for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); - theTerm()->addAction([msg]{ + // sendMsg takes MsgPtr ownership - keep our own handle + EXPECT_EQ(envelopeGetRef(msg->env), 1); + auto msg_hold = promoteMsg(msg.get()); + EXPECT_EQ(envelopeGetRef(msg_hold->env), 2); + + theMsg()->broadcastMsg(msg); + + theTerm()->addAction([msg_hold]{ // Call event cleanup all pending MPI requests to clear theEvent()->finalize(); - EXPECT_EQ(envelopeGetRef(msg->env), 1); + EXPECT_EQ(envelopeGetRef(msg_hold->env), 1); }); } @@ -284,12 +300,13 @@ TEST_F(TestMemoryLifetime, test_active_send_callback_lifetime_1) { for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage>(cb); - theMsg()->broadcastMsg, callbackHan>(msg.get()); + auto msg_hold = promoteMsg(msg.get()); + theMsg()->broadcastMsg, callbackHan>(msg); - theTerm()->addAction([msg]{ + theTerm()->addAction([msg_hold]{ // Call event cleanup all pending MPI requests to clear theEvent()->finalize(); - EXPECT_EQ(envelopeGetRef(msg->env), 1); + EXPECT_EQ(envelopeGetRef(msg_hold->env), 1); }); } } @@ -317,12 +334,13 @@ TEST_F(TestMemoryLifetime, test_active_serial_callback_lifetime_1) { for (int i = 0; i < num_msgs_sent; i++) { auto msg = makeMessage>(cb); - theMsg()->broadcastMsg, callbackHan>(msg.get()); + auto msg_hold = promoteMsg(msg.get()); + theMsg()->broadcastMsg, callbackHan>(msg); - theTerm()->addAction([msg]{ + theTerm()->addAction([msg_hold]{ // Call event cleanup all pending MPI requests to clear theEvent()->finalize(); - EXPECT_EQ(envelopeGetRef(msg->env), 1); + EXPECT_EQ(envelopeGetRef(msg_hold->env), 1); }); } } diff --git a/tests/unit/pipe/test_callback_bcast.cc b/tests/unit/pipe/test_callback_bcast.cc index 8c10d6c0e8..66434e5ba1 100644 --- a/tests/unit/pipe/test_callback_bcast.cc +++ b/tests/unit/pipe/test_callback_bcast.cc @@ -163,7 +163,7 @@ TEST_F(TestCallbackBcast, test_callback_bcast_remote_1) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); }); EXPECT_EQ(called, 100 * theContext()->getNumNodes()); @@ -181,7 +181,7 @@ TEST_F(TestCallbackBcast, test_callback_bcast_remote_2) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); }); EXPECT_EQ(called, 200 * theContext()->getNumNodes()); @@ -199,7 +199,7 @@ TEST_F(TestCallbackBcast, test_callback_bcast_remote_3) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); }); EXPECT_EQ(called, 300 * theContext()->getNumNodes()); diff --git a/tests/unit/pipe/test_callback_bcast_collection.extended.cc b/tests/unit/pipe/test_callback_bcast_collection.extended.cc index 729d1730a1..20021708c6 100644 --- a/tests/unit/pipe/test_callback_bcast_collection.extended.cc +++ b/tests/unit/pipe/test_callback_bcast_collection.extended.cc @@ -158,7 +158,7 @@ TEST_F(TestCallbackBcastCollection, test_callback_bcast_collection_2) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(proxy); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); theTerm()->addAction([=]{ proxy.destroy(); @@ -180,7 +180,7 @@ TEST_F(TestCallbackBcastCollection, test_callback_bcast_collection_3) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeBcast(proxy); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); theTerm()->addAction([=]{ proxy.destroy(); diff --git a/tests/unit/pipe/test_callback_func.cc b/tests/unit/pipe/test_callback_func.cc index 94f726851c..2fe15a9d65 100644 --- a/tests/unit/pipe/test_callback_func.cc +++ b/tests/unit/pipe/test_callback_func.cc @@ -91,7 +91,7 @@ TEST_F(TestCallbackFunc, test_callback_func_2) { if (this_node == 0) { auto cb = theCB()->makeFunc([]{ called = 400; }); auto msg = makeMessage(cb); - theMsg()->sendMsg(1, msg.get()); + theMsg()->sendMsg(1, msg); theTerm()->addAction([=]{ EXPECT_EQ(called, 400); diff --git a/tests/unit/pipe/test_callback_func_ctx.cc b/tests/unit/pipe/test_callback_func_ctx.cc index 71e50b420b..c919e595bf 100644 --- a/tests/unit/pipe/test_callback_func_ctx.cc +++ b/tests/unit/pipe/test_callback_func_ctx.cc @@ -131,7 +131,7 @@ TEST_F(TestCallbackFuncCtx, test_callback_func_ctx_2) { ); //fmt::print("{}: next={}\n", this_node, next); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); theTerm()->addAction([=]{ //fmt::print("{}: called={}\n", this_node, called); diff --git a/tests/unit/pipe/test_callback_send.cc b/tests/unit/pipe/test_callback_send.cc index 605127e30d..0eb47c00be 100644 --- a/tests/unit/pipe/test_callback_send.cc +++ b/tests/unit/pipe/test_callback_send.cc @@ -154,7 +154,7 @@ TEST_F(TestCallbackSend, test_callback_send_remote_1) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); theTerm()->addAction([=]{ EXPECT_EQ(called, 100); @@ -169,7 +169,7 @@ TEST_F(TestCallbackSend, test_callback_send_remote_2) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); theTerm()->addAction([=]{ EXPECT_EQ(called, 200); @@ -184,7 +184,7 @@ TEST_F(TestCallbackSend, test_callback_send_remote_3) { auto next = this_node + 1 < num_nodes ? this_node + 1 : 0; auto cb = theCB()->makeSend(this_node); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); theTerm()->addAction([=]{ EXPECT_EQ(called, 300); diff --git a/tests/unit/pipe/test_callback_send_collection.extended.cc b/tests/unit/pipe/test_callback_send_collection.extended.cc index 7cdc66d9af..cf29e16a6f 100644 --- a/tests/unit/pipe/test_callback_send_collection.extended.cc +++ b/tests/unit/pipe/test_callback_send_collection.extended.cc @@ -167,11 +167,11 @@ TEST_F(TestCallbackSendCollection, test_callback_send_collection_2) { if (i % 2 == 0) { auto cb = theCB()->makeSend(proxy(i)); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); } else { auto cb = theCB()->makeSend(proxy(i)); auto msg = makeMessage(cb); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); } } diff --git a/tests/unit/pipe/test_signal_cleanup.cc b/tests/unit/pipe/test_signal_cleanup.cc index ee950177a4..87673e1d29 100644 --- a/tests/unit/pipe/test_signal_cleanup.cc +++ b/tests/unit/pipe/test_signal_cleanup.cc @@ -83,7 +83,7 @@ TEST_F(TestSignalCleanup, test_signal_cleanup_3) { fmt::print("called A"); }); auto msg = makeMessage(cb); - theMsg()->sendMsg(1, msg.get()); + theMsg()->sendMsg(1, msg); } // run until termination @@ -108,7 +108,7 @@ TEST_F(TestSignalCleanup, test_signal_cleanup_3) { fmt::print("called B"); }); auto msg = makeMessage(cb); - theMsg()->sendMsg(1, msg.get()); + theMsg()->sendMsg(1, msg); } // run until termination diff --git a/tests/unit/pool/test_pool_message_sizes.cc b/tests/unit/pool/test_pool_message_sizes.cc index a887502a91..93bc215ccc 100644 --- a/tests/unit/pool/test_pool_message_sizes.cc +++ b/tests/unit/pool/test_pool_message_sizes.cc @@ -103,12 +103,12 @@ void TestPoolMessageSizes::testPoolFun(TestMsg* prev_msg) { if (count < max_test_count) { auto msg = makeMessage>(); theMsg()->sendMsg, testPoolFun>( - next, msg.get() + next, msg ); } else { auto msg = makeMessage>(); theMsg()->sendMsg, testPoolFun>( - next, msg.get() + next, msg ); count = 0; } @@ -125,7 +125,7 @@ TEST_F(TestPoolMessageSizes, pool_message_sizes_alloc) { if (my_node == 0) { auto msg = makeMessage>(); theMsg()->sendMsg, testPoolFun>( - to_node, msg.get() + to_node, msg ); } } diff --git a/tests/unit/runtime/test_mpi_access_guards.cc b/tests/unit/runtime/test_mpi_access_guards.cc index 3d2c0f9a41..af6d1ef54e 100644 --- a/tests/unit/runtime/test_mpi_access_guards.cc +++ b/tests/unit/runtime/test_mpi_access_guards.cc @@ -93,7 +93,7 @@ void testMpiAccess(bool access_allowed, bool grant_access) { // Sending message for common-case of attempting MPI access within // a message handler; it applies to all cases through the scheduler. auto msg = vt::makeMessage(); - theMsg()->sendMsg(1, msg.get()); + theMsg()->sendMsg(1, msg); } } diff --git a/tests/unit/scheduler/test_scheduler_loop.cc b/tests/unit/scheduler/test_scheduler_loop.cc index 2b270d65cc..98425d4ae2 100644 --- a/tests/unit/scheduler/test_scheduler_loop.cc +++ b/tests/unit/scheduler/test_scheduler_loop.cc @@ -88,7 +88,7 @@ static void message_handler_with_nested_loop(TestMsg* msg) { auto next_msg = vt::makeMessage(); next_msg->action_ = next_depth; - theMsg()->sendMsg(target_node, next_msg.get()); + theMsg()->sendMsg(target_node, next_msg); // ..run scheduler until someone also passed us the message. if ("nested" == action) { @@ -117,7 +117,7 @@ TEST_F(TestSchedulerLoop, test_scheduler_loop_nesting_1) { auto msg = vt::makeMessage(); msg->action_ = 1; - theMsg()->sendMsg(target_node, msg.get()); + theMsg()->sendMsg(target_node, msg); done = false; theSched()->runSchedulerWhile([]{ return not done; }); diff --git a/tests/unit/sequencer/test_sequencer.extended.cc b/tests/unit/sequencer/test_sequencer.extended.cc index 38f669b805..3d22f7d77e 100644 --- a/tests/unit/sequencer/test_sequencer.extended.cc +++ b/tests/unit/sequencer/test_sequencer.extended.cc @@ -164,7 +164,7 @@ TEST_F(TestSequencer, test_single_wait) { if (my_node == 1) { auto msg = makeMessage(); - theMsg()->sendMsg(0, msg.get()); + theMsg()->sendMsg(0, msg); } if (my_node == 0) { diff --git a/tests/unit/sequencer/test_sequencer_extensive.extended.cc b/tests/unit/sequencer/test_sequencer_extensive.extended.cc index 8b26d013a7..53c3cabd78 100644 --- a/tests/unit/sequencer/test_sequencer_extensive.extended.cc +++ b/tests/unit/sequencer/test_sequencer_extensive.extended.cc @@ -111,14 +111,14 @@ static constexpr CountType const max_seq_depth = 8; }; \ auto msg = makeMessage(in); \ theMsg()->sendMsg( \ - (NODE), msg.get() \ + (NODE), msg \ ); \ auto const total = (wait_cnt * seg_cnt) + wait_pre + wait_post; \ for (CountType i = 0; i < total; i++) { \ TagType const tag = (IS_TAG) ? i+1 : no_tag; \ auto nmsg = makeMessage(); \ theMsg()->sendMsg( \ - (NODE), nmsg.get(), tag \ + (NODE), nmsg, tag \ ); \ } \ } \ diff --git a/tests/unit/sequencer/test_sequencer_for.extended.cc b/tests/unit/sequencer/test_sequencer_for.extended.cc index d3360034fa..50930e281c 100644 --- a/tests/unit/sequencer/test_sequencer_for.extended.cc +++ b/tests/unit/sequencer/test_sequencer_for.extended.cc @@ -106,7 +106,7 @@ TEST_F(TestSequencerFor, test_for) { for (int i = 0; i < end_range; i++) { if (my_node == 1) { auto msg = makeMessage(); - theMsg()->sendMsg(0, msg.get()); + theMsg()->sendMsg(0, msg); } } diff --git a/tests/unit/sequencer/test_sequencer_parallel.extended.cc b/tests/unit/sequencer/test_sequencer_parallel.extended.cc index 9669ad9630..d22a73b659 100644 --- a/tests/unit/sequencer/test_sequencer_parallel.extended.cc +++ b/tests/unit/sequencer/test_sequencer_parallel.extended.cc @@ -157,7 +157,7 @@ TEST_P(TestSequencerParallelParam, test_seq_parallel_param) { for (CountType i = 0; i < par_count; i++) { if (node == 1) { auto msg = makeMessage(); - theMsg()->sendMsg(0, msg.get()); + theMsg()->sendMsg(0, msg); } } @@ -323,9 +323,9 @@ struct TestSequencerParallel : TestParallelHarness { for (int i = 0; i < (NUM_MSGS); i++) { \ TagType const tag = (IS_TAG) ? i+1 : no_tag; \ if ((NODE) == 1) { \ - auto msg = makeMessage(); \ + auto msg = makeMessage(); \ theMsg()->sendMsg( \ - 0, msg.get(), tag \ + 0, msg, tag \ ); \ } \ } \ diff --git a/tests/unit/termination/test_term_chaining.cc b/tests/unit/termination/test_term_chaining.cc index 82e802edb0..2316a71642 100644 --- a/tests/unit/termination/test_term_chaining.cc +++ b/tests/unit/termination/test_term_chaining.cc @@ -70,7 +70,7 @@ struct TestTermChaining : TestParallelHarness { EXPECT_EQ(theContext()->getNode(), 1); auto msg2 = makeMessage(); - theMsg()->sendMsg(0, msg2.get()); + theMsg()->sendMsg(0, msg2); } static void test_handler_response(TestMsg* msg) { @@ -87,7 +87,7 @@ struct TestTermChaining : TestParallelHarness { EXPECT_EQ(handler_count, 12); handler_count++; auto msg2 = makeMessage(); - theMsg()->sendMsg(0, msg2.get()); + theMsg()->sendMsg(0, msg2); } static void test_handler_chained(TestMsg* msg) { @@ -103,7 +103,7 @@ struct TestTermChaining : TestParallelHarness { vt::theMsg()->pushEpoch(epoch1); auto msg = makeMessage(); chain.add( - epoch1, theMsg()->sendMsg(1, msg.get()) + epoch1, theMsg()->sendMsg(1, msg) ); vt::theMsg()->popEpoch(epoch1); vt::theTerm()->finishedEpoch(epoch1); @@ -112,7 +112,7 @@ struct TestTermChaining : TestParallelHarness { vt::theMsg()->pushEpoch(epoch2); auto msg2 = makeMessage(); chain.add( - epoch2, theMsg()->sendMsg(1, msg2.get()) + epoch2, theMsg()->sendMsg(1, msg2) ); vt::theMsg()->popEpoch(epoch2); vt::theTerm()->finishedEpoch(epoch2); diff --git a/tests/unit/termination/test_term_cleanup.cc b/tests/unit/termination/test_term_cleanup.cc index 7c42ad3c02..fd50ae0f15 100644 --- a/tests/unit/termination/test_term_cleanup.cc +++ b/tests/unit/termination/test_term_cleanup.cc @@ -82,7 +82,7 @@ TEST_F(TestTermCleanup, test_termination_cleanup_1) { auto msg = makeMessage(); envelopeSetEpoch(msg->env, epoch); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); theTerm()->finishedEpoch(epoch); vt::runSchedulerThrough(epoch); @@ -128,17 +128,17 @@ TEST_F(TestTermCleanup, test_termination_cleanup_2) { for (int j = 0; j < 5; j++) { auto msg = makeMessage(); envelopeSetEpoch(msg->env, coll_epoch); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); } for (int j = 0; j < 5; j++) { auto msg = makeMessage(); envelopeSetEpoch(msg->env, root_epoch); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); } for (int j = 0; j < 5; j++) { auto msg = makeMessage(); envelopeSetEpoch(msg->env, wave_epoch); - theMsg()->sendMsg(next, msg.get()); + theMsg()->sendMsg(next, msg); } theTerm()->finishedEpoch(coll_epoch); diff --git a/tests/unit/termination/test_termination_action_common.impl.h b/tests/unit/termination/test_termination_action_common.impl.h index abd4b7e688..5ffd7a6372 100644 --- a/tests/unit/termination/test_termination_action_common.impl.h +++ b/tests/unit/termination/test_termination_action_common.impl.h @@ -169,7 +169,7 @@ void add(vt::EpochType const& epoch, int order){ EXPECT_TRUE(channel::hasEnded(epoch)); ok = true; auto msg = vt::makeMessage(); - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); }); } } diff --git a/tests/unit/termination/test_termination_channel_counting.h b/tests/unit/termination/test_termination_channel_counting.h index 31e47fad8c..7b64b9af47 100644 --- a/tests/unit/termination/test_termination_channel_counting.h +++ b/tests/unit/termination/test_termination_channel_counting.h @@ -113,4 +113,4 @@ extern std::unordered_map data; */ #include "test_termination_channel_counting.impl.h" -#endif /*INCLUDED_TERMINATION_CHANNEL_COUNTING_H*/ \ No newline at end of file +#endif /*INCLUDED_TERMINATION_CHANNEL_COUNTING_H*/ diff --git a/tests/unit/termination/test_termination_channel_counting.impl.h b/tests/unit/termination/test_termination_channel_counting.impl.h index 1e163cb05e..fc5b6c57b1 100644 --- a/tests/unit/termination/test_termination_channel_counting.impl.h +++ b/tests/unit/termination/test_termination_channel_counting.impl.h @@ -67,7 +67,7 @@ void sendMsg(vt::NodeType dst, int count, vt::EpochType ep) { if (ep != vt::no_epoch) { vt::envelopeSetEpoch(msg->env,ep); } - vt::theMsg()->sendMsg(dst,msg.get()); + vt::theMsg()->sendMsg(dst, msg); } // note: only for basic messages, @@ -80,7 +80,7 @@ void broadcast(int count, vt::EpochType ep) { if (ep != vt::no_epoch) { vt::envelopeSetEpoch(msg->env,ep); } - vt::theMsg()->broadcastMsg(msg.get()); + vt::theMsg()->broadcastMsg(msg); for (auto&& active : data[ep].count_) { auto const& dst = active.first; diff --git a/tests/unit/termination/test_termination_reset.cc b/tests/unit/termination/test_termination_reset.cc index afa2b73e7e..58bdaf089b 100644 --- a/tests/unit/termination/test_termination_reset.cc +++ b/tests/unit/termination/test_termination_reset.cc @@ -76,7 +76,7 @@ TEST_F(TestTermReset, test_termination_reset_1) { if (this_node == 0) { auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } else if (this_node == 1) { theTerm()->addAction([=]{ EXPECT_EQ(handler_count, 10); @@ -92,7 +92,7 @@ TEST_F(TestTermReset, test_termination_reset_1) { if (this_node == 1) { auto msg = makeMessage(); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } else if (this_node == 0) { theTerm()->addAction([=]{ EXPECT_EQ(handler_count, 10); diff --git a/tutorial/tutorial_1b.h b/tutorial/tutorial_1b.h index 39884fedf4..4e007fe084 100644 --- a/tutorial/tutorial_1b.h +++ b/tutorial/tutorial_1b.h @@ -118,7 +118,7 @@ static inline void activeMessageNode() { if (this_node == 0) { NodeType const to_node = 1; auto msg = ::vt::makeMessage(29,32); - ::vt::theMsg()->sendMsg(to_node, msg.get()); + ::vt::theMsg()->sendMsg(to_node, msg); } } @@ -144,7 +144,7 @@ static void msgHandlerA(MyMsg* msg) { */ NodeType const to_node = 0; auto msg2 = ::vt::makeMessage(10,20); - ::vt::theMsg()->sendMsg(to_node, msg2.get()); + ::vt::theMsg()->sendMsg(to_node, msg2); } void MsgHandlerB::operator()(MyMsg* msg) { diff --git a/tutorial/tutorial_1c.h b/tutorial/tutorial_1c.h index 6aece5a097..dddb7da40b 100644 --- a/tutorial/tutorial_1c.h +++ b/tutorial/tutorial_1c.h @@ -138,7 +138,7 @@ static inline void activeMessageSerialization() { auto msg = ::vt::makeMessage(1,2,3); msg->particles.push_back(Particle{10,11,12}); msg->particles.push_back(Particle{13,14,15}); - ::vt::theMsg()->sendMsg(to_node, msg.get()); + ::vt::theMsg()->sendMsg(to_node, msg); } } diff --git a/tutorial/tutorial_1d.h b/tutorial/tutorial_1d.h index 87d3665d04..997f717de7 100644 --- a/tutorial/tutorial_1d.h +++ b/tutorial/tutorial_1d.h @@ -82,7 +82,7 @@ static inline void activeMessageBroadcast() { if (this_node == 0) { auto msg = ::vt::makeMessage(1.0,2.0,3.0); - ::vt::theMsg()->broadcastMsg(msg.get()); + ::vt::theMsg()->broadcastMsg(msg); } } diff --git a/tutorial/tutorial_1e.h b/tutorial/tutorial_1e.h index 53280d4fd1..4551bcb495 100644 --- a/tutorial/tutorial_1e.h +++ b/tutorial/tutorial_1e.h @@ -79,7 +79,7 @@ static inline void activeMessageGroupRoot() { fmt::print("Group is created: id={:x}\n", group_id); auto msg = makeMessage(); envelopeSetGroup(msg->env, group_id); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); }); // The `id' that is returned from the newGroup invocation, can be used // anywhere in the system to broadcast (multicast) to this group. diff --git a/tutorial/tutorial_1f.h b/tutorial/tutorial_1f.h index e7495c3423..f71be6b9cc 100644 --- a/tutorial/tutorial_1f.h +++ b/tutorial/tutorial_1f.h @@ -85,7 +85,7 @@ static inline void activeMessageGroupCollective() { if (my_node == 1) { auto msg = makeMessage(); envelopeSetGroup(msg->env, group_id); - theMsg()->broadcastMsg(msg.get()); + theMsg()->broadcastMsg(msg); } } ); diff --git a/tutorial/tutorial_1g.h b/tutorial/tutorial_1g.h index e9577d4130..994f8c7ceb 100644 --- a/tutorial/tutorial_1g.h +++ b/tutorial/tutorial_1g.h @@ -114,28 +114,28 @@ static inline void activeMessageCallback() { { auto cb = ::vt::theCB()->makeFunc(void_fn); auto msg = ::vt::makeMessage(cb); - ::vt::theMsg()->sendMsg(to_node,msg.get()); + ::vt::theMsg()->sendMsg(to_node, msg); } // Example of active message handler callback with send node { auto cb = ::vt::theCB()->makeSend(cb_node); auto msg = ::vt::makeMessage(cb); - ::vt::theMsg()->sendMsg(to_node,msg.get()); + ::vt::theMsg()->sendMsg(to_node, msg); } // Example of active message handler callback with broadcast { auto cb = ::vt::theCB()->makeBcast(); auto msg = ::vt::makeMessage(cb); - ::vt::theMsg()->sendMsg(to_node,msg.get()); + ::vt::theMsg()->sendMsg(to_node, msg); } // Example of context callback { auto cb = ::vt::theCB()->makeFunc(&ctx, callbackCtx); auto msg = ::vt::makeMessage(cb); - ::vt::theMsg()->sendMsg(to_node,msg.get()); + ::vt::theMsg()->sendMsg(to_node, msg); } } } diff --git a/tutorial/tutorial_3a.h b/tutorial/tutorial_3a.h index 9dd5929011..d87b91f137 100644 --- a/tutorial/tutorial_3a.h +++ b/tutorial/tutorial_3a.h @@ -79,7 +79,7 @@ static inline void activeMessageTerm() { if (this_node == 0) { auto msg = vt::makeMessage(8); envelopeSetEpoch(msg->env, new_epoch); - vt::theMsg()->sendMsg(this_node+1,msg.get()); + vt::theMsg()->sendMsg(this_node+1, msg); } // Any node that wishes to have a notification on termination for a given @@ -117,7 +117,7 @@ static void recurHandler(ExampleMsg* msg) { ); auto msg_send = vt::makeMessage(msg->ttl); - vt::theMsg()->sendMsg(next_node,msg_send.get()); + vt::theMsg()->sendMsg(next_node, msg_send); } } }