10 template< class T, class is_mpi_datatype_ = typename is_mpi_datatype<T>::type >
14 struct send<T, true_type>
16 void operator()(MPI_Comm comm,
int dest,
int tag,
const T& x)
const
19 typedef mpi_datatype<T> Datatype;
20 MPI_Send((
void*) Datatype::address(x),
25 (void) comm; (void) dest; (void) tag; (void) x;
26 DIY_UNSUPPORTED_MPI_CALL(MPI_Send);
32 template< class T, class is_mpi_datatype_ = typename is_mpi_datatype<T>::type >
36 struct recv<T, true_type>
38 status operator()(MPI_Comm comm,
int source,
int tag, T& x)
const
41 typedef mpi_datatype<T> Datatype;
43 MPI_Recv((
void*) Datatype::address(x),
46 source, tag, comm, &s.s);
49 (void) comm; (void) source; (void) tag; (void) x;
50 DIY_UNSUPPORTED_MPI_CALL(MPI_Recv);
56 struct recv<std::vector<U>, true_type>
58 status operator()(MPI_Comm comm,
int source,
int tag, std::vector<U>& x)
const
63 MPI_Probe(source, tag, comm, &s.s);
64 x.resize(s.count<U>());
65 MPI_Recv(&x[0], static_cast<int>(x.size()), get_mpi_datatype<U>(), source, tag, comm, &s.s);
68 (void) comm; (void) source; (void) tag; (void) x;
69 DIY_UNSUPPORTED_MPI_CALL(MPI_Recv);
75 template< class T, class is_mpi_datatype_ = typename is_mpi_datatype<T>::type >
79 struct isend<T, true_type>
81 request operator()(MPI_Comm comm,
int dest,
int tag,
const T& x)
const
85 typedef mpi_datatype<T> Datatype;
86 MPI_Isend((
void*) Datatype::address(x),
89 dest, tag, comm, &r.r);
92 (void) comm; (void) dest; (void) tag; (void) x;
93 DIY_UNSUPPORTED_MPI_CALL(MPI_Isend);
99 template< class T, class is_mpi_datatype_ = typename is_mpi_datatype<T>::type >
103 struct irecv<T, true_type>
105 request operator()(MPI_Comm comm,
int source,
int tag, T& x)
const
109 typedef mpi_datatype<T> Datatype;
110 MPI_Irecv(Datatype::address(x),
112 Datatype::datatype(),
113 source, tag, comm, &r.r);
116 (void) comm; (void) source; (void) tag; (void) x;
117 DIY_UNSUPPORTED_MPI_CALL(MPI_Irecv);