Class containing wrappers to MPI. More...
#include <Communicator.h>
Classes | |
class | Request |
class | Status |
Public Member Functions | |
Communicator () | |
Default constructor. More... | |
Communicator (const Communicator &) | |
Copy constructor. More... | |
Communicator & | operator= (const Communicator &) |
Assignment operator. More... | |
virtual | ~Communicator () |
Destructor. More... | |
int | Get_rank () const |
Obtain the rank of the present process. More... | |
int | Get_size () const |
Obtain the number of processes. More... | |
void | Set_comm (MPI_Comm) |
Set from a real MPI communicator. More... | |
MPI_Comm & | Get_comm () |
Reference to MPI communicator. More... | |
void | Set_comm (void *comm) |
Set from a pointer to a real MPI communicator (C) More... | |
void | Set_fcomm (void *comm) |
Set from a pointer to a real MPI communicator (FORTRAN) More... | |
void | Abort (int) |
Wrapper to MPI_Abort. More... | |
void | Barrier () const |
Wrapper to MPI_Barrier. More... | |
template<class T > | |
void | Sum (T *, int) |
Wrapper for MPI_Allreduce with MPI_SUM. More... | |
template<class T > | |
void | Allgatherv (const T *, int, T *, const int *, const int *) |
Wrapper for MPI_Allgatherv. More... | |
template<class T > | |
void | Allgather (const T *, int, T *, int) |
template<class T > | |
Request | Isend (const T *, int, int, int) |
template<class T > | |
void | Recv (T *, int, int, int, Status &) |
template<class T > | |
void | Recv (T *, int, int, int) |
template<class T > | |
void | Bcast (T *, int, int) |
void | Split (int, int, Communicator &) const |
Wrapper to MPI_Comm_split. More... | |
Static Public Member Functions | |
static bool | initialized () |
Tests if MPI library is initialized. More... | |
static Communicator & | Get_world () |
Returns MPI_COMM_WORLD if MPI is initialized, otherwise the default communicator. More... | |
Private Attributes | |
MPI_Comm | communicator |
Communicator. More... | |
Class containing wrappers to MPI.
All the MPI related stuff is relegated here.
Definition at line 44 of file Communicator.h.
PLMD::Communicator::Communicator | ( | ) |
Default constructor.
Definition at line 30 of file Communicator.cpp.
PLMD::Communicator::Communicator | ( | const Communicator & | pc | ) |
Copy constructor.
It effectively "clones" the communicator, providing a new one acting on the same group
Definition at line 37 of file Communicator.cpp.
|
virtual |
Destructor.
Definition at line 84 of file Communicator.cpp.
void PLMD::Communicator::Abort | ( | int | errorcode | ) |
Wrapper to MPI_Abort.
Definition at line 113 of file Communicator.cpp.
void PLMD::Communicator::Allgather | ( | const T * | sendbuf, |
int | sendcount, | ||
T * | recvbuf, | ||
int | recvcount | ||
) |
Definition at line 166 of file Communicator.h.
void PLMD::Communicator::Allgatherv | ( | const T * | sendbuf, |
int | sendcount, | ||
T * | recvbuf, | ||
const int * | recvcounts, | ||
const int * | displs | ||
) |
Wrapper for MPI_Allgatherv.
Definition at line 146 of file Communicator.h.
void PLMD::Communicator::Barrier | ( | ) | const |
Wrapper to MPI_Barrier.
Definition at line 124 of file Communicator.cpp.
void PLMD::Communicator::Bcast | ( | T * | b, |
int | count, | ||
int | root | ||
) |
Definition at line 134 of file Communicator.h.
MPI_Comm & PLMD::Communicator::Get_comm | ( | ) |
Reference to MPI communicator.
Definition at line 130 of file Communicator.cpp.
int PLMD::Communicator::Get_rank | ( | ) | const |
Obtain the rank of the present process.
Definition at line 48 of file Communicator.cpp.
int PLMD::Communicator::Get_size | ( | ) | const |
Obtain the number of processes.
Definition at line 65 of file Communicator.cpp.
|
static |
Returns MPI_COMM_WORLD if MPI is initialized, otherwise the default communicator.
Definition at line 56 of file Communicator.cpp.
|
static |
Tests if MPI library is initialized.
Definition at line 134 of file Communicator.cpp.
Communicator::Request PLMD::Communicator::Isend | ( | const T * | buf, |
int | count, | ||
int | source, | ||
int | tag | ||
) |
Definition at line 183 of file Communicator.h.
Communicator & PLMD::Communicator::operator= | ( | const Communicator & | pc | ) |
Assignment operator.
It effectively "clones" the communicator, providing a new one acting on the same group
Definition at line 41 of file Communicator.cpp.
void PLMD::Communicator::Recv | ( | T * | buf, |
int | count, | ||
int | source, | ||
int | tag, | ||
Status & | status | ||
) |
Definition at line 200 of file Communicator.h.
void PLMD::Communicator::Recv | ( | T * | buf, |
int | count, | ||
int | source, | ||
int | tag | ||
) |
Definition at line 215 of file Communicator.h.
void PLMD::Communicator::Set_comm | ( | MPI_Comm | c | ) |
Set from a real MPI communicator.
Definition at line 73 of file Communicator.cpp.
void PLMD::Communicator::Set_comm | ( | void * | comm | ) |
Set from a pointer to a real MPI communicator (C)
comm | Pointer to a C MPI communicator |
Definition at line 90 of file Communicator.cpp.
void PLMD::Communicator::Set_fcomm | ( | void * | comm | ) |
Set from a pointer to a real MPI communicator (FORTRAN)
comm | Pointer to a FORTRAN MPI communicator (INTEGER) |
Definition at line 100 of file Communicator.cpp.
void PLMD::Communicator::Split | ( | int | color, |
int | key, | ||
Communicator & | pc | ||
) | const |
Wrapper to MPI_Comm_split.
Definition at line 172 of file Communicator.cpp.
void PLMD::Communicator::Sum | ( | T * | b, |
int | count | ||
) |
Wrapper for MPI_Allreduce with MPI_SUM.
Definition at line 124 of file Communicator.h.
|
private |
Definition at line 46 of file Communicator.h.
Hosted by GitHub
![]() |
![]() |