Skip to content

TilePattern::unit_at returns wrong value #670

Open
@devreal

Description

@devreal

The assert in the following example fails for some {x,y}:

using PatternT = typename dash::TilePattern<4>;
using TiledMatrix = dash::Matrix<value_t, 4, dash::default_index_t, PatternT>;
TiledMatrix A(num_blocks, num_blocks,         // super-blocks
                  dash::TILE(super_block_size), dash::TILE(super_block_size),
                  block_size, block_size,
                  dash::TILE(block_size), dash::TILE(block_size), ts);

// global coordinates of the block {x, y}
auto& pattern = A.pattern();
std::array<typename MatrixT::pattern_type::index_type, 4> gcoords = {x, y, 0, 0};
auto glob_idx = pattern.global_at(gcoords);
assert(pattern.local_index(gcoords).unit.id == pattern.unit_at(glob_idx));

I believe that the output of pattern.local_index(gcoords).unit.id is correct and that TilePattern::unit_at is broken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions