24#include <boost/mpi/collectives/gather.hpp>
25#include <boost/mpi/communicator.hpp>
26#include <boost/serialization/vector.hpp>
32namespace Observables::detail {
36auto gather(boost::mpi::communicator
const &comm,
39 global_pos.reserve(
static_cast<std::size_t
>(comm.size()));
45template <
class Pos,
class Val>
46auto gather(boost::mpi::communicator
const &comm,
50 global_pos.reserve(
static_cast<std::size_t
>(comm.size()));
53 global_val.reserve(
static_cast<std::size_t
>(comm.size()));
59template <
class T, std::
size_t N, std::
size_t M,
class U,
class Pos,
class Val>
61 std::vector<std::vector<Pos>>
const &pos,
62 std::vector<std::vector<Val>>
const &
val) {
63 for (std::size_t rank = 0
u; rank < pos.size(); ++rank) {
64 auto const &
pos_vec = pos[rank];
66 for (std::size_t i = 0
u; i <
pos_vec.size(); ++i) {
72struct empty_bin_exception {};
75template <
class T, std::
size_t N, std::
size_t M,
class U>
77 bool allow_empty_bins =
true) {
80 for (std::size_t i = 0
u; i <
hist_data.size(); ++i) {
83 }
else if (
not allow_empty_bins) {
84 throw empty_bin_exception{};
Histogram in Cartesian coordinates.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.