30#include <boost/mpi/collectives/reduce.hpp>
40 : m_data{}, m_chunk_size{chunk_size} {
44#ifdef ESPRESSO_VIRTUAL_SITES
45 constexpr std::size_t
n_vs = 1;
47 constexpr std::size_t
n_vs = 0;
50 constexpr std::size_t
n_dpd = 1;
52 constexpr std::size_t
n_dpd = 0;
62 m_data = std::vector<double>(m_chunk_size *
n_elements);
65 kinetic_lin = std::span<double>(m_data.data(), m_chunk_size);
80std::size_t Observable_stat::get_non_bonded_offset(
int type1,
int type2)
const {
81 return static_cast<std::size_t
>(
87 std::vector<double>
temp(m_data);
88 boost::mpi::reduce(
comm_cart,
temp, m_data, std::plus<>{}, 0);
90 boost::mpi::reduce(
comm_cart, m_data, std::plus<>{}, 0);
std::span< double > coulomb
Contribution(s) from Coulomb interactions.
std::span< double > non_bonded_inter
Contribution(s) from non-bonded intermolecular interactions.
std::span< double > dpd
Contribution from DPD.
std::span< double > kinetic_rot
Contribution from angular kinetic energy.
std::span< double > kinetic_lin
Contribution from linear kinetic energy.
std::span< double > virtual_sites
Contribution from virtual sites (accumulated).
Observable_stat(std::size_t chunk_size, std::size_t n_bonded, int max_type)
std::span< double > non_bonded_intra
Contribution(s) from non-bonded intramolecular interactions.
void mpi_reduce()
MPI reduction.
std::span< double > dipolar
Contribution(s) from dipolar interactions.
std::span< double > external_fields
Contribution from external fields (accumulated).
std::span< double > bonded
Contribution(s) from bonded interactions.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
boost::mpi::communicator comm_cart
The communicator.
T lower_triangular(T i, T j)
Linear index into a lower triangular matrix.