Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ While in the SeQuant source directory:
* [libPerm](https://github.com/Krzmbrzl/libPerm), tag 8e4afd1461baffa5d829c8fed059f5a172a3b060, *if not found, SeQuant will download and build libPerm*
* optional:
* for building coupled-cluster evaluation tests:
* [TiledArray](https://github.com/ValeevGroup/tiledarray.git), tag 3f6629db047417e814b75ad5069b7f4ce26428e7
* [TiledArray](https://github.com/ValeevGroup/tiledarray.git), tag 131ed04c989a5c6022d13e0dfe848d7112ffa9e4
* for building `stcc*` test programs
* [Eigen](http://eigen.tuxfamily.org/), version 3

Expand Down
12 changes: 8 additions & 4 deletions SeQuant/domain/eval/eval.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ ERPtr evaluate_core(NodeT const& node, Le const& le, Args&&... args) {
log_eval(node->is_constant() ? "[CONSTANT] "
: node->is_variable() ? "[VARIABLE] "
: "[TENSOR] ",
node->label(), " ", time.count(), "\n");
node->label(), " ", time.count(), " ", res->size_in_bytes(),
"\n");
return res;
} else {
ERPtr const left =
Expand All @@ -219,7 +220,8 @@ ERPtr evaluate_core(NodeT const& node, Le const& le, Args&&... args) {
if (node->op_type() == EvalOp::Sum) {
auto&& [res, time] = timed_eval([&]() { return left->sum(*right, ann); });
log_eval("[SUM] ", node.left()->label(), " + ", node.right()->label(),
" = ", node->label(), " ", time.count(), "\n");
" = ", node->label(), " ", time.count(), " ",
res->size_in_bytes(), "\n");
return res;
} else {
assert(node->op_type() == EvalOp::Prod);
Expand All @@ -232,7 +234,8 @@ ERPtr evaluate_core(NodeT const& node, Le const& le, Args&&... args) {
});

log_eval("[PRODUCT] ", node.left()->label(), " * ", node.right()->label(),
" = ", node->label(), " ", time.count(), "\n");
" = ", node->label(), " ", time.count(), " ",
res->size_in_bytes(), "\n");
return res;
}
}
Expand Down Expand Up @@ -356,7 +359,8 @@ auto evaluate(NodeT const& node, //
auto&& [res, time] = timed_eval([&]() {
return result->permute(std::array<std::any, 2>{node->annot(), layout});
});
log_eval("[PERMUTE] ", node->label(), " ", time.count(), "\n");
log_eval("[PERMUTE] ", node->label(), " ", time.count(), " ",
res->size_in_bytes(), "\n");
return res;
}

Expand Down
29 changes: 29 additions & 0 deletions SeQuant/domain/eval/eval_result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ class EvalResult {
return const_cast<EvalResult&>(*this).get<T>();
}

/// @return the size of the object in bytes
[[nodiscard]] virtual std::size_t size_in_bytes() const = 0;

protected:
template <typename T,
typename = std::enable_if_t<!std::is_convertible_v<T, EvalResult>>>
Expand Down Expand Up @@ -614,6 +617,8 @@ class EvalScalar final : public EvalResult {
[[nodiscard]] id_t type_id() const noexcept override {
return id_for_type<EvalScalar<T>>();
}

[[nodiscard]] std::size_t size_in_bytes() const final { return sizeof(T); }
};

///
Expand Down Expand Up @@ -743,6 +748,14 @@ class EvalTensorTA final : public EvalResult {
return eval_result<this_type>(
particle_antisymmetrize_ta(get<ArrayT>(), bra_rank));
}

private:
[[nodiscard]] std::size_t size_in_bytes() const final {
auto& v = get<ArrayT>();
auto local_size = TA::size_of<TA::MemorySpace::Host>(v);
v.world().gop.sum(local_size);
return local_size;
}
};

template <typename ArrayT,
Expand Down Expand Up @@ -882,6 +895,14 @@ class EvalTensorOfTensorTA final : public EvalResult {
// not implemented yet
return nullptr;
}

private:
[[nodiscard]] std::size_t size_in_bytes() const final {
auto& v = get<ArrayT>();
auto local_size = TA::size_of<TA::MemorySpace::Host>(v);
v.world().gop.sum(local_size);
return local_size;
}
};

///
Expand Down Expand Up @@ -975,6 +996,14 @@ class EvalTensorBTAS final : public EvalResult {
return eval_result<EvalTensorBTAS<T>>(
particle_antisymmetrize_btas(get<T>(), bra_rank));
}

private:
[[nodiscard]] std::size_t size_in_bytes() const final {
static_assert(std::is_arithmetic_v<typename T::value_type>);
const auto& tensor = get<T>();
// only count data
return tensor.range().volume() * sizeof(T);
}
};

} // namespace sequant
Expand Down
3 changes: 2 additions & 1 deletion SeQuant/domain/mbpt/rules/df.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ ExprPtr density_fit(ExprPtr const& expr, IndexSpace aux_space,
if (tensor.label() == tensor_label //
&& tensor.bra_rank() == 2 //
&& tensor.ket_rank() == 2)
return density_fit_impl(tensor, Index(L"1", aux_space), factor_label);
return density_fit_impl(
tensor, Index(aux_space.base_key() + L"_1", aux_space), factor_label);
else
return expr;
} else if (expr->is<Product>()) {
Expand Down
4 changes: 2 additions & 2 deletions external/versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set(SEQUANT_TRACKED_VGCMAKEKIT_TAG 4f40440dcbda2a5a005fd15f27c582a5587ee779)
set(SEQUANT_TRACKED_RANGEV3_TAG 0.12.0)
set(SEQUANT_TRACKED_RANGEV3_PREVIOUS_TAG d800a032132512a54c291ce55a2a43e0460591c7)

set(SEQUANT_TRACKED_TILEDARRAY_TAG fb5d5b80427cc937238a757ccec0cb313090528d)
set(SEQUANT_TRACKED_TILEDARRAY_PREVIOUS_TAG c10f8d5cade2e6040d28958f04189d6ae578c00a)
set(SEQUANT_TRACKED_TILEDARRAY_TAG 131ed04c989a5c6022d13e0dfe848d7112ffa9e4)
set(SEQUANT_TRACKED_TILEDARRAY_PREVIOUS_TAG 4a646d0c96cd0283eb34185aaf5f5b6fcc302bb2)

set(SEQUANT_TRACKED_LIBPERM_TAG 8e4afd1461baffa5d829c8fed059f5a172a3b060)
set(SEQUANT_TRACKED_LIBPERM_PREVIOUS_TAG 8e4afd1461baffa5d829c8fed059f5a172a3b060)
Expand Down
Loading