Skip to content

Commit

Permalink
Merge pull request #2012 from DARMA-tasking/2007-fix-TestLBDataRetention
Browse files Browse the repository at this point in the history
2007: Skip TestLBDataRetention tests when num_ranks > num_elems
  • Loading branch information
nlslatt authored Nov 9, 2022
2 parents 72e3a0a + 9a24f4b commit 6160443
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions tests/unit/collection/test_lb_data_retention.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <gtest/gtest.h>

#include "test_parallel_harness.h"
#include "test_helpers.h"

#include <memory>

Expand Down Expand Up @@ -105,20 +106,24 @@ struct TestCol : vt::Collection<TestCol,vt::Index1D> {
}
};

using TestLBDataRetention = TestParallelHarness;
static constexpr int32_t const num_elms = 16;

struct TestLBDataRetention : TestParallelHarness {
virtual void SetUp() {
TestParallelHarness::SetUp();

// We must have more or equal number of elements than nodes for this test to
// work properly
SET_MAX_NUM_NODES_CONSTRAINT(num_elms);
}
};

using vt::vrt::collection::balance::LoadModel;
using vt::vrt::collection::balance::PersistenceMedianLastN;

static constexpr int32_t const num_elms = 16;

TEST_F(TestLBDataRetention, test_lbdata_retention_last1) {
static constexpr int const num_phases = 5;

// We must have more or equal number of elements than nodes for this test to
// work properly
EXPECT_GE(num_elms, vt::theContext()->getNumNodes());

auto range = vt::Index1D(num_elms);

vt::vrt::collection::CollectionProxy<TestCol> proxy;
Expand Down Expand Up @@ -153,10 +158,6 @@ TEST_F(TestLBDataRetention, test_lbdata_retention_last1) {
TEST_F(TestLBDataRetention, test_lbdata_retention_last2) {
static constexpr int const num_phases = 6;

// We must have more or equal number of elements than nodes for this test to
// work properly
EXPECT_GE(num_elms, vt::theContext()->getNumNodes());

auto range = vt::Index1D(num_elms);

vt::vrt::collection::CollectionProxy<TestCol> proxy;
Expand Down Expand Up @@ -191,10 +192,6 @@ TEST_F(TestLBDataRetention, test_lbdata_retention_last2) {
TEST_F(TestLBDataRetention, test_lbdata_retention_last4) {
static constexpr int const num_phases = 8;

// We must have more or equal number of elements than nodes for this test to
// work properly
EXPECT_GE(num_elms, vt::theContext()->getNumNodes());

auto range = vt::Index1D(num_elms);

vt::vrt::collection::CollectionProxy<TestCol> proxy;
Expand Down

0 comments on commit 6160443

Please sign in to comment.