Skip to content

Commit

Permalink
Merge pull request #6689 from hoopoepg/topic/suppressed-pml-ucx-mt-wa…
Browse files Browse the repository at this point in the history
…rning-v4.0

PML/UCX: disable PML UCX if MT is requested but not supported - v4.0
  • Loading branch information
hppritcha authored May 26, 2019
2 parents 16e236d + 1edd366 commit 386ed07
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit 386ed07

Please sign in to comment.