LBIBCell
 All Classes Functions Variables Friends Pages
UtilLib::MPIProxy_ Class Reference

A class to handle all MPI related code. It also provides works if MPI is disabled. More...

#include <MPIProxy.hpp>

Public Member Functions

virtual ~MPIProxy_ ()
 
int getRank () const
 
int getSize () const
 
void barrier ()
 
void waitAll ()
 
template<typename T >
void broadcast (T &value, int root)
 
template<typename T >
void irecv (int source, int tag, T &value) const
 
template<typename T >
void isend (int dest, int tag, const T &value) const
 

Friends

class Singleton< MPIProxy_ >
 

Detailed Description

A class to handle all MPI related code. It also provides works if MPI is disabled.

This class encapsulate all MPI related code. The class also works if MPI is not enabled, such that the code does not depend if MPI is enabled or not. At the moment only in the main method the MPI environment needs to be generated. All other MPI calls are handled by this class

Definition at line 47 of file MPIProxy.hpp.

Constructor & Destructor Documentation

UtilLib::MPIProxy_::~MPIProxy_ ( )
virtual

destructor

Definition at line 38 of file MPIProxy.cpp.

Member Function Documentation

void UtilLib::MPIProxy_::barrier ( )

wrapper for mpi barrier

Definition at line 48 of file MPIProxy.cpp.

template<typename T >
void UtilLib::MPIProxy_::broadcast ( T &  value,
int  root 
)

Broadcast the value from root

Parameters
valueThe value to be broadcast
rootThe root process

Definition at line 139 of file MPIProxy.hpp.

int UtilLib::MPIProxy_::getRank ( ) const

wrapper method to return the process id, if mpi is disabled it returns 0

Returns
the world rank of a process

Definition at line 40 of file MPIProxy.cpp.

int UtilLib::MPIProxy_::getSize ( ) const

wrapper method to return the size, if MPI is disabled it returns 1

Returns

Definition at line 44 of file MPIProxy.cpp.

template<typename T >
void UtilLib::MPIProxy_::irecv ( int  source,
int  tag,
T &  value 
) const

asynchronous receive operation the mpi status is stored in _mpiStatus

Parameters
sourceThe source of the message
tagThe tag of the message
valueThe value received

Definition at line 149 of file MPIProxy.hpp.

template<typename T >
void UtilLib::MPIProxy_::isend ( int  dest,
int  tag,
const T &  value 
) const

asynchronous send operation the mpi status is stored in _mpiStatus

Parameters
destThe destination of the message
tagThe tag of the message
valueThe value sended

Definition at line 164 of file MPIProxy.hpp.

void UtilLib::MPIProxy_::waitAll ( )

waits until all request stored in the vector _mpiStatus are finished

Definition at line 55 of file MPIProxy.cpp.

Friends And Related Function Documentation

friend class Singleton< MPIProxy_ >
friend

Declare the Singleton class a friend to allow construction of the MPIProxy_ class

Definition at line 114 of file MPIProxy.hpp.


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