This source file includes following definitions.
- MPI_Initialized
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #include "ompi_config.h"
24
25 #include "ompi/mpi/c/bindings.h"
26 #include "ompi/runtime/params.h"
27 #include "ompi/communicator/communicator.h"
28 #include "ompi/errhandler/errhandler.h"
29 #include "ompi/mca/hook/base/base.h"
30
31 #if OMPI_BUILD_MPI_PROFILING
32 #if OPAL_HAVE_WEAK_SYMBOLS
33 #pragma weak MPI_Initialized = PMPI_Initialized
34 #endif
35 #define MPI_Initialized PMPI_Initialized
36 #endif
37
38 static const char FUNC_NAME[] = "MPI_Initialized";
39
40
41 int MPI_Initialized(int *flag)
42 {
43 OPAL_CR_NOOP_PROGRESS();
44
45 ompi_hook_base_mpi_initialized_top(flag);
46
47 int32_t state = ompi_mpi_state;
48
49 if (MPI_PARAM_CHECK) {
50 if (NULL == flag) {
51
52
53
54
55
56 if (state >= OMPI_MPI_STATE_INIT_COMPLETED &&
57 state < OMPI_MPI_STATE_FINALIZE_PAST_COMM_SELF_DESTRUCT) {
58 return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
59 FUNC_NAME);
60 } else {
61
62
63 return ompi_errhandler_invoke(NULL, NULL, -1,
64 ompi_errcode_get_mpi_code(MPI_ERR_ARG),
65 FUNC_NAME);
66 }
67 }
68 }
69
70 *flag = (state >= OMPI_MPI_STATE_INIT_COMPLETED);
71
72 ompi_hook_base_mpi_initialized_bottom(flag);
73
74 return MPI_SUCCESS;
75 }