Class containing wrappers to MPI. More...
#include <Communicator.h>

Classes | |
| struct | ConstData |
| Const version of Communicator::Data See Communicator::Data documentation. More... | |
| struct | Data |
| Structure defining a buffer for MPI. More... | |
| class | Request |
| Wrapper class for MPI_Request. More... | |
| class | Status |
| Wrapper class for MPI_Status. More... | |
Public Member Functions | |
| Communicator () | |
| Default constructor. | |
| Communicator (const Communicator &) | |
| Copy constructor. | |
| virtual | ~Communicator () |
| Destructor. | |
| void | Abort (int code) |
| Wrapper to MPI_Abort. | |
| template<class T, class S> | |
| void | Allgather (const T &sendbuf, S &recvbuf) |
| Wrapper for MPI_Allgatherv (reference) | |
| template<class T, class S> | |
| void | Allgather (const T *sendbuf, int sendcount, S *recvbuf, int recvcount) |
| Wrapper for MPI_Allgatherv (pointer) | |
| void | Allgather (ConstData in, Data out) |
| Wrapper for MPI_Allgather (data struct) | |
| template<class T, class S> | |
| void | Allgatherv (const T &sendbuf, S &recvbuf, const int *recvcounts, const int *displs) |
| Wrapper for MPI_Allgatherv (reference) | |
| template<class T, class S> | |
| void | Allgatherv (const T *sendbuf, int sendcount, S *recvbuf, const int *recvcounts, const int *displs) |
| Wrapper for MPI_Allgatherv (pointer) | |
| void | Allgatherv (ConstData in, Data out, const int *, const int *) |
| Wrapper for MPI_Allgatherv (data struct) | |
| void | Barrier () const |
| Wrapper to MPI_Barrier. | |
| void | Bcast (Data, int) |
| Wrapper for MPI_Bcast (data struct) | |
| template<class T> | |
| void | Bcast (T &buf, int root) |
| Wrapper for MPI_Bcast (reference) | |
| template<class T> | |
| void | Bcast (T *buf, int count, int root) |
| Wrapper for MPI_Bcast (pointer) | |
| template<class T, class S> | |
| void | Gather (const T &sendbuf, int sendcount, S &recvbuf, int recvcount, int root) |
| Wrapper for MPI_Gather (reference) | |
| template<class T, class S> | |
| void | Gather (const T *sendbuf, int sendcount, S *recvbuf, int recvcount, int root) |
| Wrapper for MPI_Gather (pointer) | |
| void | Gather (ConstData sendbuf, int sendcount, Data recvbuf, int recvcount, int root) |
| Wrapper for MPI_Gather (data struct) | |
| MPI_Comm & | Get_comm () |
| Reference to MPI communicator. | |
| int | Get_rank () const |
| Obtain the rank of the present process. | |
| int | Get_size () const |
| Obtain the number of processes. | |
| template<class T> | |
| Request | Isend (const T &buf, int source, int tag) |
| Wrapper for MPI_Isend (reference) | |
| template<class T> | |
| Request | Isend (const T *buf, int count, int source, int tag) |
| Wrapper for MPI_Isend (pointer) | |
| Request | Isend (ConstData, int, int) |
| Wrapper for MPI_Isend (data struct) | |
| bool | isStandIn () const |
| True if this communicator has been marked as a stand-in with setStandIn(). | |
| void | Max (Data) |
| Wrapper for MPI_Allreduce with MPI_MAX (data struct) | |
| template<class T> | |
| void | Max (T &buf) |
| Wrapper for MPI_Allreduce with MPI_MAX (reference) | |
| template<class T> | |
| void | Max (T *buf, int count) |
| Wrapper for MPI_Allreduce with MPI_MAX (pointer) | |
| void | Min (Data) |
| Wrapper for MPI_Allreduce with MPI_MIN (data struct) | |
| template<class T> | |
| void | Min (T &buf) |
| Wrapper for MPI_Allreduce with MPI_MIN (reference) | |
| template<class T> | |
| void | Min (T *buf, int count) |
| Wrapper for MPI_Allreduce with MPI_MIN (pointer) | |
| Communicator & | operator= (const Communicator &) |
| Assignment operator. | |
| void | Prod (Data) |
| Wrapper for MPI_Allreduce with MPI_PROD (data struct) | |
| template<class T> | |
| void | Prod (T &buf) |
| Wrapper for MPI_Allreduce with MPI_PROD (reference) | |
| template<class T> | |
| void | Prod (T *buf, int count) |
| Wrapper for MPI_Allreduce with MPI_PROD (pointer) | |
| void | Recv (Data, int, int, Status &s=StatusIgnore) |
| Wrapper for MPI_Recv (data struct) | |
| template<class T> | |
| void | Recv (T &buf, int source, int tag, Status &s=StatusIgnore) |
| Wrapper for MPI_Recv (reference) | |
| template<class T> | |
| void | Recv (T *buf, int count, int source, int tag, Status &s=StatusIgnore) |
| Wrapper for MPI_Recv (pointer) | |
| template<class T, class S> | |
| void | Scatter (const T &sendbuf, int sendcount, S &recvbuf, int recvcount, int root) |
| Wrapper for MPI_Scatter (reference) | |
| template<class T, class S> | |
| void | Scatter (const T *sendbuf, int sendcount, S *recvbuf, int recvcount, int root) |
| Wrapper for MPI_Scatter (pointer) | |
| void | Scatter (ConstData sendbuf, int sendcount, Data recvbuf, int recvcount, int root) |
| Wrapper for MPI_Scatter (data struct) | |
| void | Set_comm (const TypesafePtr &comm) |
| Set from a pointer to a real MPI communicator (C). | |
| void | Set_comm (MPI_Comm comm) |
| Set from a real MPI communicator. | |
| void | Set_fcomm (const TypesafePtr &comm) |
| Set from a pointer to a real MPI communicator (FORTRAN). | |
| void | setStandIn (bool s) |
| Mark this communicator as a stand-in on this process. | |
| void | Split (int, int, Communicator &) const |
| Wrapper to MPI_Comm_split. | |
| void | Sum (Data) |
| Wrapper for MPI_Allreduce with MPI_SUM (data struct) | |
| template<class T> | |
| void | Sum (T &buf) |
| Wrapper for MPI_Allreduce with MPI_SUM (reference) | |
| template<class T> | |
| void | Sum (T *buf, int count) |
| Wrapper for MPI_Allreduce with MPI_SUM (pointer) | |
Static Public Member Functions | |
| static bool | initialized () |
| Tests if MPI library is initialized. | |
| static bool | plumedHasMPI () |
| Runtime acces to the __PLUMED_HAS_MPI definition. | |
Static Public Attributes | |
| static Status | StatusIgnore |
| Special status used when status should be ignored. | |
Private Member Functions | |
| void | checkNotStandIn () const |
| In debug builds, raise an error if this communicator is a stand-in. | |
Static Private Member Functions | |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<> | |
| MPI_Datatype | getMPIType () |
| template<class T> | |
| static MPI_Datatype | getMPIType () |
| Function returning the MPI type. | |
Private Attributes | |
| MPI_Comm | communicator |
| Communicator. | |
| bool | standIn =false |
| True if this process holds the communicator only as a stand-in. | |
Class containing wrappers to MPI.
All the MPI related stuff is relegated here.
| PLMD::Communicator::Communicator | ( | ) |
Default constructor.
| PLMD::Communicator::Communicator | ( | const Communicator & | pc | ) |
Copy constructor.
It effectively "clones" the communicator, providing a new one acting on the same group
|
virtual |
Destructor.
| void PLMD::Communicator::Abort | ( | int | code | ) |
Wrapper to MPI_Abort.
| code | Error code |
|
inline |
Wrapper for MPI_Allgatherv (reference)
|
inline |
Wrapper for MPI_Allgatherv (pointer)
Wrapper for MPI_Allgather (data struct)
|
inline |
Wrapper for MPI_Allgatherv (reference)
|
inline |
Wrapper for MPI_Allgatherv (pointer)
| void PLMD::Communicator::Allgatherv | ( | ConstData | in, |
| Data | out, | ||
| const int * | recvcounts, | ||
| const int * | displs ) |
Wrapper for MPI_Allgatherv (data struct)
| void PLMD::Communicator::Barrier | ( | ) | const |
Wrapper to MPI_Barrier.
| void PLMD::Communicator::Bcast | ( | Data | data, |
| int | root ) |
Wrapper for MPI_Bcast (data struct)
|
inline |
Wrapper for MPI_Bcast (reference)
|
inline |
Wrapper for MPI_Bcast (pointer)
|
private |
In debug builds, raise an error if this communicator is a stand-in.
|
inline |
Wrapper for MPI_Gather (reference)
|
inline |
Wrapper for MPI_Gather (pointer)
| void PLMD::Communicator::Gather | ( | ConstData | sendbuf, |
| int | sendcount, | ||
| Data | recvbuf, | ||
| int | recvcount, | ||
| int | root ) |
Wrapper for MPI_Gather (data struct)
| MPI_Comm & PLMD::Communicator::Get_comm | ( | ) |
Reference to MPI communicator.
| int PLMD::Communicator::Get_rank | ( | ) | const |
Obtain the rank of the present process.
| int PLMD::Communicator::Get_size | ( | ) | const |
Obtain the number of processes.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
Function returning the MPI type.
You can use it to access to the MPI type of a C++ type, e.g. MPI_Datatype type=getMPIType<double>();
|
static |
Tests if MPI library is initialized.
|
inline |
Wrapper for MPI_Isend (reference)
|
inline |
Wrapper for MPI_Isend (pointer)
| Communicator::Request PLMD::Communicator::Isend | ( | ConstData | data, |
| int | source, | ||
| int | tag ) |
Wrapper for MPI_Isend (data struct)
| bool PLMD::Communicator::isStandIn | ( | ) | const |
True if this communicator has been marked as a stand-in with setStandIn().
| void PLMD::Communicator::Max | ( | Data | data | ) |
Wrapper for MPI_Allreduce with MPI_MAX (data struct)
|
inline |
Wrapper for MPI_Allreduce with MPI_MAX (reference)
|
inline |
Wrapper for MPI_Allreduce with MPI_MAX (pointer)
| void PLMD::Communicator::Min | ( | Data | data | ) |
Wrapper for MPI_Allreduce with MPI_MIN (data struct)
|
inline |
Wrapper for MPI_Allreduce with MPI_MIN (reference)
|
inline |
Wrapper for MPI_Allreduce with MPI_MIN (pointer)
| Communicator & PLMD::Communicator::operator= | ( | const Communicator & | pc | ) |
Assignment operator.
It effectively "clones" the communicator, providing a new one acting on the same group
|
static |
Runtime acces to the __PLUMED_HAS_MPI definition.
| void PLMD::Communicator::Prod | ( | Data | data | ) |
Wrapper for MPI_Allreduce with MPI_PROD (data struct)
|
inline |
Wrapper for MPI_Allreduce with MPI_PROD (reference)
|
inline |
Wrapper for MPI_Allreduce with MPI_PROD (pointer)
| void PLMD::Communicator::Recv | ( | Data | data, |
| int | source, | ||
| int | tag, | ||
| Status & | s = StatusIgnore ) |
Wrapper for MPI_Recv (data struct)
|
inline |
Wrapper for MPI_Recv (reference)
|
inline |
Wrapper for MPI_Recv (pointer)
|
inline |
Wrapper for MPI_Scatter (reference)
|
inline |
Wrapper for MPI_Scatter (pointer)
| void PLMD::Communicator::Scatter | ( | ConstData | sendbuf, |
| int | sendcount, | ||
| Data | recvbuf, | ||
| int | recvcount, | ||
| int | root ) |
Wrapper for MPI_Scatter (data struct)
| void PLMD::Communicator::Set_comm | ( | const TypesafePtr & | comm | ) |
Set from a pointer to a real MPI communicator (C).
| comm | Pointer to a C MPI communicator |
| void PLMD::Communicator::Set_comm | ( | MPI_Comm | comm | ) |
Set from a real MPI communicator.
| comm | MPI communicator |
| void PLMD::Communicator::Set_fcomm | ( | const TypesafePtr & | comm | ) |
Set from a pointer to a real MPI communicator (FORTRAN).
| comm | Pointer to a FORTRAN MPI communicator (INTEGER) |
| void PLMD::Communicator::setStandIn | ( | bool | s | ) |
Mark this communicator as a stand-in on this process.
A stand-in is a communicator that other processes were given but this process was not, so it does not connect this process to the processes it is meant to connect. This is the case of PLMD::Action::multi_sim_comm on all the processes of a replica except the first one. In debug builds, using a stand-in (asking its rank or size, or communicating over it) raises an error. Set_comm() clears the mark.
| void PLMD::Communicator::Split | ( | int | color, |
| int | key, | ||
| Communicator & | pc ) const |
Wrapper to MPI_Comm_split.
| void PLMD::Communicator::Sum | ( | Data | data | ) |
Wrapper for MPI_Allreduce with MPI_SUM (data struct)
|
inline |
Wrapper for MPI_Allreduce with MPI_SUM (reference)
|
inline |
Wrapper for MPI_Allreduce with MPI_SUM (pointer)
|
private |
|
private |
True if this process holds the communicator only as a stand-in.
See setStandIn().
|
static |
Special status used when status should be ignored.
E.g. Recv(a,0,1,Communicator::StatusIgnore); Notice that this is the default for Recv, so this is equivalent to Recv(a,0,1);
Hosted by GitHub
|
1.13.2
|