preCICE v3.1.1
Loading...
Searching...
No Matches
MPI_Mock.hpp
Go to the documentation of this file.
1#pragma once
2
12
13static MPI_Comm MPI_COMM_WORLD = nullptr;
14
15const MPI_Datatype MPI_LONG = nullptr;
16const MPI_Op MPI_MIN = nullptr;
17const MPI_Op MPI_MAX = nullptr;
18
19inline int MPI_Barrier(MPI_Comm comm)
20{
21 return 0;
22}
23
24inline int MPI_Comm_rank(MPI_Comm comm, int *rank)
25{
26 *rank = 0;
27 return 0;
28}
29
30inline int MPI_Comm_size(MPI_Comm comm, int *size)
31{
32 *size = 0;
33 return 0;
34}
35
36template <class T>
37inline int MPI_Allreduce(const T *sendbuf, T *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
38{
39 std::copy(sendbuf, sendbuf + count, recvbuf);
40 return 0;
41}
42
43template <class T>
44inline int MPI_Reduce(const T *sendbuf, T *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
45{
46 std::copy(sendbuf, sendbuf + count, recvbuf);
47 return 0;
48}
int MPI_Reduce(const T *sendbuf, T *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
Definition MPI_Mock.hpp:44
const MPI_Op MPI_MIN
Definition MPI_Mock.hpp:16
int MPI_Comm_rank(MPI_Comm comm, int *rank)
Definition MPI_Mock.hpp:24
int MPI_Barrier(MPI_Comm comm)
Definition MPI_Mock.hpp:19
const MPI_Op MPI_MAX
Definition MPI_Mock.hpp:17
static MPI_Comm MPI_COMM_WORLD
Definition MPI_Mock.hpp:13
int MPI_Allreduce(const T *sendbuf, T *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
Definition MPI_Mock.hpp:37
int MPI_Comm_size(MPI_Comm comm, int *size)
Definition MPI_Mock.hpp:30
const MPI_Datatype MPI_LONG
Definition MPI_Mock.hpp:15
T copy(T... args)