This source file includes following definitions.
- MPI_Recv_init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include "ompi_config.h"
23
24 #include "ompi/mpi/c/bindings.h"
25 #include "ompi/runtime/params.h"
26 #include "ompi/communicator/communicator.h"
27 #include "ompi/errhandler/errhandler.h"
28 #include "ompi/mca/pml/pml.h"
29 #include "ompi/request/request.h"
30 #include "ompi/memchecker.h"
31
32 #if OMPI_BUILD_MPI_PROFILING
33 #if OPAL_HAVE_WEAK_SYMBOLS
34 #pragma weak MPI_Recv_init = PMPI_Recv_init
35 #endif
36 #define MPI_Recv_init PMPI_Recv_init
37 #endif
38
39 static const char FUNC_NAME[] = "MPI_Recv_init";
40
41
42 int MPI_Recv_init(void *buf, int count, MPI_Datatype type, int source,
43 int tag, MPI_Comm comm, MPI_Request *request)
44 {
45 int rc = MPI_SUCCESS;
46
47 MEMCHECKER(
48 memchecker_datatype(type);
49 memchecker_call(&opal_memchecker_base_isaddressable, buf, count, type);
50 memchecker_comm(comm);
51 );
52
53 if ( MPI_PARAM_CHECK ) {
54 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
55 OMPI_CHECK_DATATYPE_FOR_RECV(rc, type, count);
56 OMPI_CHECK_USER_BUFFER(rc, buf, type, count);
57
58 if (ompi_comm_invalid(comm)) {
59 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM, FUNC_NAME);
60 } else if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
61 rc = MPI_ERR_TAG;
62 } else if ((source != MPI_ANY_SOURCE) &&
63 (MPI_PROC_NULL != source) &&
64 ompi_comm_peer_invalid(comm, source)) {
65 rc = MPI_ERR_RANK;
66 } else if (NULL == request) {
67 rc = MPI_ERR_REQUEST;
68 }
69
70 OMPI_ERRHANDLER_CHECK(rc, comm, rc, FUNC_NAME);
71 }
72
73 if (MPI_PROC_NULL == source) {
74 rc = ompi_request_persistent_noop_create(request);
75 OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
76 }
77
78 OPAL_CR_ENTER_LIBRARY();
79
80
81
82
83 rc = MCA_PML_CALL(irecv_init(buf,count,type,source,tag,comm,request));
84 OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
85 }