This source file includes following definitions.
- MPI_Startall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #include "ompi_config.h"
26 #include <stdio.h>
27
28 #include "ompi/mpi/c/bindings.h"
29 #include "ompi/runtime/params.h"
30 #include "ompi/communicator/communicator.h"
31 #include "ompi/errhandler/errhandler.h"
32 #include "ompi/mca/pml/pml.h"
33 #include "ompi/request/request.h"
34 #include "ompi/memchecker.h"
35
36 #if OMPI_BUILD_MPI_PROFILING
37 #if OPAL_HAVE_WEAK_SYMBOLS
38 #pragma weak MPI_Startall = PMPI_Startall
39 #endif
40 #define MPI_Startall PMPI_Startall
41 #endif
42
43 static const char FUNC_NAME[] = "MPI_Startall";
44
45
46 int MPI_Startall(int count, MPI_Request requests[])
47 {
48 int i, j;
49 int ret = OMPI_SUCCESS;
50 ompi_request_start_fn_t start_fn = NULL;
51
52 MEMCHECKER(
53 for (j = 0; j < count; j++){
54 memchecker_request(&requests[j]);
55 }
56 );
57
58 if ( MPI_PARAM_CHECK ) {
59 int rc = MPI_SUCCESS;
60 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
61 if (NULL == requests) {
62 rc = MPI_ERR_REQUEST;
63 } else if (count < 0) {
64 rc = MPI_ERR_ARG;
65 } else {
66 for (i = 0; i < count; ++i) {
67 if (NULL == requests[i] ||
68 ! requests[i]->req_persistent ||
69 (OMPI_REQUEST_PML != requests[i]->req_type &&
70 OMPI_REQUEST_COLL != requests[i]->req_type &&
71 OMPI_REQUEST_NOOP != requests[i]->req_type)) {
72 rc = MPI_ERR_REQUEST;
73 break;
74 }
75 }
76 }
77 OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
78 }
79
80 OPAL_CR_ENTER_LIBRARY();
81
82 for (i = 0, j = -1; i < count; ++i) {
83
84 if (OMPI_REQUEST_INACTIVE != requests[i]->req_state) {
85 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_REQUEST, FUNC_NAME);
86 }
87
88 if (OMPI_REQUEST_NOOP == requests[i]->req_type) {
89
90
91
92
93
94
95 requests[i]->req_state = OMPI_REQUEST_ACTIVE;
96 }
97
98
99
100 if (requests[i]->req_start != start_fn) {
101 if (NULL != start_fn && i != 0) {
102 start_fn(i - j, requests + j);
103 }
104 start_fn = requests[i]->req_start;
105 j = i;
106 }
107 }
108
109 if (NULL != start_fn) {
110 start_fn(i - j, requests + j);
111 }
112
113 OPAL_CR_EXIT_LIBRARY();
114 return ret;
115 }
116