Skip to content

Commit

Permalink
Merge pull request #465 from ValeevGroup/evaleev/fix/can-concat-empty…
Browse files Browse the repository at this point in the history
…-arrays

concat(arrays) can handle zero-volume arrays
  • Loading branch information
evaleev authored Aug 23, 2024
2 parents de669ee + f50e580 commit 7e45348
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/TiledArray/conversions/concat.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,15 @@ DistArray<Tile, Policy> concat(
DistArray<Tile, Policy> result(*target_world, tr);
const auto annot = detail::dummy_annotation(r);
for (auto i = 0ul; i != arrays.size(); ++i) {
result.make_tsrexpr(annot).block(tile_begin_end[i].first,
tile_begin_end[i].second) =
arrays[i].make_tsrexpr(annot);
if (arrays[i].trange().tiles_range().volume() !=
0) { // N.B. empty block range expression bug workaround
result.make_tsrexpr(annot).block(tile_begin_end[i].first,
tile_begin_end[i].second) =
arrays[i].make_tsrexpr(annot);
result.make_tsrexpr(annot).block(tile_begin_end[i].first,
tile_begin_end[i].second) =
arrays[i].make_tsrexpr(annot);
}
}
result.world().gop.fence();

Expand Down

0 comments on commit 7e45348

Please sign in to comment.