n2p2 - A neural network potential package
mpi-extra.h
Go to the documentation of this file.
1// n2p2 - A neural network potential package
2// Copyright (C) 2018 Andreas Singraber (University of Vienna)
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17#include <mpi.h>
18#include <cstdint>
19#include <climits>
20
21#if SIZE_MAX == UCHAR_MAX
22 #define MPI_SIZE_T MPI_UNSIGNED_CHAR
23#elif SIZE_MAX == USHRT_MAX
24 #define MPI_SIZE_T MPI_UNSIGNED_SHORT
25#elif SIZE_MAX == UINT_MAX
26 #define MPI_SIZE_T MPI_UNSIGNED
27#elif SIZE_MAX == ULONG_MAX
28 #define MPI_SIZE_T MPI_UNSIGNED_LONG
29#elif SIZE_MAX == ULLONG_MAX
30 #define MPI_SIZE_T MPI_UNSIGNED_LONG_LONG
31#else
32 #error "No matching MPI data type for size_t."
33#endif