Skip to content

Commit

Permalink
Merge pull request #451 from ValeevGroup/gaudel/tests/tot_corner_cases
Browse files Browse the repository at this point in the history
Implements support for more corner cases involving ToT times T.
  • Loading branch information
evaleev committed Jun 4, 2024
2 parents d72357a + 59fbafb commit 5cafb3f
Show file tree
Hide file tree
Showing 9 changed files with 632 additions and 208 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
fail-fast: false
matrix:
os : [ macos-latest ]
cxx : [ clang++, /usr/local/bin/g++-10 ]
cxx : [ clang++, /opt/homebrew/bin/g++-11 ]
build_type : [ Release, Debug ]
task_backend: [ Pthreads, PaRSEC ]
prerequisites : [ gcc@10 boost eigen open-mpi bison scalapack ]
prerequisites : [ gcc@11 boost eigen open-mpi bison scalapack ]

name: "${{ matrix.os }}: ${{ matrix.cxx }} ${{ matrix.build_type }} ${{ matrix.task_backend }}"
runs-on: ${{ matrix.os }}
Expand All @@ -35,7 +35,7 @@ jobs:

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '<14'
xcode-version: 'latest-stable'

- name: Host system info
shell: bash
Expand Down
8 changes: 4 additions & 4 deletions src/TiledArray/conversions/dense_to_sparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ to_sparse(DistArray<Tile, ArgPolicy> const &dense_array) {
const auto begin = dense_array.begin();
for (auto it = begin; it != end; ++it) {
// write the norm of each local tile to the tensor
norm(it->get(), tile_norms[it.ordinal()]);
norm(it->get(), tile_norms[it.index()]);
}

// Construct a sparse shape the constructor will handle communicating the
Expand All @@ -40,9 +40,9 @@ to_sparse(DistArray<Tile, ArgPolicy> const &dense_array) {
// sparse_array set the sparse array tile with a clone so as not to hold
// a pointer to the original tile.
for (auto it = begin; it != end; ++it) {
const auto ord = it.ordinal();
if (!sparse_array.is_zero(ord)) {
sparse_array.set(ord, it->get().clone());
const auto ix = it.index();
if (!sparse_array.is_zero(ix)) {
sparse_array.set(ix, it->get().clone());
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/TiledArray/conversions/sparse_to_dense.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ to_dense(DistArray<Tile, ArgPolicy> const& sparse_array) {
Tile tile(sparse_array.find(ord).get().clone());
dense_array.set(ord, tile);
} else {
// see DistArray::set(ordinal, element_type)
dense_array.set(ord, 0);
dense_array.set(ord, typename Tile::value_type{});
}
}

Expand Down
Loading

0 comments on commit 5cafb3f

Please sign in to comment.