Skip to content

Commit 55b934b

Browse files
author
Sergey Oblomov
committed
OSC/UCX: enable progress when at least one window is allocated
Signed-off-by: Sergey Oblomov <sergeyo@mellanox.com>
1 parent a081fba commit 55b934b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

ompi/mca/osc/ucx/osc_ucx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct ompi_osc_ucx_component {
3838
opal_free_list_t requests; /* request free list for the r* communication variants */
3939
bool env_initialized; /* UCX environment is initialized or not */
4040
int num_incomplete_req_ops;
41-
int init_in_progress;
41+
int num_modules;
4242
unsigned int priority;
4343
} ompi_osc_ucx_component_t;
4444

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ompi_osc_ucx_component_t mca_osc_ucx_component = {
5050
.ucp_worker = NULL,
5151
.env_initialized = false,
5252
.num_incomplete_req_ops = 0,
53-
.init_in_progress = 1
53+
.num_modules = 0
5454
};
5555

5656
ompi_osc_ucx_module_t ompi_osc_ucx_module_template = {
@@ -111,8 +111,7 @@ static int component_register(void) {
111111

112112
static int progress_callback(void) {
113113
if ((mca_osc_ucx_component.ucp_worker != NULL) &&
114-
(mca_osc_ucx_component.num_incomplete_req_ops +
115-
mca_osc_ucx_component.init_in_progress > 0)) {
114+
mca_osc_ucx_component.num_modules) {
116115
ucp_worker_progress(mca_osc_ucx_component.ucp_worker);
117116
}
118117
return 0;
@@ -362,6 +361,8 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in
362361
goto error_nomem;
363362
}
364363

364+
mca_osc_ucx_component.num_modules++;
365+
365366
/* fill in the function pointer part */
366367
memcpy(module, &ompi_osc_ucx_module_template, sizeof(ompi_osc_base_module_t));
367368

@@ -645,6 +646,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in
645646
}
646647
if (progress_registered) opal_progress_unregister(progress_callback);
647648
if (module) free(module);
649+
mca_osc_ucx_component.num_modules--;
648650

649651
error_nomem:
650652
if (env_initialized == true) {
@@ -812,6 +814,7 @@ int ompi_osc_ucx_free(struct ompi_win_t *win) {
812814
ompi_comm_free(&module->comm);
813815

814816
free(module);
817+
mca_osc_ucx_component.num_modules--;
815818

816819
return ret;
817820
}

ompi/mca/osc/ucx/osc_ucx_request.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ void req_completion(void *request, ucs_status_t status) {
5757
ompi_request_complete(&(req->external_req->super), true);
5858
ucp_request_release(req);
5959
mca_osc_ucx_component.num_incomplete_req_ops--;
60-
mca_osc_ucx_component.init_in_progress = 0;
6160
assert(mca_osc_ucx_component.num_incomplete_req_ops >= 0);
6261
}
6362
}

0 commit comments

Comments
 (0)