Chris@16: // Copyright (C) 2006 Douglas Gregor Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: /** @file config.hpp Chris@16: * Chris@16: * This header provides MPI configuration details that expose the Chris@16: * capabilities of the underlying MPI implementation, and provides Chris@16: * auto-linking support on Windows. Chris@16: */ Chris@16: #ifndef BOOST_MPI_CONFIG_HPP Chris@16: #define BOOST_MPI_CONFIG_HPP Chris@16: Chris@16: /* Force MPICH not to define SEEK_SET, SEEK_CUR, and SEEK_END, which Chris@16: conflict with the versions in and . */ Chris@16: #define MPICH_IGNORE_CXX_SEEK 1 Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: /** @brief Define this macro to avoid expensice MPI_Pack/Unpack calls on Chris@16: * homogeneous machines. Chris@16: */ Chris@16: //#define BOOST_MPI_HOMOGENEOUS Chris@16: Chris@16: // If this is an MPI-2 implementation, define configuration macros for Chris@16: // the features we are interested in. Chris@16: #if defined(MPI_VERSION) && MPI_VERSION >= 2 Chris@16: /** @brief Determine if the MPI implementation has support for memory Chris@16: * allocation. Chris@16: * Chris@16: * This macro will be defined when the underlying MPI implementation Chris@16: * has support for the MPI-2 memory allocation routines @c Chris@16: * MPI_Alloc_mem and @c MPI_Free_mem. When defined, the @c allocator Chris@16: * class template will provide Standard Library-compliant access to Chris@16: * these memory-allocation routines. Chris@16: */ Chris@16: # define BOOST_MPI_HAS_MEMORY_ALLOCATION Chris@16: Chris@16: /** @brief Determine if the MPI implementation has supports initialization Chris@16: * without command-line arguments. Chris@16: * Chris@16: * This macro will be defined when the underlying implementation Chris@16: * supports initialization of MPI without passing along command-line Chris@16: * arguments, e.g., @c MPI_Init(NULL, NULL). When defined, the @c Chris@16: * environment class will provide a default constructor. This macro is Chris@16: * always defined for MPI-2 implementations. */ Chris@16: # define BOOST_MPI_HAS_NOARG_INITIALIZATION Chris@16: #else Chris@16: // If this is an MPI-1.x implementation, no arg initialization for Chris@16: // mpi environement could still be available, but not mandatory. Chris@16: // Undef this if no arg init is available: Chris@16: //# define BOOST_MPI_HAS_NOARG_INITIALIZATION Chris@16: #endif Chris@16: Chris@16: #if defined(MPIAPI) Chris@16: # define BOOST_MPI_CALLING_CONVENTION MPIAPI Chris@16: #else Chris@16: /** @brief Specifies the calling convention that will be used for callbacks Chris@16: * from the underlying C MPI. Chris@16: * Chris@16: * This is a Windows-specific macro, which will be used internally to state Chris@16: * the calling convention of any function that is to be used as a callback Chris@16: * from MPI. For example, the internally-defined functions that are used in Chris@16: * a call to @c MPI_Op_create. This macro is likely only to be useful to Chris@16: * users that wish to bypass Boost.MPI, registering their own callbacks in Chris@16: * certain cases, e.g., through @c MPI_Op_create. Chris@16: */ Chris@16: # define BOOST_MPI_CALLING_CONVENTION Chris@16: #endif Chris@16: Chris@16: #if defined(LAM_MPI) Chris@16: // Configuration for LAM/MPI Chris@16: # define BOOST_MPI_HAS_MEMORY_ALLOCATION Chris@16: # define BOOST_MPI_HAS_NOARG_INITIALIZATION Chris@16: #elif defined(MPICH_NAME) Chris@16: // Configuration for MPICH Chris@16: #endif Chris@16: Chris@16: /***************************************************************************** Chris@16: * * Chris@16: * DLL import/export options * Chris@16: * * Chris@16: *****************************************************************************/ Chris@16: Chris@101: #if (defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_STATIC_LINK) Chris@16: # if defined(BOOST_MPI_SOURCE) Chris@101: # define BOOST_MPI_DECL BOOST_SYMBOL_EXPORT Chris@16: # define BOOST_MPI_BUILD_DLL Chris@16: # else Chris@101: # define BOOST_MPI_DECL BOOST_SYMBOL_IMPORT Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: #ifndef BOOST_MPI_DECL Chris@16: # define BOOST_MPI_DECL Chris@16: #endif Chris@16: Chris@16: #if !defined(BOOST_MPI_NO_LIB) && !defined(BOOST_MPI_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus) Chris@16: # define BOOST_LIB_NAME boost_mpi Chris@16: # if defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK) Chris@16: # define BOOST_DYN_LINK Chris@16: # endif Chris@16: # ifdef BOOST_MPI_DIAG Chris@16: # define BOOST_LIB_DIAGNOSTIC Chris@16: # endif Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #endif // BOOST_MPI_CONFIG_HPP