12 comm_(comm) { MPI_Comm_rank(comm_, &rank_); MPI_Comm_size(comm_, &size_); }
14 int rank()
const {
return rank_; }
15 int size()
const {
return size_; }
24 void send(
int dest,
int tag,
const T& x)
const { detail::send<T>()(comm_, dest, tag, x); }
29 status recv(
int source,
int tag, T& x)
const {
return detail::recv<T>()(comm_, source, tag, x); }
33 request isend(
int dest,
int tag,
const T& x)
const {
return detail::isend<T>()(comm_, dest, tag, x); }
38 request irecv(
int source,
int tag, T& x)
const {
return detail::irecv<T>()(comm_, source, tag, x); }
41 status probe(
int source,
int tag)
const {
status s; MPI_Probe(source, tag, comm_, &s.s);
return s; }
46 iprobe(
int source,
int tag)
const;
49 void barrier()
const { MPI_Barrier(comm_); }
51 operator MPI_Comm()
const {
return comm_; }
67 MPI_Iprobe(source, tag, comm_, &flag, &s.s);
request isend(int dest, int tag, const T &x) const
Non-blocking version of send().
Definition: communicator.hpp:33
Simple wrapper around MPI_Comm.
Definition: communicator.hpp:8
request irecv(int source, int tag, T &x) const
Non-blocking version of recv(). If T is an std::vector<...>, its size must be big enough to accomodat...
Definition: communicator.hpp:38
void barrier() const
barrier
Definition: communicator.hpp:49
status recv(int source, int tag, T &x) const
Receive x from dest using tag (blocking). If T is an std::vector<...>, recv will resize it to fit exa...
Definition: communicator.hpp:29
optional< status > iprobe(int source, int tag) const
iprobe
Definition: communicator.hpp:63
Definition: optional.hpp:6
Definition: request.hpp:5
void send(int dest, int tag, const T &x) const
Send x to processor dest using tag (blocking).
Definition: communicator.hpp:24
status probe(int source, int tag) const
probe
Definition: communicator.hpp:41