|
mptensor v0.5.1
Parallel Library for Tensor Network Methods
|
Typedefs | |
| using | comm_type = MPI_Comm |
Functions | |
| void | initialize (int argc, char **argv) |
| True if the calling process is the root (rank 0), false otherwise. | |
| void | finalize () |
| Finalize MPI environment. | |
| void | barrier (const comm_type &comm) |
| Barrier synchronization among processes in the communicator. | |
| void | get_info (const comm_type &comm, int &rank, int &size, bool &is_root) |
| Get MPI information: rank, size, and whether the process is the root. | |
| template<typename C > | |
| C | allreduce_sum (C val, const MPI_Comm &comm) |
| Calculate a summation over MPI communicator. | |
| 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. | |
| template<typename C > | |
| void | allreduce (const C *sendbuf, C *recvbuf, int count, MPI_Op op, const MPI_Comm &comm) |
| Wrapper of MPI_Allreduce. | |
| template<typename C > | |
| void | sendrecv (const C *sendbuf, int sendcount, int dest, int sendtag, C *recvbuf, int recvcount, int source, int recvtag, const MPI_Comm &comm) |
| Wrapper of MPI_Sendrecv. | |
| template<typename C > | |
| void | sendrecv (const std::vector< C > &send_vec, int dest, int sendtag, std::vector< C > &recv_vec, int source, int recvtag, const MPI_Comm &comm) |
| Wrapper of MPI_Sendrecv for std::vector. | |
| template<typename C > | |
| void | alltoall (const C *sendbuf, int sendcount, C *recvbuf, int recvcount, const MPI_Comm &comm) |
| Wrapper of MPI_Alltoall. | |
| 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. | |
| template<typename C > | |
| void | bcast (C *buffer, int count, int root, const MPI_Comm &comm) |
| Wrapper of MPI_Bcast. | |
Variables | |
| int | rank = -1 |
| Type for MPI communicator. | |
| int | size = -1 |
| Rank of the calling process in the communicator. | |
| bool | is_root = false |
| Number of processes in the communicator. | |
| template<typename C > | |
| MPI_Datatype | mpi_datatype = MPI_DATATYPE_NULL |
| Template variable for MPI Datatype. | |
|
inline |
Wrapper of MPI_Allreduce.
| [in] | sendbuf | send buffer |
| [out] | recvbuf | receive buffer |
| [in] | count | the number in send buffer |
| [in] | op | Opreation |
| [in] | comm | MPI Communicator |
Calculate a summation over MPI communicator.
| [in] | val | value to be summed. |
| [in] | comm | MPI communicator. |
|
inline |
Calculate a summation of each element of vector over MPI communicator.
| [in] | vec | vector to be summed. |
| [in] | comm | MPI communicator. |
|
inline |
Wrapper of MPI_Alltoall.
| [in] | sendbuf | Starting address of send buffer. |
| [in] | sendcount | The number of elements to send. |
| [out] | recvbuf | Address of receive buffer. |
| [in] | recvcount | The number of elements to receive. |
| [in] | comm | Communicator over which data is to be exchanged. |
|
inline |
Wrapper of MPI_Alltoallv.
| [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. |
Barrier synchronization among processes in the communicator.
| comm | MPI communicator |
Wrapper of MPI_Bcast.
| buffer | Starting address of buffer. |
| count | Number of entries in buffer. |
| root | Rank of broadcast root. |
| comm | Communicator. |
| void mptensor::mpi::finalize | ( | ) |
Finalize MPI environment.
This function is registered to be called at exit by initialize().
Get MPI information: rank, size, and whether the process is the root.
| comm | MPI communicator |
| rank | Rank of the calling process in the communicator |
| size | Number of processes in the communicator |
| is_root | True if the calling process is the root (rank 0), false otherwise |
True if the calling process is the root (rank 0), false otherwise.
Initialize MPI environment and get MPI information
| argc | Number of command-line arguments |
| argv | Array of command-line arguments |
This function should be called before any MPI communication. It also registers the finalize function to be called at exit.
|
inline |
Wrapper of MPI_Sendrecv.
| [in] | sendbuf | send buffer |
| [in] | sendcount | the number of elements to send |
| [in] | dest | Rank of destination |
| [in] | sendtag | Send tag |
| [out] | recvbuf | receive buffer |
| [in] | recvcount | the number of elements to receive |
| [in] | source | Rank of source |
| [in] | recvtag | Receive tag |
| [in] | comm | MPI Communicator |
|
inline |
Wrapper of MPI_Sendrecv for std::vector.
| [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 Communicator |
|
inline |
Template variable for MPI Datatype.
| int mptensor::mpi::rank = -1 |
Type for MPI communicator.
| int mptensor::mpi::size = -1 |
Rank of the calling process in the communicator.