This source file includes following definitions.
- MPI_Request_get_status
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 #include <stdio.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/request/request.h"
29 #include "ompi/request/grequest.h"
30 #include "ompi/memchecker.h"
31
32 #if OMPI_BUILD_MPI_PROFILING
33 #if OPAL_HAVE_WEAK_SYMBOLS
34 #pragma weak MPI_Request_get_status = PMPI_Request_get_status
35 #endif
36 #define MPI_Request_get_status PMPI_Request_get_status
37 #endif
38
39 static const char FUNC_NAME[] = "MPI_Request_get_status";
40
41
42
43
44
45 int MPI_Request_get_status(MPI_Request request, int *flag,
46 MPI_Status *status)
47 {
48 #if OPAL_ENABLE_PROGRESS_THREADS == 0
49 int do_it_once = 0;
50 #endif
51
52 MEMCHECKER(
53 memchecker_request(&request);
54 );
55
56 OPAL_CR_NOOP_PROGRESS();
57
58 if( MPI_PARAM_CHECK ) {
59 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
60 if( (NULL == flag) ) {
61 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
62 } else if (NULL == request) {
63 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST,
64 FUNC_NAME);
65 }
66 }
67
68 #if OPAL_ENABLE_PROGRESS_THREADS == 0
69 recheck_request_status:
70 #endif
71 opal_atomic_mb();
72 if( (request == MPI_REQUEST_NULL) || (request->req_state == OMPI_REQUEST_INACTIVE) ) {
73 *flag = true;
74 if( MPI_STATUS_IGNORE != status ) {
75 *status = ompi_status_empty;
76 }
77 return MPI_SUCCESS;
78 }
79 if( request->req_complete ) {
80 *flag = true;
81
82
83
84 if (OMPI_REQUEST_GEN == request->req_type) {
85 ompi_grequest_invoke_query(request, &request->req_status);
86 }
87 if (MPI_STATUS_IGNORE != status) {
88 *status = request->req_status;
89 }
90 return MPI_SUCCESS;
91 }
92 #if OPAL_ENABLE_PROGRESS_THREADS == 0
93 if( 0 == do_it_once ) {
94
95
96
97 opal_progress();
98 do_it_once++;
99 goto recheck_request_status;
100 }
101 #endif
102 *flag = false;
103 return MPI_SUCCESS;
104 }