openmpi  3.1.6
About: Open MPI is a high performance Message Passing Interface (MPI) library project combining technologies and resources from several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the best MPI library available. 3.x series.
  Fossies Dox: openmpi-3.1.6.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

opal_config_bottom.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2005 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2010 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
13  * Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
14  * Copyright (c) 2013 Mellanox Technologies, Inc.
15  * All rights reserved.
16  * Copyright (c) 2015-2017 Research Organization for Information Science
17  * and Technology (RIST). All rights reserved.
18  * Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
19  * $COPYRIGHT$
20  *
21  * Additional copyrights may follow
22  *
23  * $HEADER$
24  *
25  * This file is included at the bottom of opal_config.h, and is
26  * therefore a) after all the #define's that were output from
27  * configure, and b) included in most/all files in Open MPI.
28  *
29  * Since this file is *only* ever included by opal_config.h, and
30  * opal_config.h already has #ifndef/#endif protection, there is no
31  * need to #ifndef/#endif protection here.
32  */
33 
34 #ifndef OPAL_CONFIG_H
35 #error "opal_config_bottom.h should only be included from opal_config.h"
36 #endif
37 
38 /*
39  * If we build a static library, Visual C define the _LIB symbol. In the
40  * case of a shared library _USERDLL get defined.
41  *
42  * OMPI_BUILDING and _LIB define how opal_config.h
43  * handles configuring all of Open MPI's "compatibility" code. Both
44  * constants will always be defined by the end of opal_config.h.
45  *
46  * OMPI_BUILDING affects how much compatibility code is included by
47  * opal_config.h. It will always be 1 or 0. The user can set the
48  * value before including either mpi.h or opal_config.h and it will be
49  * respected. If opal_config.h is included before mpi.h, it will
50  * default to 1. If mpi.h is included before opal_config.h, it will
51  * default to 0.
52  */
53 #ifndef OMPI_BUILDING
54 #define OMPI_BUILDING 1
55 #endif
56 
57 /*
58  * Flex is trying to include the unistd.h file. As there is no configure
59  * option or this, the flex generated files will try to include the file
60  * even on platforms without unistd.h. Therefore, if we
61  * know this file is not available, we can prevent flex from including it.
62  */
63 #ifndef HAVE_UNISTD_H
64 #define YY_NO_UNISTD_H
65 #endif
66 
67 
74 /*
75  * BEGIN_C_DECLS should be used at the beginning of your declarations,
76  * so that C++ compilers don't mangle their names. Use END_C_DECLS at
77  * the end of C declarations.
78  */
79 #undef BEGIN_C_DECLS
80 #undef END_C_DECLS
81 #if defined(c_plusplus) || defined(__cplusplus)
82 # define BEGIN_C_DECLS extern "C" {
83 # define END_C_DECLS }
84 #else
85 #define BEGIN_C_DECLS /* empty */
86 #define END_C_DECLS /* empty */
87 #endif
88 
93 #if OPAL_HAVE_ATTRIBUTE_ALIGNED
94 # define __opal_attribute_aligned__(a) __attribute__((__aligned__(a)))
95 # define __opal_attribute_aligned_max__ __attribute__((__aligned__))
96 #else
97 # define __opal_attribute_aligned__(a)
98 # define __opal_attribute_aligned_max__
99 #endif
100 
101 #if OPAL_HAVE_ATTRIBUTE_ALWAYS_INLINE
102 # define __opal_attribute_always_inline__ __attribute__((__always_inline__))
103 #else
104 # define __opal_attribute_always_inline__
105 #endif
106 
107 #if OPAL_HAVE_ATTRIBUTE_COLD
108 # define __opal_attribute_cold__ __attribute__((__cold__))
109 #else
110 # define __opal_attribute_cold__
111 #endif
112 
113 #if OPAL_HAVE_ATTRIBUTE_CONST
114 # define __opal_attribute_const__ __attribute__((__const__))
115 #else
116 # define __opal_attribute_const__
117 #endif
118 
119 #if OPAL_HAVE_ATTRIBUTE_DEPRECATED
120 # define __opal_attribute_deprecated__ __attribute__((__deprecated__))
121 #else
122 # define __opal_attribute_deprecated__
123 #endif
124 
125 #if OPAL_HAVE_ATTRIBUTE_FORMAT
126 # define __opal_attribute_format__(a,b,c) __attribute__((__format__(a, b, c)))
127 #else
128 # define __opal_attribute_format__(a,b,c)
129 #endif
130 
131 /* Use this __atribute__ on function-ptr declarations, only */
132 #if OPAL_HAVE_ATTRIBUTE_FORMAT_FUNCPTR
133 # define __opal_attribute_format_funcptr__(a,b,c) __attribute__((__format__(a, b, c)))
134 #else
135 # define __opal_attribute_format_funcptr__(a,b,c)
136 #endif
137 
138 #if OPAL_HAVE_ATTRIBUTE_HOT
139 # define __opal_attribute_hot__ __attribute__((__hot__))
140 #else
141 # define __opal_attribute_hot__
142 #endif
143 
144 #if OPAL_HAVE_ATTRIBUTE_MALLOC
145 # define __opal_attribute_malloc__ __attribute__((__malloc__))
146 #else
147 # define __opal_attribute_malloc__
148 #endif
149 
150 #if OPAL_HAVE_ATTRIBUTE_MAY_ALIAS
151 # define __opal_attribute_may_alias__ __attribute__((__may_alias__))
152 #else
153 # define __opal_attribute_may_alias__
154 #endif
155 
156 #if OPAL_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION
157 # define __opal_attribute_no_instrument_function__ __attribute__((__no_instrument_function__))
158 #else
159 # define __opal_attribute_no_instrument_function__
160 #endif
161 
162 #if OPAL_HAVE_ATTRIBUTE_NOINLINE
163 # define __opal_attribute_noinline__ __attribute__((__noinline__))
164 #else
165 # define __opal_attribute_noinline__
166 #endif
167 
168 #if OPAL_HAVE_ATTRIBUTE_NONNULL
169 # define __opal_attribute_nonnull__(a) __attribute__((__nonnull__(a)))
170 # define __opal_attribute_nonnull_all__ __attribute__((__nonnull__))
171 #else
172 # define __opal_attribute_nonnull__(a)
173 # define __opal_attribute_nonnull_all__
174 #endif
175 
176 #if OPAL_HAVE_ATTRIBUTE_NORETURN
177 # define __opal_attribute_noreturn__ __attribute__((__noreturn__))
178 #else
179 # define __opal_attribute_noreturn__
180 #endif
181 
182 /* Use this __atribute__ on function-ptr declarations, only */
183 #if OPAL_HAVE_ATTRIBUTE_NORETURN_FUNCPTR
184 # define __opal_attribute_noreturn_funcptr__ __attribute__((__noreturn__))
185 #else
186 # define __opal_attribute_noreturn_funcptr__
187 #endif
188 
189 #if OPAL_HAVE_ATTRIBUTE_PACKED
190 # define __opal_attribute_packed__ __attribute__((__packed__))
191 #else
192 # define __opal_attribute_packed__
193 #endif
194 
195 #if OPAL_HAVE_ATTRIBUTE_PURE
196 # define __opal_attribute_pure__ __attribute__((__pure__))
197 #else
198 # define __opal_attribute_pure__
199 #endif
200 
201 #if OPAL_HAVE_ATTRIBUTE_SENTINEL
202 # define __opal_attribute_sentinel__ __attribute__((__sentinel__))
203 #else
204 # define __opal_attribute_sentinel__
205 #endif
206 
207 #if OPAL_HAVE_ATTRIBUTE_UNUSED
208 # define __opal_attribute_unused__ __attribute__((__unused__))
209 #else
210 # define __opal_attribute_unused__
211 #endif
212 
213 #if OPAL_HAVE_ATTRIBUTE_VISIBILITY
214 # define __opal_attribute_visibility__(a) __attribute__((__visibility__(a)))
215 #else
216 # define __opal_attribute_visibility__(a)
217 #endif
218 
219 #if OPAL_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT
220 # define __opal_attribute_warn_unused_result__ __attribute__((__warn_unused_result__))
221 #else
222 # define __opal_attribute_warn_unused_result__
223 #endif
224 
225 #if OPAL_HAVE_ATTRIBUTE_WEAK_ALIAS
226 # define __opal_attribute_weak_alias__(a) __attribute__((__weak__, __alias__(a)))
227 #else
228 # define __opal_attribute_weak_alias__(a)
229 #endif
230 
231 #if OPAL_HAVE_ATTRIBUTE_DESTRUCTOR
232 # define __opal_attribute_destructor__ __attribute__((__destructor__))
233 #else
234 # define __opal_attribute_destructor__
235 #endif
236 
237 #if OPAL_HAVE_ATTRIBUTE_OPTNONE
238 # define __opal_attribute_optnone__ __attribute__((__optnone__))
239 #else
240 # define __opal_attribute_optnone__
241 #endif
242 
243 #if OPAL_HAVE_ATTRIBUTE_EXTENSION
244 # define __opal_attribute_extension__ __extension__
245 #else
246 # define __opal_attribute_extension__
247 #endif
248 
249 # if OPAL_C_HAVE_VISIBILITY
250 # define OPAL_DECLSPEC __opal_attribute_visibility__("default")
251 # define OPAL_MODULE_DECLSPEC __opal_attribute_visibility__("default")
252 # else
253 # define OPAL_DECLSPEC
254 # define OPAL_MODULE_DECLSPEC
255 # endif
256 
257 #if !defined(__STDC_LIMIT_MACROS) && (defined(c_plusplus) || defined (__cplusplus))
258 /* When using a C++ compiler, the max / min value #defines for std
259  types are only included if __STDC_LIMIT_MACROS is set before
260  including stdint.h */
261 #define __STDC_LIMIT_MACROS
262 #endif
263 #include "opal_config.h"
264 #include "opal_stdint.h"
265 
266 
273 #if OMPI_BUILDING
274 
275 /*
276  * Maximum size of a filename path.
277  */
278 #include <limits.h>
279 #ifdef HAVE_SYS_PARAM_H
280 #include <sys/param.h>
281 #endif
282 #if defined(PATH_MAX)
283 #define OPAL_PATH_MAX (PATH_MAX + 1)
284 #elif defined(_POSIX_PATH_MAX)
285 #define OPAL_PATH_MAX (_POSIX_PATH_MAX + 1)
286 #else
287 #define OPAL_PATH_MAX 256
288 #endif
289 
290 /*
291  * Set the compile-time path-separator on this system and variable separator
292  */
293 #define OPAL_PATH_SEP "/"
294 #define OPAL_ENV_SEP ':'
295 
296 #if defined(MAXHOSTNAMELEN)
297 #define OPAL_MAXHOSTNAMELEN (MAXHOSTNAMELEN + 1)
298 #elif defined(HOST_NAME_MAX)
299 #define OPAL_MAXHOSTNAMELEN (HOST_NAME_MAX + 1)
300 #else
301 /* SUSv2 guarantees that "Host names are limited to 255 bytes". */
302 #define OPAL_MAXHOSTNAMELEN (255 + 1)
303 #endif
304 
305 /*
306  * Do we want memory debugging?
307  *
308  * A few scenarios:
309  *
310  * 1. In the OMPI C library: we want these defines in all cases
311  * 2. In the OMPI C++ bindings: we do not want them
312  * 3. In the OMPI C++ executables: we do want them
313  *
314  * So for 1, everyone must include <opal_config.h> first. For 2, the
315  * C++ bindings will never include <opal_config.h> -- they will only
316  * include <mpi.h>, which includes <opal_config.h>, but after
317  * setting OMPI_BUILDING to 0 For 3, it's the same as 1 -- just include
318  * <opal_config.h> first.
319  *
320  * Give code that needs to include opal_config.h but really can't have
321  * this stuff enabled (like the memory manager code) a way to turn us
322  * off
323  */
324 #if OPAL_ENABLE_MEM_DEBUG && !defined(OPAL_DISABLE_ENABLE_MEM_DEBUG)
325 
326 /* It is safe to include opal/util/malloc.h here because a) it will only
327  happen when we are building OMPI and therefore have a full OMPI
328  source tree [including headers] available, and b) we guaranteed to
329  *not* to include anything else via opal/util/malloc.h, so we won't
330  have Cascading Includes Of Death. */
331 # include "opal/util/malloc.h"
332 # if defined(malloc)
333 # undef malloc
334 # endif
335 # define malloc(size) opal_malloc((size), __FILE__, __LINE__)
336 # if defined(calloc)
337 # undef calloc
338 # endif
339 # define calloc(nmembers, size) opal_calloc((nmembers), (size), __FILE__, __LINE__)
340 # if defined(realloc)
341 # undef realloc
342 # endif
343 # define realloc(ptr, size) opal_realloc((ptr), (size), __FILE__, __LINE__)
344 # if defined(free)
345 # undef free
346 # endif
347 # define free(ptr) opal_free((ptr), __FILE__, __LINE__)
348 
349 /*
350  * If we're mem debugging, make the OPAL_DEBUG_ZERO resolve to memset
351  */
352 # include <string.h>
353 # define OPAL_DEBUG_ZERO(obj) memset(&(obj), 0, sizeof(obj))
354 #else
355 # define OPAL_DEBUG_ZERO(obj)
356 #endif
357 
358 /*
359  * printf functions for portability (only when building Open MPI)
360  */
361 #if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
362 #include <stdarg.h>
363 #include <stdlib.h>
364 #endif
365 
366 #if !defined(HAVE_ASPRINTF) || !defined(HAVE_SNPRINTF) || !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
367 #include "opal/util/printf.h"
368 #endif
369 
370 #ifndef HAVE_ASPRINTF
371 # define asprintf opal_asprintf
372 #endif
373 
374 #ifndef HAVE_SNPRINTF
375 # define snprintf opal_snprintf
376 #endif
377 
378 #ifndef HAVE_VASPRINTF
379 # define vasprintf opal_vasprintf
380 #endif
381 
382 #ifndef HAVE_VSNPRINTF
383 # define vsnprintf opal_vsnprintf
384 #endif
385 
386 /*
387  * Some platforms (Solaris) have a broken qsort implementation. Work
388  * around by using our own.
389  */
390 #if OPAL_HAVE_BROKEN_QSORT
391 #ifdef qsort
392 #undef qsort
393 #endif
394 
395 #include "opal/util/qsort.h"
396 #define qsort opal_qsort
397 #endif
398 
399 /*
400  * On some homogenous big-iron machines (Sandia's Red Storm), there
401  * are no htonl and friends. If that's the case, provide stubs. I
402  * would hope we never find a platform that doesn't have these macros
403  * and would want to talk to the outside world... On other platforms
404  * we fail to detect them correctly.
405  */
406 #if !defined(HAVE_UNIX_BYTESWAP)
407 static inline uint32_t htonl(uint32_t hostvar) { return hostvar; }
408 static inline uint32_t ntohl(uint32_t netvar) { return netvar; }
409 static inline uint16_t htons(uint16_t hostvar) { return hostvar; }
410 static inline uint16_t ntohs(uint16_t netvar) { return netvar; }
411 #endif
412 
413 /*
414  * Define __func__-preprocessor directive if the compiler does not
415  * already define it. Define it to __FILE__ so that we at least have
416  * a clue where the developer is trying to indicate where the error is
417  * coming from (assuming that __func__ is typically used for
418  * printf-style debugging).
419  */
420 #if defined(HAVE_DECL___FUNC__) && !HAVE_DECL___FUNC__
421 #define __func__ __FILE__
422 #endif
423 
424 #define IOVBASE_TYPE void
425 
426 /* ensure the bool type is defined as it is used everywhere */
427 #include <stdbool.h>
428 
433 # define OPAL_INT_TO_BOOL(VALUE) (bool)(VALUE)
434 
440 #if OPAL_ENABLE_IPV6 && defined(HAVE_STRUCT_SOCKADDR_IN6)
441 #define OPAL_ENABLE_IPV6 1
442 #else
443 #define OPAL_ENABLE_IPV6 0
444 #endif
445 
446 #if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && defined(HAVE_STRUCT_SOCKADDR_IN)
447 #define sockaddr_storage sockaddr
448 #define ss_family sa_family
449 #endif
450 
451 /* Compatibility structure so that we don't have to have as many
452  #if checks in the code base */
453 #if !defined(HAVE_STRUCT_SOCKADDR_IN6) && defined(HAVE_STRUCT_SOCKADDR_IN)
454 #define sockaddr_in6 sockaddr_in
455 #define sin6_len sin_len
456 #define sin6_family sin_family
457 #define sin6_port sin_port
458 #define sin6_addr sin_addr
459 #endif
460 
461 #if !HAVE_DECL_AF_UNSPEC
462 #define AF_UNSPEC 0
463 #endif
464 #if !HAVE_DECL_PF_UNSPEC
465 #define PF_UNSPEC 0
466 #endif
467 #if !HAVE_DECL_AF_INET6
468 #define AF_INET6 AF_UNSPEC
469 #endif
470 #if !HAVE_DECL_PF_INET6
471 #define PF_INET6 PF_UNSPEC
472 #endif
473 
474 #if defined(__APPLE__) && defined(HAVE_INTTYPES_H)
475 /* Prior to Mac OS X 10.3, the length modifier "ll" wasn't
476  supported, but "q" was for long long. This isn't ANSI
477  C and causes a warning when using PRI?64 macros. We
478  don't support versions prior to OS X 10.3, so we dont'
479  need such backward compatibility. Instead, redefine
480  the macros to be "ll", which is ANSI C and doesn't
481  cause a compiler warning. */
482 #include <inttypes.h>
483 #if defined(__PRI_64_LENGTH_MODIFIER__)
484 #undef __PRI_64_LENGTH_MODIFIER__
485 #define __PRI_64_LENGTH_MODIFIER__ "ll"
486 #endif
487 #if defined(__SCN_64_LENGTH_MODIFIER__)
488 #undef __SCN_64_LENGTH_MODIFIER__
489 #define __SCN_64_LENGTH_MODIFIER__ "ll"
490 #endif
491 #endif
492 
493 #ifdef MCS_VXWORKS
494 /* VXWorks puts some common functions in oddly named headers. Rather
495  than update all the places the functions are used, which would be a
496  maintenance disatster, just update here... */
497 #ifdef HAVE_IOLIB_H
498 /* pipe(), ioctl() */
499 #include <ioLib.h>
500 #endif
501 #ifdef HAVE_SOCKLIB_H
502 /* socket() */
503 #include <sockLib.h>
504 #endif
505 #ifdef HAVE_HOSTLIB_H
506 /* gethostname() */
507 #include <hostLib.h>
508 #endif
509 #endif
510 
511 /* If we're in C++, then just undefine restrict and then define it to
512  nothing. "restrict" is not part of the C++ language, and we don't
513  have a corresponding AC_CXX_RESTRICT to figure out what the C++
514  compiler supports. */
515 #if defined(c_plusplus) || defined(__cplusplus)
516 #undef restrict
517 #define restrict
518 #endif
519 
520 #else
521 
522 /* For a similar reason to what is listed in opal_config_top.h, we
523  want to protect others from the autoconf/automake-generated
524  PACKAGE_<foo> macros in opal_config.h. We can't put these undef's
525  directly in opal_config.h because they'll be turned into #defines'
526  via autoconf.
527 
528  So put them here in case any only else includes OMPI/ORTE/OPAL's
529  config.h files. */
530 
531 #undef PACKAGE_BUGREPORT
532 #undef PACKAGE_NAME
533 #undef PACKAGE_STRING
534 #undef PACKAGE_TARNAME
535 #undef PACKAGE_VERSION
536 #undef PACKAGE_URL
537 #undef HAVE_CONFIG_H
538 
539 #endif /* OMPI_BUILDING */
printf.h
opal_stdint.h
qsort.h
malloc.h