This source file includes following definitions.
- MPIO_Testany
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_Testany = PMPIO_Testany
14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15 #pragma _HP_SECONDARY_DEF PMPIO_Testany MPIO_Testany
16 #elif defined(HAVE_PRAGMA_CRI_DUP)
17 #pragma _CRI duplicate MPIO_Testany as PMPIO_Testany
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_Testany(int count, MPIO_Request requests[], int *index,
32 int *flag, MPI_Status *status)
33 {
34 int i, err;
35 MPID_THREADPRIV_DECL;
36
37 ROMIO_THREAD_CS_ENTER();
38
39 if (count == 1) {
40 err = MPIO_Test( requests, flag, status );
41 if (!err) *index = 0;
42 goto fn_exit;
43 }
44
45
46 for (i=0; i<count; i++) {
47 if (requests[i] != MPIO_REQUEST_NULL) {
48 break;
49 }
50 }
51 if (i == count) {
52 *index = MPI_UNDEFINED;
53 #ifdef MPICH
54
55 if (status != MPI_STATUS_IGNORE) {
56 status->MPI_SOURCE = MPI_ANY_SOURCE;
57 status->MPI_TAG = MPI_ANY_TAG;
58 MPIR_STATUS_SET_COUNT(*status, 0);
59 MPIR_STATUS_SET_CANCEL_BIT(*status, 0);
60 }
61 #endif
62 err = MPI_SUCCESS;
63 goto fn_exit;
64 }
65
66 err = MPI_SUCCESS;
67 for (i=0; i<count; i++) {
68 if (requests[i] != MPIO_REQUEST_NULL) {
69 err = MPIO_Test( &requests[i], flag, status );
70 if (*flag) {
71 if (!err) *index = i;
72 break;
73 }
74 }
75 }
76
77
78 fn_exit:
79 ROMIO_THREAD_CS_EXIT();
80 return err;
81 }