62 requires(is_regular_or_view_v<A>)
64 static_assert(has_contiguous_layout<A>,
"Error in MPI broadcast for nda::Array: Array needs to be contiguous");
65 auto dims = a.shape();
66 MPI_Bcast(&dims[0], dims.size(), mpi::mpi_type<
typename decltype(dims)::value_type>::get(), root, comm.get());
67 if (comm.rank() != root) { resize_or_check_if_view(a, dims); }
68 MPI_Bcast(a.data(), a.size(), mpi::mpi_type<
typename A::value_type>::get(), root, comm.get());
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.