From a6989efebd1e3dbe6a3fdcf8067e0c48e81a6659 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Mon, 13 May 2024 17:52:43 +0200 Subject: [PATCH 1/2] #2283: Cleanup performance tests --- tests/perf/collection_local_send.cc | 4 +++- tests/perf/make_runnable_micro.cc | 4 +++- tests/perf/objgroup_local_send.cc | 8 +++++--- tests/perf/ping_pong.cc | 4 +++- tests/perf/ping_pong_am.cc | 8 +++++--- tests/perf/reduce.cc | 4 +++- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/tests/perf/collection_local_send.cc b/tests/perf/collection_local_send.cc index 05cd8fc73f..12ff0cee9a 100644 --- a/tests/perf/collection_local_send.cc +++ b/tests/perf/collection_local_send.cc @@ -50,7 +50,9 @@ using namespace vt::tests::perf::common; static constexpr int num_iters = 1000000; -struct MyTest : PerfTestHarness { }; +struct MyTest : PerfTestHarness { + MyTest() { DisableGlobalTimer(); } +}; struct MyMsg : vt::Message {}; struct NodeObj; diff --git a/tests/perf/make_runnable_micro.cc b/tests/perf/make_runnable_micro.cc index c53599070c..2d99d606fb 100644 --- a/tests/perf/make_runnable_micro.cc +++ b/tests/perf/make_runnable_micro.cc @@ -53,7 +53,9 @@ using namespace vt::tests::perf::common; static constexpr int num_iters = 100000; -struct MyTest : PerfTestHarness { }; +struct MyTest : PerfTestHarness { + MyTest() { DisableGlobalTimer(); } +}; struct MyMsg : vt::Message {}; struct NodeObj; diff --git a/tests/perf/objgroup_local_send.cc b/tests/perf/objgroup_local_send.cc index ed351af419..4903df43b8 100644 --- a/tests/perf/objgroup_local_send.cc +++ b/tests/perf/objgroup_local_send.cc @@ -50,7 +50,9 @@ using namespace vt::tests::perf::common; static constexpr int num_iters = 1000000; -struct MyTest : PerfTestHarness { }; +struct MyTest : PerfTestHarness { + MyTest() { DisableGlobalTimer(); } +}; struct MyMsg : vt::Message {}; struct NodeObj; @@ -82,9 +84,9 @@ struct NodeObj { theTerm()->disableTD(); - test_obj_->StartTimer(fmt::format("colSend {}", num_iters)); + test_obj_->StartTimer(fmt::format("ObjGroup send {}", num_iters)); perfRunBenchmark(); - test_obj_->StopTimer(fmt::format("colSend {}", num_iters)); + test_obj_->StopTimer(fmt::format("ObjGroup send {}", num_iters)); theTerm()->enableTD(); } diff --git a/tests/perf/ping_pong.cc b/tests/perf/ping_pong.cc index 8bec0fa9b7..c7f0f51102 100644 --- a/tests/perf/ping_pong.cc +++ b/tests/perf/ping_pong.cc @@ -60,7 +60,9 @@ static constexpr NodeType const pong_node = 1; vt::EpochType the_epoch = vt::no_epoch; -struct MyTest : PerfTestHarness { }; +struct MyTest : PerfTestHarness { + MyTest() { DisableGlobalTimer(); } +}; struct NodeObj { template diff --git a/tests/perf/ping_pong_am.cc b/tests/perf/ping_pong_am.cc index 0ba975cee9..72644d61a0 100644 --- a/tests/perf/ping_pong_am.cc +++ b/tests/perf/ping_pong_am.cc @@ -54,7 +54,9 @@ using namespace vt::tests::perf::common; static constexpr int num_iters = 10000; static int i = 0; -struct MyTest : PerfTestHarness { }; +struct MyTest : PerfTestHarness { + MyTest() { DisableGlobalTimer(); } +}; struct MyMsg : vt::Message {}; @@ -79,14 +81,14 @@ struct NodeObj { } void complete() { - test_obj_->StopTimer(fmt::format("{} ping-pong", i)); + test_obj_->StopTimer("ping-pong"); if (theContext()->getNode() == 0) { theTerm()->enableTD(); } } void perfPingPong(MyMsg* in_msg) { - test_obj_->StartTimer(fmt::format("{} ping-pong", i)); + test_obj_->StartTimer("ping-pong"); auto msg = makeMessage(); theMsg()->sendMsg<&handler>(1, msg); } diff --git a/tests/perf/reduce.cc b/tests/perf/reduce.cc index 0f1b25791a..edda6c8a3d 100644 --- a/tests/perf/reduce.cc +++ b/tests/perf/reduce.cc @@ -52,7 +52,9 @@ using namespace vt::tests::perf::common; static constexpr int num_iters = 100; -struct MyTest : PerfTestHarness { }; +struct MyTest : PerfTestHarness { + MyTest() { DisableGlobalTimer(); } +}; struct NodeObj { explicit NodeObj(MyTest* test_obj) : test_obj_(test_obj) { } From ebd5ea6e9a6d986456a38f9b27a72bc919021438 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Mon, 13 May 2024 18:55:40 +0200 Subject: [PATCH 2/2] #2283: Cleanup ping_pong perf test --- tests/perf/ping_pong.cc | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tests/perf/ping_pong.cc b/tests/perf/ping_pong.cc index c7f0f51102..5e570850e5 100644 --- a/tests/perf/ping_pong.cc +++ b/tests/perf/ping_pong.cc @@ -101,11 +101,7 @@ struct NodeObj { constexpr auto new_num_bytes = num_bytes * 2; test_obj_->StartTimer(fmt::format("{} Bytes", new_num_bytes)); - proxy_[pong_node] - .send< - NodeObj::PingMsg, &NodeObj::pingPong - >(); - } else { + proxy_[pong_node].send<&NodeObj::pingPong>(); } } @@ -117,19 +113,12 @@ struct NodeObj { // End of iteration for node 1 addPerfStats(num_bytes); - proxy_[0] - .send< - NodeObj::FinishedPingMsg, - &NodeObj::finishedPing>(num_bytes); + proxy_[0].send<&NodeObj::finishedPing>(num_bytes); } else { NodeType const next = theContext()->getNode() == ping_node ? pong_node : ping_node; - auto msg = vt::makeMessage>(cnt + 1); - proxy_[next] - .sendMsg, &NodeObj::pingPong>( - msg - ); + proxy_[next].send<&NodeObj::pingPong>(cnt + 1); } } @@ -157,8 +146,7 @@ VT_PERF_TEST(MyTest, test_ping_pong) { StartTimer(fmt::format("{} Bytes", min_bytes)); if (my_node_ == 0) { - grp_proxy[pong_node] - .send, &NodeObj::pingPong>(); + grp_proxy[pong_node].send<&NodeObj::pingPong>(); } }