Remove some include order dependencies
[alexxy/gromacs.git] / src / external / thread_mpi / include / thread_mpi / mpi_bindings.h
1 /*
2    This source code file is part of thread_mpi.
3    Written by Sander Pronk, Erik Lindahl, and possibly others.
4
5    Copyright (c) 2009, Sander Pronk, Erik Lindahl.
6    All rights reserved.
7
8    Redistribution and use in source and binary forms, with or without
9    modification, are permitted provided that the following conditions are met:
10    1) Redistributions of source code must retain the above copyright
11    notice, this list of conditions and the following disclaimer.
12    2) Redistributions in binary form must reproduce the above copyright
13    notice, this list of conditions and the following disclaimer in the
14    documentation and/or other materials provided with the distribution.
15    3) Neither the name of the copyright holders nor the
16    names of its contributors may be used to endorse or promote products
17    derived from this software without specific prior written permission.
18
19    THIS SOFTWARE IS PROVIDED BY US ''AS IS'' AND ANY
20    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22    DISCLAIMED. IN NO EVENT SHALL WE BE LIABLE FOR ANY
23    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30    If you want to redistribute modifications, please consider that
31    scientific software is very special. Version control is crucial -
32    bugs must be traceable. We will be happy to consider code for
33    inclusion in the official distribution, but derived work should not
34    be called official thread_mpi. Details are found in the README & COPYING
35    files.
36  */
37
38 #ifndef TMPI_MPI_BINDINGS_H_
39 #define TMPI_MPI_BINDINGS_H_
40
41 #include "tmpi.h"
42
43 /** \file
44    \brief MPI bindings for thread_mpi/tmpi.h
45
46    This file contains only macros and redefinitions to expose the standard
47    MPI API with thread_mpi calls.
48
49    This is different from the API exposed through thread_mpi/tmpi.h, which
50    uses names like \a tMPI_Send() instead of \a MPI_Send()
51
52    \sa thread_mpi/tmpi.h for documentation of the available data types and
53       functions
54    \sa http://www.mpi-forum.org/docs/docs.html for MPI documentation.
55  */
56
57 #ifndef DOXYGEN
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62
63
64
65
66 /* The MPI_Comm structure contains the group of processes to communicate
67    with (defines the scope for global operations such as broadcast) */
68 typedef struct tmpi_comm_ *MPI_Comm;
69 /* The group part of the MPI-Comm structure */
70 typedef struct tmpi_group_ *MPI_Group;
71 /* Request structure for holding data about non-blocking transfers */
72 typedef struct tmpi_req_ *MPI_Request;
73 /* status of receives */
74 typedef struct tmpi_status_ MPI_Status;
75 /* data types */
76 typedef struct tmpi_datatype_ *MPI_Datatype;
77 /* reduce operations */
78 typedef tMPI_Op MPI_Op;
79
80
81 #define MPI_CHAR                TMPI_CHAR
82 #define MPI_SHORT               TMPI_SHORT
83 #define MPI_INT                 TMPI_INT
84 #define MPI_LONG                TMPI_LONG
85 #define MPI_LONG_LONG           TMPI_LONG_LONG
86 #define MPI_LONG_LONG_INT       TMPI_LONG_LONG_INT
87 #define MPI_SIGNED_CHAR         TMPI_SIGNED_CHAR
88 #define MPI_UNSIGNED_CHAR       TMPI_UNSIGNED_CHAR
89 #define MPI_UNSIGNED_SHORT      TMPI_UNSIGNED_SHORT
90 #define MPI_UNSIGNED            TMPI_UNSIGNED
91 #define MPI_UNSIGNED_LONG_LONG  TMPI_UNSIGNED_LONG_LONG
92 #define MPI_FLOAT               TMPI_FLOAT
93 #define MPI_DOUBLE              TMPI_DOUBLE
94 #define MPI_LONG_DOUBLE         TMPI_LONG_DOUBLE
95 #define MPI_WCHAR               TMPI_WCHAR
96 #define MPI_BYTE                TMPI_BYTE
97 #define MPI_INT64_T             TMPI_INT64_T
98
99
100 #define MPI_SUCCESS                 TMPI_SUCCESS
101 #define MPI_ERR_MALLOC              TMPI_ERR_MALLOC
102 #define MPI_ERR_INIT                TMPI_ERR_INIT
103 #define MPI_ERR_FINALIZE            TMPI_ERR_FINALIZE
104 #define MPI_ERR_GROUP               TMPI_ERR_GROUP
105 #define MPI_ERR_COMM                TMPI_ERR_COMM
106 #define MPI_ERR_STATUS              TMPI_ERR_STATUS
107 #define MPI_ERR_GROUP_RANK          TMPI_ERR_GROUP_RANK
108 #define MPI_ERR_DIMS                TMPI_ERR_DIMS
109 #define MPI_ERR_COORDS              TMPI_ERR_COORDS
110 #define MPI_ERR_CART_CREATE_NPROCS  TMPI_ERR_CART_CREATE_NPROCS
111 #define MPI_ERR_XFER_COUNTERPART    TMPI_ERR_XFER_COUNTERPART
112 #define MPI_ERR_XFER_BUFSIZE        TMPI_ERR_XFER_BUFSIZE
113 #define MPI_ERR_XFER_BUF_OVERLAP    TMPI_ERR_XFER_BUF_OVERLAP
114 #define MPI_ERR_SEND_DEST           TMPI_ERR_SEND_DEST
115 #define MPI_ERR_RECV_SRC            TMPI_ERR_RECV_SRC
116 #define MPI_ERR_BUF                 TMPI_ERR_BUF
117 #define MPI_ERR_MULTI_MISMATCH      TMPI_ERR_MULTI_MISMATCH
118 #define MPI_ERR_OP_FN               TMPI_ERR_OP_FN
119 #define MPI_ERR_ENVELOPES           TMPI_ERR_ENVELOPES
120 #define MPI_ERR_REQUESTS            TMPI_ERR_REQUESTS
121 #define MPI_ERR_IN_STATUS           TMPI_ERR_IN_STATUS
122 #define MPI_FAILURE                 TMPI_FAILURE
123 #define MPI_ERR_UNKNOWN             TMPI_ERR_UNKNOWN
124 #define N_MPI_ERR                   N_TMPI_ERR
125
126 #define MPI_MAX_ERROR_STRING        TMPI_MAX_ERROR_STRING
127 #define MPI_UNDEFINED               TMPI_UNDEFINED
128
129
130 #define MPI_Errhandler_fn           tMPI_Errhandler_fn
131 #define MPI_Errhandler              tMPI_Errhandler
132 #define MPI_ERRORS_ARE_FATAL        TMPI_ERRORS_ARE_FATAL
133 #define MPI_ERRORS_RETURN           TMPI_ERRORS_RETURN
134
135
136
137 /* miscelaneous defines */
138 #define MPI_ANY_SOURCE          TMPI_ANY_SOURCE
139 #define MPI_ANY_TAG             TMPI_ANY_TAG
140
141 /* comm_compare defines */
142 #define MPI_IDENT               TMPI_IDENT
143 #define MPI_CONGRUENT           TMPI_CONGRUENT
144 #define MPI_SIMILAR             TMPI_SIMILAR
145 #define MPI_UNEQUAL             TMPI_UNEQUAL
146
147
148 /* topology test defines */
149 #define MPI_CART                TMPI_CART
150 #define MPI_GRAPH               TMPI_GRAPH
151
152
153 #define MPI_COMM_WORLD          TMPI_COMM_WORLD
154 #define MPI_COMM_NULL           TMPI_COMM_NULL
155
156
157 #define MPI_GROUP_NULL          TMPI_GROUP_NULL
158 #define MPI_GROUP_EMPTY         TMPI_GROUP_EMPTY
159
160 #define MPI_MAX_PROCESSOR_NAME  TMPI_MAX_PROCESSOR_NAME
161
162
163 /* MPI status */
164 #define MPI_STATUS_IGNORE       TMPI_STATUS_IGNORE
165 #define MPI_STATUSES_IGNORE     TMPI_STATUSES_IGNORE
166
167 #define MPI_SOURCE              TMPI_SOURCE
168 #define MPI_TAG                 TMPI_TAG
169 #define MPI_ERROR               TMPI_ERROR
170
171 #define mpi_status_             tmpi_status_
172
173 #define MPI_REQUEST_NULL        TMPI_REQUEST_NULL
174
175 #define MPI_IN_PLACE            TMPI_IN_PLACE
176
177
178
179 #define MPI_MAX          TMPI_MAX
180 #define MPI_MIN          TMPI_MIN
181 #define MPI_SUM          TMPI_SUM
182 #define MPI_PROD         TMPI_PROD
183 #define MPI_LAND         TMPI_LAND
184 #define MPI_BAND         TMPI_BAND
185 #define MPI_LOR          TMPI_LOR
186 #define MPI_BOR          TMPI_BOR
187 #define MPI_LXOR         TMPI_LXOR
188 #define MPI_BXOR         TMPI_BXOR
189
190 /* the functions: */
191 #define MPI_Init                    tMPI_Init
192 #define MPI_Finalize                tMPI_Finalize
193 #define MPI_Abort                   tMPI_Abort
194 #define MPI_Initialized             tMPI_Initialized
195 #define MPI_Finalized               tMPI_Finalized
196
197 #define MPI_Create_errhandler       tMPI_Create_errhandler
198 #define MPI_Errhandler_free         tMPI_Errhandler_free
199 #define MPI_Comm_set_errhandler     tMPI_Comm_set_errhandler
200 #define MPI_Comm_get_errhandler     tMPI_Comm_get_errhandler
201 #define MPI_Error_string            tMPI_Error_string
202
203 #define MPI_Get_processor_name      tMPI_Get_processor_name
204 #define MPI_Wtime                   tMPI_Wtime
205
206 #define MPI_Group_size              tMPI_Group_size
207 #define MPI_Group_rank              tMPI_Group_rank
208 #define MPI_Group_incl              tMPI_Group_incl
209 #define MPI_Comm_group              tMPI_Comm_group
210 #define MPI_Group_free              tMPI_Group_free
211
212 #define MPI_Comm_size               tMPI_Comm_size
213 #define MPI_Comm_rank               tMPI_Comm_rank
214 #define MPI_Comm_compare            tMPI_Comm_compare
215 #define MPI_Comm_free               tMPI_Comm_free
216 #define MPI_Comm_create             tMPI_Comm_create
217 #define MPI_Comm_split              tMPI_Comm_split
218 #define MPI_Comm_dup                tMPI_Comm_dup
219
220 #define MPI_Topo_test               tMPI_Topo_test
221 #define MPI_Cartdim_get             tMPI_Cartdim_get
222 #define MPI_Cart_get                tMPI_Cart_get
223 #define MPI_Cart_rank               tMPI_Cart_rank
224 #define MPI_Cart_coords             tMPI_Cart_coords
225 #define MPI_Cart_map                tMPI_Cart_map
226 #define MPI_Cart_create             tMPI_Cart_create
227 #define MPI_Cart_sub                tMPI_Cart_sub
228
229 #define MPI_Type_contiguous         tMPI_Type_contiguous
230 #define MPI_Type_commit             tMPI_Type_commit
231
232 #define MPI_Send                    tMPI_Send
233 #define MPI_Recv                    tMPI_Recv
234 #define MPI_Sendrecv                tMPI_Sendrecv
235 #define MPI_Get_count               tMPI_Get_count
236
237 #define MPI_Isend                   tMPI_Isend
238 #define MPI_Irecv                   tMPI_Irecv
239 #define MPI_Test                    tMPI_Test
240 #define MPI_Wait                    tMPI_Wait
241 #define MPI_Waitall                 tMPI_Waitall
242
243 #define MPI_Barrier                 tMPI_Barrier
244
245 #define MPI_Bcast                   tMPI_Bcast
246
247 #define MPI_Gather                  tMPI_Gather
248 #define MPI_Gatherv                 tMPI_Gatherv
249 #define MPI_Scatter                 tMPI_Scatter
250 #define MPI_Scatterv                tMPI_Scatterv
251 #define MPI_Alltoall                tMPI_Alltoall
252 #define MPI_Alltoallv               tMPI_Alltoallv
253
254
255 #define MPI_Reduce                  tMPI_Reduce
256 #define MPI_Allreduce               tMPI_Allreduce
257 #define MPI_Scan                    tMPI_Scan
258
259 #ifdef __cplusplus
260 } /* closing extern "C" */
261 #endif
262
263 #endif
264
265 #endif /* TMPI_MPI_BINDINGS_H_ */