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