diff --git a/src/vt/topos/mapping/dense/dense.impl.h b/src/vt/topos/mapping/dense/dense.impl.h index 2d6d83b8c1..8c553ade18 100644 --- a/src/vt/topos/mapping/dense/dense.impl.h +++ b/src/vt/topos/mapping/dense/dense.impl.h @@ -93,6 +93,13 @@ NodeType dense3DRoundRobinMap(Idx3DPtr idx, Idx3DPtr max, NodeType nx) { return lin_idx % nx; } +template +NodeType denseNDRoundRobinMap(IdxNDPtr idx, IdxNDPtr max, NodeType nx) { + using IndexElmType = typename IdxTypeND::DenseIndexType; + auto const& lin_idx = linearizeDenseIndexColMajor(idx, max); + return lin_idx % nx; +} + // Default block mappings template NodeType dense1DBlockMap(Idx1DPtr idx, Idx1DPtr max, NodeType nx) { diff --git a/tests/unit/collection/test_collection_construct_common.h b/tests/unit/collection/test_collection_construct_common.h index a561f03a1b..0b4ce669d9 100644 --- a/tests/unit/collection/test_collection_construct_common.h +++ b/tests/unit/collection/test_collection_construct_common.h @@ -122,11 +122,12 @@ void test_construct_1(std::string const& label) { auto const& this_node = theContext()->getNode(); if (this_node == 0) { - auto const& col_size = 32; + // We don't want too many elements for 4 dimensions + auto constexpr num_dims = ColType::IndexType::ndims(); + auto constexpr col_size = 8 / num_dims; - auto rng = CreateRange(col_size); + auto rng = CreateRange(col_size); auto proxy = ConstructParams::construct(label, rng); - proxy.template broadcast< MsgType, ConstructHandlers::handler @@ -138,8 +139,11 @@ template void test_construct_distributed_1() { using MsgType = typename ColType::MsgType; - auto const& col_size = 32; - auto rng = CreateRange(col_size); + // We don't want too many elements for 4 dimensions + auto constexpr num_dims = ColType::IndexType::ndims(); + auto constexpr col_size = 8 / num_dims; + + auto rng = CreateRange(col_size); auto proxy = ConstructParams::constructCollective(rng, "test_construct_distributed_1"); proxy.template broadcast< MsgType, diff --git a/tests/unit/collection/test_construct.cc b/tests/unit/collection/test_construct.cc index 31d60c9212..35595716cc 100644 --- a/tests/unit/collection/test_construct.cc +++ b/tests/unit/collection/test_construct.cc @@ -100,7 +100,7 @@ TEST_F(TestConstructLabel, test_labels) { auto const range = Index1D(num_nodes); std::string const label = "test_labels"; - auto proxy = makeCollection(label) + auto proxy = makeCollection(label) .bounds(range) .bulkInsert() .wait();