1 /* Copyright (c) 2007-2017. 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_comm.hpp"
8 #include "smpi_datatype.hpp"
9 #include "smpi_request.hpp"
10 #include "smpi_process.hpp"
12 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
14 /* PMPI User level calls */
15 extern "C" { // Obviously, the C MPI interface should use the C linkage
17 int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request)
22 if (request == nullptr) {
24 } else if (comm == MPI_COMM_NULL) {
25 retval = MPI_ERR_COMM;
26 } else if (not datatype->is_valid()) {
27 retval = MPI_ERR_TYPE;
28 } else if (dst == MPI_PROC_NULL) {
31 *request = simgrid::smpi::Request::send_init(buf, count, datatype, dst, tag, comm);
35 if (retval != MPI_SUCCESS && request != nullptr)
36 *request = MPI_REQUEST_NULL;
40 int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request)
45 if (request == nullptr) {
47 } else if (comm == MPI_COMM_NULL) {
48 retval = MPI_ERR_COMM;
49 } else if (not datatype->is_valid()) {
50 retval = MPI_ERR_TYPE;
51 } else if (src == MPI_PROC_NULL) {
54 *request = simgrid::smpi::Request::recv_init(buf, count, datatype, src, tag, comm);
58 if (retval != MPI_SUCCESS && request != nullptr)
59 *request = MPI_REQUEST_NULL;
63 int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
68 if (request == nullptr) {
70 } else if (comm == MPI_COMM_NULL) {
71 retval = MPI_ERR_COMM;
72 } else if (not datatype->is_valid()) {
73 retval = MPI_ERR_TYPE;
74 } else if (dst == MPI_PROC_NULL) {
77 *request = simgrid::smpi::Request::ssend_init(buf, count, datatype, dst, tag, comm);
81 if (retval != MPI_SUCCESS && request != nullptr)
82 *request = MPI_REQUEST_NULL;
86 int PMPI_Start(MPI_Request * request)
91 if (request == nullptr || *request == MPI_REQUEST_NULL) {
92 retval = MPI_ERR_REQUEST;
101 int PMPI_Startall(int count, MPI_Request * requests)
105 if (requests == nullptr) {
106 retval = MPI_ERR_ARG;
108 retval = MPI_SUCCESS;
109 for (int i = 0; i < count; i++) {
110 if(requests[i] == MPI_REQUEST_NULL) {
111 retval = MPI_ERR_REQUEST;
114 if(retval != MPI_ERR_REQUEST) {
115 simgrid::smpi::Request::startall(count, requests);
122 int PMPI_Request_free(MPI_Request * request)
127 if (*request == MPI_REQUEST_NULL) {
128 retval = MPI_ERR_ARG;
130 simgrid::smpi::Request::unref(request);
131 retval = MPI_SUCCESS;
137 int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request)
143 if (request == nullptr) {
144 retval = MPI_ERR_ARG;
145 } else if (comm == MPI_COMM_NULL) {
146 retval = MPI_ERR_COMM;
147 } else if (src == MPI_PROC_NULL) {
148 *request = MPI_REQUEST_NULL;
149 retval = MPI_SUCCESS;
150 } else if (src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0)){
151 retval = MPI_ERR_RANK;
152 } else if ((count < 0) || (buf==nullptr && count > 0)) {
153 retval = MPI_ERR_COUNT;
154 } else if (not datatype->is_valid()) {
155 retval = MPI_ERR_TYPE;
156 } else if(tag<0 && tag != MPI_ANY_TAG){
157 retval = MPI_ERR_TAG;
160 int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
161 int src_traced = comm->group()->index(src);
163 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
164 extra->type = TRACING_IRECV;
165 extra->src = src_traced;
168 extra->datatype1 = encode_datatype(datatype, &known);
169 int dt_size_send = 1;
171 dt_size_send = datatype->size();
172 extra->send_size = count*dt_size_send;
173 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
175 *request = simgrid::smpi::Request::irecv(buf, count, datatype, src, tag, comm);
176 retval = MPI_SUCCESS;
178 TRACE_smpi_ptp_out(rank, rank, __FUNCTION__);
182 if (retval != MPI_SUCCESS && request != nullptr)
183 *request = MPI_REQUEST_NULL;
188 int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request)
193 if (request == nullptr) {
194 retval = MPI_ERR_ARG;
195 } else if (comm == MPI_COMM_NULL) {
196 retval = MPI_ERR_COMM;
197 } else if (dst == MPI_PROC_NULL) {
198 *request = MPI_REQUEST_NULL;
199 retval = MPI_SUCCESS;
200 } else if (dst >= comm->group()->size() || dst <0){
201 retval = MPI_ERR_RANK;
202 } else if ((count < 0) || (buf==nullptr && count > 0)) {
203 retval = MPI_ERR_COUNT;
204 } else if (not datatype->is_valid()) {
205 retval = MPI_ERR_TYPE;
206 } else if(tag<0 && tag != MPI_ANY_TAG){
207 retval = MPI_ERR_TAG;
209 int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
210 int dst_traced = comm->group()->index(dst);
211 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
212 extra->type = TRACING_ISEND;
214 extra->dst = dst_traced;
216 extra->datatype1 = encode_datatype(datatype, &known);
217 int dt_size_send = 1;
219 dt_size_send = datatype->size();
220 extra->send_size = count*dt_size_send;
221 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
222 TRACE_smpi_send(rank, rank, dst_traced, tag, count*datatype->size());
224 *request = simgrid::smpi::Request::isend(buf, count, datatype, dst, tag, comm);
225 retval = MPI_SUCCESS;
227 TRACE_smpi_ptp_out(rank, dst_traced, __FUNCTION__);
231 if (retval != MPI_SUCCESS && request!=nullptr)
232 *request = MPI_REQUEST_NULL;
236 int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
241 if (request == nullptr) {
242 retval = MPI_ERR_ARG;
243 } else if (comm == MPI_COMM_NULL) {
244 retval = MPI_ERR_COMM;
245 } else if (dst == MPI_PROC_NULL) {
246 *request = MPI_REQUEST_NULL;
247 retval = MPI_SUCCESS;
248 } else if (dst >= comm->group()->size() || dst <0){
249 retval = MPI_ERR_RANK;
250 } else if ((count < 0)|| (buf==nullptr && count > 0)) {
251 retval = MPI_ERR_COUNT;
252 } else if (not datatype->is_valid()) {
253 retval = MPI_ERR_TYPE;
254 } else if(tag<0 && tag != MPI_ANY_TAG){
255 retval = MPI_ERR_TAG;
257 int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
258 int dst_traced = comm->group()->index(dst);
259 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
260 extra->type = TRACING_ISSEND;
262 extra->dst = dst_traced;
264 extra->datatype1 = encode_datatype(datatype, &known);
265 int dt_size_send = 1;
267 dt_size_send = datatype->size();
268 extra->send_size = count*dt_size_send;
269 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
270 TRACE_smpi_send(rank, rank, dst_traced, tag, count*datatype->size());
272 *request = simgrid::smpi::Request::issend(buf, count, datatype, dst, tag, comm);
273 retval = MPI_SUCCESS;
275 TRACE_smpi_ptp_out(rank, dst_traced, __FUNCTION__);
279 if (retval != MPI_SUCCESS && request!=nullptr)
280 *request = MPI_REQUEST_NULL;
284 int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status)
289 if (comm == MPI_COMM_NULL) {
290 retval = MPI_ERR_COMM;
291 } else if (src == MPI_PROC_NULL) {
292 simgrid::smpi::Status::empty(status);
293 status->MPI_SOURCE = MPI_PROC_NULL;
294 retval = MPI_SUCCESS;
295 } else if (src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0)){
296 retval = MPI_ERR_RANK;
297 } else if ((count < 0) || (buf==nullptr && count > 0)) {
298 retval = MPI_ERR_COUNT;
299 } else if (not datatype->is_valid()) {
300 retval = MPI_ERR_TYPE;
301 } else if(tag<0 && tag != MPI_ANY_TAG){
302 retval = MPI_ERR_TAG;
304 int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
305 int src_traced = comm->group()->index(src);
306 instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
307 extra->type = TRACING_RECV;
308 extra->src = src_traced;
311 extra->datatype1 = encode_datatype(datatype, &known);
312 int dt_size_send = 1;
314 dt_size_send = datatype->size();
315 extra->send_size = count * dt_size_send;
316 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
318 simgrid::smpi::Request::recv(buf, count, datatype, src, tag, comm, status);
319 retval = MPI_SUCCESS;
321 // the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
322 if (status != MPI_STATUS_IGNORE) {
323 src_traced = comm->group()->index(status->MPI_SOURCE);
324 if (not TRACE_smpi_view_internals()) {
325 TRACE_smpi_recv(rank, src_traced, rank, tag);
328 TRACE_smpi_ptp_out(rank, rank, __FUNCTION__);
335 int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
341 if (comm == MPI_COMM_NULL) {
342 retval = MPI_ERR_COMM;
343 } else if (dst == MPI_PROC_NULL) {
344 retval = MPI_SUCCESS;
345 } else if (dst >= comm->group()->size() || dst <0){
346 retval = MPI_ERR_RANK;
347 } else if ((count < 0) || (buf == nullptr && count > 0)) {
348 retval = MPI_ERR_COUNT;
349 } else if (not datatype->is_valid()) {
350 retval = MPI_ERR_TYPE;
351 } else if(tag < 0 && tag != MPI_ANY_TAG){
352 retval = MPI_ERR_TAG;
354 int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
355 int dst_traced = comm->group()->index(dst);
356 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
357 extra->type = TRACING_SEND;
359 extra->dst = dst_traced;
361 extra->datatype1 = encode_datatype(datatype, &known);
362 int dt_size_send = 1;
364 dt_size_send = datatype->size();
366 extra->send_size = count*dt_size_send;
367 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
368 if (not TRACE_smpi_view_internals()) {
369 TRACE_smpi_send(rank, rank, dst_traced, tag,count*datatype->size());
372 simgrid::smpi::Request::send(buf, count, datatype, dst, tag, comm);
373 retval = MPI_SUCCESS;
375 TRACE_smpi_ptp_out(rank, dst_traced, __FUNCTION__);
382 int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) {
387 if (comm == MPI_COMM_NULL) {
388 retval = MPI_ERR_COMM;
389 } else if (dst == MPI_PROC_NULL) {
390 retval = MPI_SUCCESS;
391 } else if (dst >= comm->group()->size() || dst <0){
392 retval = MPI_ERR_RANK;
393 } else if ((count < 0) || (buf==nullptr && count > 0)) {
394 retval = MPI_ERR_COUNT;
395 } else if (not datatype->is_valid()) {
396 retval = MPI_ERR_TYPE;
397 } else if(tag<0 && tag != MPI_ANY_TAG){
398 retval = MPI_ERR_TAG;
400 int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
401 int dst_traced = comm->group()->index(dst);
402 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
403 extra->type = TRACING_SSEND;
405 extra->dst = dst_traced;
407 extra->datatype1 = encode_datatype(datatype, &known);
408 int dt_size_send = 1;
410 dt_size_send = datatype->size();
412 extra->send_size = count*dt_size_send;
413 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
414 TRACE_smpi_send(rank, rank, dst_traced, tag,count*datatype->size());
416 simgrid::smpi::Request::ssend(buf, count, datatype, dst, tag, comm);
417 retval = MPI_SUCCESS;
419 TRACE_smpi_ptp_out(rank, dst_traced, __FUNCTION__);
426 int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void *recvbuf,
427 int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status * status)
433 if (comm == MPI_COMM_NULL) {
434 retval = MPI_ERR_COMM;
435 } else if (not sendtype->is_valid() || not recvtype->is_valid()) {
436 retval = MPI_ERR_TYPE;
437 } else if (src == MPI_PROC_NULL || dst == MPI_PROC_NULL) {
438 simgrid::smpi::Status::empty(status);
439 status->MPI_SOURCE = MPI_PROC_NULL;
440 retval = MPI_SUCCESS;
441 }else if (dst >= comm->group()->size() || dst <0 ||
442 (src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0))){
443 retval = MPI_ERR_RANK;
444 } else if ((sendcount < 0 || recvcount<0) ||
445 (sendbuf==nullptr && sendcount > 0) || (recvbuf==nullptr && recvcount>0)) {
446 retval = MPI_ERR_COUNT;
447 } else if((sendtag<0 && sendtag != MPI_ANY_TAG)||(recvtag<0 && recvtag != MPI_ANY_TAG)){
448 retval = MPI_ERR_TAG;
451 int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
452 int dst_traced = comm->group()->index(dst);
453 int src_traced = comm->group()->index(src);
454 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
455 extra->type = TRACING_SENDRECV;
456 extra->src = src_traced;
457 extra->dst = dst_traced;
459 extra->datatype1 = encode_datatype(sendtype, &known);
460 int dt_size_send = 1;
462 dt_size_send = sendtype->size();
463 extra->send_size = sendcount*dt_size_send;
464 extra->datatype2 = encode_datatype(recvtype, &known);
465 int dt_size_recv = 1;
467 dt_size_recv = recvtype->size();
468 extra->recv_size = recvcount*dt_size_recv;
470 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
471 TRACE_smpi_send(rank, rank, dst_traced, sendtag,sendcount*sendtype->size());
473 simgrid::smpi::Request::sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf, recvcount, recvtype, src, recvtag, comm,
475 retval = MPI_SUCCESS;
477 TRACE_smpi_ptp_out(rank, dst_traced, __FUNCTION__);
478 TRACE_smpi_recv(rank, src_traced, rank, recvtag);
485 int PMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dst, int sendtag, int src, int recvtag,
486 MPI_Comm comm, MPI_Status* status)
489 if (not datatype->is_valid()) {
491 } else if (count < 0) {
492 return MPI_ERR_COUNT;
494 int size = datatype->get_extent() * count;
495 void* recvbuf = xbt_new0(char, size);
496 retval = MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count, datatype, src, recvtag, comm, status);
497 if(retval==MPI_SUCCESS){
498 simgrid::smpi::Datatype::copy(recvbuf, count, datatype, buf, count, datatype);
506 int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
510 if (request == nullptr || flag == nullptr) {
511 retval = MPI_ERR_ARG;
512 } else if (*request == MPI_REQUEST_NULL) {
514 simgrid::smpi::Status::empty(status);
515 retval = MPI_SUCCESS;
517 int rank = ((*request)->comm() != MPI_COMM_NULL) ? smpi_process()->index() : -1;
519 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
520 extra->type = TRACING_TEST;
521 TRACE_smpi_testing_in(rank, extra);
523 *flag = simgrid::smpi::Request::test(request,status);
525 TRACE_smpi_testing_out(rank);
526 retval = MPI_SUCCESS;
532 int PMPI_Testany(int count, MPI_Request requests[], int *index, int *flag, MPI_Status * status)
537 if (index == nullptr || flag == nullptr) {
538 retval = MPI_ERR_ARG;
540 *flag = simgrid::smpi::Request::testany(count, requests, index, status);
541 retval = MPI_SUCCESS;
547 int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses)
552 if (flag == nullptr) {
553 retval = MPI_ERR_ARG;
555 *flag = simgrid::smpi::Request::testall(count, requests, statuses);
556 retval = MPI_SUCCESS;
562 int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
566 if (status == nullptr) {
567 retval = MPI_ERR_ARG;
568 } else if (comm == MPI_COMM_NULL) {
569 retval = MPI_ERR_COMM;
570 } else if (source == MPI_PROC_NULL) {
571 simgrid::smpi::Status::empty(status);
572 status->MPI_SOURCE = MPI_PROC_NULL;
573 retval = MPI_SUCCESS;
575 simgrid::smpi::Request::probe(source, tag, comm, status);
576 retval = MPI_SUCCESS;
582 int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) {
586 if (flag == nullptr) {
587 retval = MPI_ERR_ARG;
588 } else if (comm == MPI_COMM_NULL) {
589 retval = MPI_ERR_COMM;
590 } else if (source == MPI_PROC_NULL) {
592 simgrid::smpi::Status::empty(status);
593 status->MPI_SOURCE = MPI_PROC_NULL;
594 retval = MPI_SUCCESS;
596 simgrid::smpi::Request::iprobe(source, tag, comm, flag, status);
597 retval = MPI_SUCCESS;
603 int PMPI_Wait(MPI_Request * request, MPI_Status * status)
609 simgrid::smpi::Status::empty(status);
611 if (request == nullptr) {
612 retval = MPI_ERR_ARG;
613 } else if (*request == MPI_REQUEST_NULL) {
614 retval = MPI_SUCCESS;
617 int rank = (request!=nullptr && (*request)->comm() != MPI_COMM_NULL) ? smpi_process()->index() : -1;
619 int src_traced = (*request)->src();
620 int dst_traced = (*request)->dst();
621 int tag_traced= (*request)->tag();
622 MPI_Comm comm = (*request)->comm();
623 int is_wait_for_receive = ((*request)->flags() & RECV);
624 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
625 extra->type = TRACING_WAIT;
626 TRACE_smpi_ptp_in(rank, __FUNCTION__, extra);
628 simgrid::smpi::Request::wait(request, status);
629 retval = MPI_SUCCESS;
631 //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
632 TRACE_smpi_ptp_out(rank, dst_traced, __FUNCTION__);
633 if (is_wait_for_receive) {
634 if(src_traced==MPI_ANY_SOURCE)
635 src_traced = (status!=MPI_STATUS_IGNORE) ?
636 comm->group()->rank(status->MPI_SOURCE) :
638 TRACE_smpi_recv(rank, src_traced, dst_traced, tag_traced);
646 int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
648 if (index == nullptr)
652 //save requests information for tracing
660 savedvalstype* savedvals=nullptr;
662 savedvals = xbt_new0(savedvalstype, count);
664 for (int i = 0; i < count; i++) {
665 MPI_Request req = requests[i]; //already received requests are no longer valid
667 savedvals[i]=(savedvalstype){req->src(), req->dst(), (req->flags() & RECV), req->tag(), req->comm()};
670 int rank_traced = smpi_process()->index();
671 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
672 extra->type = TRACING_WAITANY;
673 extra->send_size=count;
674 TRACE_smpi_ptp_in(rank_traced, __FUNCTION__,extra);
676 *index = simgrid::smpi::Request::waitany(count, requests, status);
678 if(*index!=MPI_UNDEFINED){
679 int src_traced = savedvals[*index].src;
680 //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
681 int dst_traced = savedvals[*index].dst;
682 int is_wait_for_receive = savedvals[*index].recv;
683 if (is_wait_for_receive) {
684 if(savedvals[*index].src==MPI_ANY_SOURCE)
685 src_traced = (status != MPI_STATUSES_IGNORE)
686 ? savedvals[*index].comm->group()->rank(status->MPI_SOURCE)
687 : savedvals[*index].src;
688 TRACE_smpi_recv(rank_traced, src_traced, dst_traced, savedvals[*index].tag);
690 TRACE_smpi_ptp_out(rank_traced, dst_traced, __FUNCTION__);
698 int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
701 //save information from requests
710 savedvalstype* savedvals=xbt_new0(savedvalstype, count);
712 for (int i = 0; i < count; i++) {
713 MPI_Request req = requests[i];
714 if(req!=MPI_REQUEST_NULL){
715 savedvals[i]=(savedvalstype){req->src(), req->dst(), (req->flags() & RECV), req->tag(), 1, req->comm()};
717 savedvals[i].valid=0;
720 int rank_traced = smpi_process()->index();
721 instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
722 extra->type = TRACING_WAITALL;
723 extra->send_size=count;
724 TRACE_smpi_ptp_in(rank_traced, __FUNCTION__,extra);
726 int retval = simgrid::smpi::Request::waitall(count, requests, status);
728 for (int i = 0; i < count; i++) {
729 if(savedvals[i].valid){
730 //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
731 int src_traced = savedvals[i].src;
732 int dst_traced = savedvals[i].dst;
733 int is_wait_for_receive = savedvals[i].recv;
734 if (is_wait_for_receive) {
735 if(src_traced==MPI_ANY_SOURCE)
736 src_traced = (status!=MPI_STATUSES_IGNORE) ?
737 savedvals[i].comm->group()->rank(status[i].MPI_SOURCE) : savedvals[i].src;
738 TRACE_smpi_recv(rank_traced, src_traced, dst_traced,savedvals[i].tag);
742 TRACE_smpi_ptp_out(rank_traced, -1, __FUNCTION__);
749 int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount, int *indices, MPI_Status status[])
754 if (outcount == nullptr) {
755 retval = MPI_ERR_ARG;
757 *outcount = simgrid::smpi::Request::waitsome(incount, requests, indices, status);
758 retval = MPI_SUCCESS;
764 int PMPI_Testsome(int incount, MPI_Request requests[], int* outcount, int* indices, MPI_Status status[])
769 if (outcount == nullptr) {
770 retval = MPI_ERR_ARG;
772 *outcount = simgrid::smpi::Request::testsome(incount, requests, indices, status);
773 retval = MPI_SUCCESS;
779 MPI_Request PMPI_Request_f2c(MPI_Fint request){
780 return static_cast<MPI_Request>(simgrid::smpi::Request::f2c(request));
783 MPI_Fint PMPI_Request_c2f(MPI_Request request) {
784 return request->c2f();