This source file includes following definitions.
- MPI_Probe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include "ompi_config.h"
21 #include <stdio.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/memchecker.h"
29 #include "ompi/request/request.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_Probe = PMPI_Probe
35 #endif
36 #define MPI_Probe PMPI_Probe
37 #endif
38
39 static const char FUNC_NAME[] = "MPI_Probe";
40
41
42 int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
43 {
44 int rc;
45
46 SPC_RECORD(OMPI_SPC_PROBE, 1);
47
48 MEMCHECKER(
49 memchecker_comm(comm);
50 );
51
52 if ( MPI_PARAM_CHECK ) {
53 rc = MPI_SUCCESS;
54 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
55 if (((tag < 0) && (tag != MPI_ANY_TAG)) || (tag > mca_pml.pml_max_tag)) {
56 rc = MPI_ERR_TAG;
57 } else if (ompi_comm_invalid(comm)) {
58 rc = MPI_ERR_COMM;
59 } else if ((source != MPI_ANY_SOURCE) &&
60 (MPI_PROC_NULL != source) &&
61 ompi_comm_peer_invalid(comm, source)) {
62 rc = MPI_ERR_RANK;
63 }
64 OMPI_ERRHANDLER_CHECK(rc, comm, rc, "MPI_Probe");
65 }
66
67 if (MPI_PROC_NULL == source) {
68 if (MPI_STATUS_IGNORE != status) {
69 *status = ompi_request_empty.req_status;
70
71
72
73 MEMCHECKER(
74 opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int));
75 );
76 }
77 return MPI_SUCCESS;
78 }
79
80 OPAL_CR_ENTER_LIBRARY();
81
82 rc = MCA_PML_CALL(probe(source, tag, comm, status));
83
84
85
86 MEMCHECKER(
87 opal_memchecker_base_mem_undefined(&status->MPI_ERROR, sizeof(int));
88 );
89
90 OMPI_ERRHANDLER_RETURN(rc, comm, rc, "MPI_Probe");
91 }