1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #ifndef MPIPP_H
28 #define MPIPP_H
29
30
31
32
33
34
35
36 #if defined(c_plusplus) || defined(__cplusplus)
37
38
39 #include "mpi.h"
40
41
42 #include <map>
43 #include <utility>
44
45 #include <stdarg.h>
46
47 #if !defined(OMPI_IGNORE_CXX_SEEK) && OMPI_WANT_MPI_CXX_SEEK
48
49
50
51
52
53
54 #include <stdio.h>
55
56
57 #include <iostream>
58
59 static const int ompi_stdio_seek_set = SEEK_SET;
60 static const int ompi_stdio_seek_cur = SEEK_CUR;
61 static const int ompi_stdio_seek_end = SEEK_END;
62
63
64 #ifdef SEEK_SET
65 #undef SEEK_SET
66 #undef SEEK_CUR
67 #undef SEEK_END
68 #endif
69
70
71 static const int SEEK_SET = ompi_stdio_seek_set;
72 static const int SEEK_CUR = ompi_stdio_seek_cur;
73 static const int SEEK_END = ompi_stdio_seek_end;
74 #endif
75
76 #ifdef OPAL_HAVE_SYS_SYNCH_H
77
78
79
80
81 #include <sys/synch.h>
82
83
84
85 #ifdef LOCK_SHARED
86 static const int ompi_synch_lock_shared = LOCK_SHARED;
87
88
89 #undef LOCK_SHARED
90
91
92 static const int LOCK_SHARED = ompi_synch_lock_shared;
93 #endif
94 #endif
95
96
97 struct opal_mutex_t;
98
99
100 extern "C" void
101 ompi_mpi_cxx_op_intercept(void *invec, void *outvec, int *len,
102 MPI_Datatype *datatype, MPI_User_function *fn);
103
104
105 enum CommType { eIntracomm, eIntercomm, eCartcomm, eGraphcomm};
106
107 extern "C" int
108 ompi_mpi_cxx_comm_copy_attr_intercept(MPI_Comm oldcomm, int keyval,
109 void *extra_state, void *attribute_val_in,
110 void *attribute_val_out, int *flag,
111 MPI_Comm newcomm);
112 extern "C" int
113 ompi_mpi_cxx_comm_delete_attr_intercept(MPI_Comm comm, int keyval,
114 void *attribute_val, void *extra_state);
115
116 extern "C" int
117 ompi_mpi_cxx_type_copy_attr_intercept(MPI_Datatype oldtype, int keyval,
118 void *extra_state, void *attribute_val_in,
119 void *attribute_val_out, int *flag);
120 extern "C" int
121 ompi_mpi_cxx_type_delete_attr_intercept(MPI_Datatype type, int keyval,
122 void *attribute_val, void *extra_state);
123
124 extern "C" int
125 ompi_mpi_cxx_win_copy_attr_intercept(MPI_Win oldwin, int keyval,
126 void *extra_state, void *attribute_val_in,
127 void *attribute_val_out, int *flag);
128 extern "C" int
129 ompi_mpi_cxx_win_delete_attr_intercept(MPI_Win win, int keyval,
130 void *attribute_val, void *extra_state);
131
132
133
134
135
136
137
138 extern "C" int
139 ompi_mpi_cxx_grequest_query_fn_intercept(void *state, MPI_Status *status);
140 extern "C" int
141 ompi_mpi_cxx_grequest_free_fn_intercept(void *state);
142 extern "C" int
143 ompi_mpi_cxx_grequest_cancel_fn_intercept(void *state, int canceled);
144
145
146
147
148
149 #if defined(WIN32) || defined(_WIN32) || defined(WIN64)
150 #define OPAL_INT_TO_BOOL(VALUE) ((VALUE) != 0 ? true : false)
151 #else
152 #define OPAL_INT_TO_BOOL(VALUE) ((bool)(VALUE))
153 #endif
154
155 #if 0
156 #include "ompi/mpi/cxx/pmpicxx.h"
157 #endif
158
159 namespace MPI {
160
161 #if ! OMPI_HAVE_CXX_EXCEPTION_SUPPORT
162 extern int mpi_errno;
163 #endif
164
165 class Comm_Null;
166 class Comm;
167 class Intracomm;
168 class Intercomm;
169 class Graphcomm;
170 class Cartcomm;
171 class Datatype;
172 class Errhandler;
173 class Group;
174 class Op;
175 class Request;
176 class Grequest;
177 class Status;
178 class Info;
179 class Win;
180 class File;
181
182 typedef MPI_Aint Aint;
183 typedef MPI_Fint Fint;
184 typedef MPI_Offset Offset;
185
186 #ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
187 #include "ompi/mpi/cxx/constants.h"
188 #include "ompi/mpi/cxx/functions.h"
189 #include "ompi/mpi/cxx/datatype.h"
190 #else
191 #include "openmpi/ompi/mpi/cxx/constants.h"
192 #include "openmpi/ompi/mpi/cxx/functions.h"
193 #include "openmpi/ompi/mpi/cxx/datatype.h"
194 #endif
195
196 typedef void User_function(const void* invec, void* inoutvec, int len,
197 const Datatype& datatype);
198
199
200
201
202 #ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
203 #include "ompi/mpi/cxx/exception.h"
204 #include "ompi/mpi/cxx/op.h"
205 #include "ompi/mpi/cxx/status.h"
206 #include "ompi/mpi/cxx/request.h"
207 #include "ompi/mpi/cxx/group.h"
208 #include "ompi/mpi/cxx/comm.h"
209 #include "ompi/mpi/cxx/win.h"
210 #include "ompi/mpi/cxx/file.h"
211 #include "ompi/mpi/cxx/errhandler.h"
212 #include "ompi/mpi/cxx/intracomm.h"
213 #include "ompi/mpi/cxx/topology.h"
214 #include "ompi/mpi/cxx/intercomm.h"
215 #include "ompi/mpi/cxx/info.h"
216 #else
217 #include "openmpi/ompi/mpi/cxx/exception.h"
218 #include "openmpi/ompi/mpi/cxx/op.h"
219 #include "openmpi/ompi/mpi/cxx/status.h"
220 #include "openmpi/ompi/mpi/cxx/request.h"
221 #include "openmpi/ompi/mpi/cxx/group.h"
222 #include "openmpi/ompi/mpi/cxx/comm.h"
223 #include "openmpi/ompi/mpi/cxx/win.h"
224 #include "openmpi/ompi/mpi/cxx/file.h"
225 #include "openmpi/ompi/mpi/cxx/errhandler.h"
226 #include "openmpi/ompi/mpi/cxx/intracomm.h"
227 #include "openmpi/ompi/mpi/cxx/topology.h"
228 #include "openmpi/ompi/mpi/cxx/intercomm.h"
229 #include "openmpi/ompi/mpi/cxx/info.h"
230 #endif
231
232
233 extern const char ompi_libcxx_version_string[];
234 }
235
236 #if 0
237 #include "ompi/mpi/cxx/pop_inln.h"
238 #include "ompi/mpi/cxx/pgroup_inln.h"
239 #include "ompi/mpi/cxx/pstatus_inln.h"
240 #include "ompi/mpi/cxx/prequest_inln.h"
241 #endif
242
243
244
245
246
247
248
249
250
251
252
253 #ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
254 #include "ompi/mpi/cxx/datatype_inln.h"
255 #include "ompi/mpi/cxx/functions_inln.h"
256 #include "ompi/mpi/cxx/request_inln.h"
257 #include "ompi/mpi/cxx/comm_inln.h"
258 #include "ompi/mpi/cxx/intracomm_inln.h"
259 #include "ompi/mpi/cxx/topology_inln.h"
260 #include "ompi/mpi/cxx/intercomm_inln.h"
261 #include "ompi/mpi/cxx/group_inln.h"
262 #include "ompi/mpi/cxx/op_inln.h"
263 #include "ompi/mpi/cxx/errhandler_inln.h"
264 #include "ompi/mpi/cxx/status_inln.h"
265 #include "ompi/mpi/cxx/info_inln.h"
266 #include "ompi/mpi/cxx/win_inln.h"
267 #include "ompi/mpi/cxx/file_inln.h"
268 #else
269 #include "openmpi/ompi/mpi/cxx/datatype_inln.h"
270 #include "openmpi/ompi/mpi/cxx/functions_inln.h"
271 #include "openmpi/ompi/mpi/cxx/request_inln.h"
272 #include "openmpi/ompi/mpi/cxx/comm_inln.h"
273 #include "openmpi/ompi/mpi/cxx/intracomm_inln.h"
274 #include "openmpi/ompi/mpi/cxx/topology_inln.h"
275 #include "openmpi/ompi/mpi/cxx/intercomm_inln.h"
276 #include "openmpi/ompi/mpi/cxx/group_inln.h"
277 #include "openmpi/ompi/mpi/cxx/op_inln.h"
278 #include "openmpi/ompi/mpi/cxx/errhandler_inln.h"
279 #include "openmpi/ompi/mpi/cxx/status_inln.h"
280 #include "openmpi/ompi/mpi/cxx/info_inln.h"
281 #include "openmpi/ompi/mpi/cxx/win_inln.h"
282 #include "openmpi/ompi/mpi/cxx/file_inln.h"
283 #endif
284
285 #endif
286 #endif