31namespace nda::detail {
34 template <nda::Array A>
35 void check_layout_mpi_compatible(
const A &a,
const std::string &func) {
36 if (not a.is_contiguous() or not a.has_positive_strides())
37 NDA_RUNTIME_ERROR <<
"Error in function " << func <<
": Array is not contiguous with positive strides";
41 template <nda::Array A>
42 bool have_mpi_equal_ranks(
const A &a,
const mpi::communicator &comm) {
43 return mpi::all_equal(a.rank, comm);
47 template <nda::Array A>
48 bool have_mpi_equal_shapes(
const A &a,
const mpi::communicator &comm) {
49 return have_mpi_equal_ranks(a, comm) && mpi::all_equal(a.shape(), comm);
Provides concepts for the nda library.
Provides a custom runtime error class and macros to assert conditions and throw exceptions.