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_mpi_dt_private.h"
10 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi,
11 "Logging specific to SMPI (pmpi)");
14 //this function need to be here because of the calls to smpi_bench
15 void TRACE_smpi_set_category(const char *category)
17 //need to end bench otherwise categories for execution tasks are wrong
19 TRACE_internal_smpi_set_category (category);
20 //begin bench after changing process's category
25 /* PMPI User level calls */
27 int PMPI_Init(int *argc, char ***argv)
29 smpi_process_init(argc, argv);
31 TRACE_smpi_init(smpi_process_index());
37 int PMPI_Finalize(void)
41 TRACE_smpi_finalize(smpi_process_index());
43 smpi_process_destroy();
47 int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided)
49 if (provided != NULL) {
50 *provided = MPI_THREAD_MULTIPLE;
52 return MPI_Init(argc, argv);
55 int PMPI_Query_thread(int *provided)
60 if (provided == NULL) {
63 *provided = MPI_THREAD_MULTIPLE;
70 int PMPI_Is_thread_main(int *flag)
78 *flag = smpi_process_index() == 0;
85 int PMPI_Abort(MPI_Comm comm, int errorcode)
88 smpi_process_destroy();
89 // FIXME: should kill all processes in comm instead
90 SIMIX_req_process_kill(SIMIX_process_self());
94 double PMPI_Wtime(void)
99 time = SIMIX_get_clock();
104 int PMPI_Address(void *location, MPI_Aint * address)
110 retval = MPI_ERR_ARG;
112 *address = (MPI_Aint) location;
118 int PMPI_Type_free(MPI_Datatype * datatype)
124 retval = MPI_ERR_ARG;
126 // FIXME: always fail for now
127 retval = MPI_ERR_TYPE;
133 int PMPI_Type_size(MPI_Datatype datatype, int *size)
138 if (datatype == MPI_DATATYPE_NULL) {
139 retval = MPI_ERR_TYPE;
140 } else if (size == NULL) {
141 retval = MPI_ERR_ARG;
143 *size = (int) smpi_datatype_size(datatype);
144 retval = MPI_SUCCESS;
150 int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
155 if (datatype == MPI_DATATYPE_NULL) {
156 retval = MPI_ERR_TYPE;
157 } else if (lb == NULL || extent == NULL) {
158 retval = MPI_ERR_ARG;
160 retval = smpi_datatype_extent(datatype, lb, extent);
166 int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
172 if (datatype == MPI_DATATYPE_NULL) {
173 retval = MPI_ERR_TYPE;
174 } else if (extent == NULL) {
175 retval = MPI_ERR_ARG;
177 retval = smpi_datatype_extent(datatype, &dummy, extent);
183 int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
188 if (datatype == MPI_DATATYPE_NULL) {
189 retval = MPI_ERR_TYPE;
190 } else if (disp == NULL) {
191 retval = MPI_ERR_ARG;
193 *disp = smpi_datatype_lb(datatype);
194 retval = MPI_SUCCESS;
200 int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
205 if (datatype == MPI_DATATYPE_NULL) {
206 retval = MPI_ERR_TYPE;
207 } else if (disp == NULL) {
208 retval = MPI_ERR_ARG;
210 *disp = smpi_datatype_ub(datatype);
211 retval = MPI_SUCCESS;
217 int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
222 if (function == NULL || op == NULL) {
223 retval = MPI_ERR_ARG;
225 *op = smpi_op_new(function, commute);
226 retval = MPI_SUCCESS;
232 int PMPI_Op_free(MPI_Op * op)
238 retval = MPI_ERR_ARG;
239 } else if (*op == MPI_OP_NULL) {
242 smpi_op_destroy(*op);
244 retval = MPI_SUCCESS;
250 int PMPI_Group_free(MPI_Group * group)
256 retval = MPI_ERR_ARG;
258 smpi_group_destroy(*group);
259 *group = MPI_GROUP_NULL;
260 retval = MPI_SUCCESS;
266 int PMPI_Group_size(MPI_Group group, int *size)
271 if (group == MPI_GROUP_NULL) {
272 retval = MPI_ERR_GROUP;
273 } else if (size == NULL) {
274 retval = MPI_ERR_ARG;
276 *size = smpi_group_size(group);
277 retval = MPI_SUCCESS;
283 int PMPI_Group_rank(MPI_Group group, int *rank)
288 if (group == MPI_GROUP_NULL) {
289 retval = MPI_ERR_GROUP;
290 } else if (rank == NULL) {
291 retval = MPI_ERR_ARG;
293 *rank = smpi_group_rank(group, smpi_process_index());
294 retval = MPI_SUCCESS;
300 int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
301 MPI_Group group2, int *ranks2)
303 int retval, i, index;
306 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
307 retval = MPI_ERR_GROUP;
309 for (i = 0; i < n; i++) {
310 index = smpi_group_index(group1, ranks1[i]);
311 ranks2[i] = smpi_group_rank(group2, index);
313 retval = MPI_SUCCESS;
319 int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
324 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
325 retval = MPI_ERR_GROUP;
326 } else if (result == NULL) {
327 retval = MPI_ERR_ARG;
329 *result = smpi_group_compare(group1, group2);
330 retval = MPI_SUCCESS;
336 int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
337 MPI_Group * newgroup)
339 int retval, i, proc1, proc2, size, size2;
342 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
343 retval = MPI_ERR_GROUP;
344 } else if (newgroup == NULL) {
345 retval = MPI_ERR_ARG;
347 size = smpi_group_size(group1);
348 size2 = smpi_group_size(group2);
349 for (i = 0; i < size2; i++) {
350 proc2 = smpi_group_index(group2, i);
351 proc1 = smpi_group_rank(group1, proc2);
352 if (proc1 == MPI_UNDEFINED) {
357 *newgroup = MPI_GROUP_EMPTY;
359 *newgroup = smpi_group_new(size);
360 size2 = smpi_group_size(group1);
361 for (i = 0; i < size2; i++) {
362 proc1 = smpi_group_index(group1, i);
363 smpi_group_set_mapping(*newgroup, proc1, i);
365 for (i = size2; i < size; i++) {
366 proc2 = smpi_group_index(group2, i - size2);
367 smpi_group_set_mapping(*newgroup, proc2, i);
370 smpi_group_use(*newgroup);
371 retval = MPI_SUCCESS;
377 int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2,
378 MPI_Group * newgroup)
380 int retval, i, proc1, proc2, size, size2;
383 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
384 retval = MPI_ERR_GROUP;
385 } else if (newgroup == NULL) {
386 retval = MPI_ERR_ARG;
388 size = smpi_group_size(group1);
389 size2 = smpi_group_size(group2);
390 for (i = 0; i < size2; i++) {
391 proc2 = smpi_group_index(group2, i);
392 proc1 = smpi_group_rank(group1, proc2);
393 if (proc1 == MPI_UNDEFINED) {
398 *newgroup = MPI_GROUP_EMPTY;
400 *newgroup = smpi_group_new(size);
401 size2 = smpi_group_size(group1);
402 for (i = 0; i < size2; i++) {
403 proc1 = smpi_group_index(group1, i);
404 proc2 = smpi_group_rank(group2, proc1);
405 if (proc2 != MPI_UNDEFINED) {
406 smpi_group_set_mapping(*newgroup, proc1, i);
410 smpi_group_use(*newgroup);
411 retval = MPI_SUCCESS;
417 int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup)
419 int retval, i, proc1, proc2, size, size2;
422 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
423 retval = MPI_ERR_GROUP;
424 } else if (newgroup == NULL) {
425 retval = MPI_ERR_ARG;
427 size = size2 = smpi_group_size(group1);
428 for (i = 0; i < size2; i++) {
429 proc1 = smpi_group_index(group1, i);
430 proc2 = smpi_group_rank(group2, proc1);
431 if (proc2 != MPI_UNDEFINED) {
436 *newgroup = MPI_GROUP_EMPTY;
438 *newgroup = smpi_group_new(size);
439 for (i = 0; i < size2; i++) {
440 proc1 = smpi_group_index(group1, i);
441 proc2 = smpi_group_rank(group2, proc1);
442 if (proc2 == MPI_UNDEFINED) {
443 smpi_group_set_mapping(*newgroup, proc1, i);
447 smpi_group_use(*newgroup);
448 retval = MPI_SUCCESS;
454 int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
456 int retval, i, index;
459 if (group == MPI_GROUP_NULL) {
460 retval = MPI_ERR_GROUP;
461 } else if (newgroup == NULL) {
462 retval = MPI_ERR_ARG;
465 *newgroup = MPI_GROUP_EMPTY;
466 } else if (n == smpi_group_size(group)) {
469 *newgroup = smpi_group_new(n);
470 for (i = 0; i < n; i++) {
471 index = smpi_group_index(group, ranks[i]);
472 smpi_group_set_mapping(*newgroup, index, i);
475 smpi_group_use(*newgroup);
476 retval = MPI_SUCCESS;
482 int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
484 int retval, i, size, rank, index;
487 if (group == MPI_GROUP_NULL) {
488 retval = MPI_ERR_GROUP;
489 } else if (newgroup == NULL) {
490 retval = MPI_ERR_ARG;
494 } else if (n == smpi_group_size(group)) {
495 *newgroup = MPI_GROUP_EMPTY;
497 size = smpi_group_size(group) - n;
498 *newgroup = smpi_group_new(size);
500 while (rank < size) {
501 for (i = 0; i < n; i++) {
502 if (ranks[i] == rank) {
507 index = smpi_group_index(group, rank);
508 smpi_group_set_mapping(*newgroup, index, rank);
513 smpi_group_use(*newgroup);
514 retval = MPI_SUCCESS;
520 int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
521 MPI_Group * newgroup)
523 int retval, i, j, rank, size, index;
526 if (group == MPI_GROUP_NULL) {
527 retval = MPI_ERR_GROUP;
528 } else if (newgroup == NULL) {
529 retval = MPI_ERR_ARG;
532 *newgroup = MPI_GROUP_EMPTY;
535 for (i = 0; i < n; i++) {
536 for (rank = ranges[i][0]; /* First */
537 rank >= 0 && rank <= ranges[i][1]; /* Last */
538 rank += ranges[i][2] /* Stride */ ) {
542 if (size == smpi_group_size(group)) {
545 *newgroup = smpi_group_new(size);
547 for (i = 0; i < n; i++) {
548 for (rank = ranges[i][0]; /* First */
549 rank >= 0 && rank <= ranges[i][1]; /* Last */
550 rank += ranges[i][2] /* Stride */ ) {
551 index = smpi_group_index(group, rank);
552 smpi_group_set_mapping(*newgroup, index, j);
558 smpi_group_use(*newgroup);
559 retval = MPI_SUCCESS;
565 int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
566 MPI_Group * newgroup)
568 int retval, i, newrank, rank, size, index, add;
571 if (group == MPI_GROUP_NULL) {
572 retval = MPI_ERR_GROUP;
573 } else if (newgroup == NULL) {
574 retval = MPI_ERR_ARG;
579 size = smpi_group_size(group);
580 for (i = 0; i < n; i++) {
581 for (rank = ranges[i][0]; /* First */
582 rank >= 0 && rank <= ranges[i][1]; /* Last */
583 rank += ranges[i][2] /* Stride */ ) {
588 *newgroup = MPI_GROUP_EMPTY;
590 *newgroup = smpi_group_new(size);
592 while (newrank < size) {
593 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 */ ) {
598 if (rank == newrank) {
604 index = smpi_group_index(group, newrank);
605 smpi_group_set_mapping(*newgroup, index, newrank);
611 smpi_group_use(*newgroup);
612 retval = MPI_SUCCESS;
618 int PMPI_Comm_rank(MPI_Comm comm, int *rank)
623 if (comm == MPI_COMM_NULL) {
624 retval = MPI_ERR_COMM;
625 } else if (rank == NULL) {
626 retval = MPI_ERR_ARG;
628 *rank = smpi_comm_rank(comm);
629 retval = MPI_SUCCESS;
635 int PMPI_Comm_size(MPI_Comm comm, int *size)
640 if (comm == MPI_COMM_NULL) {
641 retval = MPI_ERR_COMM;
642 } else if (size == NULL) {
643 retval = MPI_ERR_ARG;
645 *size = smpi_comm_size(comm);
646 retval = MPI_SUCCESS;
652 int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
657 if (comm == MPI_COMM_NULL) {
658 retval = MPI_ERR_COMM;
659 } else if (name == NULL || len == NULL) {
660 retval = MPI_ERR_ARG;
662 smpi_comm_get_name(comm, name, len);
663 retval = MPI_SUCCESS;
669 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
674 if (comm == MPI_COMM_NULL) {
675 retval = MPI_ERR_COMM;
676 } else if (group == NULL) {
677 retval = MPI_ERR_ARG;
679 *group = smpi_comm_group(comm);
680 retval = MPI_SUCCESS;
686 int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
691 if (comm1 == MPI_COMM_NULL || comm2 == MPI_COMM_NULL) {
692 retval = MPI_ERR_COMM;
693 } else if (result == NULL) {
694 retval = MPI_ERR_ARG;
696 if (comm1 == comm2) { /* Same communicators means same groups */
700 smpi_group_compare(smpi_comm_group(comm1),
701 smpi_comm_group(comm2));
702 if (*result == MPI_IDENT) {
703 *result = MPI_CONGRUENT;
706 retval = MPI_SUCCESS;
712 int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
717 if (comm == MPI_COMM_NULL) {
718 retval = MPI_ERR_COMM;
719 } else if (newcomm == NULL) {
720 retval = MPI_ERR_ARG;
722 *newcomm = smpi_comm_new(smpi_comm_group(comm));
723 retval = MPI_SUCCESS;
729 int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
734 if (comm == MPI_COMM_NULL) {
735 retval = MPI_ERR_COMM;
736 } else if (group == MPI_GROUP_NULL) {
737 retval = MPI_ERR_GROUP;
738 } else if (newcomm == NULL) {
739 retval = MPI_ERR_ARG;
741 *newcomm = smpi_comm_new(group);
742 retval = MPI_SUCCESS;
748 int PMPI_Comm_free(MPI_Comm * comm)
754 retval = MPI_ERR_ARG;
755 } else if (*comm == MPI_COMM_NULL) {
756 retval = MPI_ERR_COMM;
758 smpi_comm_destroy(*comm);
759 *comm = MPI_COMM_NULL;
760 retval = MPI_SUCCESS;
766 int PMPI_Comm_disconnect(MPI_Comm * comm)
768 /* TODO: wait until all communication in comm are done */
773 retval = MPI_ERR_ARG;
774 } else if (*comm == MPI_COMM_NULL) {
775 retval = MPI_ERR_COMM;
777 smpi_comm_destroy(*comm);
778 *comm = MPI_COMM_NULL;
779 retval = MPI_SUCCESS;
785 int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
790 if (comm_out == NULL) {
791 retval = MPI_ERR_ARG;
792 } else if (comm == MPI_COMM_NULL) {
793 retval = MPI_ERR_COMM;
795 *comm_out = smpi_comm_split(comm, color, key);
796 retval = MPI_SUCCESS;
802 int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst,
803 int tag, MPI_Comm comm, MPI_Request * request)
808 if (request == NULL) {
809 retval = MPI_ERR_ARG;
810 } else if (comm == MPI_COMM_NULL) {
811 retval = MPI_ERR_COMM;
813 *request = smpi_mpi_send_init(buf, count, datatype, dst, tag, comm);
814 retval = MPI_SUCCESS;
820 int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src,
821 int tag, MPI_Comm comm, MPI_Request * request)
826 if (request == NULL) {
827 retval = MPI_ERR_ARG;
828 } else if (comm == MPI_COMM_NULL) {
829 retval = MPI_ERR_COMM;
831 *request = smpi_mpi_recv_init(buf, count, datatype, src, tag, comm);
832 retval = MPI_SUCCESS;
838 int PMPI_Start(MPI_Request * request)
843 if (request == NULL) {
844 retval = MPI_ERR_ARG;
846 smpi_mpi_start(*request);
847 retval = MPI_SUCCESS;
853 int PMPI_Startall(int count, MPI_Request * requests)
858 if (requests == NULL) {
859 retval = MPI_ERR_ARG;
861 smpi_mpi_startall(count, requests);
862 retval = MPI_SUCCESS;
868 int PMPI_Request_free(MPI_Request * request)
873 if (request == NULL) {
874 retval = MPI_ERR_ARG;
876 smpi_mpi_request_free(request);
877 retval = MPI_SUCCESS;
883 int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
884 int tag, MPI_Comm comm, MPI_Request * request)
890 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
891 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
892 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
894 if (request == NULL) {
895 retval = MPI_ERR_ARG;
896 } else if (comm == MPI_COMM_NULL) {
897 retval = MPI_ERR_COMM;
899 *request = smpi_mpi_irecv(buf, count, datatype, src, tag, comm);
900 retval = MPI_SUCCESS;
903 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
904 (*request)->recv = 1;
910 int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
911 int tag, MPI_Comm comm, MPI_Request * request)
917 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
918 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
919 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
920 TRACE_smpi_send(rank, rank, dst_traced);
922 if (request == NULL) {
923 retval = MPI_ERR_ARG;
924 } else if (comm == MPI_COMM_NULL) {
925 retval = MPI_ERR_COMM;
927 *request = smpi_mpi_isend(buf, count, datatype, dst, tag, comm);
928 retval = MPI_SUCCESS;
931 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
932 (*request)->send = 1;
938 int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
939 MPI_Comm comm, MPI_Status * status)
945 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
946 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
947 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
949 if (comm == MPI_COMM_NULL) {
950 retval = MPI_ERR_COMM;
952 smpi_mpi_recv(buf, count, datatype, src, tag, comm, status);
953 retval = MPI_SUCCESS;
956 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
957 TRACE_smpi_recv(rank, src_traced, rank);
963 int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
970 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
971 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
972 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
973 TRACE_smpi_send(rank, rank, dst_traced);
975 if (comm == MPI_COMM_NULL) {
976 retval = MPI_ERR_COMM;
978 smpi_mpi_send(buf, count, datatype, dst, tag, comm);
979 retval = MPI_SUCCESS;
982 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
988 int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
989 int dst, int sendtag, void *recvbuf, int recvcount,
990 MPI_Datatype recvtype, int src, int recvtag,
991 MPI_Comm comm, MPI_Status * status)
997 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
998 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
999 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
1000 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
1001 TRACE_smpi_send(rank, rank, dst_traced);
1002 TRACE_smpi_send(rank, src_traced, rank);
1004 if (comm == MPI_COMM_NULL) {
1005 retval = MPI_ERR_COMM;
1006 } else if (sendtype == MPI_DATATYPE_NULL
1007 || recvtype == MPI_DATATYPE_NULL) {
1008 retval = MPI_ERR_TYPE;
1010 smpi_mpi_sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf,
1011 recvcount, recvtype, src, recvtag, comm, status);
1012 retval = MPI_SUCCESS;
1015 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
1016 TRACE_smpi_recv(rank, rank, dst_traced);
1017 TRACE_smpi_recv(rank, src_traced, rank);
1023 int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
1024 int dst, int sendtag, int src, int recvtag,
1025 MPI_Comm comm, MPI_Status * status)
1027 //TODO: suboptimal implementation
1031 size = smpi_datatype_size(datatype) * count;
1032 recvbuf = xbt_new(char, size);
1034 MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count,
1035 datatype, src, recvtag, comm, status);
1036 memcpy(buf, recvbuf, size * sizeof(char));
1041 int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
1046 if (request == NULL || flag == NULL) {
1047 retval = MPI_ERR_ARG;
1048 } else if (*request == MPI_REQUEST_NULL) {
1049 retval = MPI_ERR_REQUEST;
1051 *flag = smpi_mpi_test(request, status);
1052 retval = MPI_SUCCESS;
1058 int PMPI_Testany(int count, MPI_Request requests[], int *index, int *flag,
1059 MPI_Status * status)
1064 if (index == NULL || flag == NULL) {
1065 retval = MPI_ERR_ARG;
1067 *flag = smpi_mpi_testany(count, requests, index, status);
1068 retval = MPI_SUCCESS;
1074 int PMPI_Wait(MPI_Request * request, MPI_Status * status)
1080 int rank = request && (*request)->comm != MPI_COMM_NULL
1081 ? smpi_comm_rank((*request)->comm)
1083 MPI_Group group = smpi_comm_group((*request)->comm);
1084 int src_traced = smpi_group_rank(group, (*request)->src);
1085 int dst_traced = smpi_group_rank(group, (*request)->dst);
1086 int is_wait_for_receive = (*request)->recv;
1087 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
1089 if (request == NULL) {
1090 retval = MPI_ERR_ARG;
1091 } else if (*request == MPI_REQUEST_NULL) {
1092 retval = MPI_ERR_REQUEST;
1094 smpi_mpi_wait(request, status);
1095 retval = MPI_SUCCESS;
1098 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
1099 if (is_wait_for_receive) {
1100 TRACE_smpi_recv(rank, src_traced, dst_traced);
1107 int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
1113 //save requests information for tracing
1115 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1116 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1117 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1118 for (i = 0; i < count; i++) {
1119 MPI_Request req = requests[i]; //already received requests are no longer valid
1121 int *asrc = xbt_new(int, 1);
1122 int *adst = xbt_new(int, 1);
1123 int *arecv = xbt_new(int, 1);
1127 xbt_dynar_insert_at(srcs, i, asrc);
1128 xbt_dynar_insert_at(dsts, i, adst);
1129 xbt_dynar_insert_at(recvs, i, arecv);
1131 int *t = xbt_new(int, 1);
1132 xbt_dynar_insert_at(srcs, i, t);
1133 xbt_dynar_insert_at(dsts, i, t);
1134 xbt_dynar_insert_at(recvs, i, t);
1137 int rank_traced = smpi_comm_rank(MPI_COMM_WORLD);
1138 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1140 if (index == NULL) {
1141 retval = MPI_ERR_ARG;
1143 *index = smpi_mpi_waitany(count, requests, status);
1144 retval = MPI_SUCCESS;
1147 int src_traced, dst_traced, is_wait_for_receive;
1148 xbt_dynar_get_cpy(srcs, *index, &src_traced);
1149 xbt_dynar_get_cpy(dsts, *index, &dst_traced);
1150 xbt_dynar_get_cpy(recvs, *index, &is_wait_for_receive);
1151 if (is_wait_for_receive) {
1152 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1154 TRACE_smpi_ptp_out(rank_traced, src_traced, dst_traced, __FUNCTION__);
1155 //clean-up of dynars
1164 int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
1169 //save information from requests
1171 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1172 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1173 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1174 for (i = 0; i < count; i++) {
1175 MPI_Request req = requests[i]; //all req should be valid in Waitall
1176 int *asrc = xbt_new(int, 1);
1177 int *adst = xbt_new(int, 1);
1178 int *arecv = xbt_new(int, 1);
1182 xbt_dynar_insert_at(srcs, i, asrc);
1183 xbt_dynar_insert_at(dsts, i, adst);
1184 xbt_dynar_insert_at(recvs, i, arecv);
1186 int rank_traced = smpi_comm_rank (MPI_COMM_WORLD);
1187 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1189 smpi_mpi_waitall(count, requests, status);
1191 for (i = 0; i < count; i++) {
1192 int src_traced, dst_traced, is_wait_for_receive;
1193 xbt_dynar_get_cpy(srcs, i, &src_traced);
1194 xbt_dynar_get_cpy(dsts, i, &dst_traced);
1195 xbt_dynar_get_cpy(recvs, i, &is_wait_for_receive);
1196 if (is_wait_for_receive) {
1197 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1200 TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
1201 //clean-up of dynars
1210 int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
1211 int *indices, MPI_Status status[])
1216 if (outcount == NULL || indices == NULL) {
1217 retval = MPI_ERR_ARG;
1219 *outcount = smpi_mpi_waitsome(incount, requests, indices, status);
1220 retval = MPI_SUCCESS;
1226 int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
1232 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1233 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1234 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1236 if (comm == MPI_COMM_NULL) {
1237 retval = MPI_ERR_COMM;
1239 smpi_mpi_bcast(buf, count, datatype, root, comm);
1240 retval = MPI_SUCCESS;
1243 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1249 int PMPI_Barrier(MPI_Comm comm)
1255 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1256 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1258 if (comm == MPI_COMM_NULL) {
1259 retval = MPI_ERR_COMM;
1261 smpi_mpi_barrier(comm);
1262 retval = MPI_SUCCESS;
1265 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1271 int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1272 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1273 int root, MPI_Comm comm)
1279 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1280 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1281 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1283 if (comm == MPI_COMM_NULL) {
1284 retval = MPI_ERR_COMM;
1285 } else if (sendtype == MPI_DATATYPE_NULL
1286 || recvtype == MPI_DATATYPE_NULL) {
1287 retval = MPI_ERR_TYPE;
1289 smpi_mpi_gather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1290 recvtype, root, comm);
1291 retval = MPI_SUCCESS;
1294 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1300 int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1301 void *recvbuf, int *recvcounts, int *displs,
1302 MPI_Datatype recvtype, int root, MPI_Comm comm)
1308 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1309 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1310 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1312 if (comm == MPI_COMM_NULL) {
1313 retval = MPI_ERR_COMM;
1314 } else if (sendtype == MPI_DATATYPE_NULL
1315 || recvtype == MPI_DATATYPE_NULL) {
1316 retval = MPI_ERR_TYPE;
1317 } else if (recvcounts == NULL || displs == NULL) {
1318 retval = MPI_ERR_ARG;
1320 smpi_mpi_gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1321 displs, recvtype, root, comm);
1322 retval = MPI_SUCCESS;
1325 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1331 int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1332 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1339 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1340 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1342 if (comm == MPI_COMM_NULL) {
1343 retval = MPI_ERR_COMM;
1344 } else if (sendtype == MPI_DATATYPE_NULL
1345 || recvtype == MPI_DATATYPE_NULL) {
1346 retval = MPI_ERR_TYPE;
1348 smpi_mpi_allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1350 retval = MPI_SUCCESS;
1353 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1359 int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1360 void *recvbuf, int *recvcounts, int *displs,
1361 MPI_Datatype recvtype, MPI_Comm comm)
1367 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1368 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1370 if (comm == MPI_COMM_NULL) {
1371 retval = MPI_ERR_COMM;
1372 } else if (sendtype == MPI_DATATYPE_NULL
1373 || recvtype == MPI_DATATYPE_NULL) {
1374 retval = MPI_ERR_TYPE;
1375 } else if (recvcounts == NULL || displs == NULL) {
1376 retval = MPI_ERR_ARG;
1378 smpi_mpi_allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1379 displs, recvtype, comm);
1380 retval = MPI_SUCCESS;
1383 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1389 int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1390 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1391 int root, MPI_Comm comm)
1397 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1398 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1399 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1401 if (comm == MPI_COMM_NULL) {
1402 retval = MPI_ERR_COMM;
1403 } else if (sendtype == MPI_DATATYPE_NULL
1404 || recvtype == MPI_DATATYPE_NULL) {
1405 retval = MPI_ERR_TYPE;
1407 smpi_mpi_scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1408 recvtype, root, comm);
1409 retval = MPI_SUCCESS;
1412 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1418 int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
1419 MPI_Datatype sendtype, void *recvbuf, int recvcount,
1420 MPI_Datatype recvtype, int root, MPI_Comm comm)
1426 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1427 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1428 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1430 if (comm == MPI_COMM_NULL) {
1431 retval = MPI_ERR_COMM;
1432 } else if (sendtype == MPI_DATATYPE_NULL
1433 || recvtype == MPI_DATATYPE_NULL) {
1434 retval = MPI_ERR_TYPE;
1435 } else if (sendcounts == NULL || displs == NULL) {
1436 retval = MPI_ERR_ARG;
1438 smpi_mpi_scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
1439 recvcount, recvtype, root, comm);
1440 retval = MPI_SUCCESS;
1443 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1449 int PMPI_Reduce(void *sendbuf, void *recvbuf, int count,
1450 MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
1456 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1457 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1458 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1460 if (comm == MPI_COMM_NULL) {
1461 retval = MPI_ERR_COMM;
1462 } else if (datatype == MPI_DATATYPE_NULL || op == MPI_OP_NULL) {
1463 retval = MPI_ERR_ARG;
1465 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
1466 retval = MPI_SUCCESS;
1469 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1475 int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
1476 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1482 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1483 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1485 if (comm == MPI_COMM_NULL) {
1486 retval = MPI_ERR_COMM;
1487 } else if (datatype == MPI_DATATYPE_NULL) {
1488 retval = MPI_ERR_TYPE;
1489 } else if (op == MPI_OP_NULL) {
1490 retval = MPI_ERR_OP;
1492 smpi_mpi_allreduce(sendbuf, recvbuf, count, datatype, op, comm);
1493 retval = MPI_SUCCESS;
1496 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1502 int PMPI_Scan(void *sendbuf, void *recvbuf, int count,
1503 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1509 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1510 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1512 if (comm == MPI_COMM_NULL) {
1513 retval = MPI_ERR_COMM;
1514 } else if (datatype == MPI_DATATYPE_NULL) {
1515 retval = MPI_ERR_TYPE;
1516 } else if (op == MPI_OP_NULL) {
1517 retval = MPI_ERR_OP;
1519 smpi_mpi_scan(sendbuf, recvbuf, count, datatype, op, comm);
1520 retval = MPI_SUCCESS;
1523 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1529 int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
1530 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1532 int retval, i, size, count;
1534 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1538 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1540 if (comm == MPI_COMM_NULL) {
1541 retval = MPI_ERR_COMM;
1542 } else if (datatype == MPI_DATATYPE_NULL) {
1543 retval = MPI_ERR_TYPE;
1544 } else if (op == MPI_OP_NULL) {
1545 retval = MPI_ERR_OP;
1546 } else if (recvcounts == NULL) {
1547 retval = MPI_ERR_ARG;
1549 /* arbitrarily choose root as rank 0 */
1550 /* TODO: faster direct implementation ? */
1551 size = smpi_comm_size(comm);
1553 displs = xbt_new(int, size);
1554 for (i = 0; i < size; i++) {
1555 count += recvcounts[i];
1558 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
1559 smpi_mpi_scatterv(recvbuf, recvcounts, displs, datatype, recvbuf,
1560 recvcounts[rank], datatype, 0, comm);
1562 retval = MPI_SUCCESS;
1565 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1571 int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1572 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1575 int retval, size, sendsize;
1579 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1580 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1582 if (comm == MPI_COMM_NULL) {
1583 retval = MPI_ERR_COMM;
1584 } else if (sendtype == MPI_DATATYPE_NULL
1585 || recvtype == MPI_DATATYPE_NULL) {
1586 retval = MPI_ERR_TYPE;
1588 size = smpi_comm_size(comm);
1589 sendsize = smpi_datatype_size(sendtype) * sendcount;
1590 if (sendsize < 200 && size > 12) {
1592 smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
1593 recvbuf, recvcount, recvtype,
1595 } else if (sendsize < 3000) {
1597 smpi_coll_tuned_alltoall_basic_linear(sendbuf, sendcount,
1599 recvcount, recvtype, comm);
1602 smpi_coll_tuned_alltoall_pairwise(sendbuf, sendcount, sendtype,
1603 recvbuf, recvcount, recvtype,
1608 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1614 int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
1615 MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
1616 int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
1622 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1623 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1625 if (comm == MPI_COMM_NULL) {
1626 retval = MPI_ERR_COMM;
1627 } else if (sendtype == MPI_DATATYPE_NULL
1628 || recvtype == MPI_DATATYPE_NULL) {
1629 retval = MPI_ERR_TYPE;
1630 } else if (sendcounts == NULL || senddisps == NULL || recvcounts == NULL
1631 || recvdisps == NULL) {
1632 retval = MPI_ERR_ARG;
1635 smpi_coll_basic_alltoallv(sendbuf, sendcounts, senddisps, sendtype,
1636 recvbuf, recvcounts, recvdisps, recvtype,
1640 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1647 int PMPI_Get_processor_name(char *name, int *resultlen)
1649 int retval = MPI_SUCCESS;
1652 strncpy(name, SIMIX_host_get_name(SIMIX_host_self()),
1653 MPI_MAX_PROCESSOR_NAME - 1);
1656 MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
1662 int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
1664 int retval = MPI_SUCCESS;
1668 if (status == NULL || count == NULL) {
1669 retval = MPI_ERR_ARG;
1670 } else if (datatype == MPI_DATATYPE_NULL) {
1671 retval = MPI_ERR_TYPE;
1673 size = smpi_datatype_size(datatype);
1676 } else if (status->count % size != 0) {
1677 retval = MPI_UNDEFINED;
1679 *count = smpi_mpi_get_count(status, datatype);
1686 /* The following calls are not yet implemented and will fail at runtime. */
1687 /* Once implemented, please move them above this notice. */
1689 static int not_yet_implemented(void) {
1690 xbt_die("Not yet implemented");
1691 return MPI_ERR_OTHER;
1694 int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
1695 return not_yet_implemented();
1698 int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
1699 return not_yet_implemented();
1702 int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) {
1703 return not_yet_implemented();
1706 int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) {
1707 return not_yet_implemented();
1710 int PMPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) {
1711 return not_yet_implemented();
1714 int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) {
1715 return not_yet_implemented();
1718 int PMPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) {
1719 return not_yet_implemented();
1722 int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) {
1723 return not_yet_implemented();
1726 int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) {
1727 return not_yet_implemented();
1730 int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) {
1731 return not_yet_implemented();
1734 int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) {
1735 return not_yet_implemented();
1738 int PMPI_Graph_map(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) {
1739 return not_yet_implemented();
1742 int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) {
1743 return not_yet_implemented();
1746 int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int* nneighbors) {
1747 return not_yet_implemented();
1750 int PMPI_Graphdims_get(MPI_Comm comm, int* nnodes, int* nedges) {
1751 return not_yet_implemented();
1754 int PMPI_Topo_test(MPI_Comm comm, int* top_type) {
1755 return not_yet_implemented();
1758 int PMPI_Error_class(int errorcode, int* errorclass) {
1759 return not_yet_implemented();
1762 int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler) {
1763 return not_yet_implemented();
1766 int PMPI_Errhandler_free(MPI_Errhandler* errhandler) {
1767 return not_yet_implemented();
1770 int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler) {
1771 return not_yet_implemented();
1774 int PMPI_Error_string(int errorcode, char* string, int* resultlen) {
1775 return not_yet_implemented();
1778 int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {
1779 return not_yet_implemented();
1782 int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* newtype) {
1783 return not_yet_implemented();
1786 int PMPI_Cancel(MPI_Request* request) {
1787 return not_yet_implemented();
1790 int PMPI_Buffer_attach(void* buffer, int size) {
1791 return not_yet_implemented();
1794 int PMPI_Buffer_detach(void* buffer, int* size) {
1795 return not_yet_implemented();
1798 int PMPI_Testsome(int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses) {
1799 return not_yet_implemented();
1802 int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
1803 return not_yet_implemented();
1806 int PMPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
1807 return not_yet_implemented();
1810 int PMPI_Type_commit(MPI_Datatype* datatype) {
1811 return not_yet_implemented();
1814 int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1815 return not_yet_implemented();
1818 int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1819 return not_yet_implemented();
1822 int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1823 return not_yet_implemented();
1826 int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
1827 return not_yet_implemented();
1830 int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1831 return not_yet_implemented();
1834 int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1835 return not_yet_implemented();
1838 int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1839 return not_yet_implemented();
1842 int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) {
1843 return not_yet_implemented();
1846 int PMPI_Intercomm_merge(MPI_Comm comm, int high, MPI_Comm* comm_out) {
1847 return not_yet_implemented();
1850 int PMPI_Bsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1851 return not_yet_implemented();
1854 int PMPI_Bsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1855 return not_yet_implemented();
1858 int PMPI_Ibsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1859 return not_yet_implemented();
1862 int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group* group) {
1863 return not_yet_implemented();
1866 int PMPI_Comm_remote_size(MPI_Comm comm, int* size) {
1867 return not_yet_implemented();
1870 int PMPI_Issend(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_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
1875 return not_yet_implemented();
1878 int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
1879 return not_yet_implemented();
1882 int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
1883 return not_yet_implemented();
1886 int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
1887 return not_yet_implemented();
1890 int PMPI_Rsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1891 return not_yet_implemented();
1894 int PMPI_Rsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1895 return not_yet_implemented();
1898 int PMPI_Irsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1899 return not_yet_implemented();
1902 int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
1903 return not_yet_implemented();
1906 int PMPI_Keyval_free(int* keyval) {
1907 return not_yet_implemented();
1910 int PMPI_Test_cancelled(MPI_Status* status, int* flag) {
1911 return not_yet_implemented();
1914 int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
1915 return not_yet_implemented();
1918 int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) {
1919 return not_yet_implemented();
1922 int PMPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) {
1923 return not_yet_implemented();
1926 int PMPI_Dims_create(int nnodes, int ndims, int* dims) {
1927 return not_yet_implemented();
1930 int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) {
1931 return not_yet_implemented();
1934 int PMPI_Initialized(int* flag) {
1935 return not_yet_implemented();