Skip to content

Commit 7651aa3

Browse files
author
Mamzi Bayatpour [email protected] ()
committed
fix thread_enabled name
1 parent 18ff47b commit 7651aa3

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

ompi/mca/osc/ucx/osc_ucx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ typedef struct ompi_osc_ucx_lock {
165165
#define OSC_UCX_GET_EP(_module, rank_) (mca_osc_ucx_component.endpoints[_module->comm_world_ranks[rank_]])
166166
#define OSC_UCX_GET_DISP(module_, rank_) ((module_->disp_unit < 0) ? module_->disp_units[rank_] : module_->disp_unit)
167167

168-
extern bool thread_enabled;
168+
extern bool opal_common_ucx_thread_enabled;
169169

170170
#define OSC_UCX_GET_DEFAULT_EP(_ep_ptr, _module, _target) \
171-
if (thread_enabled) { \
171+
if (opal_common_ucx_thread_enabled) { \
172172
_ep_ptr = NULL; \
173173
} else { \
174174
_ep_ptr = (ucp_ep_h *)&(OSC_UCX_GET_EP(_module, _target)); \

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int component_register(void) {
175175
MCA_BASE_VAR_SCOPE_GROUP, &mca_osc_ucx_component.no_locks);
176176
free(description_str);
177177

178-
thread_enabled = opal_using_threads();
178+
opal_common_ucx_thread_enabled = opal_using_threads();
179179
mca_osc_ucx_component.acc_single_intrinsic = false;
180180

181181
opal_asprintf(&description_str, "Enable optimizations for MPI_Fetch_and_op, MPI_Accumulate, etc for codes "
@@ -193,10 +193,10 @@ static int component_register(void) {
193193

194194
opal_asprintf(&description_str, "Enable optimizations for multi-threaded applications by allocating a separate worker "
195195
"for each thread and a separate endpoint for each window (default: %s)",
196-
thread_enabled ? "true" : "false");
196+
opal_common_ucx_thread_enabled ? "true" : "false");
197197
(void) mca_base_component_var_register(&mca_osc_ucx_component.super.osc_version, "enable_wpool_thread_multiple",
198198
description_str, MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, OPAL_INFO_LVL_5,
199-
MCA_BASE_VAR_SCOPE_GROUP, &thread_enabled);
199+
MCA_BASE_VAR_SCOPE_GROUP, &opal_common_ucx_thread_enabled);
200200

201201
opal_asprintf(&description_str, "Threshold on number of nonblocking accumulate calls on which there is a periodical "
202202
"flush (default: %d)", ompi_osc_ucx_outstanding_ops_flush_threshold);
@@ -309,7 +309,7 @@ static int component_init(bool enable_progress_threads, bool enable_mpi_threads)
309309
}
310310

311311
static int component_finalize(void) {
312-
if (!thread_enabled) {
312+
if (!opal_common_ucx_thread_enabled) {
313313
int i;
314314
for (i = 0; i < mca_osc_ucx_component.comm_world_size; i++) {
315315
ucp_ep_h ep = mca_osc_ucx_component.endpoints[i];
@@ -519,7 +519,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in
519519
OSC_UCX_VERBOSE(1, "opal_common_ucx_wpool_init failed: %d", ret);
520520
goto select_unlock;
521521
}
522-
if (!thread_enabled) {
522+
if (!opal_common_ucx_thread_enabled) {
523523
mca_osc_ucx_component.comm_world_size = ompi_proc_world_size();
524524
mca_osc_ucx_component.endpoints = calloc(mca_osc_ucx_component.comm_world_size, sizeof(ucp_ep_h));
525525
}

opal/mca/common/ucx/common_ucx_wpool.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ __thread FILE *tls_pf = NULL;
3131
__thread int initialized = 0;
3232
#endif
3333

34-
bool thread_enabled;
34+
bool opal_common_ucx_thread_enabled;
3535

3636
static _ctx_record_t *_tlocal_add_ctx_rec(opal_common_ucx_ctx_t *ctx);
3737
static inline _ctx_record_t *_tlocal_get_ctx_rec(opal_tsd_tracked_key_t tls_key);
@@ -50,7 +50,7 @@ static opal_common_ucx_winfo_t *_winfo_create(opal_common_ucx_wpool_t *wpool)
5050
ucs_status_t status;
5151
opal_common_ucx_winfo_t *winfo = NULL;
5252

53-
if (thread_enabled || wpool->dflt_winfo == NULL) {
53+
if (opal_common_ucx_thread_enabled || wpool->dflt_winfo == NULL) {
5454
memset(&worker_params, 0, sizeof(worker_params));
5555
worker_params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
5656
worker_params.thread_mode = UCS_THREAD_MODE_SINGLE;
@@ -98,7 +98,7 @@ static void _winfo_destructor(opal_common_ucx_winfo_t *winfo)
9898

9999
if (winfo->comm_size != 0) {
100100
size_t i;
101-
if (thread_enabled) {
101+
if (opal_common_ucx_thread_enabled) {
102102
for (i = 0; i < winfo->comm_size; i++) {
103103
if (NULL != winfo->endpoints[i]) {
104104
ucp_ep_destroy(winfo->endpoints[i]);
@@ -113,7 +113,7 @@ static void _winfo_destructor(opal_common_ucx_winfo_t *winfo)
113113
winfo->comm_size = 0;
114114

115115
OBJ_DESTRUCT(&winfo->mutex);
116-
if (thread_enabled || winfo->is_dflt_winfo) {
116+
if (opal_common_ucx_thread_enabled || winfo->is_dflt_winfo) {
117117
ucp_worker_destroy(winfo->worker);
118118
}
119119

@@ -730,13 +730,13 @@ OPAL_DECLSPEC int opal_common_ucx_tlocal_fetch_spath(opal_common_ucx_wpmem_t *me
730730

731731
/* Obtain the endpoint */
732732
if (OPAL_UNLIKELY(NULL == winfo->endpoints[target])) {
733-
if (thread_enabled || (dflt_ep == NULL) ||
733+
if (opal_common_ucx_thread_enabled || (dflt_ep == NULL) ||
734734
(*dflt_ep == NULL)) {
735735
rc = _tlocal_ctx_connect(ctx_rec, target);
736736
if (rc != OPAL_SUCCESS) {
737737
return rc;
738738
}
739-
if (!thread_enabled && (dflt_ep != NULL) &&
739+
if (!opal_common_ucx_thread_enabled && (dflt_ep != NULL) &&
740740
(*dflt_ep == NULL)) {
741741
/* set the proc ep */
742742
*dflt_ep = winfo->endpoints[target];

0 commit comments

Comments
 (0)