This source file includes following definitions.
- mca_pml_ucx_component_register
- mca_pml_ucx_component_open
- mca_pml_ucx_component_close
- mca_pml_ucx_component_init
- mca_pml_ucx_component_fini
1
2
3
4
5
6
7
8
9
10 #include "pml_ucx.h"
11
12 #include "opal/mca/memory/base/base.h"
13
14
15 static int mca_pml_ucx_component_register(void);
16 static int mca_pml_ucx_component_open(void);
17 static int mca_pml_ucx_component_close(void);
18
19 static mca_pml_base_module_t*
20 mca_pml_ucx_component_init(int* priority, bool enable_progress_threads,
21 bool enable_mpi_threads);
22 static int mca_pml_ucx_component_fini(void);
23
24
25 mca_pml_base_component_2_0_0_t mca_pml_ucx_component = {
26
27
28
29 .pmlm_version = {
30 MCA_PML_BASE_VERSION_2_0_0,
31
32 .mca_component_name = "ucx",
33 .mca_component_major_version = OMPI_MAJOR_VERSION,
34 .mca_component_minor_version = OMPI_MINOR_VERSION,
35 .mca_component_release_version = OMPI_RELEASE_VERSION,
36 .mca_open_component = mca_pml_ucx_component_open,
37 .mca_close_component = mca_pml_ucx_component_close,
38 .mca_query_component = NULL,
39 .mca_register_component_params = mca_pml_ucx_component_register,
40 },
41 .pmlm_data = {
42
43 .param_field = MCA_BASE_METADATA_PARAM_NONE
44 },
45
46 .pmlm_init = mca_pml_ucx_component_init,
47 .pmlm_finalize = mca_pml_ucx_component_fini
48 };
49
50 static int mca_pml_ucx_component_register(void)
51 {
52 ompi_pml_ucx.priority = 51;
53 (void) mca_base_component_var_register(&mca_pml_ucx_component.pmlm_version, "priority",
54 "Priority of the UCX component",
55 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
56 OPAL_INFO_LVL_3,
57 MCA_BASE_VAR_SCOPE_LOCAL,
58 &ompi_pml_ucx.priority);
59
60 ompi_pml_ucx.num_disconnect = 1;
61 (void) mca_base_component_var_register(&mca_pml_ucx_component.pmlm_version, "num_disconnect",
62 "How may disconnects go in parallel",
63 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
64 OPAL_INFO_LVL_3,
65 MCA_BASE_VAR_SCOPE_LOCAL,
66 &ompi_pml_ucx.num_disconnect);
67 opal_common_ucx_mca_var_register(&mca_pml_ucx_component.pmlm_version);
68 return 0;
69 }
70
71 static int mca_pml_ucx_component_open(void)
72 {
73 opal_common_ucx_mca_register();
74
75 return mca_pml_ucx_open();
76 }
77
78 static int mca_pml_ucx_component_close(void)
79 {
80 int rc;
81
82 rc = mca_pml_ucx_close();
83 if (rc != 0) {
84 return rc;
85 }
86
87 opal_common_ucx_mca_deregister();
88 return 0;
89 }
90
91 static mca_pml_base_module_t*
92 mca_pml_ucx_component_init(int* priority, bool enable_progress_threads,
93 bool enable_mpi_threads)
94 {
95 int ret;
96
97 if ( (ret = mca_pml_ucx_init(enable_mpi_threads)) != 0) {
98 return NULL;
99 }
100
101 *priority = ompi_pml_ucx.priority;
102 return &ompi_pml_ucx.super;
103 }
104
105 static int mca_pml_ucx_component_fini(void)
106 {
107 return mca_pml_ucx_cleanup();
108 }
109