diff --git a/INSTALL.md b/INSTALL.md index f00354d17b..2ee93c6a06 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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 diff --git a/SeQuant/domain/eval/eval.hpp b/SeQuant/domain/eval/eval.hpp index 1de9994c30..1af38f55e5 100644 --- a/SeQuant/domain/eval/eval.hpp +++ b/SeQuant/domain/eval/eval.hpp @@ -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 = @@ -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); @@ -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; } } @@ -356,7 +359,8 @@ auto evaluate(NodeT const& node, // auto&& [res, time] = timed_eval([&]() { return result->permute(std::array{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; } diff --git a/SeQuant/domain/eval/eval_result.hpp b/SeQuant/domain/eval/eval_result.hpp index 2258e51ebd..b2b5854c90 100644 --- a/SeQuant/domain/eval/eval_result.hpp +++ b/SeQuant/domain/eval/eval_result.hpp @@ -522,6 +522,9 @@ class EvalResult { return const_cast(*this).get(); } + /// @return the size of the object in bytes + [[nodiscard]] virtual std::size_t size_in_bytes() const = 0; + protected: template >> @@ -614,6 +617,8 @@ class EvalScalar final : public EvalResult { [[nodiscard]] id_t type_id() const noexcept override { return id_for_type>(); } + + [[nodiscard]] std::size_t size_in_bytes() const final { return sizeof(T); } }; /// @@ -743,6 +748,14 @@ class EvalTensorTA final : public EvalResult { return eval_result( particle_antisymmetrize_ta(get(), bra_rank)); } + + private: + [[nodiscard]] std::size_t size_in_bytes() const final { + auto& v = get(); + auto local_size = TA::size_of(v); + v.world().gop.sum(local_size); + return local_size; + } }; template (); + auto local_size = TA::size_of(v); + v.world().gop.sum(local_size); + return local_size; + } }; /// @@ -975,6 +996,14 @@ class EvalTensorBTAS final : public EvalResult { return eval_result>( particle_antisymmetrize_btas(get(), bra_rank)); } + + private: + [[nodiscard]] std::size_t size_in_bytes() const final { + static_assert(std::is_arithmetic_v); + const auto& tensor = get(); + // only count data + return tensor.range().volume() * sizeof(T); + } }; } // namespace sequant diff --git a/SeQuant/domain/mbpt/rules/df.cpp b/SeQuant/domain/mbpt/rules/df.cpp index d54fd24874..252dcde51e 100644 --- a/SeQuant/domain/mbpt/rules/df.cpp +++ b/SeQuant/domain/mbpt/rules/df.cpp @@ -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()) { diff --git a/external/versions.cmake b/external/versions.cmake index 9185c8ed05..754ecdc8c2 100644 --- a/external/versions.cmake +++ b/external/versions.cmake @@ -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)