diff --git a/arbor/communication/mpi.hpp b/arbor/communication/mpi.hpp index 7b9e64311a197c81bd1966bb361ce37cfa4399ce..3200dd9e2ee1c0620e4e7fe8d920e8e7dc8e748a 100644 --- a/arbor/communication/mpi.hpp +++ b/arbor/communication/mpi.hpp @@ -48,15 +48,19 @@ struct mpi_traits<T> { \ constexpr static bool is_mpi_native_type() { return true; } \ }; -MAKE_TRAITS(double, MPI_DOUBLE) -MAKE_TRAITS(float, MPI_FLOAT) -MAKE_TRAITS(int, MPI_INT) -MAKE_TRAITS(long int, MPI_LONG) -MAKE_TRAITS(char, MPI_CHAR) -MAKE_TRAITS(unsigned int, MPI_UNSIGNED) -MAKE_TRAITS(size_t, MPI_UNSIGNED_LONG) -static_assert(sizeof(size_t)==sizeof(unsigned long), - "size_t and unsigned long are not equivalent"); +MAKE_TRAITS(float, MPI_FLOAT) +MAKE_TRAITS(double, MPI_DOUBLE) +MAKE_TRAITS(char, MPI_CHAR) +MAKE_TRAITS(int, MPI_INT) +MAKE_TRAITS(unsigned, MPI_UNSIGNED) +MAKE_TRAITS(long, MPI_LONG) +MAKE_TRAITS(unsigned long, MPI_UNSIGNED_LONG) +MAKE_TRAITS(long long, MPI_LONG_LONG) +MAKE_TRAITS(unsigned long long, MPI_UNSIGNED_LONG_LONG) + +static_assert(std::is_same<std::size_t, unsigned long>::value || + std::is_same<std::size_t, unsigned long long>::value, + "size_t is not the same as unsigned long or unsigned long long"); // Gather individual values of type T from each rank into a std::vector on // the root rank. diff --git a/aux/glob.cpp b/aux/glob.cpp index 9b67a4721f83b712e6d3d01bfb1829b364eeae48..78d96edbac11881b174e04b3052ef864061af4dc 100644 --- a/aux/glob.cpp +++ b/aux/glob.cpp @@ -1,6 +1,6 @@ // POSIX headers extern "C" { -#define _POSIX_C_SOURCE 2 +#define _POSIX_C_SOURCE 200809L #include <glob.h> } diff --git a/include/arbor/distributed_context.hpp b/include/arbor/distributed_context.hpp index 4f545874593c562696dd390f2a528107cc0960f5..5f50baa99397d055e70b0bb287c6f1ae77fad8ef 100644 --- a/include/arbor/distributed_context.hpp +++ b/include/arbor/distributed_context.hpp @@ -27,7 +27,7 @@ namespace arb { T sum(T value) const override { return wrapped.sum(value); }\ std::vector<T> gather(T value, int root) const override { return wrapped.gather(value, root); } -#define ARB_COLLECTIVE_TYPES_ float, double, int, std::uint32_t, std::uint64_t +#define ARB_COLLECTIVE_TYPES_ float, double, int, unsigned, long, unsigned long, long long, unsigned long long // Defines the concept/interface for a distributed communication context. //