File: mpicxx.h

package info (click to toggle)
openmpi 4.1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 127,592 kB
  • sloc: ansic: 690,998; makefile: 43,047; f90: 19,220; sh: 7,182; java: 6,360; perl: 3,590; cpp: 2,227; python: 1,350; lex: 989; fortran: 61; tcl: 12
file content (286 lines) | stat: -rw-r--r-- 9,752 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
// -*- c++ -*-
//
// Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
//                         University Research and Technology
//                         Corporation.  All rights reserved.
// Copyright (c) 2004-2005 The University of Tennessee and The University
//                         of Tennessee Research Foundation.  All rights
//                         reserved.
// Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
//                         University of Stuttgart.  All rights reserved.
// Copyright (c) 2004-2005 The Regents of the University of California.
//                         All rights reserved.
// Copyright (c) 2006-2008 Cisco Systems, Inc.  All rights reserved.
// Copyright (c) 2008      Sun Microsystems, Inc.  All rights reserved.
// Copyright (c) 2011      FUJITSU LIMITED.  All rights reserved.
// Copyright (c) 2016      Los Alamos National Security, LLC. All rights
//                         reserved.
// Copyright (c) 2017      Research Organization for Information Science
//                         and Technology (RIST). All rights reserved.
// $COPYRIGHT$
//
// Additional copyrights may follow
//
// $HEADER$
//

#ifndef MPIPP_H
#define MPIPP_H

//
// Let's ensure that we're really in C++, and some errant programmer
// hasn't included <mpicxx.h> just "for completeness"
//

// We do not include the opal_config.h and may not replace extern "C" {
#if defined(c_plusplus) || defined(__cplusplus)

// do not include ompi_config.h.  it will smash free() as a symbol
#include "mpi.h"

// we include all this here so that we escape the silly namespacing issues
#include <map>
#include <utility>

#include <stdarg.h>

#if !defined(OMPI_IGNORE_CXX_SEEK) && OMPI_WANT_MPI_CXX_SEEK
// We need to include the header files that define SEEK_* or use them
// in ways that require them to be #defines so that if the user
// includes them later, the double inclusion logic in the headers will
// prevent trouble from occuring.

// include so that we can smash SEEK_* properly
#include <stdio.h>
// include because on Linux, there is one place that assumes SEEK_* is
// a #define (it's used in an enum).
#include <iostream>

static const int ompi_stdio_seek_set = SEEK_SET;
static const int ompi_stdio_seek_cur = SEEK_CUR;
static const int ompi_stdio_seek_end = SEEK_END;

// smash SEEK_* #defines
#ifdef SEEK_SET
#undef SEEK_SET
#undef SEEK_CUR
#undef SEEK_END
#endif

// make globally scoped constants to replace smashed #defines
static const int SEEK_SET = ompi_stdio_seek_set;
static const int SEEK_CUR = ompi_stdio_seek_cur;
static const int SEEK_END = ompi_stdio_seek_end;
#endif

#ifdef OPAL_HAVE_SYS_SYNCH_H
// Solaris threads.h pulls in sys/synch.h which in certain versions
// defines LOCK_SHARED.

// include so that we can smash LOCK_SHARED
#include <sys/synch.h>

// a user app may be included on a system with an older version
// sys/synch.h
#ifdef LOCK_SHARED
static const int ompi_synch_lock_shared = LOCK_SHARED;

// smash LOCK_SHARED #defines
#undef LOCK_SHARED

// make globally scoped constants to replace smashed #defines
static const int LOCK_SHARED = ompi_synch_lock_shared;
#endif
#endif

// forward declare so that we can still do inlining
struct opal_mutex_t;

// See lengthy explanation in intercepts.cc about this function.
extern "C" void
ompi_mpi_cxx_op_intercept(void *invec, void *outvec, int *len,
                          MPI_Datatype *datatype, MPI_User_function *fn);

//used for attr intercept functions
enum CommType { eIntracomm, eIntercomm, eCartcomm, eGraphcomm};

extern "C" int
ompi_mpi_cxx_comm_copy_attr_intercept(MPI_Comm oldcomm, int keyval,
                                      void *extra_state, void *attribute_val_in,
                                      void *attribute_val_out, int *flag,
                                      MPI_Comm newcomm);
extern "C" int
ompi_mpi_cxx_comm_delete_attr_intercept(MPI_Comm comm, int keyval,
                                        void *attribute_val, void *extra_state);

extern "C" int
ompi_mpi_cxx_type_copy_attr_intercept(MPI_Datatype oldtype, int keyval,
                                      void *extra_state, void *attribute_val_in,
                                      void *attribute_val_out, int *flag);
extern "C" int
ompi_mpi_cxx_type_delete_attr_intercept(MPI_Datatype type, int keyval,
                                        void *attribute_val, void *extra_state);

extern "C" int
ompi_mpi_cxx_win_copy_attr_intercept(MPI_Win oldwin, int keyval,
                                      void *extra_state, void *attribute_val_in,
                                      void *attribute_val_out, int *flag);
extern "C" int
ompi_mpi_cxx_win_delete_attr_intercept(MPI_Win win, int keyval,
                                        void *attribute_val, void *extra_state);



//
// MPI generalized request intercepts
//

extern "C" int
ompi_mpi_cxx_grequest_query_fn_intercept(void *state, MPI_Status *status);
extern "C" int
ompi_mpi_cxx_grequest_free_fn_intercept(void *state);
extern "C" int
ompi_mpi_cxx_grequest_cancel_fn_intercept(void *state, int canceled);

/**
 * Windows bool type is not any kind of integer. Special care should
 * be taken in order to cast it correctly.
 */
#if defined(WIN32) || defined(_WIN32) || defined(WIN64)
#define OPAL_INT_TO_BOOL(VALUE)  ((VALUE) != 0 ? true : false)
#else
#define OPAL_INT_TO_BOOL(VALUE)  ((bool)(VALUE))
#endif  /* defined(WIN32) || defined(_WIN32) || defined(WIN64) */

#if 0 /* OMPI_ENABLE_MPI_PROFILING */
#include "ompi/mpi/cxx/pmpicxx.h"
#endif

namespace MPI {

#if ! OMPI_HAVE_CXX_EXCEPTION_SUPPORT
	extern int mpi_errno;
#endif

  class Comm_Null;
  class Comm;
  class Intracomm;
  class Intercomm;
  class Graphcomm;
  class Cartcomm;
  class Datatype;
  class Errhandler;
  class Group;
  class Op;
  class Request;
  class Grequest;
  class Status;
  class Info;
  class Win;
  class File;

  typedef MPI_Aint Aint;
  typedef MPI_Fint Fint;
  typedef MPI_Offset Offset;

#ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
#include "ompi/mpi/cxx/constants.h"
#include "ompi/mpi/cxx/functions.h"
#include "ompi/mpi/cxx/datatype.h"
#else
#include "openmpi/ompi/mpi/cxx/constants.h"
#include "openmpi/ompi/mpi/cxx/functions.h"
#include "openmpi/ompi/mpi/cxx/datatype.h"
#endif

  typedef void User_function(const void* invec, void* inoutvec, int len,
			     const Datatype& datatype);

    /* Prevent needing a -I${prefix}/include/openmpi, as it seems to
       really annoy peope that don't use the wrapper compilers and is
       no longer worth the fight of getting right... */
#ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
#include "ompi/mpi/cxx/exception.h"
#include "ompi/mpi/cxx/op.h"
#include "ompi/mpi/cxx/status.h"
#include "ompi/mpi/cxx/request.h"   //includes class Prequest
#include "ompi/mpi/cxx/group.h"
#include "ompi/mpi/cxx/comm.h"
#include "ompi/mpi/cxx/win.h"
#include "ompi/mpi/cxx/file.h"
#include "ompi/mpi/cxx/errhandler.h"
#include "ompi/mpi/cxx/intracomm.h"
#include "ompi/mpi/cxx/topology.h"  //includes Cartcomm and Graphcomm
#include "ompi/mpi/cxx/intercomm.h"
#include "ompi/mpi/cxx/info.h"
#else
#include "openmpi/ompi/mpi/cxx/exception.h"
#include "openmpi/ompi/mpi/cxx/op.h"
#include "openmpi/ompi/mpi/cxx/status.h"
#include "openmpi/ompi/mpi/cxx/request.h"   //includes class Prequest
#include "openmpi/ompi/mpi/cxx/group.h"
#include "openmpi/ompi/mpi/cxx/comm.h"
#include "openmpi/ompi/mpi/cxx/win.h"
#include "openmpi/ompi/mpi/cxx/file.h"
#include "openmpi/ompi/mpi/cxx/errhandler.h"
#include "openmpi/ompi/mpi/cxx/intracomm.h"
#include "openmpi/ompi/mpi/cxx/topology.h"  //includes Cartcomm and Graphcomm
#include "openmpi/ompi/mpi/cxx/intercomm.h"
#include "openmpi/ompi/mpi/cxx/info.h"
#endif

    // Version string
    extern const char ompi_libcxx_version_string[];
}

#if 0 /* OMPI_ENABLE_MPI_PROFILING */
#include "ompi/mpi/cxx/pop_inln.h"
#include "ompi/mpi/cxx/pgroup_inln.h"
#include "ompi/mpi/cxx/pstatus_inln.h"
#include "ompi/mpi/cxx/prequest_inln.h"
#endif

//
// These are the "real" functions, whether prototyping is enabled
// or not. These functions are assigned to either the MPI::XXX class
// or the PMPI::XXX class based on the value of the macro MPI
// which is set in mpi2cxx_config.h.
// If prototyping is enabled, there is a top layer that calls these
// PMPI functions, and this top layer is in the XXX.cc files.
//

/* see note above... */
#ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
#include "ompi/mpi/cxx/datatype_inln.h"
#include "ompi/mpi/cxx/functions_inln.h"
#include "ompi/mpi/cxx/request_inln.h"
#include "ompi/mpi/cxx/comm_inln.h"
#include "ompi/mpi/cxx/intracomm_inln.h"
#include "ompi/mpi/cxx/topology_inln.h"
#include "ompi/mpi/cxx/intercomm_inln.h"
#include "ompi/mpi/cxx/group_inln.h"
#include "ompi/mpi/cxx/op_inln.h"
#include "ompi/mpi/cxx/errhandler_inln.h"
#include "ompi/mpi/cxx/status_inln.h"
#include "ompi/mpi/cxx/info_inln.h"
#include "ompi/mpi/cxx/win_inln.h"
#include "ompi/mpi/cxx/file_inln.h"
#else
#include "openmpi/ompi/mpi/cxx/datatype_inln.h"
#include "openmpi/ompi/mpi/cxx/functions_inln.h"
#include "openmpi/ompi/mpi/cxx/request_inln.h"
#include "openmpi/ompi/mpi/cxx/comm_inln.h"
#include "openmpi/ompi/mpi/cxx/intracomm_inln.h"
#include "openmpi/ompi/mpi/cxx/topology_inln.h"
#include "openmpi/ompi/mpi/cxx/intercomm_inln.h"
#include "openmpi/ompi/mpi/cxx/group_inln.h"
#include "openmpi/ompi/mpi/cxx/op_inln.h"
#include "openmpi/ompi/mpi/cxx/errhandler_inln.h"
#include "openmpi/ompi/mpi/cxx/status_inln.h"
#include "openmpi/ompi/mpi/cxx/info_inln.h"
#include "openmpi/ompi/mpi/cxx/win_inln.h"
#include "openmpi/ompi/mpi/cxx/file_inln.h"
#endif

#endif // #if defined(c_plusplus) || defined(__cplusplus)
#endif // #ifndef MPIPP_H_