1 /* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "smpi_coll.hpp"
8 #include "smpi_comm.hpp"
9 #include "smpi_request.hpp"
10 #include "smpi_datatype_derived.hpp"
11 #include "smpi_op.hpp"
12 #include "src/smpi/include/smpi_actor.hpp"
14 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
16 #define CHECK_ARGS(test, errcode, ...) \
18 XBT_WARN(__VA_ARGS__); \
22 static const void* smpi_get_in_place_buf(const void* inplacebuf, const void* otherbuf,std::unique_ptr<unsigned char[]>& tmp_sendbuf, int count, MPI_Datatype datatype){
23 if (inplacebuf == MPI_IN_PLACE) {
24 tmp_sendbuf.reset(new unsigned char[count * datatype->get_extent()]);
25 simgrid::smpi::Datatype::copy(otherbuf, count, datatype, tmp_sendbuf.get(), count, datatype);
26 return tmp_sendbuf.get();
31 /* PMPI User level calls */
33 int PMPI_Barrier(MPI_Comm comm)
35 return PMPI_Ibarrier(comm, MPI_REQUEST_IGNORED);
38 int PMPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
40 if (comm == MPI_COMM_NULL)
42 if (request == nullptr)
46 int rank = simgrid::s4u::this_actor::get_pid();
47 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Barrier" : "PMPI_Ibarrier",
48 new simgrid::instr::NoOpTIData(request == MPI_REQUEST_IGNORED ? "barrier" : "ibarrier"));
49 if (request == MPI_REQUEST_IGNORED) {
50 simgrid::smpi::colls::barrier(comm);
51 // Barrier can be used to synchronize RMA calls. Finish all requests from comm before.
52 comm->finish_rma_calls();
54 simgrid::smpi::colls::ibarrier(comm, request);
56 TRACE_smpi_comm_out(rank);
61 int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
63 return PMPI_Ibcast(buf, count, datatype, root, comm, MPI_REQUEST_IGNORED);
66 int PMPI_Ibcast(void *buf, int count, MPI_Datatype datatype,
67 int root, MPI_Comm comm, MPI_Request* request)
69 if (comm == MPI_COMM_NULL)
71 if (buf == nullptr && count > 0)
72 return MPI_ERR_BUFFER;
73 if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
77 if (root < 0 || root >= comm->size())
79 if (request == nullptr)
83 int rank = simgrid::s4u::this_actor::get_pid();
84 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Bcast" : "PMPI_Ibcast",
85 new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "bcast" : "ibcast", root, -1.0,
86 datatype->is_replayable() ? count : count * datatype->size(), -1,
87 simgrid::smpi::Datatype::encode(datatype), ""));
88 if (comm->size() > 1) {
89 if (request == MPI_REQUEST_IGNORED)
90 simgrid::smpi::colls::bcast(buf, count, datatype, root, comm);
92 simgrid::smpi::colls::ibcast(buf, count, datatype, root, comm, request);
94 if (request != MPI_REQUEST_IGNORED)
95 *request = MPI_REQUEST_NULL;
98 TRACE_smpi_comm_out(rank);
103 int PMPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,
104 int root, MPI_Comm comm){
105 return PMPI_Igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
108 int PMPI_Igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
109 MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
111 if (comm == MPI_COMM_NULL)
113 if ((sendbuf == nullptr && sendcount > 0) || ((comm->rank() == root) && recvbuf == nullptr && recvcount > 0))
114 return MPI_ERR_BUFFER;
115 if (((sendbuf != MPI_IN_PLACE && sendcount > 0) && (sendtype == MPI_DATATYPE_NULL)) ||
116 ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL)))
118 if (((sendbuf != MPI_IN_PLACE) && (sendcount < 0)) || ((comm->rank() == root) && (recvcount < 0)))
119 return MPI_ERR_COUNT;
120 if (root < 0 || root >= comm->size())
122 if (request == nullptr)
126 const void* real_sendbuf = sendbuf;
127 int real_sendcount = sendcount;
128 MPI_Datatype real_sendtype = sendtype;
129 if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) {
131 real_sendtype = recvtype;
133 int rank = simgrid::s4u::this_actor::get_pid();
135 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Gather" : "PMPI_Igather",
136 new simgrid::instr::CollTIData(
137 request == MPI_REQUEST_IGNORED ? "gather" : "igather", root, -1.0,
138 real_sendtype->is_replayable() ? real_sendcount : real_sendcount * real_sendtype->size(),
139 (comm->rank() != root || recvtype->is_replayable()) ? recvcount : recvcount * recvtype->size(),
140 simgrid::smpi::Datatype::encode(real_sendtype), simgrid::smpi::Datatype::encode(recvtype)));
141 if (request == MPI_REQUEST_IGNORED)
142 simgrid::smpi::colls::gather(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype, root, comm);
144 simgrid::smpi::colls::igather(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype, root, comm,
147 TRACE_smpi_comm_out(rank);
152 int PMPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,
153 MPI_Datatype recvtype, int root, MPI_Comm comm){
154 return PMPI_Igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, MPI_REQUEST_IGNORED);
157 int PMPI_Igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs,
158 MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
160 if (comm == MPI_COMM_NULL)
162 if ((sendbuf == nullptr && sendcount > 0) || ((comm->rank() == root) && recvbuf == nullptr))
163 return MPI_ERR_BUFFER;
164 if (((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
165 ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL)))
167 if ((sendbuf != MPI_IN_PLACE) && (sendcount < 0))
168 return MPI_ERR_COUNT;
169 if ((comm->rank() == root) && (recvcounts == nullptr || displs == nullptr))
171 if (root < 0 || root >= comm->size())
173 if (request == nullptr)
176 for (int i = 0; i < comm->size(); i++) {
177 if ((comm->rank() == root) && (recvcounts[i] < 0))
178 return MPI_ERR_COUNT;
182 const void* real_sendbuf = sendbuf;
183 int real_sendcount = sendcount;
184 MPI_Datatype real_sendtype = sendtype;
185 if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) {
187 real_sendtype = recvtype;
190 int rank = simgrid::s4u::this_actor::get_pid();
191 int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size();
193 std::vector<int>* trace_recvcounts = new std::vector<int>;
194 if (comm->rank() == root) {
195 for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
196 trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
199 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Gatherv" : "PMPI_Igatherv",
200 new simgrid::instr::VarCollTIData(
201 request == MPI_REQUEST_IGNORED ? "gatherv" : "igatherv", root,
202 real_sendtype->is_replayable() ? real_sendcount : real_sendcount * real_sendtype->size(),
203 nullptr, dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(real_sendtype),
204 simgrid::smpi::Datatype::encode(recvtype)));
205 if (request == MPI_REQUEST_IGNORED)
206 simgrid::smpi::colls::gatherv(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcounts, displs, recvtype,
209 simgrid::smpi::colls::igatherv(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcounts, displs, recvtype,
210 root, comm, request);
212 TRACE_smpi_comm_out(rank);
217 int PMPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
218 void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm){
219 return PMPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, MPI_REQUEST_IGNORED);
222 int PMPI_Iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
223 MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
225 CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM,
226 "(I)Allgather: the communicator cannot be MPI_COMM_NULL");
227 CHECK_ARGS(recvbuf == nullptr && recvcount > 0, MPI_ERR_BUFFER,
228 "(I)Allgather: param 4 recvbuf cannot be NULL");
229 CHECK_ARGS(sendbuf == nullptr && sendcount > 0, MPI_ERR_BUFFER,
230 "(I)Allgather: param 1 sendbuf cannot be NULL when sendcount > 0");
231 CHECK_ARGS((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,
232 "(I)Allgather: param 3 sendtype cannot be MPI_DATATYPE_NULL when sendbuff is not MPI_IN_PLACE");
233 CHECK_ARGS(recvtype == MPI_DATATYPE_NULL, MPI_ERR_TYPE,
234 "(I)Allgather: param 6 recvtype cannot be MPI_DATATYPE_NULL");
235 CHECK_ARGS(recvcount < 0, MPI_ERR_COUNT,
236 "(I)Allgather: param 5 recvcount cannot be negative");
237 CHECK_ARGS((sendbuf != MPI_IN_PLACE) && (sendcount < 0), MPI_ERR_COUNT,
238 "(I)Allgather: param 2 sendcount cannot be negative when sendbuf is not MPI_IN_PLACE");
239 CHECK_ARGS(request == nullptr, MPI_ERR_ARG,
240 "Iallgather: param 8 request cannot be NULL");
243 if (sendbuf == MPI_IN_PLACE) {
244 sendbuf = static_cast<char*>(recvbuf) + recvtype->get_extent() * recvcount * comm->rank();
245 sendcount = recvcount;
248 int rank = simgrid::s4u::this_actor::get_pid();
250 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Allgather" : "PMPI_Iallggather",
251 new simgrid::instr::CollTIData(
252 request == MPI_REQUEST_IGNORED ? "allgather" : "iallgather", -1, -1.0,
253 sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
254 recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
255 simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
256 if (request == MPI_REQUEST_IGNORED)
257 simgrid::smpi::colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
259 simgrid::smpi::colls::iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request);
261 TRACE_smpi_comm_out(rank);
266 int PMPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
267 void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm){
268 return PMPI_Iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, MPI_REQUEST_IGNORED);
271 int PMPI_Iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs,
272 MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
274 CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM,
275 "(I)Allgatherv: the communicator cannot be MPI_COMM_NULL");
276 CHECK_ARGS(sendbuf == nullptr && sendcount > 0, MPI_ERR_BUFFER,
277 "(I)Allgatherv: param 1 sendbuf cannot be NULL when sendcount > 0");
278 CHECK_ARGS((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,
279 "(I)Allgatherv: param 3 sendtype cannot be MPI_DATATYPE_NULL when sendbuff is not MPI_IN_PLACE");
280 CHECK_ARGS(recvtype == MPI_DATATYPE_NULL, MPI_ERR_TYPE,
281 "(I)Allgatherv: param 7 recvtype cannot be MPI_DATATYPE_NULL");
282 CHECK_ARGS(recvcounts == nullptr, MPI_ERR_COUNT,
283 "(I)Allgatherv: param 5 recvcounts cannot be null");
284 CHECK_ARGS(displs == nullptr, MPI_ERR_ARG,
285 "(I)Allgatherv: param 6 displs cannot be null");
286 CHECK_ARGS((sendbuf != MPI_IN_PLACE) && (sendcount < 0), MPI_ERR_COUNT,
287 "(I)Allgatherv: param 2 sendcount cannot be negative when sendbuf is not MPI_IN_PLACE");
288 CHECK_ARGS(request == nullptr, MPI_ERR_ARG,
289 "Iallgatherv: param 9 request cannot be NULL");
291 for (int i = 0; i < comm->size(); i++) {
292 if (recvcounts[i] < 0)
293 return MPI_ERR_COUNT;
294 else if (recvcounts[i] > 0 && recvbuf == nullptr)
295 return MPI_ERR_BUFFER;
299 if (sendbuf == MPI_IN_PLACE) {
300 sendbuf = static_cast<char*>(recvbuf) + recvtype->get_extent() * displs[comm->rank()];
301 sendcount = recvcounts[comm->rank()];
304 int rank = simgrid::s4u::this_actor::get_pid();
305 int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size();
307 std::vector<int>* trace_recvcounts = new std::vector<int>;
308 for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free
309 trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
313 rank, request == MPI_REQUEST_IGNORED ? "PMPI_Allgatherv" : "PMPI_Iallgatherv",
314 new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "allgatherv" : "iallgatherv", -1,
315 sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(), nullptr,
316 dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
317 simgrid::smpi::Datatype::encode(recvtype)));
318 if (request == MPI_REQUEST_IGNORED)
319 simgrid::smpi::colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
321 simgrid::smpi::colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm,
324 TRACE_smpi_comm_out(rank);
329 int PMPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
330 void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm){
331 return PMPI_Iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
334 int PMPI_Iscatter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
335 MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
337 CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM,
338 "(I)Scatter: the communicator cannot be MPI_COMM_NULL");
339 CHECK_ARGS(recvbuf == nullptr && recvcount > 0, MPI_ERR_BUFFER,
340 "(I)Scatter: param 4 recvbuf cannot be NULL");
341 CHECK_ARGS(((sendbuf == recvbuf) || ((comm->rank() == root) && sendcount > 0 && (sendbuf == nullptr))), MPI_ERR_BUFFER,
342 "(I)Scatter: param 1 sendbuf cannot be NULL when sendcount > 0");
343 CHECK_ARGS(((comm->rank() == root) && (sendtype == MPI_DATATYPE_NULL || not sendtype->is_valid())), MPI_ERR_TYPE,
344 "(I)Scatter: param 3 sendtype cannot be MPI_DATATYPE_NULL or invalid on root");
345 CHECK_ARGS(((recvbuf != MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL || not recvtype->is_valid())), MPI_ERR_TYPE,
346 "(I)Scatter: param 6 recvtype cannot be MPI_DATATYPE_NULL or invalid when recvbuf is not MPI_IN_PLACE");
347 CHECK_ARGS(((comm->rank() == root) && (sendcount < 0)), MPI_ERR_COUNT,
348 "(I)Scatter: param 2 sendcount cannot be negative");
349 CHECK_ARGS(((recvbuf != MPI_IN_PLACE) && (recvcount < 0)), MPI_ERR_COUNT,
350 "(I)Scatter: param 5 recvcount cannot be negative");
351 CHECK_ARGS(root < 0, MPI_ERR_ROOT,
352 "(I)Scatter: root cannot be negative");
353 CHECK_ARGS(root >= comm->size(), MPI_ERR_ROOT,
354 "(I)Scatter: root (=%d) is larger than communicator size (=%d)", root,
356 CHECK_ARGS(request == nullptr, MPI_ERR_ARG,
357 "Iscatter: param 9 request cannot be NULL");
360 if (recvbuf == MPI_IN_PLACE) {
362 recvcount = sendcount;
364 int rank = simgrid::s4u::this_actor::get_pid();
366 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Scatter" : "PMPI_Iscatter",
367 new simgrid::instr::CollTIData(
368 request == MPI_REQUEST_IGNORED ? "scatter" : "iscatter", root, -1.0,
369 (comm->rank() != root || sendtype->is_replayable()) ? sendcount : sendcount * sendtype->size(),
370 recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
371 simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
372 if (request == MPI_REQUEST_IGNORED)
373 simgrid::smpi::colls::scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
375 simgrid::smpi::colls::iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request);
377 TRACE_smpi_comm_out(rank);
382 int PMPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
383 MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm){
384 return PMPI_Iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
387 int PMPI_Iscatterv(const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount,
388 MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
390 CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM,
391 "(I)Scatterv: the communicator cannot be MPI_COMM_NULL");
392 CHECK_ARGS((comm->rank() == root) && (sendcounts == nullptr), MPI_ERR_ARG,
393 "(I)Scatterv: param 2 sendcounts cannot be NULL on the root rank");
394 CHECK_ARGS((comm->rank() == root) && (displs == nullptr), MPI_ERR_ARG,
395 "(I)Scatterv: param 3 displs cannot be NULL on the root rank");
396 CHECK_ARGS((comm->rank() == root) && (sendtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,
397 "(I)Scatterv: The sendtype cannot be NULL on the root rank");
398 CHECK_ARGS((recvbuf != MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,
399 "(I)Scatterv: the recvtype cannot be NULL when not receiving in place");
400 CHECK_ARGS(request == nullptr, MPI_ERR_ARG,
401 "Iscatterv: param 10 request cannot be NULL");
402 CHECK_ARGS(recvbuf != MPI_IN_PLACE && recvcount < 0, MPI_ERR_COUNT,
403 "(I)Scatterv: When not receiving in place, the recvcount cannot be negative");
404 CHECK_ARGS(root < 0, MPI_ERR_ROOT,
405 "(I)Scatterv: root cannot be negative");
406 CHECK_ARGS(root >= comm->size(), MPI_ERR_ROOT,
407 "(I)Scatterv: root (=%d) is larger than communicator size (=%d)", root,
410 if (comm->rank() == root) {
411 if (recvbuf == MPI_IN_PLACE) {
413 recvcount = sendcounts[comm->rank()];
415 for (int i = 0; i < comm->size(); i++)
416 CHECK_ARGS(sendcounts[i] < 0, MPI_ERR_COUNT, "Iscatterv: sendcounts[%d]=%d but this cannot be negative", i,
422 int rank = simgrid::s4u::this_actor::get_pid();
423 int dt_size_send = sendtype->is_replayable() ? 1 : sendtype->size();
425 std::vector<int>* trace_sendcounts = new std::vector<int>;
426 if (comm->rank() == root) {
427 for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free
428 trace_sendcounts->push_back(sendcounts[i] * dt_size_send);
432 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Scatterv" : "PMPI_Iscatterv",
433 new simgrid::instr::VarCollTIData(
434 request == MPI_REQUEST_IGNORED ? "scatterv" : "iscatterv", root, dt_size_send,
435 trace_sendcounts, recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
436 nullptr, simgrid::smpi::Datatype::encode(sendtype),
437 simgrid::smpi::Datatype::encode(recvtype)));
438 if (request == MPI_REQUEST_IGNORED)
439 simgrid::smpi::colls::scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
441 simgrid::smpi::colls::iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm,
444 TRACE_smpi_comm_out(rank);
449 int PMPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
451 return PMPI_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, MPI_REQUEST_IGNORED);
454 int PMPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* request)
456 CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM,
457 "(I)Reduce: the communicator cannot be MPI_COMM_NULL");
458 CHECK_ARGS(((comm->rank() == root) && recvbuf == nullptr), MPI_ERR_BUFFER,
459 "(I)Reduce: param 2 recvbuf cannot be NULL");
460 CHECK_ARGS((sendbuf == nullptr && count > 0), MPI_ERR_BUFFER,
461 "(I)Reduce: param 1 sendbuf cannot be NULL when count > 0");
462 CHECK_ARGS((datatype == MPI_DATATYPE_NULL || not datatype->is_valid()), MPI_ERR_TYPE,
463 "(I)Reduce: param 4 datatype cannot be MPI_DATATYPE_NULL or invalid");
464 CHECK_ARGS(count < 0, MPI_ERR_COUNT,
465 "(I)Reduce: param 3 count cannot be negative");
466 CHECK_ARGS(request == nullptr, MPI_ERR_ARG,
467 "Ireduce: param 8 request cannot be NULL");
468 CHECK_ARGS(op == MPI_OP_NULL, MPI_ERR_OP,
469 "(I)Reduce: param 5 op cannot be MPI_OP_NULL");
470 CHECK_ARGS(root < 0, MPI_ERR_ROOT,
471 "(I)Reduce: root cannot be negative");
472 CHECK_ARGS(root >= comm->size(), MPI_ERR_ROOT,
473 "(I)Reduce: root (=%d) is larger than communicator size (=%d)", root,
477 int rank = simgrid::s4u::this_actor::get_pid();
479 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce" : "PMPI_Ireduce",
480 new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "reduce" : "ireduce", root, 0,
481 datatype->is_replayable() ? count : count * datatype->size(), -1,
482 simgrid::smpi::Datatype::encode(datatype), ""));
483 if (request == MPI_REQUEST_IGNORED)
484 simgrid::smpi::colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
486 simgrid::smpi::colls::ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request);
488 TRACE_smpi_comm_out(rank);
493 int PMPI_Reduce_local(const void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op)
495 if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
497 if (op == MPI_OP_NULL)
500 return MPI_ERR_COUNT;
503 op->apply(inbuf, inoutbuf, &count, datatype);
508 int PMPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
510 return PMPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED);
513 int PMPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
515 if (comm == MPI_COMM_NULL)
517 if ((sendbuf == nullptr && count > 0) || (recvbuf == nullptr))
518 return MPI_ERR_BUFFER;
519 if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
522 return MPI_ERR_COUNT;
523 if (op == MPI_OP_NULL)
525 if (request == nullptr)
529 std::unique_ptr<unsigned char[]> tmp_sendbuf;
530 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, count, datatype);
532 int rank = simgrid::s4u::this_actor::get_pid();
534 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Allreduce" : "PMPI_Iallreduce",
535 new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "allreduce" : "iallreduce", -1, 0,
536 datatype->is_replayable() ? count : count * datatype->size(), -1,
537 simgrid::smpi::Datatype::encode(datatype), ""));
539 if (request == MPI_REQUEST_IGNORED)
540 simgrid::smpi::colls::allreduce(real_sendbuf, recvbuf, count, datatype, op, comm);
542 simgrid::smpi::colls::iallreduce(real_sendbuf, recvbuf, count, datatype, op, comm, request);
544 TRACE_smpi_comm_out(rank);
549 int PMPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
551 return PMPI_Iscan(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED);
554 int PMPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request)
556 if (comm == MPI_COMM_NULL)
558 if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
560 if (op == MPI_OP_NULL)
562 if (request == nullptr)
565 return MPI_ERR_COUNT;
566 if (sendbuf == nullptr || recvbuf == nullptr)
567 return MPI_ERR_BUFFER;
570 int rank = simgrid::s4u::this_actor::get_pid();
571 std::unique_ptr<unsigned char[]> tmp_sendbuf;
572 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, count, datatype);
574 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Scan" : "PMPI_Iscan",
575 new simgrid::instr::Pt2PtTIData(request == MPI_REQUEST_IGNORED ? "scan" : "iscan", -1,
576 datatype->is_replayable() ? count : count * datatype->size(),
577 simgrid::smpi::Datatype::encode(datatype)));
580 if (request == MPI_REQUEST_IGNORED)
581 retval = simgrid::smpi::colls::scan(real_sendbuf, recvbuf, count, datatype, op, comm);
583 retval = simgrid::smpi::colls::iscan(real_sendbuf, recvbuf, count, datatype, op, comm, request);
585 TRACE_smpi_comm_out(rank);
590 int PMPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
592 return PMPI_Iexscan(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED);
595 int PMPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request){
596 if (comm == MPI_COMM_NULL)
598 if (not datatype->is_valid())
600 if (op == MPI_OP_NULL)
602 if (request == nullptr)
605 return MPI_ERR_COUNT;
606 if (sendbuf == nullptr || recvbuf == nullptr)
607 return MPI_ERR_BUFFER;
610 int rank = simgrid::s4u::this_actor::get_pid();
611 std::unique_ptr<unsigned char[]> tmp_sendbuf;
612 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, count, datatype);
614 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Exscan" : "PMPI_Iexscan",
615 new simgrid::instr::Pt2PtTIData(request == MPI_REQUEST_IGNORED ? "exscan" : "iexscan", -1,
616 datatype->is_replayable() ? count : count * datatype->size(),
617 simgrid::smpi::Datatype::encode(datatype)));
620 if (request == MPI_REQUEST_IGNORED)
621 retval = simgrid::smpi::colls::exscan(real_sendbuf, recvbuf, count, datatype, op, comm);
623 retval = simgrid::smpi::colls::iexscan(real_sendbuf, recvbuf, count, datatype, op, comm, request);
625 TRACE_smpi_comm_out(rank);
630 int PMPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
632 return PMPI_Ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, MPI_REQUEST_IGNORED);
635 int PMPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
637 if (comm == MPI_COMM_NULL)
639 if ((sendbuf == nullptr) || (recvbuf == nullptr))
640 return MPI_ERR_BUFFER;
641 if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
643 if (op == MPI_OP_NULL)
645 if (recvcounts == nullptr)
647 if (request == nullptr)
650 for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free
651 if (recvcounts[i] < 0)
652 return MPI_ERR_COUNT;
656 int rank = simgrid::s4u::this_actor::get_pid();
657 std::vector<int>* trace_recvcounts = new std::vector<int>;
658 int dt_send_size = datatype->is_replayable() ? 1 : datatype->size();
661 for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free
662 trace_recvcounts->push_back(recvcounts[i] * dt_send_size);
663 totalcount += recvcounts[i];
665 std::unique_ptr<unsigned char[]> tmp_sendbuf;
666 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, totalcount, datatype);
668 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter" : "PMPI_Ireduce_scatter",
669 new simgrid::instr::VarCollTIData(
670 request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, dt_send_size, nullptr,
671 -1, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
673 if (request == MPI_REQUEST_IGNORED)
674 simgrid::smpi::colls::reduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm);
676 simgrid::smpi::colls::ireduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm, request);
678 TRACE_smpi_comm_out(rank);
683 int PMPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount,
684 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
686 return PMPI_Ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, MPI_REQUEST_IGNORED);
689 int PMPI_Ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,
690 MPI_Comm comm, MPI_Request* request)
692 if (comm == MPI_COMM_NULL)
694 if (not datatype->is_valid())
696 if (op == MPI_OP_NULL)
700 if (request == nullptr)
704 int count = comm->size();
706 int rank = simgrid::s4u::this_actor::get_pid();
707 int dt_send_size = datatype->is_replayable() ? 1 : datatype->size();
708 std::vector<int>* trace_recvcounts = new std::vector<int>(recvcount * dt_send_size); // copy data to avoid bad free
709 std::unique_ptr<unsigned char[]> tmp_sendbuf;
710 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, recvcount * count, datatype);
713 rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter_block" : "PMPI_Ireduce_scatter_block",
714 new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, 0,
715 nullptr, -1, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
717 int* recvcounts = new int[count];
718 for (int i = 0; i < count; i++)
719 recvcounts[i] = recvcount;
720 if (request == MPI_REQUEST_IGNORED)
721 simgrid::smpi::colls::reduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm);
723 simgrid::smpi::colls::ireduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm, request);
726 TRACE_smpi_comm_out(rank);
731 int PMPI_Alltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
732 MPI_Datatype recvtype, MPI_Comm comm){
733 return PMPI_Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, MPI_REQUEST_IGNORED);
736 int PMPI_Ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
737 MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
739 if (comm == MPI_COMM_NULL)
741 if ((sendbuf == nullptr && sendcount > 0) || (recvbuf == nullptr && recvcount > 0))
742 return MPI_ERR_BUFFER;
743 if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL)
745 if ((sendbuf != MPI_IN_PLACE && sendcount < 0) || recvcount < 0)
746 return MPI_ERR_COUNT;
747 if (request == nullptr)
751 int rank = simgrid::s4u::this_actor::get_pid();
752 int real_sendcount = sendcount;
753 MPI_Datatype real_sendtype = sendtype;
755 std::unique_ptr<unsigned char[]> tmp_sendbuf;
756 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, recvcount * comm->size(), recvtype);
758 if (sendbuf == MPI_IN_PLACE) {
759 real_sendcount = recvcount;
760 real_sendtype = recvtype;
763 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Alltoall" : "PMPI_Ialltoall",
764 new simgrid::instr::CollTIData(
765 request == MPI_REQUEST_IGNORED ? "alltoall" : "ialltoall", -1, -1.0,
766 real_sendtype->is_replayable() ? real_sendcount : real_sendcount * real_sendtype->size(),
767 recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
768 simgrid::smpi::Datatype::encode(real_sendtype), simgrid::smpi::Datatype::encode(recvtype)));
770 if (request == MPI_REQUEST_IGNORED)
772 simgrid::smpi::colls::alltoall(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype, comm);
774 retval = simgrid::smpi::colls::ialltoall(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype,
777 TRACE_smpi_comm_out(rank);
782 int PMPI_Alltoallv(const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf,
783 const int* recvcounts, const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
785 return PMPI_Ialltoallv(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, MPI_REQUEST_IGNORED);
788 int PMPI_Ialltoallv(const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf,
789 const int* recvcounts, const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
791 if (comm == MPI_COMM_NULL)
793 if (sendbuf == nullptr || recvbuf == nullptr)
794 return MPI_ERR_BUFFER;
795 if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL)
797 if ((sendbuf != MPI_IN_PLACE && (sendcounts == nullptr || senddisps == nullptr)) || recvcounts == nullptr ||
798 recvdisps == nullptr)
800 if (request == nullptr)
803 int rank = simgrid::s4u::this_actor::get_pid();
804 int size = comm->size();
805 for (int i = 0; i < size; i++) {
806 if (recvcounts[i] < 0 || (sendbuf != MPI_IN_PLACE && sendcounts[i] < 0))
807 return MPI_ERR_COUNT;
813 std::vector<int>* trace_sendcounts = new std::vector<int>;
814 std::vector<int>* trace_recvcounts = new std::vector<int>;
815 int dt_size_recv = recvtype->size();
817 const int* real_sendcounts = sendcounts;
818 const int* real_senddisps = senddisps;
819 MPI_Datatype real_sendtype = sendtype;
821 for (int i = 0; i < size; i++) { // copy data to avoid bad free
822 recv_size += recvcounts[i] * dt_size_recv;
823 trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
824 if (((recvdisps[i] + recvcounts[i]) * dt_size_recv) > maxsize)
825 maxsize = (recvdisps[i] + recvcounts[i]) * dt_size_recv;
828 std::unique_ptr<unsigned char[]> tmp_sendbuf;
829 std::unique_ptr<int[]> tmp_sendcounts;
830 std::unique_ptr<int[]> tmp_senddisps;
831 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, maxsize, MPI_CHAR);
832 if (sendbuf == MPI_IN_PLACE) {
833 tmp_sendcounts.reset(new int[size]);
834 std::copy(recvcounts, recvcounts + size, tmp_sendcounts.get());
835 real_sendcounts = tmp_sendcounts.get();
836 tmp_senddisps.reset(new int[size]);
837 std::copy(recvdisps, recvdisps + size, tmp_senddisps.get());
838 real_senddisps = tmp_senddisps.get();
839 real_sendtype = recvtype;
842 int dt_size_send = real_sendtype->size();
844 for (int i = 0; i < size; i++) { // copy data to avoid bad free
845 send_size += real_sendcounts[i] * dt_size_send;
846 trace_sendcounts->push_back(real_sendcounts[i] * dt_size_send);
849 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Alltoallv" : "PMPI_Ialltoallv",
850 new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "alltoallv" : "ialltoallv", -1,
851 send_size, trace_sendcounts, recv_size, trace_recvcounts,
852 simgrid::smpi::Datatype::encode(real_sendtype),
853 simgrid::smpi::Datatype::encode(recvtype)));
856 if (request == MPI_REQUEST_IGNORED)
857 retval = simgrid::smpi::colls::alltoallv(real_sendbuf, real_sendcounts, real_senddisps, real_sendtype, recvbuf,
858 recvcounts, recvdisps, recvtype, comm);
860 retval = simgrid::smpi::colls::ialltoallv(real_sendbuf, real_sendcounts, real_senddisps, real_sendtype, recvbuf,
861 recvcounts, recvdisps, recvtype, comm, request);
863 TRACE_smpi_comm_out(rank);
868 int PMPI_Alltoallw(const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf,
869 const int* recvcounts, const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm)
871 return PMPI_Ialltoallw(sendbuf, sendcounts, senddisps, sendtypes, recvbuf, recvcounts, recvdisps, recvtypes, comm, MPI_REQUEST_IGNORED);
874 int PMPI_Ialltoallw(const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf,
875 const int* recvcounts, const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request* request)
877 if (comm == MPI_COMM_NULL)
879 if (sendbuf == nullptr || recvbuf == nullptr)
880 return MPI_ERR_BUFFER;
881 if ((sendbuf != MPI_IN_PLACE && sendtypes == nullptr) || recvtypes == nullptr)
883 if ((sendbuf != MPI_IN_PLACE && (sendcounts == nullptr || senddisps == nullptr)) || recvcounts == nullptr ||
884 recvdisps == nullptr)
886 if (request == nullptr)
890 int rank = simgrid::s4u::this_actor::get_pid();
891 int size = comm->size();
892 for (int i = 0; i < size; i++) {
893 if (recvcounts[i] < 0 || (sendbuf != MPI_IN_PLACE && sendcounts[i] < 0))
894 return MPI_ERR_COUNT;
898 std::vector<int>* trace_sendcounts = new std::vector<int>;
899 std::vector<int>* trace_recvcounts = new std::vector<int>;
901 const int* real_sendcounts = sendcounts;
902 const int* real_senddisps = senddisps;
903 const MPI_Datatype* real_sendtypes = sendtypes;
904 unsigned long maxsize = 0;
905 for (int i = 0; i < size; i++) { // copy data to avoid bad free
906 if (recvtypes[i] == MPI_DATATYPE_NULL) {
907 delete trace_recvcounts;
908 delete trace_sendcounts;
911 recv_size += recvcounts[i] * recvtypes[i]->size();
912 trace_recvcounts->push_back(recvcounts[i] * recvtypes[i]->size());
913 if ((recvdisps[i] + (recvcounts[i] * recvtypes[i]->size())) > maxsize)
914 maxsize = recvdisps[i] + (recvcounts[i] * recvtypes[i]->size());
917 std::unique_ptr<unsigned char[]> tmp_sendbuf;
918 std::unique_ptr<int[]> tmp_sendcounts;
919 std::unique_ptr<int[]> tmp_senddisps;
920 std::unique_ptr<MPI_Datatype[]> tmp_sendtypes;
921 const void* real_sendbuf = smpi_get_in_place_buf(sendbuf, recvbuf, tmp_sendbuf, maxsize, MPI_CHAR);
922 if (sendbuf == MPI_IN_PLACE) {
923 tmp_sendcounts.reset(new int[size]);
924 std::copy(recvcounts, recvcounts + size, tmp_sendcounts.get());
925 real_sendcounts = tmp_sendcounts.get();
926 tmp_senddisps.reset(new int[size]);
927 std::copy(recvdisps, recvdisps + size, tmp_senddisps.get());
928 real_senddisps = tmp_senddisps.get();
929 tmp_sendtypes.reset(new MPI_Datatype[size]);
930 std::copy(recvtypes, recvtypes + size, tmp_sendtypes.get());
931 real_sendtypes = tmp_sendtypes.get();
934 for (int i = 0; i < size; i++) { // copy data to avoid bad free
935 send_size += real_sendcounts[i] * real_sendtypes[i]->size();
936 trace_sendcounts->push_back(real_sendcounts[i] * real_sendtypes[i]->size());
939 TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Alltoallw" : "PMPI_Ialltoallw",
940 new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "alltoallv" : "ialltoallv", -1,
941 send_size, trace_sendcounts, recv_size, trace_recvcounts,
942 simgrid::smpi::Datatype::encode(real_sendtypes[0]),
943 simgrid::smpi::Datatype::encode(recvtypes[0])));
946 if (request == MPI_REQUEST_IGNORED)
947 retval = simgrid::smpi::colls::alltoallw(real_sendbuf, real_sendcounts, real_senddisps, real_sendtypes, recvbuf,
948 recvcounts, recvdisps, recvtypes, comm);
950 retval = simgrid::smpi::colls::ialltoallw(real_sendbuf, real_sendcounts, real_senddisps, real_sendtypes, recvbuf,
951 recvcounts, recvdisps, recvtypes, comm, request);
953 TRACE_smpi_comm_out(rank);