mirror of
https://github.com/boostorg/mpi.git
synced 2026-02-25 16:32:22 +00:00
Add default constructor to environment class
[SVN r36384]
This commit is contained in:
@@ -27,11 +27,22 @@
|
||||
* these memory-allocation routines.
|
||||
*/
|
||||
# define BOOST_MPI_HAS_MEMORY_ALLOCATION
|
||||
|
||||
/** @brief Determine if the MPI implementation has supports initialization
|
||||
* without command-line arguments.
|
||||
*
|
||||
* This macro will be defined when the underlying implementation
|
||||
* supports initialization of MPI without passing along command-line
|
||||
* arguments, e.g., @c MPI_Init(NULL, NULL). When defined, the @c
|
||||
* environment class will provide a default constructor. This macro is
|
||||
* always defined for MPI-2 implementations. */
|
||||
# define BOOST_MPI_HAS_NOARG_INITIALIZATION
|
||||
#endif
|
||||
|
||||
#if defined(LAM_MPI)
|
||||
// Configuration for LAM/MPI
|
||||
# define BOOST_MPI_HAS_MEMORY_ALLOCATION
|
||||
# define BOOST_MPI_HAS_NOARG_INITIALIZATION
|
||||
#elif defined(MPICH_NAME)
|
||||
// Configuration for MPICH
|
||||
#endif
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <string>
|
||||
#include <boost/parallel/mpi/config.hpp>
|
||||
|
||||
namespace boost { namespace parallel { namespace mpi {
|
||||
|
||||
@@ -46,6 +47,23 @@ namespace boost { namespace parallel { namespace mpi {
|
||||
*/
|
||||
class environment : noncopyable {
|
||||
public:
|
||||
#ifdef BOOST_MPI_HAS_NOARG_INITIALIZATION
|
||||
/** Initialize the MPI environment.
|
||||
*
|
||||
* If the MPI environment has not already been initialized,
|
||||
* initializes MPI with a call to @c MPI_Init. Since this
|
||||
* constructor does not take command-line arguments (@c argc and @c
|
||||
* argv), it is only available when the underlying MPI
|
||||
* implementation supports calling @c MPI_Init with @c NULL
|
||||
* arguments, indicated by the macro @c
|
||||
* BOOST_MPI_HAS_NOARG_INITIALIZATION.
|
||||
*
|
||||
* @param abort_on_exception When true, this object will abort the
|
||||
* program if it is destructed due to an uncaught exception.
|
||||
*/
|
||||
explicit environment(bool abort_on_exception = true);
|
||||
#endif
|
||||
|
||||
/** Initialize the MPI environment.
|
||||
*
|
||||
* If the MPI environment has not already been initialized,
|
||||
|
||||
Reference in New Issue
Block a user