Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:46:55

0001 // Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>
0002 
0003 // Use, modification and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 /** @file config.hpp
0008  *
0009  *  This header provides MPI configuration details that expose the
0010  *  capabilities of the underlying MPI implementation, and provides
0011  *  auto-linking support on Windows.
0012  */
0013 #ifndef BOOST_MPI_CONFIG_HPP
0014 #define BOOST_MPI_CONFIG_HPP
0015 
0016 /* Force MPICH not to define SEEK_SET, SEEK_CUR, and SEEK_END, which
0017    conflict with the versions in <stdio.h> and <cstdio>. */
0018 #define MPICH_IGNORE_CXX_SEEK 1
0019 /* We do not want to link in the OpenMPI CXX stuff */
0020 #define OMPI_SKIP_MPICXX
0021 
0022 #include <mpi.h>
0023 #include <boost/config.hpp>
0024 
0025 /** @brief Comment this macro is you are running in an heterogeneous environment.
0026  *
0027  * When this flag is enabled, we assume some simple, POD-like, type can be 
0028  * transmitted without paying the cost of portable serialization. 
0029  *
0030  * Comment this if your platform is not homogeneous and that portable 
0031  * serialization/deserialization must be performed.
0032  *
0033  * It you do so, check that your MPI implementation supports thats kind of environment.
0034  */
0035 #define BOOST_MPI_HOMOGENEOUS
0036 
0037 #if defined MPI_VERSION
0038 /** @brief Major version of the underlying MPI implementation supproted standard.
0039  * 
0040  * If, for some reason, MPI_VERSION is not supported, you should probably set that
0041  * according to your MPI documentation
0042  */
0043 # define BOOST_MPI_VERSION MPI_VERSION
0044 #else 
0045 // assume a safe default
0046 # define BOOST_MPI_VERSION 2
0047 #endif
0048 
0049 #if defined MPI_SUBVERSION
0050 /** @brief Major version of the underlying MPI implementation supported standard.
0051  * 
0052  * If, for some reason, MPI_SUBVERSION is not supported, you should probably set that
0053  * according to your MPI documentation
0054  */
0055 # define BOOST_MPI_SUBVERSION MPI_SUBVERSION
0056 #else 
0057 // assume a safe default
0058 # define BOOST_MPI_SUBVERSION 2
0059 #endif
0060 
0061 // If this is an MPI-2 implementation, define configuration macros for
0062 // the features we are interested in.
0063 #if BOOST_MPI_VERSION >= 2
0064 /** @brief Determine if the MPI implementation has support for memory
0065  *  allocation.
0066  *
0067  *  This macro will be defined when the underlying MPI implementation
0068  *  has support for the MPI-2 memory allocation routines @c
0069  *  MPI_Alloc_mem and @c MPI_Free_mem. When defined, the @c allocator
0070  *  class template will provide Standard Library-compliant access to
0071  *  these memory-allocation routines.
0072  */
0073 #  define BOOST_MPI_HAS_MEMORY_ALLOCATION
0074 
0075 /** @brief Determine if the MPI implementation has supports initialization 
0076  *  without command-line arguments.
0077  *
0078  *  This macro will be defined when the underlying implementation
0079  *  supports initialization of MPI without passing along command-line
0080  *  arguments, e.g., @c MPI_Init(NULL, NULL). When defined, the @c
0081  *  environment class will provide a default constructor. This macro is 
0082  *  always defined for MPI-2 implementations. */
0083 #  define BOOST_MPI_HAS_NOARG_INITIALIZATION
0084 #else
0085 // If this is an MPI-1.x implementation, no arg initialization for
0086 // mpi environment could still be available, but not mandatory.
0087 // Undef this if no arg init is available:
0088 //#  define BOOST_MPI_HAS_NOARG_INITIALIZATION
0089 #endif
0090 
0091 #if defined(MPIAPI)
0092 #  define BOOST_MPI_CALLING_CONVENTION MPIAPI
0093 #else
0094 /** @brief Specifies the calling convention that will be used for callbacks
0095  *  from the underlying C MPI. 
0096  *
0097  *  This is a Windows-specific macro, which will be used internally to state
0098  *  the calling convention of any function that is to be used as a callback
0099  *  from MPI. For example, the internally-defined functions that are used in
0100  *  a call to @c MPI_Op_create. This macro is likely only to be useful to
0101  *  users that wish to bypass Boost.MPI, registering their own callbacks in
0102  *  certain cases, e.g., through @c MPI_Op_create.
0103  */
0104 #  define BOOST_MPI_CALLING_CONVENTION
0105 #endif
0106 
0107 /** @brief Indicates that MPI_Bcast supports MPI_BOTTOM.
0108  *
0109  * Some implementations have a broken MPI_Bcast wrt to MPI_BOTTOM.
0110  * BullX MPI and LAM seems to be among them, at least for some versions.
0111  * The `broacast_test.cpp` test `test_skeleton_and_content` can be used to 
0112  * detect that.
0113  */
0114 #define BOOST_MPI_BCAST_BOTTOM_WORKS_FINE
0115 
0116 #if defined(LAM_MPI)
0117 // Configuration for LAM/MPI
0118 #  define BOOST_MPI_HAS_MEMORY_ALLOCATION
0119 #  define BOOST_MPI_HAS_NOARG_INITIALIZATION
0120 #  undef  BOOST_MPI_BCAST_BOTTOM_WORKS_FINE
0121 #endif
0122 
0123 #if defined(MPICH_NAME)
0124 // Configuration for MPICH
0125 #endif
0126 
0127 #if defined(OPEN_MPI)
0128 // Configuration for Open MPI
0129 #endif
0130 
0131 #if BOOST_MPI_VERSION >= 3 
0132 // MPI_Probe an friends should work
0133 #  if defined(I_MPI_NUMVERSION)
0134 // Excepted for some Intel versions.
0135 // Note that I_MPI_NUMVERSION is not always defined with Intel.
0136 #    if I_MPI_NUMVERSION > 20190004000
0137 #      define BOOST_MPI_USE_IMPROBE 1
0138 #    endif
0139 #  else
0140 #    define BOOST_MPI_USE_IMPROBE 1
0141 #  endif
0142 #endif
0143 
0144 /*****************************************************************************
0145  *                                                                           *
0146  *  DLL import/export options                                                *  
0147  *                                                                           *
0148  *****************************************************************************/
0149 
0150 #if (defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_STATIC_LINK)
0151 #  if defined(BOOST_MPI_SOURCE)
0152 #     define BOOST_MPI_DECL BOOST_SYMBOL_EXPORT
0153 #     define BOOST_MPI_BUILD_DLL
0154 #  else
0155 #     define BOOST_MPI_DECL BOOST_SYMBOL_IMPORT
0156 #  endif
0157 #endif
0158 
0159 #ifndef BOOST_MPI_DECL
0160 #  define BOOST_MPI_DECL
0161 #endif
0162 
0163 #if !defined(BOOST_MPI_NO_LIB) && !defined(BOOST_MPI_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
0164 #  define BOOST_LIB_NAME boost_mpi
0165 #  if defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
0166 #     define BOOST_DYN_LINK
0167 #  endif
0168 #  ifdef BOOST_MPI_DIAG
0169 #     define BOOST_LIB_DIAGNOSTIC
0170 #  endif
0171 #  include <boost/config/auto_link.hpp>
0172 #endif
0173 
0174 #endif // BOOST_MPI_CONFIG_HPP