MADNESS 0.10.1
|
MPI singleton that manages MPI setup and teardown for MADNESS. More...
#include <worldmpi.h>
Public Member Functions | |
~WorldMpi () | |
WorldMpi destructor. | |
Static Public Member Functions | |
static void | finalize () |
Finalize the MPI runtime. | |
static void | initialize (int &argc, char **&argv, int requested) |
Initialize the MPI runtime. | |
Private Member Functions | |
WorldMpi (const WorldMpi &)=delete | |
WorldMpi (int &argc, char **&argv, int requested) | |
WorldMpi constructor. | |
WorldMpi & | operator= (const WorldMpi &)=delete |
Static Private Attributes | |
static bool | own_mpi = false |
Flag storing if MADNESS is responsible for MPI. | |
static std::shared_ptr< WorldMpi > | world_mpi |
Pointer to help MADNESS manage MPI. | |
Friends | |
class | WorldMpiRuntime |
MPI singleton that manages MPI setup and teardown for MADNESS.
MADNESS will call WorldMpi::initialize
and WorldMpi::finalize
to setup and teardown the MPI runtime.
WorldMpi
constructor.
Initialize the MPI runtime for MADNESS.
initialize
. [in,out] | argc | The number of command-line arguments to process. |
[in,out] | argv | The command-line arguments. |
requested | The requested thread support for MPI runtime |
References SafeMPI::Attach_buffer(), SafeMPI::detail::init_comm_world(), SafeMPI::Init_thread(), madness::nonlinear_vector_solver(), and own_mpi.
|
privatedelete |
|
inline |
WorldMpi
destructor.
This will teardown the MPI, SafeMPI.
References SafeMPI::Detach_buffer(), SafeMPI::Finalize(), MPI_Error_string(), MPI_MAX_ERROR_STRING, MPI_SUCCESS, madness::nonlinear_vector_solver(), and own_mpi.
Finalize the MPI runtime.
This function starts the teardown process of the MPI runtime. The actual MPI_Finalize
will only be called when all the objects using MPI have been destroyed.
References world_mpi.
|
inlinestatic |
Initialize the MPI runtime.
This function starts the MPI runtime. If MPI is already running, then MADNESS delegate responsibility for MPI to the user. In either case, MPI thread support is checked to make sure MPI will play nice with MADNESS.
madness::Exception | When MADNESS has already been initialized. |
madness::Exception | When MPI has already been finalized. |
SafeMPI::Exception | When an MPI error occurs. |
[in,out] | argc | The number of command line arguments. |
[in,out] | argv | The values of command line arguments. |
[in] | requested | The requested thread support for MPI runtime. |
References SafeMPI::COMM_WORLD, SafeMPI::Intracomm::Get_rank(), SafeMPI::Is_finalized(), SafeMPI::Is_initialized(), MADNESS_ASSERT, MPI_Abort(), MPI_COMM_WORLD, MPI_THREAD_STRING, madness::nonlinear_vector_solver(), own_mpi, SafeMPI::Query_thread(), and world_mpi.
|
friend |