Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / legacyheaders / 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 /** \file
42   \brief MPI bindings for thread_mpi/tmpi.h
43
44   This file contains only macros and redefinitions to expose the standard 
45   MPI API with thread_mpi calls. 
46   
47   This is different from the API exposed through thread_mpi/tmpi.h, which 
48   uses names like \a tMPI_Send() instead of \a MPI_Send()
49
50   \sa thread_mpi/tmpi.h for documentation of the available data types and 
51       functions
52   \sa http://www.mpi-forum.org/docs/docs.html for MPI documentation.
53 */
54
55 #ifndef DOXYGEN
56 #ifdef __cplusplus
57 extern "C" 
58 {  
59 #endif
60
61
62
63
64 /* The MPI_Comm structure contains the group of processes to communicate
65    with (defines the scope for global operations such as broadcast) */
66 typedef struct tmpi_comm_ *MPI_Comm;
67 /* The group part of the MPI-Comm structure */
68 typedef struct tmpi_group_ *MPI_Group;
69 /* Request structure for holding data about non-blocking transfers */
70 typedef struct tmpi_req_ *MPI_Request;
71 /* status of receives */
72 typedef struct tmpi_status_ MPI_Status;
73 /* data types */
74 typedef struct tmpi_datatype_ *MPI_Datatype;
75 /* reduce operations */
76 typedef tMPI_Op MPI_Op;
77
78
79
80 #define MPI_CHAR                TMPI_CHAR
81 #define MPI_SHORT               TMPI_SHORT
82 #define MPI_INT                 TMPI_INT
83 #define MPI_LONG                TMPI_LONG
84 #define MPI_LONG_LONG           TMPI_LONG_LONG
85 #define MPI_LONG_LONG_INT       TMPI_LONG_LONG_INT
86 #define MPI_SIGNED_CHAR         TMPI_SIGNED_CHAR
87 #define MPI_UNSIGNED_CHAR       TMPI_UNSIGNED_CHAR
88 #define MPI_UNSIGNED_SHORT      TMPI_UNSIGNED_SHORT
89 #define MPI_UNSIGNED            TMPI_UNSIGNED
90 #define MPI_UNSIGNED_LONG_LONG  TMPI_UNSIGNED_LONG_LONG
91 #define MPI_FLOAT               TMPI_FLOAT
92 #define MPI_DOUBLE              TMPI_DOUBLE
93 #define MPI_LONG_DOUBLE         TMPI_LONG_DOUBLE
94 #define MPI_WCHAR               TMPI_WCHAR
95 #define MPI_BYTE                TMPI_BYTE
96
97
98
99 #define MPI_SUCCESS                 TMPI_SUCCESS
100 #define MPI_ERR_MALLOC              TMPI_ERR_MALLOC
101 #define MPI_ERR_INIT                TMPI_ERR_INIT
102 #define MPI_ERR_FINALIZE            TMPI_ERR_FINALIZE
103 #define MPI_ERR_GROUP               TMPI_ERR_GROUP
104 #define MPI_ERR_COMM                TMPI_ERR_COMM
105 #define MPI_ERR_STATUS              TMPI_ERR_STATUS
106 #define MPI_ERR_GROUP_RANK          TMPI_ERR_GROUP_RANK
107 #define MPI_ERR_DIMS                TMPI_ERR_DIMS
108 #define MPI_ERR_COORDS              TMPI_ERR_COORDS
109 #define MPI_ERR_CART_CREATE_NPROCS  TMPI_ERR_CART_CREATE_NPROCS
110 #define MPI_ERR_XFER_COUNTERPART    TMPI_ERR_XFER_COUNTERPART
111 #define MPI_ERR_XFER_BUFSIZE        TMPI_ERR_XFER_BUFSIZE
112 #define MPI_ERR_XFER_BUF_OVERLAP    TMPI_ERR_XFER_BUF_OVERLAP
113 #define MPI_ERR_SEND_DEST           TMPI_ERR_SEND_DEST
114 #define MPI_ERR_RECV_SRC            TMPI_ERR_RECV_SRC
115 #define MPI_ERR_BUF                 TMPI_ERR_BUF
116 #define MPI_ERR_MULTI_MISMATCH      TMPI_ERR_MULTI_MISMATCH
117 #define MPI_ERR_OP_FN               TMPI_ERR_OP_FN
118 #define MPI_ERR_ENVELOPES           TMPI_ERR_ENVELOPES
119 #define MPI_ERR_REQUESTS            TMPI_ERR_REQUESTS
120 #define MPI_ERR_IN_STATUS           TMPI_ERR_IN_STATUS
121 #define MPI_FAILURE                 TMPI_FAILURE
122 #define MPI_ERR_UNKNOWN             TMPI_ERR_UNKNOWN
123 #define N_MPI_ERR                   N_TMPI_ERR
124
125 #define MPI_MAX_ERROR_STRING        TMPI_MAX_ERROR_STRING  
126 #define MPI_UNDEFINED               TMPI_UNDEFINED 
127
128
129 #define MPI_Errhandler_fn           tMPI_Errhandler_fn
130 #define MPI_Errhandler              tMPI_Errhandler
131 #define MPI_ERRORS_ARE_FATAL        TMPI_ERRORS_ARE_FATAL
132 #define MPI_ERRORS_RETURN           TMPI_ERRORS_RETURN
133
134
135
136 /* miscelaneous defines */
137 #define MPI_ANY_SOURCE          TMPI_ANY_SOURCE
138 #define MPI_ANY_TAG             TMPI_ANY_TAG
139
140 /* comm_compare defines */
141 #define MPI_IDENT               TMPI_IDENT
142 #define MPI_CONGRUENT           TMPI_CONGRUENT
143 #define MPI_SIMILAR             TMPI_SIMILAR
144 #define MPI_UNEQUAL             TMPI_UNEQUAL
145
146
147 /* topology test defines */
148 #define MPI_CART                TMPI_CART
149 #define MPI_GRAPH               TMPI_GRAPH
150
151
152 #define MPI_COMM_WORLD          TMPI_COMM_WORLD
153 #define MPI_COMM_NULL           TMPI_COMM_NULL 
154
155
156 #define MPI_GROUP_NULL          TMPI_GROUP_NULL
157 #define MPI_GROUP_EMPTY         TMPI_GROUP_EMPTY
158
159 #define MPI_MAX_PROCESSOR_NAME  TMPI_MAX_PROCESSOR_NAME
160
161
162 /* MPI status */
163 #define MPI_STATUS_IGNORE       TMPI_STATUS_IGNORE
164 #define MPI_STATUSES_IGNORE     TMPI_STATUSES_IGNORE
165
166 #define MPI_SOURCE              TMPI_SOURCE
167 #define MPI_TAG                 TMPI_TAG
168 #define MPI_ERROR               TMPI_ERROR
169
170 #define mpi_status_             tmpi_status_
171
172 #define MPI_REQUEST_NULL        TMPI_REQUEST_NULL 
173
174 #define MPI_IN_PLACE            TMPI_IN_PLACE
175
176
177
178 #define MPI_MAX          TMPI_MAX 
179 #define MPI_MIN          TMPI_MIN 
180 #define MPI_SUM          TMPI_SUM 
181 #define MPI_PROD         TMPI_PROD
182 #define MPI_LAND         TMPI_LAND
183 #define MPI_BAND         TMPI_BAND
184 #define MPI_LOR          TMPI_LOR 
185 #define MPI_BOR          TMPI_BOR 
186 #define MPI_LXOR         TMPI_LXOR 
187 #define MPI_BXOR         TMPI_BXOR
188
189 /* the functions: */
190 #define MPI_Init                    tMPI_Init
191 #define MPI_Finalize                tMPI_Finalize
192 #define MPI_Abort                   tMPI_Abort
193 #define MPI_Initialized             tMPI_Initialized
194 #define MPI_Finalized               tMPI_Finalized
195
196 #define MPI_Create_errhandler       tMPI_Create_errhandler
197 #define MPI_Errhandler_free         tMPI_Errhandler_free
198 #define MPI_Comm_set_errhandler     tMPI_Comm_set_errhandler
199 #define MPI_Comm_get_errhandler     tMPI_Comm_get_errhandler
200 #define MPI_Error_string            tMPI_Error_string
201
202 #define MPI_Get_processor_name      tMPI_Get_processor_name
203 #define MPI_Wtime                   tMPI_Wtime
204
205 #define MPI_Group_size              tMPI_Group_size
206 #define MPI_Group_rank              tMPI_Group_rank
207 #define MPI_Group_incl              tMPI_Group_incl
208 #define MPI_Comm_group              tMPI_Comm_group
209 #define MPI_Group_free              tMPI_Group_free
210
211 #define MPI_Comm_size               tMPI_Comm_size
212 #define MPI_Comm_rank               tMPI_Comm_rank
213 #define MPI_Comm_compare            tMPI_Comm_compare
214 #define MPI_Comm_free               tMPI_Comm_free
215 #define MPI_Comm_create             tMPI_Comm_create
216 #define MPI_Comm_split              tMPI_Comm_split
217 #define MPI_Comm_dup                tMPI_Comm_dup
218
219 #define MPI_Topo_test               tMPI_Topo_test
220 #define MPI_Cartdim_get             tMPI_Cartdim_get
221 #define MPI_Cart_get                tMPI_Cart_get
222 #define MPI_Cart_rank               tMPI_Cart_rank
223 #define MPI_Cart_coords             tMPI_Cart_coords
224 #define MPI_Cart_map                tMPI_Cart_map
225 #define MPI_Cart_create             tMPI_Cart_create
226 #define MPI_Cart_sub                tMPI_Cart_sub
227
228 #define MPI_Type_contiguous         tMPI_Type_contiguous
229 #define MPI_Type_commit             tMPI_Type_commit
230
231 #define MPI_Send                    tMPI_Send
232 #define MPI_Recv                    tMPI_Recv
233 #define MPI_Sendrecv                tMPI_Sendrecv
234 #define MPI_Get_count               tMPI_Get_count
235
236 #define MPI_Isend                   tMPI_Isend
237 #define MPI_Irecv                   tMPI_Irecv
238 #define MPI_Test                    tMPI_Test
239 #define MPI_Wait                    tMPI_Wait
240 #define MPI_Waitall                 tMPI_Waitall
241
242 #define MPI_Barrier                 tMPI_Barrier
243
244 #define MPI_Bcast                   tMPI_Bcast
245
246 #define MPI_Gather                  tMPI_Gather
247 #define MPI_Gatherv                 tMPI_Gatherv
248 #define MPI_Scatter                 tMPI_Scatter
249 #define MPI_Scatterv                tMPI_Scatterv
250 #define MPI_Alltoall                tMPI_Alltoall
251 #define MPI_Alltoallv               tMPI_Alltoallv
252
253
254 #define MPI_Reduce                  tMPI_Reduce
255 #define MPI_Allreduce               tMPI_Allreduce
256 #define MPI_Scan                    tMPI_Scan
257
258 #ifdef __cplusplus
259 } /* closing extern "C" */
260 #endif
261
262 #endif
263
264 #endif /* TMPI_MPI_BINDINGS_H_ */
265