dune-common 2.9.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Dune::MPIHelper Class Reference

A real mpi helper. More...

#include <dune/common/parallel/mpihelper.hh>

Public Types

typedef MPI_Comm MPICommunicator
 The type of the mpi communicator.
 

Public Member Functions

int rank () const
 return rank of process
 
int size () const
 return number of processes
 
 ~MPIHelper ()
 calls MPI_Finalize
 

Static Public Member Functions

static MPICommunicator getCommunicator ()
 get the default communicator
 
static MPICommunicator getLocalCommunicator ()
 get a local communicator
 
static Communication< MPICommunicatorgetCollectiveCommunication ()
 
static Communication< MPICommunicatorgetCommunication ()
 
static DUNE_EXPORT MPIHelperinstance (int &argc, char **&argv)
 Get the singleton instance of the helper.
 
static DUNE_EXPORT MPIHelperinstance ()
 

Static Public Attributes

static constexpr bool isFake = false
 Are we fake (i. e. pretend to have MPI support but are compiled without.
 

Detailed Description

A real mpi helper.

This helper should be used for parallel programs.

Member Typedef Documentation

◆ MPICommunicator

The type of the mpi communicator.

Constructor & Destructor Documentation

◆ ~MPIHelper()

Dune::MPIHelper::~MPIHelper ( )
inline

calls MPI_Finalize

Member Function Documentation

◆ getCollectiveCommunication()

static Communication< MPICommunicator > Dune::MPIHelper::getCollectiveCommunication ( )
inlinestatic
Deprecated:
getCollectionCommunication is deprecated and will be removed after Dune 2.9.

Use getCommunication instead.

◆ getCommunication()

static Communication< MPICommunicator > Dune::MPIHelper::getCommunication ( )
inlinestatic

◆ getCommunicator()

static MPICommunicator Dune::MPIHelper::getCommunicator ( )
inlinestatic

get the default communicator

Return a communicator to exchange data with all processes

Returns
MPI_COMM_WORLD

◆ getLocalCommunicator()

static MPICommunicator Dune::MPIHelper::getLocalCommunicator ( )
inlinestatic

get a local communicator

Returns a communicator to exchange data with the local process only

Returns
MPI_COMM_SELF

◆ instance() [1/2]

static DUNE_EXPORT MPIHelper & Dune::MPIHelper::instance ( )
inlinestatic

◆ instance() [2/2]

static DUNE_EXPORT MPIHelper & Dune::MPIHelper::instance ( int &  argc,
char **&  argv 
)
inlinestatic

Get the singleton instance of the helper.

This method has to be called with the same arguments that the main method of the program was called:

int main(int argc, char** argv){
MPIHelper::instance(argc, argv);
// program code comes here
...
}
int main(int argc, char **argv)
Definition mpi_collective_benchmark.cc:293
static DUNE_EXPORT MPIHelper & instance()
Definition mpihelper.hh:258
Parameters
argcThe number of arguments provided to main.
argvThe arguments provided to main.

◆ rank()

int Dune::MPIHelper::rank ( ) const
inline

return rank of process

◆ size()

int Dune::MPIHelper::size ( ) const
inline

return number of processes

Member Data Documentation

◆ isFake

constexpr bool Dune::MPIHelper::isFake = false
staticconstexpr

Are we fake (i. e. pretend to have MPI support but are compiled without.


The documentation for this class was generated from the following file: