dune-common  2.4.1-rc2
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Dune::MPIHelper Class Reference

A real mpi helper.This helper should be used for parallel programs. More...

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

Public Types

enum  { isFake = false }
 
typedef MPI_Comm MPICommunicator
 The type of the mpi communicator. More...
 

Public Member Functions

int rank () const
 return rank of process More...
 
int size () const
 return number of processes More...
 

Static Public Member Functions

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

Detailed Description

A real mpi helper.

This helper should be used for parallel programs.

Member Typedef Documentation

The type of the mpi communicator.

Member Enumeration Documentation

anonymous enum
Enumerator
isFake 

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

Member Function Documentation

static CollectiveCommunication<MPICommunicator> Dune::MPIHelper::getCollectiveCommunication ( )
inlinestatic
static MPICommunicator Dune::MPIHelper::getCommunicator ( )
inlinestatic

get the default communicator

Return a communicator to exchange data with all processes

Returns
MPI_COMM_WORLD
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
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
...
}
Parameters
argcThe number of arguments provided to main.
argvThe arguments provided to main.
int Dune::MPIHelper::rank ( ) const
inline

return rank of process

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

return number of processes

References Dune::dverb.


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