This source file includes following definitions.
- MPI_Init_thread
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
26 #include "ompi_config.h"
27
28 #include "opal/util/show_help.h"
29 #include "ompi/runtime/ompi_spc.h"
30 #include "ompi/mpi/c/bindings.h"
31 #include "ompi/runtime/params.h"
32 #include "ompi/communicator/communicator.h"
33 #include "ompi/errhandler/errhandler.h"
34 #include "ompi/constants.h"
35 #include "ompi/mca/hook/base/base.h"
36
37 #if OMPI_BUILD_MPI_PROFILING
38 #if OPAL_HAVE_WEAK_SYMBOLS
39 #pragma weak MPI_Init_thread = PMPI_Init_thread
40 #endif
41 #define MPI_Init_thread PMPI_Init_thread
42 #endif
43
44 static const char FUNC_NAME[] = "MPI_Init_thread";
45
46
47 int MPI_Init_thread(int *argc, char ***argv, int required,
48 int *provided)
49 {
50 int err;
51
52 ompi_hook_base_mpi_init_thread_top(argc, argv, required, provided);
53
54 if ( MPI_PARAM_CHECK ) {
55 if (required < MPI_THREAD_SINGLE || required > MPI_THREAD_MULTIPLE) {
56 ompi_mpi_errors_are_fatal_comm_handler(NULL, NULL, FUNC_NAME);
57 }
58 }
59
60 *provided = required;
61
62
63
64
65
66 if (NULL != argc && NULL != argv) {
67 err = ompi_mpi_init(*argc, *argv, required, provided, false);
68 } else {
69 err = ompi_mpi_init(0, NULL, required, provided, false);
70 }
71
72
73
74
75
76
77 if (MPI_SUCCESS != err) {
78 return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM,
79 err < 0 ? ompi_errcode_get_mpi_code(err) :
80 err, FUNC_NAME);
81 }
82
83 OPAL_CR_INIT_LIBRARY();
84
85 SPC_INIT();
86
87 ompi_hook_base_mpi_init_thread_bottom(argc, argv, required, provided);
88
89 return MPI_SUCCESS;
90 }