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)
39 smpi_process_finalize();
42 TRACE_smpi_finalize(smpi_process_index());
44 smpi_process_destroy();
48 int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided)
50 if (provided != NULL) {
51 *provided = MPI_THREAD_MULTIPLE;
53 return MPI_Init(argc, argv);
56 int PMPI_Query_thread(int *provided)
61 if (provided == NULL) {
64 *provided = MPI_THREAD_MULTIPLE;
71 int PMPI_Is_thread_main(int *flag)
79 *flag = smpi_process_index() == 0;
86 int PMPI_Abort(MPI_Comm comm, int errorcode)
89 smpi_process_destroy();
90 // FIXME: should kill all processes in comm instead
91 SIMIX_req_process_kill(SIMIX_process_self());
95 double PMPI_Wtime(void)
100 time = SIMIX_get_clock();
105 int PMPI_Address(void *location, MPI_Aint * address)
111 retval = MPI_ERR_ARG;
113 *address = (MPI_Aint) location;
119 int PMPI_Type_free(MPI_Datatype * datatype)
125 retval = MPI_ERR_ARG;
127 // FIXME: always fail for now
128 retval = MPI_ERR_TYPE;
134 int PMPI_Type_size(MPI_Datatype datatype, int *size)
139 if (datatype == MPI_DATATYPE_NULL) {
140 retval = MPI_ERR_TYPE;
141 } else if (size == NULL) {
142 retval = MPI_ERR_ARG;
144 *size = (int) smpi_datatype_size(datatype);
145 retval = MPI_SUCCESS;
151 int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
156 if (datatype == MPI_DATATYPE_NULL) {
157 retval = MPI_ERR_TYPE;
158 } else if (lb == NULL || extent == NULL) {
159 retval = MPI_ERR_ARG;
161 retval = smpi_datatype_extent(datatype, lb, extent);
167 int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
173 if (datatype == MPI_DATATYPE_NULL) {
174 retval = MPI_ERR_TYPE;
175 } else if (extent == NULL) {
176 retval = MPI_ERR_ARG;
178 retval = smpi_datatype_extent(datatype, &dummy, extent);
184 int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
189 if (datatype == MPI_DATATYPE_NULL) {
190 retval = MPI_ERR_TYPE;
191 } else if (disp == NULL) {
192 retval = MPI_ERR_ARG;
194 *disp = smpi_datatype_lb(datatype);
195 retval = MPI_SUCCESS;
201 int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
206 if (datatype == MPI_DATATYPE_NULL) {
207 retval = MPI_ERR_TYPE;
208 } else if (disp == NULL) {
209 retval = MPI_ERR_ARG;
211 *disp = smpi_datatype_ub(datatype);
212 retval = MPI_SUCCESS;
218 int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
223 if (function == NULL || op == NULL) {
224 retval = MPI_ERR_ARG;
226 *op = smpi_op_new(function, commute);
227 retval = MPI_SUCCESS;
233 int PMPI_Op_free(MPI_Op * op)
239 retval = MPI_ERR_ARG;
240 } else if (*op == MPI_OP_NULL) {
243 smpi_op_destroy(*op);
245 retval = MPI_SUCCESS;
251 int PMPI_Group_free(MPI_Group * group)
257 retval = MPI_ERR_ARG;
259 smpi_group_destroy(*group);
260 *group = MPI_GROUP_NULL;
261 retval = MPI_SUCCESS;
267 int PMPI_Group_size(MPI_Group group, int *size)
272 if (group == MPI_GROUP_NULL) {
273 retval = MPI_ERR_GROUP;
274 } else if (size == NULL) {
275 retval = MPI_ERR_ARG;
277 *size = smpi_group_size(group);
278 retval = MPI_SUCCESS;
284 int PMPI_Group_rank(MPI_Group group, int *rank)
289 if (group == MPI_GROUP_NULL) {
290 retval = MPI_ERR_GROUP;
291 } else if (rank == NULL) {
292 retval = MPI_ERR_ARG;
294 *rank = smpi_group_rank(group, smpi_process_index());
295 retval = MPI_SUCCESS;
301 int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
302 MPI_Group group2, int *ranks2)
304 int retval, i, index;
307 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
308 retval = MPI_ERR_GROUP;
310 for (i = 0; i < n; i++) {
311 index = smpi_group_index(group1, ranks1[i]);
312 ranks2[i] = smpi_group_rank(group2, index);
314 retval = MPI_SUCCESS;
320 int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
325 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
326 retval = MPI_ERR_GROUP;
327 } else if (result == NULL) {
328 retval = MPI_ERR_ARG;
330 *result = smpi_group_compare(group1, group2);
331 retval = MPI_SUCCESS;
337 int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
338 MPI_Group * newgroup)
340 int retval, i, proc1, proc2, size, size2;
343 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
344 retval = MPI_ERR_GROUP;
345 } else if (newgroup == NULL) {
346 retval = MPI_ERR_ARG;
348 size = smpi_group_size(group1);
349 size2 = smpi_group_size(group2);
350 for (i = 0; i < size2; i++) {
351 proc2 = smpi_group_index(group2, i);
352 proc1 = smpi_group_rank(group1, proc2);
353 if (proc1 == MPI_UNDEFINED) {
358 *newgroup = MPI_GROUP_EMPTY;
360 *newgroup = smpi_group_new(size);
361 size2 = smpi_group_size(group1);
362 for (i = 0; i < size2; i++) {
363 proc1 = smpi_group_index(group1, i);
364 smpi_group_set_mapping(*newgroup, proc1, i);
366 for (i = size2; i < size; i++) {
367 proc2 = smpi_group_index(group2, i - size2);
368 smpi_group_set_mapping(*newgroup, proc2, i);
371 smpi_group_use(*newgroup);
372 retval = MPI_SUCCESS;
378 int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2,
379 MPI_Group * newgroup)
381 int retval, i, proc1, proc2, size, size2;
384 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
385 retval = MPI_ERR_GROUP;
386 } else if (newgroup == NULL) {
387 retval = MPI_ERR_ARG;
389 size = smpi_group_size(group1);
390 size2 = smpi_group_size(group2);
391 for (i = 0; i < size2; i++) {
392 proc2 = smpi_group_index(group2, i);
393 proc1 = smpi_group_rank(group1, proc2);
394 if (proc1 == MPI_UNDEFINED) {
399 *newgroup = MPI_GROUP_EMPTY;
401 *newgroup = smpi_group_new(size);
402 size2 = smpi_group_size(group1);
403 for (i = 0; i < size2; i++) {
404 proc1 = smpi_group_index(group1, i);
405 proc2 = smpi_group_rank(group2, proc1);
406 if (proc2 != MPI_UNDEFINED) {
407 smpi_group_set_mapping(*newgroup, proc1, i);
411 smpi_group_use(*newgroup);
412 retval = MPI_SUCCESS;
418 int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup)
420 int retval, i, proc1, proc2, size, size2;
423 if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
424 retval = MPI_ERR_GROUP;
425 } else if (newgroup == NULL) {
426 retval = MPI_ERR_ARG;
428 size = size2 = smpi_group_size(group1);
429 for (i = 0; i < size2; i++) {
430 proc1 = smpi_group_index(group1, i);
431 proc2 = smpi_group_rank(group2, proc1);
432 if (proc2 != MPI_UNDEFINED) {
437 *newgroup = MPI_GROUP_EMPTY;
439 *newgroup = smpi_group_new(size);
440 for (i = 0; i < size2; i++) {
441 proc1 = smpi_group_index(group1, i);
442 proc2 = smpi_group_rank(group2, proc1);
443 if (proc2 == MPI_UNDEFINED) {
444 smpi_group_set_mapping(*newgroup, proc1, i);
448 smpi_group_use(*newgroup);
449 retval = MPI_SUCCESS;
455 int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
457 int retval, i, index;
460 if (group == MPI_GROUP_NULL) {
461 retval = MPI_ERR_GROUP;
462 } else if (newgroup == NULL) {
463 retval = MPI_ERR_ARG;
466 *newgroup = MPI_GROUP_EMPTY;
467 } else if (n == smpi_group_size(group)) {
470 *newgroup = smpi_group_new(n);
471 for (i = 0; i < n; i++) {
472 index = smpi_group_index(group, ranks[i]);
473 smpi_group_set_mapping(*newgroup, index, i);
476 smpi_group_use(*newgroup);
477 retval = MPI_SUCCESS;
483 int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
485 int retval, i, size, rank, index;
488 if (group == MPI_GROUP_NULL) {
489 retval = MPI_ERR_GROUP;
490 } else if (newgroup == NULL) {
491 retval = MPI_ERR_ARG;
495 } else if (n == smpi_group_size(group)) {
496 *newgroup = MPI_GROUP_EMPTY;
498 size = smpi_group_size(group) - n;
499 *newgroup = smpi_group_new(size);
501 while (rank < size) {
502 for (i = 0; i < n; i++) {
503 if (ranks[i] == rank) {
508 index = smpi_group_index(group, rank);
509 smpi_group_set_mapping(*newgroup, index, rank);
514 smpi_group_use(*newgroup);
515 retval = MPI_SUCCESS;
521 int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
522 MPI_Group * newgroup)
524 int retval, i, j, rank, size, index;
527 if (group == MPI_GROUP_NULL) {
528 retval = MPI_ERR_GROUP;
529 } else if (newgroup == NULL) {
530 retval = MPI_ERR_ARG;
533 *newgroup = MPI_GROUP_EMPTY;
536 for (i = 0; i < n; i++) {
537 for (rank = ranges[i][0]; /* First */
538 rank >= 0 && rank <= ranges[i][1]; /* Last */
539 rank += ranges[i][2] /* Stride */ ) {
543 if (size == smpi_group_size(group)) {
546 *newgroup = smpi_group_new(size);
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 */ ) {
552 index = smpi_group_index(group, rank);
553 smpi_group_set_mapping(*newgroup, index, j);
559 smpi_group_use(*newgroup);
560 retval = MPI_SUCCESS;
566 int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
567 MPI_Group * newgroup)
569 int retval, i, newrank, rank, size, index, add;
572 if (group == MPI_GROUP_NULL) {
573 retval = MPI_ERR_GROUP;
574 } else if (newgroup == NULL) {
575 retval = MPI_ERR_ARG;
580 size = smpi_group_size(group);
581 for (i = 0; i < n; i++) {
582 for (rank = ranges[i][0]; /* First */
583 rank >= 0 && rank <= ranges[i][1]; /* Last */
584 rank += ranges[i][2] /* Stride */ ) {
589 *newgroup = MPI_GROUP_EMPTY;
591 *newgroup = smpi_group_new(size);
593 while (newrank < size) {
594 for (i = 0; i < n; i++) {
596 for (rank = ranges[i][0]; /* First */
597 rank >= 0 && rank <= ranges[i][1]; /* Last */
598 rank += ranges[i][2] /* Stride */ ) {
599 if (rank == newrank) {
605 index = smpi_group_index(group, newrank);
606 smpi_group_set_mapping(*newgroup, index, newrank);
612 smpi_group_use(*newgroup);
613 retval = MPI_SUCCESS;
619 int PMPI_Comm_rank(MPI_Comm comm, int *rank)
624 if (comm == MPI_COMM_NULL) {
625 retval = MPI_ERR_COMM;
626 } else if (rank == NULL) {
627 retval = MPI_ERR_ARG;
629 *rank = smpi_comm_rank(comm);
630 retval = MPI_SUCCESS;
636 int PMPI_Comm_size(MPI_Comm comm, int *size)
641 if (comm == MPI_COMM_NULL) {
642 retval = MPI_ERR_COMM;
643 } else if (size == NULL) {
644 retval = MPI_ERR_ARG;
646 *size = smpi_comm_size(comm);
647 retval = MPI_SUCCESS;
653 int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
658 if (comm == MPI_COMM_NULL) {
659 retval = MPI_ERR_COMM;
660 } else if (name == NULL || len == NULL) {
661 retval = MPI_ERR_ARG;
663 smpi_comm_get_name(comm, name, len);
664 retval = MPI_SUCCESS;
670 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
675 if (comm == MPI_COMM_NULL) {
676 retval = MPI_ERR_COMM;
677 } else if (group == NULL) {
678 retval = MPI_ERR_ARG;
680 *group = smpi_comm_group(comm);
681 retval = MPI_SUCCESS;
687 int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
692 if (comm1 == MPI_COMM_NULL || comm2 == MPI_COMM_NULL) {
693 retval = MPI_ERR_COMM;
694 } else if (result == NULL) {
695 retval = MPI_ERR_ARG;
697 if (comm1 == comm2) { /* Same communicators means same groups */
701 smpi_group_compare(smpi_comm_group(comm1),
702 smpi_comm_group(comm2));
703 if (*result == MPI_IDENT) {
704 *result = MPI_CONGRUENT;
707 retval = MPI_SUCCESS;
713 int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
718 if (comm == MPI_COMM_NULL) {
719 retval = MPI_ERR_COMM;
720 } else if (newcomm == NULL) {
721 retval = MPI_ERR_ARG;
723 *newcomm = smpi_comm_new(smpi_comm_group(comm));
724 retval = MPI_SUCCESS;
730 int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
735 if (comm == MPI_COMM_NULL) {
736 retval = MPI_ERR_COMM;
737 } else if (group == MPI_GROUP_NULL) {
738 retval = MPI_ERR_GROUP;
739 } else if (newcomm == NULL) {
740 retval = MPI_ERR_ARG;
742 *newcomm = smpi_comm_new(group);
743 retval = MPI_SUCCESS;
749 int PMPI_Comm_free(MPI_Comm * comm)
755 retval = MPI_ERR_ARG;
756 } else if (*comm == MPI_COMM_NULL) {
757 retval = MPI_ERR_COMM;
759 smpi_comm_destroy(*comm);
760 *comm = MPI_COMM_NULL;
761 retval = MPI_SUCCESS;
767 int PMPI_Comm_disconnect(MPI_Comm * comm)
769 /* TODO: wait until all communication in comm are done */
774 retval = MPI_ERR_ARG;
775 } else if (*comm == MPI_COMM_NULL) {
776 retval = MPI_ERR_COMM;
778 smpi_comm_destroy(*comm);
779 *comm = MPI_COMM_NULL;
780 retval = MPI_SUCCESS;
786 int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
791 if (comm_out == NULL) {
792 retval = MPI_ERR_ARG;
793 } else if (comm == MPI_COMM_NULL) {
794 retval = MPI_ERR_COMM;
796 *comm_out = smpi_comm_split(comm, color, key);
797 retval = MPI_SUCCESS;
803 int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst,
804 int tag, MPI_Comm comm, MPI_Request * request)
809 if (request == NULL) {
810 retval = MPI_ERR_ARG;
811 } else if (comm == MPI_COMM_NULL) {
812 retval = MPI_ERR_COMM;
814 *request = smpi_mpi_send_init(buf, count, datatype, dst, tag, comm);
815 retval = MPI_SUCCESS;
821 int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src,
822 int tag, MPI_Comm comm, MPI_Request * request)
827 if (request == NULL) {
828 retval = MPI_ERR_ARG;
829 } else if (comm == MPI_COMM_NULL) {
830 retval = MPI_ERR_COMM;
832 *request = smpi_mpi_recv_init(buf, count, datatype, src, tag, comm);
833 retval = MPI_SUCCESS;
839 int PMPI_Start(MPI_Request * request)
844 if (request == NULL) {
845 retval = MPI_ERR_ARG;
847 smpi_mpi_start(*request);
848 retval = MPI_SUCCESS;
854 int PMPI_Startall(int count, MPI_Request * requests)
859 if (requests == NULL) {
860 retval = MPI_ERR_ARG;
862 smpi_mpi_startall(count, requests);
863 retval = MPI_SUCCESS;
869 int PMPI_Request_free(MPI_Request * request)
874 if (request == NULL) {
875 retval = MPI_ERR_ARG;
877 smpi_mpi_request_free(request);
878 retval = MPI_SUCCESS;
884 int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
885 int tag, MPI_Comm comm, MPI_Request * request)
891 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
892 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
893 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
895 if (request == NULL) {
896 retval = MPI_ERR_ARG;
897 } else if (comm == MPI_COMM_NULL) {
898 retval = MPI_ERR_COMM;
900 *request = smpi_mpi_irecv(buf, count, datatype, src, tag, comm);
901 retval = MPI_SUCCESS;
904 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
905 (*request)->recv = 1;
911 int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
912 int tag, MPI_Comm comm, MPI_Request * request)
918 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
919 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
920 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
921 TRACE_smpi_send(rank, rank, dst_traced);
923 if (request == NULL) {
924 retval = MPI_ERR_ARG;
925 } else if (comm == MPI_COMM_NULL) {
926 retval = MPI_ERR_COMM;
928 *request = smpi_mpi_isend(buf, count, datatype, dst, tag, comm);
929 retval = MPI_SUCCESS;
932 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
933 (*request)->send = 1;
939 int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
940 MPI_Comm comm, MPI_Status * status)
946 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
947 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
948 TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
950 if (comm == MPI_COMM_NULL) {
951 retval = MPI_ERR_COMM;
953 smpi_mpi_recv(buf, count, datatype, src, tag, comm, status);
954 retval = MPI_SUCCESS;
957 TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
958 TRACE_smpi_recv(rank, src_traced, rank);
964 int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
971 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
972 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
973 TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
974 TRACE_smpi_send(rank, rank, dst_traced);
976 if (comm == MPI_COMM_NULL) {
977 retval = MPI_ERR_COMM;
979 smpi_mpi_send(buf, count, datatype, dst, tag, comm);
980 retval = MPI_SUCCESS;
983 TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
989 int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
990 int dst, int sendtag, void *recvbuf, int recvcount,
991 MPI_Datatype recvtype, int src, int recvtag,
992 MPI_Comm comm, MPI_Status * status)
998 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
999 int dst_traced = smpi_group_rank(smpi_comm_group(comm), dst);
1000 int src_traced = smpi_group_rank(smpi_comm_group(comm), src);
1001 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
1002 TRACE_smpi_send(rank, rank, dst_traced);
1003 TRACE_smpi_send(rank, src_traced, rank);
1005 if (comm == MPI_COMM_NULL) {
1006 retval = MPI_ERR_COMM;
1007 } else if (sendtype == MPI_DATATYPE_NULL
1008 || recvtype == MPI_DATATYPE_NULL) {
1009 retval = MPI_ERR_TYPE;
1011 smpi_mpi_sendrecv(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf,
1012 recvcount, recvtype, src, recvtag, comm, status);
1013 retval = MPI_SUCCESS;
1016 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
1017 TRACE_smpi_recv(rank, rank, dst_traced);
1018 TRACE_smpi_recv(rank, src_traced, rank);
1024 int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
1025 int dst, int sendtag, int src, int recvtag,
1026 MPI_Comm comm, MPI_Status * status)
1028 //TODO: suboptimal implementation
1032 size = smpi_datatype_size(datatype) * count;
1033 recvbuf = xbt_new(char, size);
1035 MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count,
1036 datatype, src, recvtag, comm, status);
1037 memcpy(buf, recvbuf, size * sizeof(char));
1042 int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
1047 if (request == NULL || flag == NULL) {
1048 retval = MPI_ERR_ARG;
1049 } else if (*request == MPI_REQUEST_NULL) {
1050 retval = MPI_ERR_REQUEST;
1052 *flag = smpi_mpi_test(request, status);
1053 retval = MPI_SUCCESS;
1059 int PMPI_Testany(int count, MPI_Request requests[], int *index, int *flag,
1060 MPI_Status * status)
1065 if (index == NULL || flag == NULL) {
1066 retval = MPI_ERR_ARG;
1068 *flag = smpi_mpi_testany(count, requests, index, status);
1069 retval = MPI_SUCCESS;
1075 int PMPI_Wait(MPI_Request * request, MPI_Status * status)
1081 int rank = request && (*request)->comm != MPI_COMM_NULL
1082 ? smpi_comm_rank((*request)->comm)
1084 MPI_Group group = smpi_comm_group((*request)->comm);
1085 int src_traced = smpi_group_rank(group, (*request)->src);
1086 int dst_traced = smpi_group_rank(group, (*request)->dst);
1087 int is_wait_for_receive = (*request)->recv;
1088 TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
1090 if (request == NULL) {
1091 retval = MPI_ERR_ARG;
1092 } else if (*request == MPI_REQUEST_NULL) {
1093 retval = MPI_ERR_REQUEST;
1095 smpi_mpi_wait(request, status);
1096 retval = MPI_SUCCESS;
1099 TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
1100 if (is_wait_for_receive) {
1101 TRACE_smpi_recv(rank, src_traced, dst_traced);
1108 int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
1114 //save requests information for tracing
1116 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1117 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1118 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1119 for (i = 0; i < count; i++) {
1120 MPI_Request req = requests[i]; //already received requests are no longer valid
1122 int *asrc = xbt_new(int, 1);
1123 int *adst = xbt_new(int, 1);
1124 int *arecv = xbt_new(int, 1);
1128 xbt_dynar_insert_at(srcs, i, asrc);
1129 xbt_dynar_insert_at(dsts, i, adst);
1130 xbt_dynar_insert_at(recvs, i, arecv);
1132 int *t = xbt_new(int, 1);
1133 xbt_dynar_insert_at(srcs, i, t);
1134 xbt_dynar_insert_at(dsts, i, t);
1135 xbt_dynar_insert_at(recvs, i, t);
1138 int rank_traced = smpi_comm_rank(MPI_COMM_WORLD);
1139 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1141 if (index == NULL) {
1142 retval = MPI_ERR_ARG;
1144 *index = smpi_mpi_waitany(count, requests, status);
1145 retval = MPI_SUCCESS;
1148 int src_traced, dst_traced, is_wait_for_receive;
1149 xbt_dynar_get_cpy(srcs, *index, &src_traced);
1150 xbt_dynar_get_cpy(dsts, *index, &dst_traced);
1151 xbt_dynar_get_cpy(recvs, *index, &is_wait_for_receive);
1152 if (is_wait_for_receive) {
1153 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1155 TRACE_smpi_ptp_out(rank_traced, src_traced, dst_traced, __FUNCTION__);
1156 //clean-up of dynars
1165 int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
1170 //save information from requests
1172 xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), xbt_free);
1173 xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), xbt_free);
1174 xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), xbt_free);
1175 for (i = 0; i < count; i++) {
1176 MPI_Request req = requests[i]; //all req should be valid in Waitall
1177 int *asrc = xbt_new(int, 1);
1178 int *adst = xbt_new(int, 1);
1179 int *arecv = xbt_new(int, 1);
1183 xbt_dynar_insert_at(srcs, i, asrc);
1184 xbt_dynar_insert_at(dsts, i, adst);
1185 xbt_dynar_insert_at(recvs, i, arecv);
1187 int rank_traced = smpi_comm_rank (MPI_COMM_WORLD);
1188 TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
1190 smpi_mpi_waitall(count, requests, status);
1192 for (i = 0; i < count; i++) {
1193 int src_traced, dst_traced, is_wait_for_receive;
1194 xbt_dynar_get_cpy(srcs, i, &src_traced);
1195 xbt_dynar_get_cpy(dsts, i, &dst_traced);
1196 xbt_dynar_get_cpy(recvs, i, &is_wait_for_receive);
1197 if (is_wait_for_receive) {
1198 TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
1201 TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
1202 //clean-up of dynars
1211 int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
1212 int *indices, MPI_Status status[])
1217 if (outcount == NULL || indices == NULL) {
1218 retval = MPI_ERR_ARG;
1220 *outcount = smpi_mpi_waitsome(incount, requests, indices, status);
1221 retval = MPI_SUCCESS;
1227 int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
1233 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1234 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1235 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1237 if (comm == MPI_COMM_NULL) {
1238 retval = MPI_ERR_COMM;
1240 smpi_mpi_bcast(buf, count, datatype, root, comm);
1241 retval = MPI_SUCCESS;
1244 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1250 int PMPI_Barrier(MPI_Comm comm)
1256 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1257 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1259 if (comm == MPI_COMM_NULL) {
1260 retval = MPI_ERR_COMM;
1262 smpi_mpi_barrier(comm);
1263 retval = MPI_SUCCESS;
1266 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1272 int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1273 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1274 int root, MPI_Comm comm)
1280 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1281 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1282 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1284 if (comm == MPI_COMM_NULL) {
1285 retval = MPI_ERR_COMM;
1286 } else if (sendtype == MPI_DATATYPE_NULL
1287 || recvtype == MPI_DATATYPE_NULL) {
1288 retval = MPI_ERR_TYPE;
1290 smpi_mpi_gather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1291 recvtype, root, comm);
1292 retval = MPI_SUCCESS;
1295 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1301 int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1302 void *recvbuf, int *recvcounts, int *displs,
1303 MPI_Datatype recvtype, int root, MPI_Comm comm)
1309 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1310 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1311 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1313 if (comm == MPI_COMM_NULL) {
1314 retval = MPI_ERR_COMM;
1315 } else if (sendtype == MPI_DATATYPE_NULL
1316 || recvtype == MPI_DATATYPE_NULL) {
1317 retval = MPI_ERR_TYPE;
1318 } else if (recvcounts == NULL || displs == NULL) {
1319 retval = MPI_ERR_ARG;
1321 smpi_mpi_gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1322 displs, recvtype, root, comm);
1323 retval = MPI_SUCCESS;
1326 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1332 int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1333 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1340 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1341 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1343 if (comm == MPI_COMM_NULL) {
1344 retval = MPI_ERR_COMM;
1345 } else if (sendtype == MPI_DATATYPE_NULL
1346 || recvtype == MPI_DATATYPE_NULL) {
1347 retval = MPI_ERR_TYPE;
1349 smpi_mpi_allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1351 retval = MPI_SUCCESS;
1354 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1360 int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1361 void *recvbuf, int *recvcounts, int *displs,
1362 MPI_Datatype recvtype, MPI_Comm comm)
1368 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1369 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1371 if (comm == MPI_COMM_NULL) {
1372 retval = MPI_ERR_COMM;
1373 } else if (sendtype == MPI_DATATYPE_NULL
1374 || recvtype == MPI_DATATYPE_NULL) {
1375 retval = MPI_ERR_TYPE;
1376 } else if (recvcounts == NULL || displs == NULL) {
1377 retval = MPI_ERR_ARG;
1379 smpi_mpi_allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
1380 displs, recvtype, comm);
1381 retval = MPI_SUCCESS;
1384 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1390 int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1391 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1392 int root, MPI_Comm comm)
1398 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1399 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1400 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1402 if (comm == MPI_COMM_NULL) {
1403 retval = MPI_ERR_COMM;
1404 } else if (sendtype == MPI_DATATYPE_NULL
1405 || recvtype == MPI_DATATYPE_NULL) {
1406 retval = MPI_ERR_TYPE;
1408 smpi_mpi_scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount,
1409 recvtype, root, comm);
1410 retval = MPI_SUCCESS;
1413 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1419 int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
1420 MPI_Datatype sendtype, void *recvbuf, int recvcount,
1421 MPI_Datatype recvtype, int root, MPI_Comm comm)
1427 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1428 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1429 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1431 if (comm == MPI_COMM_NULL) {
1432 retval = MPI_ERR_COMM;
1433 } else if (sendtype == MPI_DATATYPE_NULL
1434 || recvtype == MPI_DATATYPE_NULL) {
1435 retval = MPI_ERR_TYPE;
1436 } else if (sendcounts == NULL || displs == NULL) {
1437 retval = MPI_ERR_ARG;
1439 smpi_mpi_scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
1440 recvcount, recvtype, root, comm);
1441 retval = MPI_SUCCESS;
1444 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1450 int PMPI_Reduce(void *sendbuf, void *recvbuf, int count,
1451 MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
1457 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1458 int root_traced = smpi_group_rank(smpi_comm_group(comm), root);
1459 TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
1461 if (comm == MPI_COMM_NULL) {
1462 retval = MPI_ERR_COMM;
1463 } else if (datatype == MPI_DATATYPE_NULL || op == MPI_OP_NULL) {
1464 retval = MPI_ERR_ARG;
1466 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
1467 retval = MPI_SUCCESS;
1470 TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
1476 int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
1477 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1483 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1484 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1486 if (comm == MPI_COMM_NULL) {
1487 retval = MPI_ERR_COMM;
1488 } else if (datatype == MPI_DATATYPE_NULL) {
1489 retval = MPI_ERR_TYPE;
1490 } else if (op == MPI_OP_NULL) {
1491 retval = MPI_ERR_OP;
1493 smpi_mpi_allreduce(sendbuf, recvbuf, count, datatype, op, comm);
1494 retval = MPI_SUCCESS;
1497 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1503 int PMPI_Scan(void *sendbuf, void *recvbuf, int count,
1504 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1510 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1511 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1513 if (comm == MPI_COMM_NULL) {
1514 retval = MPI_ERR_COMM;
1515 } else if (datatype == MPI_DATATYPE_NULL) {
1516 retval = MPI_ERR_TYPE;
1517 } else if (op == MPI_OP_NULL) {
1518 retval = MPI_ERR_OP;
1520 smpi_mpi_scan(sendbuf, recvbuf, count, datatype, op, comm);
1521 retval = MPI_SUCCESS;
1524 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1530 int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
1531 MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
1533 int retval, i, size, count;
1535 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1539 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1541 if (comm == MPI_COMM_NULL) {
1542 retval = MPI_ERR_COMM;
1543 } else if (datatype == MPI_DATATYPE_NULL) {
1544 retval = MPI_ERR_TYPE;
1545 } else if (op == MPI_OP_NULL) {
1546 retval = MPI_ERR_OP;
1547 } else if (recvcounts == NULL) {
1548 retval = MPI_ERR_ARG;
1550 /* arbitrarily choose root as rank 0 */
1551 /* TODO: faster direct implementation ? */
1552 size = smpi_comm_size(comm);
1554 displs = xbt_new(int, size);
1555 for (i = 0; i < size; i++) {
1556 count += recvcounts[i];
1559 smpi_mpi_reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
1560 smpi_mpi_scatterv(recvbuf, recvcounts, displs, datatype, recvbuf,
1561 recvcounts[rank], datatype, 0, comm);
1563 retval = MPI_SUCCESS;
1566 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1572 int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
1573 void *recvbuf, int recvcount, MPI_Datatype recvtype,
1576 int retval, size, sendsize;
1580 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1581 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1583 if (comm == MPI_COMM_NULL) {
1584 retval = MPI_ERR_COMM;
1585 } else if (sendtype == MPI_DATATYPE_NULL
1586 || recvtype == MPI_DATATYPE_NULL) {
1587 retval = MPI_ERR_TYPE;
1589 size = smpi_comm_size(comm);
1590 sendsize = smpi_datatype_size(sendtype) * sendcount;
1591 if (sendsize < 200 && size > 12) {
1593 smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
1594 recvbuf, recvcount, recvtype,
1596 } else if (sendsize < 3000) {
1598 smpi_coll_tuned_alltoall_basic_linear(sendbuf, sendcount,
1600 recvcount, recvtype, comm);
1603 smpi_coll_tuned_alltoall_pairwise(sendbuf, sendcount, sendtype,
1604 recvbuf, recvcount, recvtype,
1609 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1615 int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
1616 MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
1617 int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
1623 int rank = comm != MPI_COMM_NULL ? smpi_comm_rank(comm) : -1;
1624 TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
1626 if (comm == MPI_COMM_NULL) {
1627 retval = MPI_ERR_COMM;
1628 } else if (sendtype == MPI_DATATYPE_NULL
1629 || recvtype == MPI_DATATYPE_NULL) {
1630 retval = MPI_ERR_TYPE;
1631 } else if (sendcounts == NULL || senddisps == NULL || recvcounts == NULL
1632 || recvdisps == NULL) {
1633 retval = MPI_ERR_ARG;
1636 smpi_coll_basic_alltoallv(sendbuf, sendcounts, senddisps, sendtype,
1637 recvbuf, recvcounts, recvdisps, recvtype,
1641 TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
1648 int PMPI_Get_processor_name(char *name, int *resultlen)
1650 int retval = MPI_SUCCESS;
1653 strncpy(name, SIMIX_host_get_name(SIMIX_host_self()),
1654 MPI_MAX_PROCESSOR_NAME - 1);
1657 MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
1663 int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
1665 int retval = MPI_SUCCESS;
1669 if (status == NULL || count == NULL) {
1670 retval = MPI_ERR_ARG;
1671 } else if (datatype == MPI_DATATYPE_NULL) {
1672 retval = MPI_ERR_TYPE;
1674 size = smpi_datatype_size(datatype);
1677 } else if (status->count % size != 0) {
1678 retval = MPI_UNDEFINED;
1680 *count = smpi_mpi_get_count(status, datatype);
1687 /* The following calls are not yet implemented and will fail at runtime. */
1688 /* Once implemented, please move them above this notice. */
1690 static int not_yet_implemented(void) {
1691 xbt_die("Not yet implemented");
1692 return MPI_ERR_OTHER;
1695 int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
1696 return not_yet_implemented();
1699 int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
1700 return not_yet_implemented();
1703 int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) {
1704 return not_yet_implemented();
1707 int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) {
1708 return not_yet_implemented();
1711 int PMPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) {
1712 return not_yet_implemented();
1715 int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) {
1716 return not_yet_implemented();
1719 int PMPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) {
1720 return not_yet_implemented();
1723 int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) {
1724 return not_yet_implemented();
1727 int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) {
1728 return not_yet_implemented();
1731 int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) {
1732 return not_yet_implemented();
1735 int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) {
1736 return not_yet_implemented();
1739 int PMPI_Graph_map(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) {
1740 return not_yet_implemented();
1743 int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) {
1744 return not_yet_implemented();
1747 int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int* nneighbors) {
1748 return not_yet_implemented();
1751 int PMPI_Graphdims_get(MPI_Comm comm, int* nnodes, int* nedges) {
1752 return not_yet_implemented();
1755 int PMPI_Topo_test(MPI_Comm comm, int* top_type) {
1756 return not_yet_implemented();
1759 int PMPI_Error_class(int errorcode, int* errorclass) {
1760 return not_yet_implemented();
1763 int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler) {
1764 return not_yet_implemented();
1767 int PMPI_Errhandler_free(MPI_Errhandler* errhandler) {
1768 return not_yet_implemented();
1771 int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler) {
1772 return not_yet_implemented();
1775 int PMPI_Error_string(int errorcode, char* string, int* resultlen) {
1776 return not_yet_implemented();
1779 int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {
1780 return not_yet_implemented();
1783 int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* newtype) {
1784 return not_yet_implemented();
1787 int PMPI_Cancel(MPI_Request* request) {
1788 return not_yet_implemented();
1791 int PMPI_Buffer_attach(void* buffer, int size) {
1792 return not_yet_implemented();
1795 int PMPI_Buffer_detach(void* buffer, int* size) {
1796 return not_yet_implemented();
1799 int PMPI_Testsome(int incount, MPI_Request* requests, int* outcount, int* indices, MPI_Status* statuses) {
1800 return not_yet_implemented();
1803 int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
1804 return not_yet_implemented();
1807 int PMPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
1808 return not_yet_implemented();
1811 int PMPI_Type_commit(MPI_Datatype* datatype) {
1812 return not_yet_implemented();
1815 int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1816 return not_yet_implemented();
1819 int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1820 return not_yet_implemented();
1823 int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
1824 return not_yet_implemented();
1827 int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
1828 return not_yet_implemented();
1831 int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
1832 return not_yet_implemented();
1835 int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1836 return not_yet_implemented();
1839 int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1840 return not_yet_implemented();
1843 int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) {
1844 return not_yet_implemented();
1847 int PMPI_Intercomm_merge(MPI_Comm comm, int high, MPI_Comm* comm_out) {
1848 return not_yet_implemented();
1851 int PMPI_Bsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1852 return not_yet_implemented();
1855 int PMPI_Bsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1856 return not_yet_implemented();
1859 int PMPI_Ibsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1860 return not_yet_implemented();
1863 int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group* group) {
1864 return not_yet_implemented();
1867 int PMPI_Comm_remote_size(MPI_Comm comm, int* size) {
1868 return not_yet_implemented();
1871 int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1872 return not_yet_implemented();
1875 int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
1876 return not_yet_implemented();
1879 int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
1880 return not_yet_implemented();
1883 int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
1884 return not_yet_implemented();
1887 int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
1888 return not_yet_implemented();
1891 int PMPI_Rsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
1892 return not_yet_implemented();
1895 int PMPI_Rsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1896 return not_yet_implemented();
1899 int PMPI_Irsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
1900 return not_yet_implemented();
1903 int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
1904 return not_yet_implemented();
1907 int PMPI_Keyval_free(int* keyval) {
1908 return not_yet_implemented();
1911 int PMPI_Test_cancelled(MPI_Status* status, int* flag) {
1912 return not_yet_implemented();
1915 int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
1916 return not_yet_implemented();
1919 int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) {
1920 return not_yet_implemented();
1923 int PMPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) {
1924 return not_yet_implemented();
1927 int PMPI_Dims_create(int nnodes, int ndims, int* dims) {
1928 return not_yet_implemented();
1931 int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) {
1932 return not_yet_implemented();
1935 int PMPI_Initialized(int* flag) {
1936 return not_yet_implemented();