1// Message Passing Interface mock header. Mocks MPI constants and functions, in
2// order to make them available in distinct integration test files.
3
4#define NULL 0
5
6// mock types
7typedef int MPI_Datatype;
8typedef int MPI_Comm;
9typedef int MPI_Request;
10typedef int MPI_Status;
11typedef int MPI_Op;
12typedef int int8_t;
13typedef int uint8_t;
14typedef int uint16_t;
15typedef int int64_t;
16namespace std { template<class T> struct complex { T real; T imag; }; }
17
18// mock constants
19#define MPI_DATATYPE_NULL 0
20#define MPI_CHAR 0
21#define MPI_BYTE 0
22#define MPI_INT 0
23#define MPI_LONG 0
24#define MPI_LONG_DOUBLE 0
25#define MPI_UNSIGNED 0
26#define MPI_INT8_T 0
27#define MPI_UINT8_T 0
28#define MPI_UINT16_T 0
29#define MPI_C_LONG_DOUBLE_COMPLEX 0
30#define MPI_FLOAT 0
31#define MPI_DOUBLE 0
32#define MPI_CXX_BOOL 0
33#define MPI_CXX_FLOAT_COMPLEX 0
34#define MPI_CXX_DOUBLE_COMPLEX 0
35#define MPI_CXX_LONG_DOUBLE_COMPLEX 0
36#define MPI_IN_PLACE 0
37#define MPI_COMM_WORLD 0
38#define MPI_STATUS_IGNORE 0
39#define MPI_STATUSES_IGNORE 0
40#define MPI_SUM 0
41
42// mock functions
43int MPI_Comm_size(MPI_Comm, int *);
44int MPI_Comm_rank(MPI_Comm, int *);
45int MPI_Send(const void *, int, MPI_Datatype, int, int, MPI_Comm);
46int MPI_Recv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *);
47int MPI_Isend(const void *, int, MPI_Datatype, int, int, MPI_Comm,
48    MPI_Request *);
49int MPI_Irecv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
50int MPI_Wait(MPI_Request *, MPI_Status *);
51int MPI_Waitall(int, MPI_Request[], MPI_Status[]);
52int MPI_Reduce(const void *, void *, int, MPI_Datatype, MPI_Op, int, MPI_Comm);
53int MPI_Ireduce(const void *, void *, int, MPI_Datatype, MPI_Op, int, MPI_Comm,
54    MPI_Request *);
55int MPI_Bcast(void *, int count, MPI_Datatype, int, MPI_Comm);
56