This source file includes following definitions.
- MPIO_Waitsome
1
2
3
4
5
6
7
8 #include "mpioimpl.h"
9
10 #ifdef HAVE_WEAK_SYMBOLS
11
12 #if defined(HAVE_PRAGMA_WEAK)
13 #pragma weak MPIO_Waitsome = PMPIO_Waitsome
14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15 #pragma _HP_SECONDARY_DEF PMPIO_Waitsome MPIO_Waitsome
16 #elif defined(HAVE_PRAGMA_CRI_DUP)
17 #pragma _CRI duplicate MPIO_Waitsome as PMPIO_Waitsome
18
19 #endif
20
21
22 #define MPIO_BUILD_PROFILING
23 #include "mpioprof.h"
24 #endif
25
26
27
28
29
30
31 int MPIO_Waitsome(int count, MPIO_Request requests[], int *outcount,
32 int indices[], MPI_Status *statuses)
33 {
34 int i, flag, err;
35 MPID_THREADPRIV_DECL;
36
37 ROMIO_THREAD_CS_ENTER();
38
39 if (count == 1) {
40 err = MPIO_Wait( requests, statuses );
41 if (!err) {
42 *outcount = 1;
43 indices[0] = 0;
44 }
45 goto fn_exit;
46 }
47
48
49 for (i=0; i<count; i++) {
50 if (requests[i] != MPIO_REQUEST_NULL) {
51 break;
52 }
53 }
54 if (i == count) {
55 *outcount = MPI_UNDEFINED;
56 err = MPI_SUCCESS;
57 goto fn_exit;
58 }
59
60 err = MPI_SUCCESS;
61 *outcount = 0;
62 do {
63 for (i=0; i<count; i++) {
64 if (requests[i] != MPIO_REQUEST_NULL) {
65 err = MPIO_Test( &requests[i], &flag, statuses );
66 if (flag) {
67 if (!err) {
68 indices[0] = i;
69 indices++;
70 statuses++;
71 *outcount = *outcount + 1;
72 }
73 }
74 }
75 }
76 } while (*outcount == 0);
77
78 fn_exit:
79 ROMIO_THREAD_CS_EXIT();
80 return err;
81 }