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 Apr 19, 2022
1 parent bde766a commit c5bc220
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 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: 10 additions & 4 deletions tests/unit/collection/test_collection_construct_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ void test_construct_1() {

auto const& this_node = theContext()->getNode();
if (this_node == 0) {
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>::construct(rng);
proxy.template broadcast<
MsgType,
Expand All @@ -133,8 +136,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);
proxy.template broadcast<
MsgType,
Expand Down

0 comments on commit c5bc220

Please sign in to comment.