4
4
* Copyright (c) 2021 Triad National Security, LLC. All rights
5
5
* reserved.
6
6
*
7
+ * Copyright (c) 2022 IBM Corporation. All rights reserved.
7
8
* $COPYRIGHT$
8
9
*
9
10
* Additional copyrights may follow
@@ -44,6 +45,7 @@ static void _osc_ucx_init_unlock(void)
44
45
45
46
46
47
static int component_open (void );
48
+ static int component_close (void );
47
49
static int component_register (void );
48
50
static int component_init (bool enable_progress_threads , bool enable_mpi_threads );
49
51
static int component_finalize (void );
@@ -62,6 +64,7 @@ ompi_osc_ucx_component_t mca_osc_ucx_component = {
62
64
MCA_BASE_MAKE_VERSION (component , OMPI_MAJOR_VERSION , OMPI_MINOR_VERSION ,
63
65
OMPI_RELEASE_VERSION ),
64
66
.mca_open_component = component_open ,
67
+ .mca_close_component = component_close ,
65
68
.mca_register_component_params = component_register ,
66
69
},
67
70
.osc_data = {
@@ -143,6 +146,14 @@ static bool check_config_value_bool (char *key, opal_info_t *info)
143
146
}
144
147
145
148
static int component_open (void ) {
149
+ opal_common_ucx_mca_register ();
150
+
151
+ return OMPI_SUCCESS ;
152
+ }
153
+
154
+ static int component_close (void ) {
155
+ opal_common_ucx_mca_deregister ();
156
+
146
157
return OMPI_SUCCESS ;
147
158
}
148
159
@@ -253,7 +264,6 @@ static int component_init(bool enable_progress_threads, bool enable_mpi_threads)
253
264
254
265
mca_osc_ucx_component .enable_mpi_threads = enable_mpi_threads ;
255
266
mca_osc_ucx_component .wpool = opal_common_ucx_wpool_allocate ();
256
- opal_common_ucx_mca_register ();
257
267
258
268
ret = ucp_context_init (enable_mpi_threads , ompi_proc_world_size ());
259
269
if (OMPI_ERROR == ret ) {
@@ -286,7 +296,7 @@ static int component_init(bool enable_progress_threads, bool enable_mpi_threads)
286
296
}
287
297
288
298
static int component_finalize (void ) {
289
- opal_common_ucx_mca_deregister ();
299
+
290
300
if (mca_osc_ucx_component .env_initialized ) {
291
301
opal_common_ucx_wpool_finalize (mca_osc_ucx_component .wpool );
292
302
}
0 commit comments