Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ompi/mca/pml/ucx/pml_ucx.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ int mca_pml_ucx_close(void)
return OMPI_SUCCESS;
}

int mca_pml_ucx_init(void)
int mca_pml_ucx_init(int enable_mpi_threads)
{
ucp_worker_params_t params;
ucp_worker_attr_t attr;
Expand All @@ -256,8 +256,7 @@ int mca_pml_ucx_init(void)

/* TODO check MPI thread mode */
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
params.thread_mode = UCS_THREAD_MODE_SINGLE;
if (ompi_mpi_thread_multiple) {
if (enable_mpi_threads) {
params.thread_mode = UCS_THREAD_MODE_MULTI;
} else {
params.thread_mode = UCS_THREAD_MODE_SINGLE;
Expand All @@ -279,10 +278,11 @@ int mca_pml_ucx_init(void)
goto err_destroy_worker;
}

if (ompi_mpi_thread_multiple && (attr.thread_mode != UCS_THREAD_MODE_MULTI)) {
if (enable_mpi_threads && (attr.thread_mode != UCS_THREAD_MODE_MULTI)) {
/* UCX does not support multithreading, disqualify current PML for now */
/* TODO: we should let OMPI to fallback to THREAD_SINGLE mode */
PML_UCX_ERROR("UCP worker does not support MPI_THREAD_MULTIPLE");
PML_UCX_VERBOSE(1, "UCP worker does not support MPI_THREAD_MULTIPLE. "
"PML UCX could not be selected");
rc = OMPI_ERR_NOT_SUPPORTED;
goto err_destroy_worker;
}
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/pml/ucx/pml_ucx.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extern mca_pml_ucx_module_t ompi_pml_ucx;

int mca_pml_ucx_open(void);
int mca_pml_ucx_close(void);
int mca_pml_ucx_init(void);
int mca_pml_ucx_init(int enable_mpi_threads);
int mca_pml_ucx_cleanup(void);

int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs);
Expand Down
4 changes: 2 additions & 2 deletions ompi/mca/pml/ucx/pml_ucx_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ static int mca_pml_ucx_component_close(void)

static mca_pml_base_module_t*
mca_pml_ucx_component_init(int* priority, bool enable_progress_threads,
bool enable_mpi_threads)
bool enable_mpi_threads)
{
int ret;

if ( (ret = mca_pml_ucx_init()) != 0) {
if ( (ret = mca_pml_ucx_init(enable_mpi_threads)) != 0) {
return NULL;
}

Expand Down