LBIBCell
|
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_ > |
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.
|
virtual |
destructor
Definition at line 38 of file MPIProxy.cpp.
void UtilLib::MPIProxy_::barrier | ( | ) |
wrapper for mpi barrier
Definition at line 48 of file MPIProxy.cpp.
void UtilLib::MPIProxy_::broadcast | ( | T & | value, |
int | root | ||
) |
Broadcast the value from root
value | The value to be broadcast |
root | The 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
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
Definition at line 44 of file MPIProxy.cpp.
void UtilLib::MPIProxy_::irecv | ( | int | source, |
int | tag, | ||
T & | value | ||
) | const |
asynchronous receive operation the mpi status is stored in _mpiStatus
source | The source of the message |
tag | The tag of the message |
value | The value received |
Definition at line 149 of file MPIProxy.hpp.
void UtilLib::MPIProxy_::isend | ( | int | dest, |
int | tag, | ||
const T & | value | ||
) | const |
asynchronous send operation the mpi status is stored in _mpiStatus
dest | The destination of the message |
tag | The tag of the message |
value | The 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.
Declare the Singleton class a friend to allow construction of the MPIProxy_ class
Definition at line 114 of file MPIProxy.hpp.