50 auto dims = a.shape();
51 mpi::broadcast(dims, comm, root);
57 if (a.is_contiguous() and a.has_positive_strides()) {
58 auto a_span = std::span{a.data(),
static_cast<std::size_t
>(a.size())};
59 mpi::broadcast_range(a_span, comm, root);
61 mpi::broadcast_range(a, comm, root);
Provides basic functions to create and manipulate arrays and views.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
void mpi_broadcast(A &&a, mpi::communicator comm={}, int root=0)
Implementation of an MPI broadcast for nda::basic_array or nda::basic_array_view types.
constexpr bool is_regular_or_view_v
Constexpr variable that is true if type A is either a regular array or a view.
Provides various utility functions used by the MPI interface of nda.
Provides type traits for the nda library.