24#include <boost/mpi/communicator.hpp>
25#include <boost/mpi/exception.hpp>
43 (
nodes,
static_cast<int>(dim), dims.data()))
53template <std::
size_t dim>
63 return {
temp_comm, boost::mpi::comm_take_ownership};
71template <std::
size_t dims>
83template <std::
size_t dims>
96inline std::pair<int, int>
cart_shift(boost::mpi::communicator
const &comm,
113template <std::
size_t dim>
119 for (std::size_t i = 0; i < dim; i++) {
120 ret[2 * i + 0] = std::get<1>(
cart_shift(comm,
static_cast<int>(i), -1));
121 ret[2 * i + 1] = std::get<1>(
cart_shift(comm,
static_cast<int>(i), +1));
148template <std::
size_t dim>
153 ret.periods.data(),
ret.coords.data()))
Vector implementation and trait types for boost qvm interoperability.
DEVICE_QUALIFIER constexpr pointer data() noexcept
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
int cart_rank(boost::mpi::communicator const &comm, const Vector< int, dims > &pos)
Wrapper around MPI_Cart_rank.
std::pair< int, int > cart_shift(boost::mpi::communicator const &comm, int direction, int displacement)
Wrapper around MPI_Cart_shift.
Vector3i cart_coords(boost::mpi::communicator const &comm, int rank)
Wrapper around MPI_Cart_coords.
Vector< int, dim > dims_create(int nodes)
Wrapper around MPI_Dims_create.
CartInfo< dim > cart_get(const boost::mpi::communicator &comm)
Wrapper around MPI_Cart_get.
Utils::Vector< int, 2 *dim > cart_neighbors(const boost::mpi::communicator &comm)
Calculates the numbers of the nearest neighbors for a node.
boost::mpi::communicator cart_create(boost::mpi::communicator const &comm, Vector< int, dim > const &dims, bool reorder=true, Vector< int, dim > const &periodicity=Vector< int, dim >::broadcast(1))
Wrapper around MPI_Cart_create.
Information about a Cartesian communicator.
Utils::Vector< int, dim > dims
Utils::Vector< int, dim > periods
Utils::Vector< int, dim > coords