diff --git a/src/vt/vrt/collection/manager.impl.h b/src/vt/vrt/collection/manager.impl.h index c05f3f55a0..74cb18f406 100644 --- a/src/vt/vrt/collection/manager.impl.h +++ b/src/vt/vrt/collection/manager.impl.h @@ -2836,7 +2836,7 @@ MigrateStatus CollectionManager::migrateOut( if (elm_holder->numElements() == 1 and theConfig()->vt_lb_keep_last_elm) { vt_debug_print( vrt_coll, node, - "migrateOut: do not migrate last element\n", + "migrateOut: do not migrate last element\n" ); return MigrateStatus::ElementNotLocal; } diff --git a/tests/unit/collection/test_lb.extended.cc b/tests/unit/collection/test_lb.extended.cc index 4c2d41efd8..e7c7c88ed3 100644 --- a/tests/unit/collection/test_lb.extended.cc +++ b/tests/unit/collection/test_lb.extended.cc @@ -80,14 +80,15 @@ void colHandler(MyMsg*, MyCol* col) { } } -struct TestLoadBalancer : TestParallelHarnessParam { }; +struct TestLoadBalancer : TestParallelHarnessParam { + void runTest(); +}; -TEST_P(TestLoadBalancer, test_load_balancer_1) { +void TestLoadBalancer::runTest() { auto lb_name = GetParam(); vt::theConfig()->vt_lb = true; vt::theConfig()->vt_lb_name = lb_name; - vt::theConfig()->vt_lb_keep_last_elm = true; if (vt::theContext()->getNode() == 0) { fmt::print("Testing lb {}\n", lb_name); } @@ -112,6 +113,16 @@ TEST_P(TestLoadBalancer, test_load_balancer_1) { // Go to the next phase. vt::thePhase()->nextPhaseCollective(); } + return; +} + +TEST_P(TestLoadBalancer, test_load_balancer_1) { + runTest(); +} + +TEST_P(TestLoadBalancer, test_load_balancer_keep_last_elm) { + vt::theConfig()->vt_lb_keep_last_elm = true; + runTest(); } auto balancers = ::testing::Values(