Skip to content

Commit

Permalink
Merge pull request #1656 from DARMA-tasking/1654-split-test-to-avoid-…
Browse files Browse the repository at this point in the history
…timeout

#1654: tests: split up LB parameterization to reduce time per test instance
  • Loading branch information
lifflander authored Jan 12, 2022
2 parents a4e8127 + 5bf258c commit f88c3ba
Showing 1 changed file with 32 additions and 17 deletions.
49 changes: 32 additions & 17 deletions tests/unit/collection/test_lb.extended.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,10 @@ void colHandler(MyMsg*, MyCol* col) {
}
}

struct TestLoadBalancer : TestParallelHarnessParam<std::string> {
void runTest();
};

void TestLoadBalancer::runTest() {
auto lb_name = GetParam();
struct TestLoadBalancerOther : TestParallelHarnessParam<std::string> { };
struct TestLoadBalancerGreedy : TestParallelHarnessParam<std::string> { };

void runTest(std::string lb_name) {
vt::theConfig()->vt_lb = true;
vt::theConfig()->vt_lb_name = lb_name;
if (vt::theContext()->getNode() == 0) {
Expand Down Expand Up @@ -133,18 +130,29 @@ void TestLoadBalancer::runTest() {
return;
}

TEST_P(TestLoadBalancer, test_load_balancer_1) {
runTest();
TEST_P(TestLoadBalancerOther, test_load_balancer_other_1) {
runTest(GetParam());
}

TEST_P(TestLoadBalancerOther, test_load_balancer_other_keep_last_elm) {
vt::theConfig()->vt_lb_keep_last_elm = true;
runTest(GetParam());
}

TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_2) {
runTest(GetParam());
}

TEST_P(TestLoadBalancer, test_load_balancer_keep_last_elm) {
TEST_P(TestLoadBalancerGreedy, test_load_balancer_greedy_keep_last_elm) {
vt::theConfig()->vt_lb_keep_last_elm = true;
runTest();
runTest(GetParam());
}

struct MyCol2 : vt::Collection<MyCol2,vt::Index1D> {};

TEST_P(TestLoadBalancer, test_load_balancer_no_work) {
using TestLoadBalancerNoWork = TestParallelHarness;

TEST_F(TestLoadBalancerNoWork, test_load_balancer_no_work) {
auto const num_nodes = theContext()->getNumNodes();
auto const range = Index1D(num_nodes * 8);
theCollection()->constructCollective<MyCol2>(
Expand All @@ -164,21 +172,28 @@ TEST_P(TestLoadBalancer, test_load_balancer_no_work) {
}
}

auto balancers = ::testing::Values(
auto balancers_other = ::testing::Values(
"RandomLB",
"RotateLB",
"HierarchicalLB",
"TemperedLB",
"GreedyLB:strategy=scatter",
"GreedyLB:strategy=pt2pt",
"GreedyLB:strategy=bcast"
"TemperedLB"
# if vt_check_enabled(zoltan)
, "ZoltanLB"
# endif
);

auto balancers_greedy = ::testing::Values(
"GreedyLB:strategy=scatter",
"GreedyLB:strategy=pt2pt",
"GreedyLB:strategy=bcast"
);

INSTANTIATE_TEST_SUITE_P(
LoadBalancerExplodeOther, TestLoadBalancerOther, balancers_other
);

INSTANTIATE_TEST_SUITE_P(
LoadBalancerExplode, TestLoadBalancer, balancers
LoadBalancerExplodeGreedy, TestLoadBalancerGreedy, balancers_greedy
);

struct TestParallelHarnessWithStatsDumping : TestParallelHarnessParam<int> {
Expand Down

0 comments on commit f88c3ba

Please sign in to comment.