Skip to content

Commit

Permalink
Merge pull request #2284 from DARMA-tasking/2283-cleanup-performance-…
Browse files Browse the repository at this point in the history
…tests

#2283: Cleanup performance tests
  • Loading branch information
lifflander authored May 14, 2024
2 parents b16eb7a + ebd5ea6 commit 1570dcf
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
4 changes: 3 additions & 1 deletion tests/perf/collection_local_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/perf/make_runnable_micro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 5 additions & 3 deletions tests/perf/objgroup_local_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
24 changes: 7 additions & 17 deletions tests/perf/ping_pong.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <int64_t num_bytes>
Expand Down Expand Up @@ -99,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<new_num_bytes>, &NodeObj::pingPong<new_num_bytes>
>();
} else {
proxy_[pong_node].send<&NodeObj::pingPong<new_num_bytes>>();
}
}

Expand All @@ -115,19 +113,12 @@ struct NodeObj {
// End of iteration for node 1
addPerfStats(num_bytes);

proxy_[0]
.send<
NodeObj::FinishedPingMsg<num_bytes>,
&NodeObj::finishedPing<num_bytes>>(num_bytes);
proxy_[0].send<&NodeObj::finishedPing<num_bytes>>(num_bytes);
} else {
NodeType const next =
theContext()->getNode() == ping_node ? pong_node : ping_node;

auto msg = vt::makeMessage<NodeObj::PingMsg<num_bytes>>(cnt + 1);
proxy_[next]
.sendMsg<NodeObj::PingMsg<num_bytes>, &NodeObj::pingPong<num_bytes>>(
msg
);
proxy_[next].send<&NodeObj::pingPong<num_bytes>>(cnt + 1);
}
}

Expand Down Expand Up @@ -155,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::PingMsg<min_bytes>, &NodeObj::pingPong<min_bytes>>();
grp_proxy[pong_node].send<&NodeObj::pingPong<min_bytes>>();
}
}

Expand Down
8 changes: 5 additions & 3 deletions tests/perf/ping_pong_am.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};

Expand All @@ -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<MyMsg>();
theMsg()->sendMsg<&handler>(1, msg);
}
Expand Down
4 changes: 3 additions & 1 deletion tests/perf/reduce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
Expand Down

0 comments on commit 1570dcf

Please sign in to comment.