20namespace nda::detail {
23 template <nda::Array A>
24 void check_layout_mpi_compatible(
const A &a,
const std::string &func) {
25 if (not a.is_contiguous() or not a.has_positive_strides())
26 NDA_RUNTIME_ERROR <<
"Error in function " << func <<
": Array is not contiguous with positive strides";
30 template <nda::Array A>
31 bool have_mpi_equal_ranks(
const A &a,
const mpi::communicator &comm) {
32 return mpi::all_equal(a.rank, comm);
36 template <nda::Array A>
37 bool have_mpi_equal_shapes(
const A &a,
const mpi::communicator &comm) {
38 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.