59 detail::check_layout_mpi_compatible(a,
"mpi_broadcast");
60 auto dims = a.shape();
61 mpi::broadcast(dims, comm, root);
63 mpi::broadcast_range(std::span{a.data(),
static_cast<std::size_t
>(a.size())}, 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.