Wrappers of MPI library.
More...
|
template<typename C > |
C | allreduce_sum (C val, const MPI_Comm &comm) |
| Calculate a summation over MPI communicator. More...
|
|
template<typename C > |
std::vector< C > | allreduce_vec (const std::vector< C > &vec, const MPI_Comm &comm) |
| Calculate a summation of each element of vector over MPI communicator. More...
|
|
template<typename C > |
void | send_recv_vector (const std::vector< C > &send_vec, int dest, int sendtag, std::vector< C > &recv_vec, int source, int recvtag, const MPI_Comm &comm, MPI_Status &status) |
| Wrapper of MPI_Sendrecv. More...
|
|
template<typename C > |
void | alltoallv (const C *sendbuf, const int *sendcounts, const int *sdispls, C *recvbuf, const int *recvcounts, const int *rdispls, const MPI_Comm &comm) |
| Wrapper of MPI_Alltoallv. More...
|
|
template<typename C > |
void | bcast (C *buffer, int count, int root, const MPI_Comm &comm) |
| Wrapper of MPI_Bcast. More...
|
|
◆ allreduce_sum()
template<typename C >
C mptensor::mpi_wrapper::allreduce_sum |
( |
C |
val, |
|
|
const MPI_Comm & |
comm |
|
) |
| |
Calculate a summation over MPI communicator.
- Parameters
-
[in] | val | value to be summed. |
[in] | comm | MPI communicator. |
- Returns
- summation of val.
◆ allreduce_vec()
template<typename C >
std::vector<C> mptensor::mpi_wrapper::allreduce_vec |
( |
const std::vector< C > & |
vec, |
|
|
const MPI_Comm & |
comm |
|
) |
| |
Calculate a summation of each element of vector over MPI communicator.
- Parameters
-
[in] | vec | vector to be summed. |
[in] | comm | MPI communicator. |
- Returns
- resulted vector.
◆ alltoallv()
template<typename C >
void mptensor::mpi_wrapper::alltoallv |
( |
const C * |
sendbuf, |
|
|
const int * |
sendcounts, |
|
|
const int * |
sdispls, |
|
|
C * |
recvbuf, |
|
|
const int * |
recvcounts, |
|
|
const int * |
rdispls, |
|
|
const MPI_Comm & |
comm |
|
) |
| |
Wrapper of MPI_Alltoallv.
- Parameters
-
[in] | sendbuf | Starting address of send buffer. |
[in] | sendcounts | Integer array, where entry i specifies the number of elements to send to rank i. |
[in] | sdispls | Integer array, where entry i specifies the displacement (offset from sendbuf, in units of sendtype) from which to send data to rank i. |
[out] | recvbuf | Address of receive buffer. |
[in] | recvcounts | Integer array, where entry j specifies the number of elements to receive from rank j. |
[in] | rdispls | Integer array, where entry j specifies the displacement (offset from recvbuf, in units of recvtype) to which data from rank j should be written. |
[in] | comm | Communicator over which data is to be exchanged. |
◆ bcast()
template<typename C >
void mptensor::mpi_wrapper::bcast |
( |
C * |
buffer, |
|
|
int |
count, |
|
|
int |
root, |
|
|
const MPI_Comm & |
comm |
|
) |
| |
Wrapper of MPI_Bcast.
- Parameters
-
buffer | Starting address of buffer. |
count | Number of entries in buffer. |
root | Rank of broadcast root. |
comm | Communicator. |
◆ send_recv_vector()
template<typename C >
void mptensor::mpi_wrapper::send_recv_vector |
( |
const std::vector< C > & |
send_vec, |
|
|
int |
dest, |
|
|
int |
sendtag, |
|
|
std::vector< C > & |
recv_vec, |
|
|
int |
source, |
|
|
int |
recvtag, |
|
|
const MPI_Comm & |
comm, |
|
|
MPI_Status & |
status |
|
) |
| |
Wrapper of MPI_Sendrecv.
- Parameters
-
[in] | send_vec | send vector |
[in] | dest | Rank of destination |
[in] | sendtag | Send tag |
[out] | recv_vec | receive vector |
[in] | source | Rank of source |
[in] | recvtag | Receive tag |
[in] | comm | MPI Comunicator |
[out] | status | Status object |