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 void 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
38 /* PMPI User level calls */
40 int PMPI_Init(int *argc, char ***argv)
42 smpi_process_init(argc, argv);
44 TRACE_smpi_init(smpi_process_index());
50 int PMPI_Finalize(void)
54 TRACE_smpi_finalize(smpi_process_index());
56 smpi_process_destroy();
60 int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided)
62 if (provided != NULL) {
63 *provided = MPI_THREAD_MULTIPLE;
65 return MPI_Init(argc, argv);
68 int PMPI_Query_thread(int *provided)
73 if (provided == NULL) {
76 *provided = MPI_THREAD_MULTIPLE;
83 int PMPI_Is_thread_main(int *flag)
91 *flag = smpi_process_index() == 0;
98 int PMPI_Abort(MPI_Comm comm, int errorcode)
101 smpi_process_destroy();
102 // FIXME: should kill all processes in comm instead
103 SIMIX_req_process_kill(SIMIX_process_self());
107 double PMPI_Wtime(void)
112 time = SIMIX_get_clock();
117 int PMPI_Address(void *location, MPI_Aint * address)
123 retval = MPI_ERR_ARG;
125 *address = (MPI_Aint) location;
131 int PMPI_Type_free(MPI_Datatype * datatype)
137 retval = MPI_ERR_ARG;
139 // FIXME: always fail for now
140 retval = MPI_ERR_TYPE;
146 int PMPI_Type_size(MPI_Datatype datatype, int *size)
151 if (datatype == MPI_DATATYPE_NULL) {
152 retval = MPI_ERR_TYPE;
153 } else if (size == NULL) {
154 retval = MPI_ERR_ARG;
156 *size = (int) smpi_datatype_size(datatype);
157 retval = MPI_SUCCESS;
163 int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
168 if (datatype == MPI_DATATYPE_NULL) {
169 retval = MPI_ERR_TYPE;
170 } else if (lb == NULL || extent == NULL) {
171 retval = MPI_ERR_ARG;
173 retval = smpi_datatype_extent(datatype, lb, extent);
179 int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
185 if (datatype == MPI_DATATYPE_NULL) {
186 retval = MPI_ERR_TYPE;
187 } else if (extent == NULL) {
188 retval = MPI_ERR_ARG;
190 retval = smpi_datatype_extent(datatype, &dummy, extent);
196 int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
201 if (datatype == MPI_DATATYPE_NULL) {
202 retval = MPI_ERR_TYPE;
203 } else if (disp == NULL) {
204 retval = MPI_ERR_ARG;
206 *disp = smpi_datatype_lb(datatype);
207 retval = MPI_SUCCESS;
213 int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
218 if (datatype == MPI_DATATYPE_NULL) {
219 retval = MPI_ERR_TYPE;
220 } else if (disp == NULL) {
221 retval = MPI_ERR_ARG;
223 *disp = smpi_datatype_ub(datatype);
224 retval = MPI_SUCCESS;
230 int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
235 if (function == NULL || op == NULL) {
236 retval = MPI_ERR_ARG;
238 *op = smpi_op_new(function, commute);
239 retval = MPI_SUCCESS;
245 int PMPI_Op_free(MPI_Op * op)
251 retval = MPI_ERR_ARG;
252 } else if (*op == MPI_OP_NULL) {
255 smpi_op_destroy(*op);
257 retval = MPI_SUCCESS;
263 int PMPI_Group_free(MPI_Group * group)
269 retval = MPI_ERR_ARG;
271 smpi_group_destroy(*group);
272 *group = MPI_GROUP_NULL;
273 retval = MPI_SUCCESS;
279 int PMPI_Group_size(MPI_Group group, int *size)
284 if (group == MPI_GROUP_NULL) {
285 retval = MPI_ERR_GROUP;
286 } else if (size == NULL) {
287 retval = MPI_ERR_ARG;
289 *size = smpi_group_size(group);
290 retval = MPI_SUCCESS;
296 int PMPI_Group_rank(MPI_Group group, int *rank)
301 if (group == MPI_GROUP_NULL) {
302 retval = MPI_ERR_GROUP;
303 } else if (rank == NULL) {
304 retval = MPI_ERR_ARG;
306 *rank = smpi_group_rank(group, smpi_process_index());
307 retval = MPI_SUCCESS;
313 int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
314 MPI_Group group2, int *ranks2)
316 int retval, i, index;
319 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
320 retval = MPI_ERR_GROUP;
322 for (i = 0; i < n; i++) {
323 index = smpi_group_index(group1, ranks1[i]);
324 ranks2[i] = smpi_group_rank(group2, index);
326 retval = MPI_SUCCESS;
332 int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
337 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
338 retval = MPI_ERR_GROUP;
339 } else if (result == NULL) {
340 retval = MPI_ERR_ARG;
342 *result = smpi_group_compare(group1, group2);
343 retval = MPI_SUCCESS;
349 int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
350 MPI_Group * newgroup)
352 int retval, i, proc1, proc2, size, size2;
355 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
356 retval = MPI_ERR_GROUP;
357 } else if (newgroup == NULL) {
358 retval = MPI_ERR_ARG;
360 size = smpi_group_size(group1);
361 size2 = smpi_group_size(group2);
362 for (i = 0; i < size2; i++) {
363 proc2 = smpi_group_index(group2, i);
364 proc1 = smpi_group_rank(group1, proc2);
365 if (proc1 == MPI_UNDEFINED) {
370 *newgroup = MPI_GROUP_EMPTY;
372 *newgroup = smpi_group_new(size);
373 size2 = smpi_group_size(group1);
374 for (i = 0; i < size2; i++) {
375 proc1 = smpi_group_index(group1, i);
376 smpi_group_set_mapping(*newgroup, proc1, i);
378 for (i = size2; i < size; i++) {
379 proc2 = smpi_group_index(group2, i - size2);
380 smpi_group_set_mapping(*newgroup, proc2, i);
383 smpi_group_use(*newgroup);
384 retval = MPI_SUCCESS;
390 int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2,
391 MPI_Group * newgroup)
393 int retval, i, proc1, proc2, size, size2;
396 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
397 retval = MPI_ERR_GROUP;
398 } else if (newgroup == NULL) {
399 retval = MPI_ERR_ARG;
401 size = smpi_group_size(group1);
402 size2 = smpi_group_size(group2);
403 for (i = 0; i < size2; i++) {
404 proc2 = smpi_group_index(group2, i);
405 proc1 = smpi_group_rank(group1, proc2);
406 if (proc1 == MPI_UNDEFINED) {
411 *newgroup = MPI_GROUP_EMPTY;
413 *newgroup = smpi_group_new(size);
414 size2 = smpi_group_size(group1);
415 for (i = 0; i < size2; i++) {
416 proc1 = smpi_group_index(group1, i);
417 proc2 = smpi_group_rank(group2, proc1);
418 if (proc2 != MPI_UNDEFINED) {
419 smpi_group_set_mapping(*newgroup, proc1, i);
423 smpi_group_use(*newgroup);
424 retval = MPI_SUCCESS;
430 int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup)
432 int retval, i, proc1, proc2, size, size2;
435 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
436 retval = MPI_ERR_GROUP;
437 } else if (newgroup == NULL) {
438 retval = MPI_ERR_ARG;
440 size = size2 = smpi_group_size(group1);
441 for (i = 0; i < size2; i++) {
442 proc1 = smpi_group_index(group1, i);
443 proc2 = smpi_group_rank(group2, proc1);
444 if (proc2 != MPI_UNDEFINED) {
449 *newgroup = MPI_GROUP_EMPTY;
451 *newgroup = smpi_group_new(size);
452 for (i = 0; i < size2; i++) {
453 proc1 = smpi_group_index(group1, i);
454 proc2 = smpi_group_rank(group2, proc1);
455 if (proc2 == MPI_UNDEFINED) {
456 smpi_group_set_mapping(*newgroup, proc1, i);
460 smpi_group_use(*newgroup);
461 retval = MPI_SUCCESS;
467 int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
469 int retval, i, index;
472 if (group == MPI_GROUP_NULL) {
473 retval = MPI_ERR_GROUP;
474 } else if (newgroup == NULL) {
475 retval = MPI_ERR_ARG;
478 *newgroup = MPI_GROUP_EMPTY;
479 } else if (n == smpi_group_size(group)) {
482 *newgroup = smpi_group_new(n);
483 for (i = 0; i < n; i++) {
484 index = smpi_group_index(group, ranks[i]);
485 smpi_group_set_mapping(*newgroup, index, i);
488 smpi_group_use(*newgroup);
489 retval = MPI_SUCCESS;
495 int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
497 int retval, i, size, rank, index;
500 if (group == MPI_GROUP_NULL) {
501 retval = MPI_ERR_GROUP;
502 } else if (newgroup == NULL) {
503 retval = MPI_ERR_ARG;
507 } else if (n == smpi_group_size(group)) {
508 *newgroup = MPI_GROUP_EMPTY;
510 size = smpi_group_size(group) - n;
511 *newgroup = smpi_group_new(size);
513 while (rank < size) {
514 for (i = 0; i < n; i++) {
515 if (ranks[i] == rank) {
520 index = smpi_group_index(group, rank);
521 smpi_group_set_mapping(*newgroup, index, rank);
526 smpi_group_use(*newgroup);
527 retval = MPI_SUCCESS;
533 int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
534 MPI_Group * newgroup)
536 int retval, i, j, rank, size, index;
539 if (group == MPI_GROUP_NULL) {
540 retval = MPI_ERR_GROUP;
541 } else if (newgroup == NULL) {
542 retval = MPI_ERR_ARG;
545 *newgroup = MPI_GROUP_EMPTY;
548 for (i = 0; i < n; i++) {
549 for (rank = ranges[i][0]; /* First */
550 rank >= 0 && rank <= ranges[i][1]; /* Last */
551 rank += ranges[i][2] /* Stride */ ) {
555 if (size == smpi_group_size(group)) {
558 *newgroup = smpi_group_new(size);
560 for (i = 0; i < n; i++) {
561 for (rank = ranges[i][0]; /* First */
562 rank >= 0 && rank <= ranges[i][1]; /* Last */
563 rank += ranges[i][2] /* Stride */ ) {
564 index = smpi_group_index(group, rank);
565 smpi_group_set_mapping(*newgroup, index, j);
571 smpi_group_use(*newgroup);
572 retval = MPI_SUCCESS;
578 int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
579 MPI_Group * newgroup)
581 int retval, i, newrank, rank, size, index, add;
584 if (group == MPI_GROUP_NULL) {
585 retval = MPI_ERR_GROUP;
586 } else if (newgroup == NULL) {
587 retval = MPI_ERR_ARG;
592 size = smpi_group_size(group);
593 for (i = 0; i < n; i++) {
594 for (rank = ranges[i][0]; /* First */
595 rank >= 0 && rank <= ranges[i][1]; /* Last */
596 rank += ranges[i][2] /* Stride */ ) {
601 *newgroup = MPI_GROUP_EMPTY;
603 *newgroup = smpi_group_new(size);
605 while (newrank < size) {
606 for (i = 0; i < n; i++) {
608 for (rank = ranges[i][0]; /* First */
609 rank >= 0 && rank <= ranges[i][1]; /* Last */
610 rank += ranges[i][2] /* Stride */ ) {
611 if (rank == newrank) {
617 index = smpi_group_index(group, newrank);
618 smpi_group_set_mapping(*newgroup, index, newrank);
624 smpi_group_use(*newgroup);
625 retval = MPI_SUCCESS;
631 int PMPI_Comm_rank(MPI_Comm comm, int *rank)
636 if (comm == MPI_COMM_NULL) {
637 retval = MPI_ERR_COMM;
639 *rank = smpi_comm_rank(comm);
640 retval = MPI_SUCCESS;
646 int PMPI_Comm_size(MPI_Comm comm, int *size)
651 if (comm == MPI_COMM_NULL) {
652 retval = MPI_ERR_COMM;
653 } else if (size == NULL) {
654 retval = MPI_ERR_ARG;
656 *size = smpi_comm_size(comm);
657 retval = MPI_SUCCESS;
663 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
668 if (comm == MPI_COMM_NULL) {
669 retval = MPI_ERR_COMM;
670 } else if (group == NULL) {
671 retval = MPI_ERR_ARG;
673 *group = smpi_comm_group(comm);
674 retval = MPI_SUCCESS;
680 int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
685 if (comm1 == MPI_COMM_NULL || comm2 == MPI_COMM_NULL) {
686 retval = MPI_ERR_COMM;
687 } else if (result == NULL) {
688 retval = MPI_ERR_ARG;
690 if (comm1 == comm2) { /* Same communicators means same groups */
694 smpi_group_compare(smpi_comm_group(comm1),
695 smpi_comm_group(comm2));
696 if (*result == MPI_IDENT) {
697 *result = MPI_CONGRUENT;
700 retval = MPI_SUCCESS;
706 int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
711 if (comm == MPI_COMM_NULL) {
712 retval = MPI_ERR_COMM;
713 } else if (newcomm == NULL) {
714 retval = MPI_ERR_ARG;
716 *newcomm = smpi_comm_new(smpi_comm_group(comm));
717 retval = MPI_SUCCESS;
723 int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
728 if (comm == MPI_COMM_NULL) {
729 retval = MPI_ERR_COMM;
730 } else if (group == MPI_GROUP_NULL) {
731 retval = MPI_ERR_GROUP;
732 } else if (newcomm == NULL) {
733 retval = MPI_ERR_ARG;
735 *newcomm = smpi_comm_new(group);
736 retval = MPI_SUCCESS;
742 int PMPI_Comm_free(MPI_Comm * comm)
748 retval = MPI_ERR_ARG;
749 } else if (*comm == MPI_COMM_NULL) {
750 retval = MPI_ERR_COMM;
752 smpi_comm_destroy(*comm);
753 *comm = MPI_COMM_NULL;
754 retval = MPI_SUCCESS;
760 int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
765 if (comm_out == NULL) {
766 retval = MPI_ERR_ARG;
767 } else if (comm == MPI_COMM_NULL) {
768 retval = MPI_ERR_COMM;
770 *comm_out = smpi_comm_split(comm, color, key);
771 retval = MPI_SUCCESS;
777 int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst,
778 int tag, MPI_Comm comm, MPI_Request * request)
783 if (request == NULL) {
784 retval = MPI_ERR_ARG;
785 } else if (comm == MPI_COMM_NULL) {
786 retval = MPI_ERR_COMM;
788 *request = smpi_mpi_send_init(buf, count, datatype, dst, tag, comm);
789 retval = MPI_SUCCESS;
795 int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src,
796 int tag, MPI_Comm comm, MPI_Request * request)
801 if (request == NULL) {
802 retval = MPI_ERR_ARG;
803 } else if (comm == MPI_COMM_NULL) {
804 retval = MPI_ERR_COMM;
806 *request = smpi_mpi_recv_init(buf, count, datatype, src, tag, comm);
807 retval = MPI_SUCCESS;
813 int PMPI_Start(MPI_Request * request)
818 if (request == NULL) {
819 retval = MPI_ERR_ARG;
821 smpi_mpi_start(*request);
822 retval = MPI_SUCCESS;
828 int PMPI_Startall(int count, MPI_Request * requests)
833 if (requests == NULL) {
834 retval = MPI_ERR_ARG;
836 smpi_mpi_startall(count, requests);
837 retval = MPI_SUCCESS;
843 int PMPI_Request_free(MPI_Request * request)
848 if (request == NULL) {
849 retval = MPI_ERR_ARG;
851 smpi_mpi_request_free(request);
852 retval = MPI_SUCCESS;
858 int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
859 int tag, MPI_Comm comm, MPI_Request * request)
865 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
866 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
867 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
869 if (request == NULL) {
870 retval = MPI_ERR_ARG;
871 } else if (comm == MPI_COMM_NULL) {
872 retval = MPI_ERR_COMM;
874 *request = smpi_mpi_irecv(buf, count, datatype, src, tag, comm);
875 retval = MPI_SUCCESS;
878 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
879 (*request)->recv = 1;
885 int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
886 int tag, MPI_Comm comm, MPI_Request * request)
892 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
893 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
894 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
895 TRACE_smpi_send(rank, rank, dst_traced);
897 if (request == NULL) {
898 retval = MPI_ERR_ARG;
899 } else if (comm == MPI_COMM_NULL) {
900 retval = MPI_ERR_COMM;
902 *request = smpi_mpi_isend(buf, count, datatype, dst, tag, comm);
903 retval = MPI_SUCCESS;
906 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
907 (*request)->send = 1;
913 int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
914 MPI_Comm comm, MPI_Status * status)
920 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
921 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
922 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
924 if (comm == MPI_COMM_NULL) {
925 retval = MPI_ERR_COMM;
927 smpi_mpi_recv(buf, count, datatype, src, tag, comm, status);
928 retval = MPI_SUCCESS;
931 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
932 TRACE_smpi_recv(rank, src_traced, rank);
938 int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
945 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
946 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
947 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
948 TRACE_smpi_send(rank, rank, dst_traced);
950 if (comm == MPI_COMM_NULL) {
951 retval = MPI_ERR_COMM;
953 smpi_mpi_send(buf, count, datatype, dst, tag, comm);
954 retval = MPI_SUCCESS;
957 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
963 int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
964 int dst, int sendtag, void *recvbuf, int recvcount,
965 MPI_Datatype recvtype, int src, int recvtag,
966 MPI_Comm comm, MPI_Status * status)
972 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
973 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
974 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
975 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
976 TRACE_smpi_send(rank, rank, dst_traced);
977 TRACE_smpi_send(rank, src_traced, rank);
979 if (comm == MPI_COMM_NULL) {
980 retval = MPI_ERR_COMM;
981 } else if (sendtype == MPI_DATATYPE_NULL
982 || recvtype == MPI_DATATYPE_NULL) {
983 retval = MPI_ERR_TYPE;
985 smpi_mpi_sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf,
986 recvcount, recvtype, src, recvtag, comm, status);
987 retval = MPI_SUCCESS;
990 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
991 TRACE_smpi_recv(rank, rank, dst_traced);
992 TRACE_smpi_recv(rank, src_traced, rank);
998 int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
999 int dst, int sendtag, int src, int recvtag,
1000 MPI_Comm comm, MPI_Status * status)
1002 //TODO: suboptimal implementation
1006 size = smpi_datatype_size(datatype) * count;
1007 recvbuf = xbt_new(char, size);
1009 MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count,
1010 datatype, src, recvtag, comm, status);
1011 memcpy(buf, recvbuf, size * sizeof(char));
1016 int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
1021 if (request == NULL || flag == NULL) {
1022 retval = MPI_ERR_ARG;
1023 } else if (*request == MPI_REQUEST_NULL) {
1024 retval = MPI_ERR_REQUEST;
1026 *flag = smpi_mpi_test(request, status);
1027 retval = MPI_SUCCESS;
1033 int PMPI_Testany(int count, MPI_Request requests[], int *index, int *flag,
1034 MPI_Status * status)
1039 if (index == NULL || flag == NULL) {
1040 retval = MPI_ERR_ARG;
1042 *flag = smpi_mpi_testany(count, requests, index, status);
1043 retval = MPI_SUCCESS;
1049 int PMPI_Wait(MPI_Request * request, MPI_Status * status)
1055 int rank = request && (*request)->comm != MPI_COMM_NULL
1056 ? smpi_comm_rank((*request)->comm)
1058 MPI_Group group = smpi_comm_group((*request)->comm);
1059 int src_traced = smpi_group_rank(group, (*request)->src);
1060 int dst_traced = smpi_group_rank(group, (*request)->dst);
1061 int is_wait_for_receive = (*request)->recv;
1062 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
1064 if (request == NULL) {
1065 retval = MPI_ERR_ARG;
1066 } else if (*request == MPI_REQUEST_NULL) {
1067 retval = MPI_ERR_REQUEST;
1069 smpi_mpi_wait(request, status);
1070 retval = MPI_SUCCESS;
1073 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
1074 if (is_wait_for_receive) {
1075 TRACE_smpi_recv(rank, src_traced, dst_traced);
1082 int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
1088 //save requests information for tracing
1090 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1091 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1092 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1093 for (i = 0; i < count; i++) {
1094 MPI_Request req = requests[i]; //already received requests are no longer valid
1096 int *asrc = xbt_new(int, 1);
1097 int *adst = xbt_new(int, 1);
1098 int *arecv = xbt_new(int, 1);
1102 xbt_dynar_insert_at(srcs, i, asrc);
1103 xbt_dynar_insert_at(dsts, i, adst);
1104 xbt_dynar_insert_at(recvs, i, arecv);
1106 int *t = xbt_new(int, 1);
1107 xbt_dynar_insert_at(srcs, i, t);
1108 xbt_dynar_insert_at(dsts, i, t);
1109 xbt_dynar_insert_at(recvs, i, t);
1112 int rank_traced = smpi_comm_rank(MPI_COMM_WORLD);
1113 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1115 if (index == NULL) {
1116 retval = MPI_ERR_ARG;
1118 *index = smpi_mpi_waitany(count, requests, status);
1119 retval = MPI_SUCCESS;
1122 int src_traced, dst_traced, is_wait_for_receive;
1123 xbt_dynar_get_cpy(srcs, *index, &src_traced);
1124 xbt_dynar_get_cpy(dsts, *index, &dst_traced);
1125 xbt_dynar_get_cpy(recvs, *index, &is_wait_for_receive);
1126 if (is_wait_for_receive) {
1127 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1129 TRACE_smpi_ptp_out(rank_traced, src_traced, dst_traced, __FUNCTION__);
1130 //clean-up of dynars
1139 int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
1144 //save information from requests
1146 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1147 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1148 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1149 for (i = 0; i < count; i++) {
1150 MPI_Request req = requests[i]; //all req should be valid in Waitall
1151 int *asrc = xbt_new(int, 1);
1152 int *adst = xbt_new(int, 1);
1153 int *arecv = xbt_new(int, 1);
1157 xbt_dynar_insert_at(srcs, i, asrc);
1158 xbt_dynar_insert_at(dsts, i, adst);
1159 xbt_dynar_insert_at(recvs, i, arecv);
1161 int rank_traced = smpi_comm_rank (MPI_COMM_WORLD);
1162 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1164 smpi_mpi_waitall(count, requests, status);
1166 for (i = 0; i < count; i++) {
1167 int src_traced, dst_traced, is_wait_for_receive;
1168 xbt_dynar_get_cpy(srcs, i, &src_traced);
1169 xbt_dynar_get_cpy(dsts, i, &dst_traced);
1170 xbt_dynar_get_cpy(recvs, i, &is_wait_for_receive);
1171 if (is_wait_for_receive) {
1172 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1175 TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
1176 //clean-up of dynars
1185 int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
1186 int *indices, MPI_Status status[])
1191 if (outcount == NULL || indices == NULL) {
1192 retval = MPI_ERR_ARG;
1194 *outcount = smpi_mpi_waitsome(incount, requests, indices, status);
1195 retval = MPI_SUCCESS;
1201 int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
1207 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1208 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1209 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1211 if (comm == MPI_COMM_NULL) {
1212 retval = MPI_ERR_COMM;
1214 smpi_mpi_bcast(buf, count, datatype, root, comm);
1215 retval = MPI_SUCCESS;
1218 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1224 int PMPI_Barrier(MPI_Comm comm)
1230 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1231 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1233 if (comm == MPI_COMM_NULL) {
1234 retval = MPI_ERR_COMM;
1236 smpi_mpi_barrier(comm);
1237 retval = MPI_SUCCESS;
1240 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1246 int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1247 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1248 int root, MPI_Comm comm)
1254 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1255 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1256 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1258 if (comm == MPI_COMM_NULL) {
1259 retval = MPI_ERR_COMM;
1260 } else if (sendtype == MPI_DATATYPE_NULL
1261 || recvtype == MPI_DATATYPE_NULL) {
1262 retval = MPI_ERR_TYPE;
1264 smpi_mpi_gather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1265 recvtype, root, comm);
1266 retval = MPI_SUCCESS;
1269 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1275 int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1276 void *recvbuf, int *recvcounts, int *displs,
1277 MPI_Datatype recvtype, int root, MPI_Comm comm)
1283 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1284 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1285 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1287 if (comm == MPI_COMM_NULL) {
1288 retval = MPI_ERR_COMM;
1289 } else if (sendtype == MPI_DATATYPE_NULL
1290 || recvtype == MPI_DATATYPE_NULL) {
1291 retval = MPI_ERR_TYPE;
1292 } else if (recvcounts == NULL || displs == NULL) {
1293 retval = MPI_ERR_ARG;
1295 smpi_mpi_gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1296 displs, recvtype, root, comm);
1297 retval = MPI_SUCCESS;
1300 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1306 int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1307 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1314 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1315 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1317 if (comm == MPI_COMM_NULL) {
1318 retval = MPI_ERR_COMM;
1319 } else if (sendtype == MPI_DATATYPE_NULL
1320 || recvtype == MPI_DATATYPE_NULL) {
1321 retval = MPI_ERR_TYPE;
1323 smpi_mpi_allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1325 retval = MPI_SUCCESS;
1328 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1334 int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1335 void *recvbuf, int *recvcounts, int *displs,
1336 MPI_Datatype recvtype, MPI_Comm comm)
1342 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1343 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1345 if (comm == MPI_COMM_NULL) {
1346 retval = MPI_ERR_COMM;
1347 } else if (sendtype == MPI_DATATYPE_NULL
1348 || recvtype == MPI_DATATYPE_NULL) {
1349 retval = MPI_ERR_TYPE;
1350 } else if (recvcounts == NULL || displs == NULL) {
1351 retval = MPI_ERR_ARG;
1353 smpi_mpi_allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1354 displs, recvtype, comm);
1355 retval = MPI_SUCCESS;
1358 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1364 int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1365 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1366 int root, MPI_Comm comm)
1372 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1373 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1374 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1376 if (comm == MPI_COMM_NULL) {
1377 retval = MPI_ERR_COMM;
1378 } else if (sendtype == MPI_DATATYPE_NULL
1379 || recvtype == MPI_DATATYPE_NULL) {
1380 retval = MPI_ERR_TYPE;
1382 smpi_mpi_scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1383 recvtype, root, comm);
1384 retval = MPI_SUCCESS;
1387 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1393 int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
1394 MPI_Datatype sendtype, void *recvbuf, int recvcount,
1395 MPI_Datatype recvtype, int root, MPI_Comm comm)
1401 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1402 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1403 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1405 if (comm == MPI_COMM_NULL) {
1406 retval = MPI_ERR_COMM;
1407 } else if (sendtype == MPI_DATATYPE_NULL
1408 || recvtype == MPI_DATATYPE_NULL) {
1409 retval = MPI_ERR_TYPE;
1410 } else if (sendcounts == NULL || displs == NULL) {
1411 retval = MPI_ERR_ARG;
1413 smpi_mpi_scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
1414 recvcount, recvtype, root, comm);
1415 retval = MPI_SUCCESS;
1418 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1424 int PMPI_Reduce(void *sendbuf, void *recvbuf, int count,
1425 MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
1431 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1432 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1433 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1435 if (comm == MPI_COMM_NULL) {
1436 retval = MPI_ERR_COMM;
1437 } else if (datatype == MPI_DATATYPE_NULL || op == MPI_OP_NULL) {
1438 retval = MPI_ERR_ARG;
1440 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
1441 retval = MPI_SUCCESS;
1444 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1450 int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
1451 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1457 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1458 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1460 if (comm == MPI_COMM_NULL) {
1461 retval = MPI_ERR_COMM;
1462 } else if (datatype == MPI_DATATYPE_NULL) {
1463 retval = MPI_ERR_TYPE;
1464 } else if (op == MPI_OP_NULL) {
1465 retval = MPI_ERR_OP;
1467 smpi_mpi_allreduce(sendbuf, recvbuf, count, datatype, op, comm);
1468 retval = MPI_SUCCESS;
1471 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1477 int PMPI_Scan(void *sendbuf, void *recvbuf, int count,
1478 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1484 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1485 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1487 if (comm == MPI_COMM_NULL) {
1488 retval = MPI_ERR_COMM;
1489 } else if (datatype == MPI_DATATYPE_NULL) {
1490 retval = MPI_ERR_TYPE;
1491 } else if (op == MPI_OP_NULL) {
1492 retval = MPI_ERR_OP;
1494 smpi_mpi_scan(sendbuf, recvbuf, count, datatype, op, comm);
1495 retval = MPI_SUCCESS;
1498 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1504 int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
1505 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1507 int retval, i, size, count;
1509 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1513 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1515 if (comm == MPI_COMM_NULL) {
1516 retval = MPI_ERR_COMM;
1517 } else if (datatype == MPI_DATATYPE_NULL) {
1518 retval = MPI_ERR_TYPE;
1519 } else if (op == MPI_OP_NULL) {
1520 retval = MPI_ERR_OP;
1521 } else if (recvcounts == NULL) {
1522 retval = MPI_ERR_ARG;
1524 /* arbitrarily choose root as rank 0 */
1525 /* TODO: faster direct implementation ? */
1526 size = smpi_comm_size(comm);
1528 displs = xbt_new(int, size);
1529 for (i = 0; i < size; i++) {
1530 count += recvcounts[i];
1533 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
1534 smpi_mpi_scatterv(recvbuf, recvcounts, displs, datatype, recvbuf,
1535 recvcounts[rank], datatype, 0, comm);
1537 retval = MPI_SUCCESS;
1540 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1546 int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1547 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1550 int retval, size, sendsize;
1554 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1555 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1557 if (comm == MPI_COMM_NULL) {
1558 retval = MPI_ERR_COMM;
1559 } else if (sendtype == MPI_DATATYPE_NULL
1560 || recvtype == MPI_DATATYPE_NULL) {
1561 retval = MPI_ERR_TYPE;
1563 size = smpi_comm_size(comm);
1564 sendsize = smpi_datatype_size(sendtype) * sendcount;
1565 if (sendsize < 200 && size > 12) {
1567 smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
1568 recvbuf, recvcount, recvtype,
1570 } else if (sendsize < 3000) {
1572 smpi_coll_tuned_alltoall_basic_linear(sendbuf, sendcount,
1574 recvcount, recvtype, comm);
1577 smpi_coll_tuned_alltoall_pairwise(sendbuf, sendcount, sendtype,
1578 recvbuf, recvcount, recvtype,
1583 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1589 int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
1590 MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
1591 int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
1597 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1598 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1600 if (comm == MPI_COMM_NULL) {
1601 retval = MPI_ERR_COMM;
1602 } else if (sendtype == MPI_DATATYPE_NULL
1603 || recvtype == MPI_DATATYPE_NULL) {
1604 retval = MPI_ERR_TYPE;
1605 } else if (sendcounts == NULL || senddisps == NULL || recvcounts == NULL
1606 || recvdisps == NULL) {
1607 retval = MPI_ERR_ARG;
1610 smpi_coll_basic_alltoallv(sendbuf, sendcounts, senddisps, sendtype,
1611 recvbuf, recvcounts, recvdisps, recvtype,
1615 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1622 int PMPI_Get_processor_name(char *name, int *resultlen)
1624 int retval = MPI_SUCCESS;
1627 strncpy(name, SIMIX_host_get_name(SIMIX_host_self()),
1628 MPI_MAX_PROCESSOR_NAME - 1);
1631 MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
1637 int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
1639 int retval = MPI_SUCCESS;
1643 if (status == NULL || count == NULL) {
1644 retval = MPI_ERR_ARG;
1645 } else if (datatype == MPI_DATATYPE_NULL) {
1646 retval = MPI_ERR_TYPE;
1648 size = smpi_datatype_size(datatype);
1651 } else if (status->count % size != 0) {
1652 retval = MPI_UNDEFINED;
1654 *count = smpi_mpi_get_count(status, datatype);
1661 /* The following calls are not yet implemented and will fail at runtime. */
1662 /* Once implemented, please move them above this notice. */
1664 static int not_yet_implemented(void) {
1665 xbt_die("Not yet implemented");
1666 return MPI_ERR_OTHER;
1669 int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
1670 return not_yet_implemented();
1673 int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
1674 return not_yet_implemented();
1677 int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) {
1678 return not_yet_implemented();
1681 int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) {
1682 return not_yet_implemented();
1685 int PMPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) {
1686 return not_yet_implemented();
1689 int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) {
1690 return not_yet_implemented();
1693 int PMPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) {
1694 return not_yet_implemented();
1697 int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) {
1698 return not_yet_implemented();
1701 int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) {
1702 return not_yet_implemented();
1705 int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) {
1706 return not_yet_implemented();
1709 int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) {
1710 return not_yet_implemented();
1713 int PMPI_Graph_map(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) {
1714 return not_yet_implemented();
1717 int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) {
1718 return not_yet_implemented();
1721 int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int* nneighbors) {
1722 return not_yet_implemented();
1725 int PMPI_Graphdims_get(MPI_Comm comm, int* nnodes, int* nedges) {
1726 return not_yet_implemented();
1729 int PMPI_Topo_test(MPI_Comm comm, int* top_type) {
1730 return not_yet_implemented();
1733 int PMPI_Error_class(int errorcode, int* errorclass) {
1734 return not_yet_implemented();
1737 int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler) {
1738 return not_yet_implemented();
1741 int PMPI_Errhandler_free(MPI_Errhandler* errhandler) {
1742 return not_yet_implemented();
1745 int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler) {
1746 return not_yet_implemented();
1749 int PMPI_Error_string(int errorcode, char* string, int* resultlen) {
1750 return not_yet_implemented();
1753 int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {
1754 return not_yet_implemented();
1757 int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* newtype) {
1758 return not_yet_implemented();
1761 int PMPI_Cancel(MPI_Request* request) {
1762 return not_yet_implemented();
1765 int PMPI_Buffer_attach(void* buffer, int size) {
1766 return not_yet_implemented();
1769 int PMPI_Buffer_detach(void* buffer, int* size) {
1770 return not_yet_implemented();
1773 int PMPI_Testsome(int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses) {
1774 return not_yet_implemented();
1777 int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
1778 return not_yet_implemented();
1781 int PMPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
1782 return not_yet_implemented();
1785 int PMPI_Type_commit(MPI_Datatype* datatype) {
1786 return not_yet_implemented();
1789 int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1790 return not_yet_implemented();
1793 int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1794 return not_yet_implemented();
1797 int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1798 return not_yet_implemented();
1801 int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
1802 return not_yet_implemented();
1805 int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1806 return not_yet_implemented();
1809 int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1810 return not_yet_implemented();
1813 int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1814 return not_yet_implemented();
1817 int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) {
1818 return not_yet_implemented();
1821 int PMPI_Intercomm_merge(MPI_Comm comm, int high, MPI_Comm* comm_out) {
1822 return not_yet_implemented();
1825 int PMPI_Bsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1826 return not_yet_implemented();
1829 int PMPI_Bsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1830 return not_yet_implemented();
1833 int PMPI_Ibsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1834 return not_yet_implemented();
1837 int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group* group) {
1838 return not_yet_implemented();
1841 int PMPI_Comm_remote_size(MPI_Comm comm, int* size) {
1842 return not_yet_implemented();
1845 int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1846 return not_yet_implemented();
1849 int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
1850 return not_yet_implemented();
1853 int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
1854 return not_yet_implemented();
1857 int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
1858 return not_yet_implemented();
1861 int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
1862 return not_yet_implemented();
1865 int PMPI_Rsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1866 return not_yet_implemented();
1869 int PMPI_Rsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1870 return not_yet_implemented();
1873 int PMPI_Irsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1874 return not_yet_implemented();
1877 int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
1878 return not_yet_implemented();
1881 int PMPI_Keyval_free(int* keyval) {
1882 return not_yet_implemented();
1885 int PMPI_Test_cancelled(MPI_Status* status, int* flag) {
1886 return not_yet_implemented();
1889 int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
1890 return not_yet_implemented();
1893 int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) {
1894 return not_yet_implemented();
1897 int PMPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) {
1898 return not_yet_implemented();
1901 int PMPI_Dims_create(int nnodes, int ndims, int* dims) {
1902 return not_yet_implemented();
1905 int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) {
1906 return not_yet_implemented();
1909 int PMPI_Initialized(int* flag) {
1910 return not_yet_implemented();