1 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "smpi_coll_private.h"
9 #include "smpi_mpi_dt_private.h"
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi,
12 "Logging specific to SMPI (pmpi)");
15 //this function need to be here because of the calls to smpi_bench
16 int TRACE_smpi_set_category(const char *category)
18 //need to end bench otherwise categories for execution tasks are wrong
21 if (!TRACE_is_enabled()){
24 if (category != NULL) {
25 ret = TRACE_category(category);
26 TRACE_category_set(SIMIX_process_self(), category);
28 //if category is NULL, trace of platform is disabled for this process
29 TRACE_category_unset(SIMIX_process_self());
33 //begin bench after changing process's category
39 /* PMPI User level calls */
41 int PMPI_Init(int *argc, char ***argv)
43 smpi_process_init(argc, argv);
45 TRACE_smpi_init(smpi_process_index());
51 int PMPI_Finalize(void)
55 TRACE_smpi_finalize(smpi_process_index());
57 smpi_process_destroy();
61 int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided)
63 if (provided != NULL) {
64 *provided = MPI_THREAD_MULTIPLE;
66 return MPI_Init(argc, argv);
69 int PMPI_Query_thread(int *provided)
74 if (provided == NULL) {
77 *provided = MPI_THREAD_MULTIPLE;
84 int PMPI_Is_thread_main(int *flag)
92 *flag = smpi_process_index() == 0;
99 int PMPI_Abort(MPI_Comm comm, int errorcode)
102 smpi_process_destroy();
103 // FIXME: should kill all processes in comm instead
104 SIMIX_req_process_kill(SIMIX_process_self());
108 double PMPI_Wtime(void)
113 time = SIMIX_get_clock();
118 int PMPI_Address(void *location, MPI_Aint * address)
124 retval = MPI_ERR_ARG;
126 *address = (MPI_Aint) location;
132 int PMPI_Type_free(MPI_Datatype * datatype)
138 retval = MPI_ERR_ARG;
140 // FIXME: always fail for now
141 retval = MPI_ERR_TYPE;
147 int PMPI_Type_size(MPI_Datatype datatype, int *size)
152 if (datatype == MPI_DATATYPE_NULL) {
153 retval = MPI_ERR_TYPE;
154 } else if (size == NULL) {
155 retval = MPI_ERR_ARG;
157 *size = (int) smpi_datatype_size(datatype);
158 retval = MPI_SUCCESS;
164 int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
169 if (datatype == MPI_DATATYPE_NULL) {
170 retval = MPI_ERR_TYPE;
171 } else if (lb == NULL || extent == NULL) {
172 retval = MPI_ERR_ARG;
174 retval = smpi_datatype_extent(datatype, lb, extent);
180 int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
186 if (datatype == MPI_DATATYPE_NULL) {
187 retval = MPI_ERR_TYPE;
188 } else if (extent == NULL) {
189 retval = MPI_ERR_ARG;
191 retval = smpi_datatype_extent(datatype, &dummy, extent);
197 int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
202 if (datatype == MPI_DATATYPE_NULL) {
203 retval = MPI_ERR_TYPE;
204 } else if (disp == NULL) {
205 retval = MPI_ERR_ARG;
207 *disp = smpi_datatype_lb(datatype);
208 retval = MPI_SUCCESS;
214 int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
219 if (datatype == MPI_DATATYPE_NULL) {
220 retval = MPI_ERR_TYPE;
221 } else if (disp == NULL) {
222 retval = MPI_ERR_ARG;
224 *disp = smpi_datatype_ub(datatype);
225 retval = MPI_SUCCESS;
231 int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
236 if (function == NULL || op == NULL) {
237 retval = MPI_ERR_ARG;
239 *op = smpi_op_new(function, commute);
240 retval = MPI_SUCCESS;
246 int PMPI_Op_free(MPI_Op * op)
252 retval = MPI_ERR_ARG;
253 } else if (*op == MPI_OP_NULL) {
256 smpi_op_destroy(*op);
258 retval = MPI_SUCCESS;
264 int PMPI_Group_free(MPI_Group * group)
270 retval = MPI_ERR_ARG;
272 smpi_group_destroy(*group);
273 *group = MPI_GROUP_NULL;
274 retval = MPI_SUCCESS;
280 int PMPI_Group_size(MPI_Group group, int *size)
285 if (group == MPI_GROUP_NULL) {
286 retval = MPI_ERR_GROUP;
287 } else if (size == NULL) {
288 retval = MPI_ERR_ARG;
290 *size = smpi_group_size(group);
291 retval = MPI_SUCCESS;
297 int PMPI_Group_rank(MPI_Group group, int *rank)
302 if (group == MPI_GROUP_NULL) {
303 retval = MPI_ERR_GROUP;
304 } else if (rank == NULL) {
305 retval = MPI_ERR_ARG;
307 *rank = smpi_group_rank(group, smpi_process_index());
308 retval = MPI_SUCCESS;
314 int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
315 MPI_Group group2, int *ranks2)
317 int retval, i, index;
320 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
321 retval = MPI_ERR_GROUP;
323 for (i = 0; i < n; i++) {
324 index = smpi_group_index(group1, ranks1[i]);
325 ranks2[i] = smpi_group_rank(group2, index);
327 retval = MPI_SUCCESS;
333 int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
338 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
339 retval = MPI_ERR_GROUP;
340 } else if (result == NULL) {
341 retval = MPI_ERR_ARG;
343 *result = smpi_group_compare(group1, group2);
344 retval = MPI_SUCCESS;
350 int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
351 MPI_Group * newgroup)
353 int retval, i, proc1, proc2, size, size2;
356 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
357 retval = MPI_ERR_GROUP;
358 } else if (newgroup == NULL) {
359 retval = MPI_ERR_ARG;
361 size = smpi_group_size(group1);
362 size2 = smpi_group_size(group2);
363 for (i = 0; i < size2; i++) {
364 proc2 = smpi_group_index(group2, i);
365 proc1 = smpi_group_rank(group1, proc2);
366 if (proc1 == MPI_UNDEFINED) {
371 *newgroup = MPI_GROUP_EMPTY;
373 *newgroup = smpi_group_new(size);
374 size2 = smpi_group_size(group1);
375 for (i = 0; i < size2; i++) {
376 proc1 = smpi_group_index(group1, i);
377 smpi_group_set_mapping(*newgroup, proc1, i);
379 for (i = size2; i < size; i++) {
380 proc2 = smpi_group_index(group2, i - size2);
381 smpi_group_set_mapping(*newgroup, proc2, i);
384 smpi_group_use(*newgroup);
385 retval = MPI_SUCCESS;
391 int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2,
392 MPI_Group * newgroup)
394 int retval, i, proc1, proc2, size, size2;
397 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
398 retval = MPI_ERR_GROUP;
399 } else if (newgroup == NULL) {
400 retval = MPI_ERR_ARG;
402 size = smpi_group_size(group1);
403 size2 = smpi_group_size(group2);
404 for (i = 0; i < size2; i++) {
405 proc2 = smpi_group_index(group2, i);
406 proc1 = smpi_group_rank(group1, proc2);
407 if (proc1 == MPI_UNDEFINED) {
412 *newgroup = MPI_GROUP_EMPTY;
414 *newgroup = smpi_group_new(size);
415 size2 = smpi_group_size(group1);
416 for (i = 0; i < size2; i++) {
417 proc1 = smpi_group_index(group1, i);
418 proc2 = smpi_group_rank(group2, proc1);
419 if (proc2 != MPI_UNDEFINED) {
420 smpi_group_set_mapping(*newgroup, proc1, i);
424 smpi_group_use(*newgroup);
425 retval = MPI_SUCCESS;
431 int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup)
433 int retval, i, proc1, proc2, size, size2;
436 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
437 retval = MPI_ERR_GROUP;
438 } else if (newgroup == NULL) {
439 retval = MPI_ERR_ARG;
441 size = size2 = smpi_group_size(group1);
442 for (i = 0; i < size2; i++) {
443 proc1 = smpi_group_index(group1, i);
444 proc2 = smpi_group_rank(group2, proc1);
445 if (proc2 != MPI_UNDEFINED) {
450 *newgroup = MPI_GROUP_EMPTY;
452 *newgroup = smpi_group_new(size);
453 for (i = 0; i < size2; i++) {
454 proc1 = smpi_group_index(group1, i);
455 proc2 = smpi_group_rank(group2, proc1);
456 if (proc2 == MPI_UNDEFINED) {
457 smpi_group_set_mapping(*newgroup, proc1, i);
461 smpi_group_use(*newgroup);
462 retval = MPI_SUCCESS;
468 int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
470 int retval, i, index;
473 if (group == MPI_GROUP_NULL) {
474 retval = MPI_ERR_GROUP;
475 } else if (newgroup == NULL) {
476 retval = MPI_ERR_ARG;
479 *newgroup = MPI_GROUP_EMPTY;
480 } else if (n == smpi_group_size(group)) {
483 *newgroup = smpi_group_new(n);
484 for (i = 0; i < n; i++) {
485 index = smpi_group_index(group, ranks[i]);
486 smpi_group_set_mapping(*newgroup, index, i);
489 smpi_group_use(*newgroup);
490 retval = MPI_SUCCESS;
496 int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
498 int retval, i, size, rank, index;
501 if (group == MPI_GROUP_NULL) {
502 retval = MPI_ERR_GROUP;
503 } else if (newgroup == NULL) {
504 retval = MPI_ERR_ARG;
508 } else if (n == smpi_group_size(group)) {
509 *newgroup = MPI_GROUP_EMPTY;
511 size = smpi_group_size(group) - n;
512 *newgroup = smpi_group_new(size);
514 while (rank < size) {
515 for (i = 0; i < n; i++) {
516 if (ranks[i] == rank) {
521 index = smpi_group_index(group, rank);
522 smpi_group_set_mapping(*newgroup, index, rank);
527 smpi_group_use(*newgroup);
528 retval = MPI_SUCCESS;
534 int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
535 MPI_Group * newgroup)
537 int retval, i, j, rank, size, index;
540 if (group == MPI_GROUP_NULL) {
541 retval = MPI_ERR_GROUP;
542 } else if (newgroup == NULL) {
543 retval = MPI_ERR_ARG;
546 *newgroup = MPI_GROUP_EMPTY;
549 for (i = 0; i < n; i++) {
550 for (rank = ranges[i][0]; /* First */
551 rank >= 0 && rank <= ranges[i][1]; /* Last */
552 rank += ranges[i][2] /* Stride */ ) {
556 if (size == smpi_group_size(group)) {
559 *newgroup = smpi_group_new(size);
561 for (i = 0; i < n; i++) {
562 for (rank = ranges[i][0]; /* First */
563 rank >= 0 && rank <= ranges[i][1]; /* Last */
564 rank += ranges[i][2] /* Stride */ ) {
565 index = smpi_group_index(group, rank);
566 smpi_group_set_mapping(*newgroup, index, j);
572 smpi_group_use(*newgroup);
573 retval = MPI_SUCCESS;
579 int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
580 MPI_Group * newgroup)
582 int retval, i, newrank, rank, size, index, add;
585 if (group == MPI_GROUP_NULL) {
586 retval = MPI_ERR_GROUP;
587 } else if (newgroup == NULL) {
588 retval = MPI_ERR_ARG;
593 size = smpi_group_size(group);
594 for (i = 0; i < n; i++) {
595 for (rank = ranges[i][0]; /* First */
596 rank >= 0 && rank <= ranges[i][1]; /* Last */
597 rank += ranges[i][2] /* Stride */ ) {
602 *newgroup = MPI_GROUP_EMPTY;
604 *newgroup = smpi_group_new(size);
606 while (newrank < size) {
607 for (i = 0; i < n; i++) {
609 for (rank = ranges[i][0]; /* First */
610 rank >= 0 && rank <= ranges[i][1]; /* Last */
611 rank += ranges[i][2] /* Stride */ ) {
612 if (rank == newrank) {
618 index = smpi_group_index(group, newrank);
619 smpi_group_set_mapping(*newgroup, index, newrank);
625 smpi_group_use(*newgroup);
626 retval = MPI_SUCCESS;
632 int PMPI_Comm_rank(MPI_Comm comm, int *rank)
637 if (comm == MPI_COMM_NULL) {
638 retval = MPI_ERR_COMM;
640 *rank = smpi_comm_rank(comm);
641 retval = MPI_SUCCESS;
647 int PMPI_Comm_size(MPI_Comm comm, int *size)
652 if (comm == MPI_COMM_NULL) {
653 retval = MPI_ERR_COMM;
654 } else if (size == NULL) {
655 retval = MPI_ERR_ARG;
657 *size = smpi_comm_size(comm);
658 retval = MPI_SUCCESS;
664 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
669 if (comm == MPI_COMM_NULL) {
670 retval = MPI_ERR_COMM;
671 } else if (group == NULL) {
672 retval = MPI_ERR_ARG;
674 *group = smpi_comm_group(comm);
675 retval = MPI_SUCCESS;
681 int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
686 if (comm1 == MPI_COMM_NULL || comm2 == MPI_COMM_NULL) {
687 retval = MPI_ERR_COMM;
688 } else if (result == NULL) {
689 retval = MPI_ERR_ARG;
691 if (comm1 == comm2) { /* Same communicators means same groups */
695 smpi_group_compare(smpi_comm_group(comm1),
696 smpi_comm_group(comm2));
697 if (*result == MPI_IDENT) {
698 *result = MPI_CONGRUENT;
701 retval = MPI_SUCCESS;
707 int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
712 if (comm == MPI_COMM_NULL) {
713 retval = MPI_ERR_COMM;
714 } else if (newcomm == NULL) {
715 retval = MPI_ERR_ARG;
717 *newcomm = smpi_comm_new(smpi_comm_group(comm));
718 retval = MPI_SUCCESS;
724 int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
729 if (comm == MPI_COMM_NULL) {
730 retval = MPI_ERR_COMM;
731 } else if (group == MPI_GROUP_NULL) {
732 retval = MPI_ERR_GROUP;
733 } else if (newcomm == NULL) {
734 retval = MPI_ERR_ARG;
736 *newcomm = smpi_comm_new(group);
737 retval = MPI_SUCCESS;
743 int PMPI_Comm_free(MPI_Comm * comm)
749 retval = MPI_ERR_ARG;
750 } else if (*comm == MPI_COMM_NULL) {
751 retval = MPI_ERR_COMM;
753 smpi_comm_destroy(*comm);
754 *comm = MPI_COMM_NULL;
755 retval = MPI_SUCCESS;
761 int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
766 if (comm_out == NULL) {
767 retval = MPI_ERR_ARG;
768 } else if (comm == MPI_COMM_NULL) {
769 retval = MPI_ERR_COMM;
771 *comm_out = smpi_comm_split(comm, color, key);
772 retval = MPI_SUCCESS;
778 int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst,
779 int tag, MPI_Comm comm, MPI_Request * request)
784 if (request == NULL) {
785 retval = MPI_ERR_ARG;
786 } else if (comm == MPI_COMM_NULL) {
787 retval = MPI_ERR_COMM;
789 *request = smpi_mpi_send_init(buf, count, datatype, dst, tag, comm);
790 retval = MPI_SUCCESS;
796 int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src,
797 int tag, MPI_Comm comm, MPI_Request * request)
802 if (request == NULL) {
803 retval = MPI_ERR_ARG;
804 } else if (comm == MPI_COMM_NULL) {
805 retval = MPI_ERR_COMM;
807 *request = smpi_mpi_recv_init(buf, count, datatype, src, tag, comm);
808 retval = MPI_SUCCESS;
814 int PMPI_Start(MPI_Request * request)
819 if (request == NULL) {
820 retval = MPI_ERR_ARG;
822 smpi_mpi_start(*request);
823 retval = MPI_SUCCESS;
829 int PMPI_Startall(int count, MPI_Request * requests)
834 if (requests == NULL) {
835 retval = MPI_ERR_ARG;
837 smpi_mpi_startall(count, requests);
838 retval = MPI_SUCCESS;
844 int PMPI_Request_free(MPI_Request * request)
849 if (request == NULL) {
850 retval = MPI_ERR_ARG;
852 smpi_mpi_request_free(request);
853 retval = MPI_SUCCESS;
859 int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
860 int tag, MPI_Comm comm, MPI_Request * request)
866 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
867 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
868 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
870 if (request == NULL) {
871 retval = MPI_ERR_ARG;
872 } else if (comm == MPI_COMM_NULL) {
873 retval = MPI_ERR_COMM;
875 *request = smpi_mpi_irecv(buf, count, datatype, src, tag, comm);
876 retval = MPI_SUCCESS;
879 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
880 (*request)->recv = 1;
886 int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
887 int tag, MPI_Comm comm, MPI_Request * request)
893 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
894 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
895 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
896 TRACE_smpi_send(rank, rank, dst_traced);
898 if (request == NULL) {
899 retval = MPI_ERR_ARG;
900 } else if (comm == MPI_COMM_NULL) {
901 retval = MPI_ERR_COMM;
903 *request = smpi_mpi_isend(buf, count, datatype, dst, tag, comm);
904 retval = MPI_SUCCESS;
907 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
908 (*request)->send = 1;
914 int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
915 MPI_Comm comm, MPI_Status * status)
921 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
922 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
923 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
925 if (comm == MPI_COMM_NULL) {
926 retval = MPI_ERR_COMM;
928 smpi_mpi_recv(buf, count, datatype, src, tag, comm, status);
929 retval = MPI_SUCCESS;
932 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
933 TRACE_smpi_recv(rank, src_traced, rank);
939 int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
946 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
947 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
948 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
949 TRACE_smpi_send(rank, rank, dst_traced);
951 if (comm == MPI_COMM_NULL) {
952 retval = MPI_ERR_COMM;
954 smpi_mpi_send(buf, count, datatype, dst, tag, comm);
955 retval = MPI_SUCCESS;
958 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
964 int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
965 int dst, int sendtag, void *recvbuf, int recvcount,
966 MPI_Datatype recvtype, int src, int recvtag,
967 MPI_Comm comm, MPI_Status * status)
973 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
974 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
975 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
976 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
977 TRACE_smpi_send(rank, rank, dst_traced);
978 TRACE_smpi_send(rank, src_traced, rank);
980 if (comm == MPI_COMM_NULL) {
981 retval = MPI_ERR_COMM;
982 } else if (sendtype == MPI_DATATYPE_NULL
983 || recvtype == MPI_DATATYPE_NULL) {
984 retval = MPI_ERR_TYPE;
986 smpi_mpi_sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf,
987 recvcount, recvtype, src, recvtag, comm, status);
988 retval = MPI_SUCCESS;
991 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
992 TRACE_smpi_recv(rank, rank, dst_traced);
993 TRACE_smpi_recv(rank, src_traced, rank);
999 int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
1000 int dst, int sendtag, int src, int recvtag,
1001 MPI_Comm comm, MPI_Status * status)
1003 //TODO: suboptimal implementation
1007 size = smpi_datatype_size(datatype) * count;
1008 recvbuf = xbt_new(char, size);
1010 MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count,
1011 datatype, src, recvtag, comm, status);
1012 memcpy(buf, recvbuf, size * sizeof(char));
1017 int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
1022 if (request == NULL || flag == NULL) {
1023 retval = MPI_ERR_ARG;
1024 } else if (*request == MPI_REQUEST_NULL) {
1025 retval = MPI_ERR_REQUEST;
1027 *flag = smpi_mpi_test(request, status);
1028 retval = MPI_SUCCESS;
1034 int PMPI_Testany(int count, MPI_Request requests[], int *index, int *flag,
1035 MPI_Status * status)
1040 if (index == NULL || flag == NULL) {
1041 retval = MPI_ERR_ARG;
1043 *flag = smpi_mpi_testany(count, requests, index, status);
1044 retval = MPI_SUCCESS;
1050 int PMPI_Wait(MPI_Request * request, MPI_Status * status)
1056 int rank = request && (*request)->comm != MPI_COMM_NULL
1057 ? smpi_comm_rank((*request)->comm)
1059 MPI_Group group = smpi_comm_group((*request)->comm);
1060 int src_traced = smpi_group_rank(group, (*request)->src);
1061 int dst_traced = smpi_group_rank(group, (*request)->dst);
1062 int is_wait_for_receive = (*request)->recv;
1063 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
1065 if (request == NULL) {
1066 retval = MPI_ERR_ARG;
1067 } else if (*request == MPI_REQUEST_NULL) {
1068 retval = MPI_ERR_REQUEST;
1070 smpi_mpi_wait(request, status);
1071 retval = MPI_SUCCESS;
1074 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
1075 if (is_wait_for_receive) {
1076 TRACE_smpi_recv(rank, src_traced, dst_traced);
1083 int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
1089 //save requests information for tracing
1091 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1092 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1093 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1094 for (i = 0; i < count; i++) {
1095 MPI_Request req = requests[i]; //already received requests are no longer valid
1097 int *asrc = xbt_new(int, 1);
1098 int *adst = xbt_new(int, 1);
1099 int *arecv = xbt_new(int, 1);
1103 xbt_dynar_insert_at(srcs, i, asrc);
1104 xbt_dynar_insert_at(dsts, i, adst);
1105 xbt_dynar_insert_at(recvs, i, arecv);
1107 int *t = xbt_new(int, 1);
1108 xbt_dynar_insert_at(srcs, i, t);
1109 xbt_dynar_insert_at(dsts, i, t);
1110 xbt_dynar_insert_at(recvs, i, t);
1113 int rank_traced = smpi_comm_rank(MPI_COMM_WORLD);
1114 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1116 if (index == NULL) {
1117 retval = MPI_ERR_ARG;
1119 *index = smpi_mpi_waitany(count, requests, status);
1120 retval = MPI_SUCCESS;
1123 int src_traced, dst_traced, is_wait_for_receive;
1124 xbt_dynar_get_cpy(srcs, *index, &src_traced);
1125 xbt_dynar_get_cpy(dsts, *index, &dst_traced);
1126 xbt_dynar_get_cpy(recvs, *index, &is_wait_for_receive);
1127 if (is_wait_for_receive) {
1128 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1130 TRACE_smpi_ptp_out(rank_traced, src_traced, dst_traced, __FUNCTION__);
1131 //clean-up of dynars
1140 int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
1145 //save information from requests
1147 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1148 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1149 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1150 for (i = 0; i < count; i++) {
1151 MPI_Request req = requests[i]; //all req should be valid in Waitall
1152 int *asrc = xbt_new(int, 1);
1153 int *adst = xbt_new(int, 1);
1154 int *arecv = xbt_new(int, 1);
1158 xbt_dynar_insert_at(srcs, i, asrc);
1159 xbt_dynar_insert_at(dsts, i, adst);
1160 xbt_dynar_insert_at(recvs, i, arecv);
1162 int rank_traced = smpi_comm_rank (MPI_COMM_WORLD);
1163 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1165 smpi_mpi_waitall(count, requests, status);
1167 for (i = 0; i < count; i++) {
1168 int src_traced, dst_traced, is_wait_for_receive;
1169 xbt_dynar_get_cpy(srcs, i, &src_traced);
1170 xbt_dynar_get_cpy(dsts, i, &dst_traced);
1171 xbt_dynar_get_cpy(recvs, i, &is_wait_for_receive);
1172 if (is_wait_for_receive) {
1173 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1176 TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
1177 //clean-up of dynars
1186 int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
1187 int *indices, MPI_Status status[])
1192 if (outcount == NULL || indices == NULL) {
1193 retval = MPI_ERR_ARG;
1195 *outcount = smpi_mpi_waitsome(incount, requests, indices, status);
1196 retval = MPI_SUCCESS;
1202 int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
1208 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1209 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1210 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1212 if (comm == MPI_COMM_NULL) {
1213 retval = MPI_ERR_COMM;
1215 smpi_mpi_bcast(buf, count, datatype, root, comm);
1216 retval = MPI_SUCCESS;
1219 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1225 int PMPI_Barrier(MPI_Comm comm)
1231 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1232 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1234 if (comm == MPI_COMM_NULL) {
1235 retval = MPI_ERR_COMM;
1237 smpi_mpi_barrier(comm);
1238 retval = MPI_SUCCESS;
1241 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1247 int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1248 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1249 int root, MPI_Comm comm)
1255 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1256 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1257 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1259 if (comm == MPI_COMM_NULL) {
1260 retval = MPI_ERR_COMM;
1261 } else if (sendtype == MPI_DATATYPE_NULL
1262 || recvtype == MPI_DATATYPE_NULL) {
1263 retval = MPI_ERR_TYPE;
1265 smpi_mpi_gather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1266 recvtype, root, comm);
1267 retval = MPI_SUCCESS;
1270 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1276 int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1277 void *recvbuf, int *recvcounts, int *displs,
1278 MPI_Datatype recvtype, int root, MPI_Comm comm)
1284 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1285 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1286 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1288 if (comm == MPI_COMM_NULL) {
1289 retval = MPI_ERR_COMM;
1290 } else if (sendtype == MPI_DATATYPE_NULL
1291 || recvtype == MPI_DATATYPE_NULL) {
1292 retval = MPI_ERR_TYPE;
1293 } else if (recvcounts == NULL || displs == NULL) {
1294 retval = MPI_ERR_ARG;
1296 smpi_mpi_gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1297 displs, recvtype, root, comm);
1298 retval = MPI_SUCCESS;
1301 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1307 int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1308 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1315 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1316 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1318 if (comm == MPI_COMM_NULL) {
1319 retval = MPI_ERR_COMM;
1320 } else if (sendtype == MPI_DATATYPE_NULL
1321 || recvtype == MPI_DATATYPE_NULL) {
1322 retval = MPI_ERR_TYPE;
1324 smpi_mpi_allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1326 retval = MPI_SUCCESS;
1329 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1335 int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1336 void *recvbuf, int *recvcounts, int *displs,
1337 MPI_Datatype recvtype, MPI_Comm comm)
1343 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1344 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1346 if (comm == MPI_COMM_NULL) {
1347 retval = MPI_ERR_COMM;
1348 } else if (sendtype == MPI_DATATYPE_NULL
1349 || recvtype == MPI_DATATYPE_NULL) {
1350 retval = MPI_ERR_TYPE;
1351 } else if (recvcounts == NULL || displs == NULL) {
1352 retval = MPI_ERR_ARG;
1354 smpi_mpi_allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1355 displs, recvtype, comm);
1356 retval = MPI_SUCCESS;
1359 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1365 int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1366 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1367 int root, MPI_Comm comm)
1373 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1374 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1375 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1377 if (comm == MPI_COMM_NULL) {
1378 retval = MPI_ERR_COMM;
1379 } else if (sendtype == MPI_DATATYPE_NULL
1380 || recvtype == MPI_DATATYPE_NULL) {
1381 retval = MPI_ERR_TYPE;
1383 smpi_mpi_scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1384 recvtype, root, comm);
1385 retval = MPI_SUCCESS;
1388 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1394 int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
1395 MPI_Datatype sendtype, void *recvbuf, int recvcount,
1396 MPI_Datatype recvtype, int root, MPI_Comm comm)
1402 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1403 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1404 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1406 if (comm == MPI_COMM_NULL) {
1407 retval = MPI_ERR_COMM;
1408 } else if (sendtype == MPI_DATATYPE_NULL
1409 || recvtype == MPI_DATATYPE_NULL) {
1410 retval = MPI_ERR_TYPE;
1411 } else if (sendcounts == NULL || displs == NULL) {
1412 retval = MPI_ERR_ARG;
1414 smpi_mpi_scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
1415 recvcount, recvtype, root, comm);
1416 retval = MPI_SUCCESS;
1419 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1425 int PMPI_Reduce(void *sendbuf, void *recvbuf, int count,
1426 MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
1432 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1433 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1434 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1436 if (comm == MPI_COMM_NULL) {
1437 retval = MPI_ERR_COMM;
1438 } else if (datatype == MPI_DATATYPE_NULL || op == MPI_OP_NULL) {
1439 retval = MPI_ERR_ARG;
1441 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
1442 retval = MPI_SUCCESS;
1445 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1451 int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
1452 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1458 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1459 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1461 if (comm == MPI_COMM_NULL) {
1462 retval = MPI_ERR_COMM;
1463 } else if (datatype == MPI_DATATYPE_NULL) {
1464 retval = MPI_ERR_TYPE;
1465 } else if (op == MPI_OP_NULL) {
1466 retval = MPI_ERR_OP;
1468 smpi_mpi_allreduce(sendbuf, recvbuf, count, datatype, op, comm);
1469 retval = MPI_SUCCESS;
1472 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1478 int PMPI_Scan(void *sendbuf, void *recvbuf, int count,
1479 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1485 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1486 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1488 if (comm == MPI_COMM_NULL) {
1489 retval = MPI_ERR_COMM;
1490 } else if (datatype == MPI_DATATYPE_NULL) {
1491 retval = MPI_ERR_TYPE;
1492 } else if (op == MPI_OP_NULL) {
1493 retval = MPI_ERR_OP;
1495 smpi_mpi_scan(sendbuf, recvbuf, count, datatype, op, comm);
1496 retval = MPI_SUCCESS;
1499 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1505 int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
1506 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1508 int retval, i, size, count;
1510 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1514 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1516 if (comm == MPI_COMM_NULL) {
1517 retval = MPI_ERR_COMM;
1518 } else if (datatype == MPI_DATATYPE_NULL) {
1519 retval = MPI_ERR_TYPE;
1520 } else if (op == MPI_OP_NULL) {
1521 retval = MPI_ERR_OP;
1522 } else if (recvcounts == NULL) {
1523 retval = MPI_ERR_ARG;
1525 /* arbitrarily choose root as rank 0 */
1526 /* TODO: faster direct implementation ? */
1527 size = smpi_comm_size(comm);
1529 displs = xbt_new(int, size);
1530 for (i = 0; i < size; i++) {
1531 count += recvcounts[i];
1534 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
1535 smpi_mpi_scatterv(recvbuf, recvcounts, displs, datatype, recvbuf,
1536 recvcounts[rank], datatype, 0, comm);
1538 retval = MPI_SUCCESS;
1541 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1547 int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1548 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1551 int retval, size, sendsize;
1555 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1556 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1558 if (comm == MPI_COMM_NULL) {
1559 retval = MPI_ERR_COMM;
1560 } else if (sendtype == MPI_DATATYPE_NULL
1561 || recvtype == MPI_DATATYPE_NULL) {
1562 retval = MPI_ERR_TYPE;
1564 size = smpi_comm_size(comm);
1565 sendsize = smpi_datatype_size(sendtype) * sendcount;
1566 if (sendsize < 200 && size > 12) {
1568 smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
1569 recvbuf, recvcount, recvtype,
1571 } else if (sendsize < 3000) {
1573 smpi_coll_tuned_alltoall_basic_linear(sendbuf, sendcount,
1575 recvcount, recvtype, comm);
1578 smpi_coll_tuned_alltoall_pairwise(sendbuf, sendcount, sendtype,
1579 recvbuf, recvcount, recvtype,
1584 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1590 int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
1591 MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
1592 int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
1598 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1599 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1601 if (comm == MPI_COMM_NULL) {
1602 retval = MPI_ERR_COMM;
1603 } else if (sendtype == MPI_DATATYPE_NULL
1604 || recvtype == MPI_DATATYPE_NULL) {
1605 retval = MPI_ERR_TYPE;
1606 } else if (sendcounts == NULL || senddisps == NULL || recvcounts == NULL
1607 || recvdisps == NULL) {
1608 retval = MPI_ERR_ARG;
1611 smpi_coll_basic_alltoallv(sendbuf, sendcounts, senddisps, sendtype,
1612 recvbuf, recvcounts, recvdisps, recvtype,
1616 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1623 int PMPI_Get_processor_name(char *name, int *resultlen)
1625 int retval = MPI_SUCCESS;
1628 strncpy(name, SIMIX_host_get_name(SIMIX_host_self()),
1629 MPI_MAX_PROCESSOR_NAME - 1);
1632 MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
1638 int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
1640 int retval = MPI_SUCCESS;
1644 if (status == NULL || count == NULL) {
1645 retval = MPI_ERR_ARG;
1646 } else if (datatype == MPI_DATATYPE_NULL) {
1647 retval = MPI_ERR_TYPE;
1649 size = smpi_datatype_size(datatype);
1652 } else if (status->count % size != 0) {
1653 retval = MPI_UNDEFINED;
1655 *count = smpi_mpi_get_count(status, datatype);
1662 /* The following calls are not yet implemented and will fail at runtime. */
1663 /* Once implemented, please move them above this notice. */
1665 static int not_yet_implemented(void) {
1666 xbt_die("Not yet implemented");
1667 return MPI_ERR_OTHER;
1670 int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
1671 return not_yet_implemented();
1674 int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
1675 return not_yet_implemented();
1678 int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) {
1679 return not_yet_implemented();
1682 int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) {
1683 return not_yet_implemented();
1686 int PMPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) {
1687 return not_yet_implemented();
1690 int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) {
1691 return not_yet_implemented();
1694 int PMPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) {
1695 return not_yet_implemented();
1698 int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) {
1699 return not_yet_implemented();
1702 int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) {
1703 return not_yet_implemented();
1706 int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) {
1707 return not_yet_implemented();
1710 int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) {
1711 return not_yet_implemented();
1714 int PMPI_Graph_map(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) {
1715 return not_yet_implemented();
1718 int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) {
1719 return not_yet_implemented();
1722 int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int* nneighbors) {
1723 return not_yet_implemented();
1726 int PMPI_Graphdims_get(MPI_Comm comm, int* nnodes, int* nedges) {
1727 return not_yet_implemented();
1730 int PMPI_Topo_test(MPI_Comm comm, int* top_type) {
1731 return not_yet_implemented();
1734 int PMPI_Error_class(int errorcode, int* errorclass) {
1735 return not_yet_implemented();
1738 int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler) {
1739 return not_yet_implemented();
1742 int PMPI_Errhandler_free(MPI_Errhandler* errhandler) {
1743 return not_yet_implemented();
1746 int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler) {
1747 return not_yet_implemented();
1750 int PMPI_Error_string(int errorcode, char* string, int* resultlen) {
1751 return not_yet_implemented();
1754 int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {
1755 return not_yet_implemented();
1758 int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* newtype) {
1759 return not_yet_implemented();
1762 int PMPI_Cancel(MPI_Request* request) {
1763 return not_yet_implemented();
1766 int PMPI_Buffer_attach(void* buffer, int size) {
1767 return not_yet_implemented();
1770 int PMPI_Buffer_detach(void* buffer, int* size) {
1771 return not_yet_implemented();
1774 int PMPI_Testsome(int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses) {
1775 return not_yet_implemented();
1778 int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
1779 return not_yet_implemented();
1782 int PMPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
1783 return not_yet_implemented();
1786 int PMPI_Type_commit(MPI_Datatype* datatype) {
1787 return not_yet_implemented();
1790 int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1791 return not_yet_implemented();
1794 int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1795 return not_yet_implemented();
1798 int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1799 return not_yet_implemented();
1802 int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
1803 return not_yet_implemented();
1806 int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1807 return not_yet_implemented();
1810 int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1811 return not_yet_implemented();
1814 int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1815 return not_yet_implemented();
1818 int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) {
1819 return not_yet_implemented();
1822 int PMPI_Intercomm_merge(MPI_Comm comm, int high, MPI_Comm* comm_out) {
1823 return not_yet_implemented();
1826 int PMPI_Bsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1827 return not_yet_implemented();
1830 int PMPI_Bsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1831 return not_yet_implemented();
1834 int PMPI_Ibsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1835 return not_yet_implemented();
1838 int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group* group) {
1839 return not_yet_implemented();
1842 int PMPI_Comm_remote_size(MPI_Comm comm, int* size) {
1843 return not_yet_implemented();
1846 int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1847 return not_yet_implemented();
1850 int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
1851 return not_yet_implemented();
1854 int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
1855 return not_yet_implemented();
1858 int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
1859 return not_yet_implemented();
1862 int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
1863 return not_yet_implemented();
1866 int PMPI_Rsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1867 return not_yet_implemented();
1870 int PMPI_Rsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1871 return not_yet_implemented();
1874 int PMPI_Irsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1875 return not_yet_implemented();
1878 int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
1879 return not_yet_implemented();
1882 int PMPI_Keyval_free(int* keyval) {
1883 return not_yet_implemented();
1886 int PMPI_Test_cancelled(MPI_Status* status, int* flag) {
1887 return not_yet_implemented();
1890 int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
1891 return not_yet_implemented();
1894 int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) {
1895 return not_yet_implemented();
1898 int PMPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) {
1899 return not_yet_implemented();
1902 int PMPI_Dims_create(int nnodes, int ndims, int* dims) {
1903 return not_yet_implemented();
1906 int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) {
1907 return not_yet_implemented();
1910 int PMPI_Initialized(int* flag) {
1911 return not_yet_implemented();