1 #ifndef _RHEO_MPI_SCATTER_BEGIN_H
2 #define _RHEO_MPI_SCATTER_BEGIN_H
24 # include "rheolef/msg_right_permutation_apply.h"
25 # include "rheolef/msg_both_permutation_apply.h"
78 from.requests.clear();
80 size_type n_receive = from.starts().size() - 1;
82 for (
size_type i = 0; i < n_receive; i++) {
83 size_type i_size = from.starts() [i+1] - from.starts() [i];
84 mpi::request i_req = comm.irecv(
87 from.values().begin().operator->() + i_start,
90 from.requests.push_back (std::make_pair(i, i_req));
103 size_type n_send = to.starts().size() - 1;
106 size_type i_size = to.starts() [i+1] - to.starts() [i];
107 mpi::request i_req = comm.isend(
110 to.values().begin().operator->() + i_start,
113 to.requests.push_back (std::make_pair(i, i_req));
119 class OutputIterator,
132 to.local_slots.begin(),
133 to.local_slots.end(),
136 from.local_slots.begin(),
143 class OutputIterator,
155 if (y == x && ! to.local_nonmatching_computed) {
157 fatal_macro (
"y == x: adress matches in scatter: not yet -- sorry");
159 if (to.local_is_copy) {
161 std::copy(x + to.local_copy_start,
162 x + to.local_copy_start + to.local_copy_length,
163 y + from.local_copy_start);
165 }
else if (y != x || ! to.local_nonmatching_computed) {
168 to.local_slots.begin(),
169 to.local_slots.end(),
172 from.local_slots.begin(),
178 to.local_slots_nonmatching.begin(),
179 to.local_slots_nonmatching.end(),
182 from.local_slots_nonmatching.begin(),
189 class OutputIterator,
206 if (to.n_local() == 0) {
214 #endif // _RHEO_MPI_SCATTER_BEGIN_H