Skip to content

Commit c6766bb

Browse files
authored
Merge pull request open-mpi#12910 from hppritcha/fix_ucx_sessions_prob
UCX: fix problem when doing multiple session init/finalize
2 parents 594e29a + db92ff5 commit c6766bb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

opal/mca/common/ucx/common_ucx.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (c) 2019 Intel, Inc. All rights reserved.
55
* Copyright (c) 2019 Research Organization for Information Science
66
* and Technology (RIST). All rights reserved.
7-
* Copyright (c) 2021 Triad National Security, LLC. All rights
7+
* Copyright (c) 2021-2024 Triad National Security, LLC. All rights
88
* reserved.
99
* Copyright (c) 2022 Google, LLC. All rights reserved.
1010
* Copyright (c) 2022 IBM Corporation. All rights reserved.
@@ -107,6 +107,10 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
107107
// cleans up the MCA vars. This will cause the string to go
108108
// out of scope unless we place the pointer to it on the heap.
109109
opal_common_ucx.tls = (char **) malloc(sizeof(char *));
110+
*opal_common_ucx.tls = NULL;
111+
}
112+
113+
if (NULL == *opal_common_ucx.tls) {
110114
*opal_common_ucx.tls = strdup(default_tls);
111115
}
112116

@@ -122,8 +126,13 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
122126

123127
if (NULL == opal_common_ucx.devices) {
124128
opal_common_ucx.devices = (char**) malloc(sizeof(char*));
129+
*opal_common_ucx.devices = NULL;
130+
}
131+
132+
if (NULL == *opal_common_ucx.devices) {
125133
*opal_common_ucx.devices = strdup(default_devices);
126134
}
135+
127136
devices_index = mca_base_var_register(
128137
"opal", "opal_common", "ucx", "devices",
129138
"List of device driver pattern names, which, if supported by UCX, will "

0 commit comments

Comments
 (0)