Skip to content

Commit 61adcd9

Browse files
authored
Merge pull request #6680 from hoopoepg/topic/suppressed-pml-ucx-mt-warning
PML/UCX: disable PML UCX if MT is requested but not supported
2 parents 5cfa1cf + a3578d9 commit 61adcd9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ int mca_pml_ucx_close(void)
245245
return OMPI_SUCCESS;
246246
}
247247

248-
int mca_pml_ucx_init(void)
248+
int mca_pml_ucx_init(int enable_mpi_threads)
249249
{
250250
ucp_worker_params_t params;
251251
ucp_worker_attr_t attr;
@@ -256,8 +256,7 @@ int mca_pml_ucx_init(void)
256256

257257
/* TODO check MPI thread mode */
258258
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
259-
params.thread_mode = UCS_THREAD_MODE_SINGLE;
260-
if (ompi_mpi_thread_multiple) {
259+
if (enable_mpi_threads) {
261260
params.thread_mode = UCS_THREAD_MODE_MULTI;
262261
} else {
263262
params.thread_mode = UCS_THREAD_MODE_SINGLE;
@@ -279,10 +278,11 @@ int mca_pml_ucx_init(void)
279278
goto err_destroy_worker;
280279
}
281280

282-
if (ompi_mpi_thread_multiple && (attr.thread_mode != UCS_THREAD_MODE_MULTI)) {
281+
if (enable_mpi_threads && (attr.thread_mode != UCS_THREAD_MODE_MULTI)) {
283282
/* UCX does not support multithreading, disqualify current PML for now */
284283
/* TODO: we should let OMPI to fallback to THREAD_SINGLE mode */
285-
PML_UCX_ERROR("UCP worker does not support MPI_THREAD_MULTIPLE");
284+
PML_UCX_VERBOSE(1, "UCP worker does not support MPI_THREAD_MULTIPLE. "
285+
"PML UCX could not be selected");
286286
rc = OMPI_ERR_NOT_SUPPORTED;
287287
goto err_destroy_worker;
288288
}

ompi/mca/pml/ucx/pml_ucx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern mca_pml_ucx_module_t ompi_pml_ucx;
6464

6565
int mca_pml_ucx_open(void);
6666
int mca_pml_ucx_close(void);
67-
int mca_pml_ucx_init(void);
67+
int mca_pml_ucx_init(int enable_mpi_threads);
6868
int mca_pml_ucx_cleanup(void);
6969

7070
int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs);

ompi/mca/pml/ucx/pml_ucx_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ static int mca_pml_ucx_component_close(void)
9090

9191
static mca_pml_base_module_t*
9292
mca_pml_ucx_component_init(int* priority, bool enable_progress_threads,
93-
bool enable_mpi_threads)
93+
bool enable_mpi_threads)
9494
{
9595
int ret;
9696

97-
if ( (ret = mca_pml_ucx_init()) != 0) {
97+
if ( (ret = mca_pml_ucx_init(enable_mpi_threads)) != 0) {
9898
return NULL;
9999
}
100100

0 commit comments

Comments
 (0)