31#include <boost/mpi/collectives/reduce.hpp>
40 : m_data{}, m_chunk_size{chunk_size} {
42 constexpr std::size_t n_coulomb = 2;
43 constexpr std::size_t n_dipolar = 2;
45 constexpr std::size_t n_vs = 1;
47 constexpr std::size_t n_vs = 0;
49 auto const n_non_bonded =
52 constexpr std::size_t n_ext_fields = 1;
53 constexpr std::size_t n_kinetic = 1;
55 auto const n_elements = n_kinetic + n_bonded + 2ul * n_non_bonded +
56 n_coulomb + n_dipolar + n_vs + n_ext_fields;
57 m_data = std::vector<double>(m_chunk_size * n_elements);
76 int type1,
int type2)
const {
77 auto const offset =
static_cast<std::size_t
>(
79 return {base_pointer.
begin() + offset * m_chunk_size, m_chunk_size};
84 std::vector<double> temp(m_data);
85 boost::mpi::reduce(
comm_cart, temp, m_data, std::plus<>{}, 0);
87 boost::mpi::reduce(
comm_cart, m_data, std::plus<>{}, 0);
Utils::Span< double > kinetic
Contribution from linear and angular kinetic energy (accumulated).
Utils::Span< double > dipolar
Contribution(s) from dipolar interactions.
Observable_stat(std::size_t chunk_size, std::size_t n_bonded, int max_type)
Utils::Span< double > virtual_sites
Contribution from virtual sites (accumulated).
void mpi_reduce()
MPI reduction.
Utils::Span< double > non_bonded_intra
Contribution(s) from non-bonded intramolecular interactions.
Utils::Span< double > external_fields
Contribution from external fields (accumulated).
Utils::Span< double > non_bonded_inter
Contribution(s) from non-bonded intermolecular interactions.
Utils::Span< double > bonded
Contribution(s) from bonded interactions.
Utils::Span< double > coulomb
Contribution(s) from Coulomb interactions.
A stripped-down version of std::span from C++17.
DEVICE_QUALIFIER constexpr iterator end() const
DEVICE_QUALIFIER constexpr iterator begin() const
boost::mpi::communicator comm_cart
The communicator.
This file contains the defaults for ESPResSo.
T lower_triangular(T i, T j)
Linear index into a lower triangular matrix.