diff --git a/dash/include/dash/Pattern.h b/dash/include/dash/Pattern.h index c8da56908..3876f9e89 100644 --- a/dash/include/dash/Pattern.h +++ b/dash/include/dash/Pattern.h @@ -48,7 +48,8 @@ namespace dash { * index | global | unit u, index li | Local offset li of unit u to global index | * index | global | index li | Local offset li of active unit to global index | * blocks |   |   |   | - * size[d] | blockspec |   | Number of blocks in all dimensions. | + * size[d] | blockspec |   | Number of blocks in all dimensions. | + * size[d] | local_blockspec |   | Number of local blocks in all dimensions. | * index | block_at | index[d] gp | Global index of block at global coordinates gp | * viewspec | block | index gbi | Offset and extent in global cartesian space of block at global block index gbi | * viewspec | local_block | index lbi | Offset and extent in global cartesian space of block at local block index lbi | diff --git a/dash/include/dash/io/hdf5/StorageDriver.h b/dash/include/dash/io/hdf5/StorageDriver.h index 7df9f4f7a..25de12b43 100644 --- a/dash/include/dash/io/hdf5/StorageDriver.h +++ b/dash/include/dash/io/hdf5/StorageDriver.h @@ -361,9 +361,9 @@ class StoreHDF { } } else { // Auto deduce pattern - const pattern_t pattern(dash::SizeSpec(size_extents), + const pattern_t pattern(dash::SizeSpec(size_extents), dash::DistributionSpec(), - dash::TeamSpec(), dash::Team::All()); + dash::TeamSpec(), dash::Team::All()); matrix.allocate(pattern); } @@ -698,9 +698,9 @@ class StoreHDF { } DASH_LOG_DEBUG("Created pattern according to metadata"); - const pattern_t pattern(dash::SizeSpec(size_extents), + const pattern_t pattern(dash::SizeSpec(size_extents), dash::DistributionSpec(dist_extents), - dash::TeamSpec(team_extents), + dash::TeamSpec(team_extents), dash::Team::All()); // Allocate DASH Matrix diff --git a/dash/include/dash/pattern/ShiftTilePattern1D.h b/dash/include/dash/pattern/ShiftTilePattern1D.h index 736f665ff..1ff4f81a1 100644 --- a/dash/include/dash/pattern/ShiftTilePattern1D.h +++ b/dash/include/dash/pattern/ShiftTilePattern1D.h @@ -916,9 +916,9 @@ class ShiftTilePattern<1, Arrangement, IndexType> } /** - * Cartesian arrangement of pattern blocks. + * Cartesian arrangement of local pattern blocks. */ - const BlockSpec_t & local_blockspec() const + const BlockSpec_t local_blockspec() const { return BlockSpec_t(_nlblocks); } diff --git a/dash/include/dash/pattern/TilePattern.h b/dash/include/dash/pattern/TilePattern.h index 9d75d623f..c28bdf5a0 100644 --- a/dash/include/dash/pattern/TilePattern.h +++ b/dash/include/dash/pattern/TilePattern.h @@ -1295,7 +1295,7 @@ class TilePattern } /** - * Cartesian arrangement of pattern blocks. + * Cartesian arrangement of local pattern blocks. */ constexpr const BlockSpec_t & local_blockspec() const { diff --git a/dash/include/dash/pattern/TilePattern1D.h b/dash/include/dash/pattern/TilePattern1D.h index e6a324a57..23b46a47a 100644 --- a/dash/include/dash/pattern/TilePattern1D.h +++ b/dash/include/dash/pattern/TilePattern1D.h @@ -796,9 +796,15 @@ class TilePattern<1, Arrangement, IndexType> * Cartesian arrangement of pattern blocks. */ constexpr BlockSpec_t blockspec() const { - return BlockSpec_t({ dash::math::div_ceil(_size, _blocksize) }); + return BlockSpec_t({ _nblocks }); } + /** + * Cartesian arrangement of local pattern blocks. + */ + constexpr BlockSpec_t local_blockspec() const { + return BlockSpec_t({ _nlblocks }); + } /** * Index of block at given global coordinates. * diff --git a/dash/test/pattern/TilePatternTest.cc b/dash/test/pattern/TilePatternTest.cc index f202dcb5b..081ac1119 100644 --- a/dash/test/pattern/TilePatternTest.cc +++ b/dash/test/pattern/TilePatternTest.cc @@ -300,3 +300,18 @@ TEST_F(TilePatternTest, Tile4Dim) } } } + +TEST_F(TilePatternTest, TileFunctionalCheck) +{ + const size_t dims = 1; + using pattern_t = typename dash::TilePattern; + using IndexType = typename pattern_t::index_type; + + // create simple TilePattern 1D BLOCKED for functional checks, now the test just checks for issue 692, unfinished + size_t array_size = 100; + pattern_t pattern(array_size, dash::BLOCKED); + + // tested local_blockspec() + const auto &lblockspec = pattern.local_blockspec(); + ASSERT_EQ_U(dims, lblockspec.size()); +} \ No newline at end of file