Go to the documentation of this file.
43 # define UNUSED_WITHOUT_MPI
44 # define MPI_BOOL_TYPE unsigned char // TODO: replace with bool under MPI-3
45 # define MPI_BOOL MPI_UNSIGNED_CHAR // TODO: replace with MPI_CXX_BOOL under MPI-3
46 # warning "Implementing unsafe MPI-2 workaround for MPI_Comm_group_create"
47 # define MPI_Comm_group_create(c, g, t, pc) MPI_Comm_create(c, g, pc)
52 # define UNUSED_WITHOUT_MPI __attribute__((unused))
53 # define MPI_BOOL_TYPE unsigned char
65 # define MPI_COMM_WORLD 0
66 # define MPI_COMM_SELF 0
67 # define MPI_COMM_NULL -1
68 # define MPI_GROUP_NULL -1
69 # define MPI_UNDEFINED -1
70 # define MPI_IN_PLACE nullptr
71 # define MPI_Comm_size(c, sp) \
73 *(sp) = (((c) != MPI_COMM_NULL) ? 1 : 0); \
75 # define MPI_Comm_rank(c, rp) \
77 *(rp) = (((c) != MPI_COMM_NULL) ? 0 : -1); \
79 # define MPI_Comm_dup(c, cp) \
83 # define MPI_Comm_free(c) do {} while (0)
84 # define MPI_Comm_split(comm, color, key, cp) \
86 *(cp) = (((color) != MPI_UNDEFINED) \
90 # define MPI_Comm_group(c, pg) do { \
91 *(pg) = (((c) != MPI_COMM_NULL) \
92 ? (MPI_GROUP_NULL + 1) \
95 # define MPI_Group_free(pg) do {} while (0)
96 # define MPI_Group_incl(g, nr, pr, pg) do { \
97 if ((g) != MPI_GROUP_NULL && (nr) > 0) \
98 *(pg) = MPI_GROUP_NULL + 1; \
100 *(pg) = MPI_GROUP_NULL; \
102 # define MPI_Comm_group_create(c, g, t, pc) do { \
103 if ((c) != MPI_COMM_NULL && (g) != MPI_GROUP_NULL) \
106 *(pc) = MPI_COMM_NULL; \
108 # define MPI_Type_create_struct(a, b, c, d, pd) do { *(pd) = 0; } while (0)
109 # define MPI_Type_create_resized(a, b, c, pd) do { *(pd) = 0; } while (0)
110 # define MPI_Type_free(pd) do {} while (0)
111 # define MPI_Type_commit(pd) do {} while (0)
112 # define MPI_Op_create(a, b, po) do { *(po) = 0; } while (0)
113 # define MPI_Op_free(po) do {} while (0)
114 # define MPI_Barrier(c) do {} while (0)
115 # define MPI_Bcast(a, b, c, d, e) do {} while (0)
116 # define MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm) \
118 assert((sendbuf) == MPI_IN_PLACE); \
120 # define MPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm) \
122 assert((sendbuf) == MPI_IN_PLACE \
123 && (sendtype) == (recvtype) \
124 && (sendcount) == (recvcount)); \
126 # define MPI_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm) \
128 assert((sendbuf) == MPI_IN_PLACE \
129 && (sendtype) == (recvtype) \
130 && (sendcount) == (recvcounts)[0]); \
134 #endif // MPI_GLUE_H_