Skip to content

Commit

Permalink
#1544: Tests: Reduce number of elements for 4 dim Collection in test_…
Browse files Browse the repository at this point in the history
…construct
  • Loading branch information
JacobDomagala committed Jun 6, 2022
1 parent 737ae79 commit a740792
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/vt/topos/mapping/dense/dense.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ NodeType dense3DRoundRobinMap(Idx3DPtr<T> idx, Idx3DPtr<T> max, NodeType nx) {
return lin_idx % nx;
}

template <typename T, int8_t N>
NodeType denseNDRoundRobinMap(IdxNDPtr<T,N> idx, IdxNDPtr<T,N> max, NodeType nx) {
using IndexElmType = typename IdxTypeND<T, N>::DenseIndexType;
auto const& lin_idx = linearizeDenseIndexColMajor<IndexElmType, N>(idx, max);
return lin_idx % nx;
}

// Default block mappings
template <typename T>
NodeType dense1DBlockMap(Idx1DPtr<T> idx, Idx1DPtr<T> max, NodeType nx) {
Expand Down
14 changes: 9 additions & 5 deletions tests/unit/collection/test_collection_construct_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ColType, ColType::IndexType::ndims()>(col_size);
auto rng = CreateRange<ColType, num_dims>(col_size);
auto proxy = ConstructParams<ColType>::construct(label, rng);

proxy.template broadcast<
MsgType,
ConstructHandlers::handler<ColType,MsgType>
Expand All @@ -138,8 +139,11 @@ template<typename ColType>
void test_construct_distributed_1() {
using MsgType = typename ColType::MsgType;

auto const& col_size = 32;
auto rng = CreateRange<ColType, ColType::IndexType::ndims()>(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<ColType, num_dims>(col_size);
auto proxy = ConstructParams<ColType>::constructCollective(rng, "test_construct_distributed_1");
proxy.template broadcast<
MsgType,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/collection/test_construct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ TEST_F(TestConstructLabel, test_labels) {
auto const range = Index1D(num_nodes);
std::string const label = "test_labels";

auto proxy = makeCollection<default_::TestCol>(label)
auto proxy = makeCollection<default_::TestCol1D>(label)
.bounds(range)
.bulkInsert()
.wait();
Expand Down

0 comments on commit a740792

Please sign in to comment.