From dad69c7c1553887cf3a4f3d1c31539a915e7ad19 Mon Sep 17 00:00:00 2001 From: Alina Sklarevich Date: Wed, 7 Dec 2016 10:51:18 +0200 Subject: [PATCH] PML/SPML/UCX: Adapt to the API changes in the UCX lib. Signed-off-by: Alina Sklarevich --- ompi/mca/pml/ucx/pml_ucx.c | 13 +++++++++++-- oshmem/mca/spml/ucx/spml_ucx.c | 21 ++++++++++++++++----- oshmem/mca/spml/ucx/spml_ucx_component.c | 6 +++++- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ompi/mca/pml/ucx/pml_ucx.c b/ompi/mca/pml/ucx/pml_ucx.c index 3d0ac7abca9..59cc043362d 100644 --- a/ompi/mca/pml/ucx/pml_ucx.c +++ b/ompi/mca/pml/ucx/pml_ucx.c @@ -193,6 +193,7 @@ int mca_pml_ucx_close(void) int mca_pml_ucx_init(void) { + ucp_worker_params_t params; ucs_status_t status; int rc; @@ -203,7 +204,10 @@ int mca_pml_ucx_init(void) } /* TODO check MPI thread mode */ - status = ucp_worker_create(ompi_pml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE, + params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE; + params.thread_mode = UCS_THREAD_MODE_SINGLE; + + status = ucp_worker_create(ompi_pml_ucx.ucp_context, ¶ms, &ompi_pml_ucx.ucp_worker); if (UCS_OK != status) { return OMPI_ERROR; @@ -257,6 +261,7 @@ int mca_pml_ucx_cleanup(void) int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs) { + ucp_ep_params_t ep_params; ucp_address_t *address; ucs_status_t status; ompi_proc_t *proc; @@ -287,7 +292,11 @@ int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs) } PML_UCX_VERBOSE(2, "connecting to proc. %d", proc->proc_name.vpid); - status = ucp_ep_create(ompi_pml_ucx.ucp_worker, address, &ep); + + ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS; + ep_params.address = address; + + status = ucp_ep_create(ompi_pml_ucx.ucp_worker, &ep_params, &ep); free(address); if (UCS_OK != status) { diff --git a/oshmem/mca/spml/ucx/spml_ucx.c b/oshmem/mca/spml/ucx/spml_ucx.c index e1129021ab7..0a19df5c02e 100644 --- a/oshmem/mca/spml/ucx/spml_ucx.c +++ b/oshmem/mca/spml/ucx/spml_ucx.c @@ -252,6 +252,7 @@ int mca_spml_ucx_add_procs(oshmem_proc_t** procs, size_t nprocs) size_t wk_addr_len; int *wk_roffs, *wk_rsizes; char *wk_raddrs; + ucp_ep_params_t ep_params; mca_spml_ucx.ucp_peers = (ucp_peer_t *) calloc(nprocs, sizeof(*(mca_spml_ucx.ucp_peers))); @@ -277,9 +278,13 @@ int mca_spml_ucx_add_procs(oshmem_proc_t** procs, size_t nprocs) for (n = 0; n < nprocs; ++n) { i = (my_rank + n) % nprocs; dump_address(i, (char *)(wk_raddrs + wk_roffs[i]), wk_rsizes[i]); + + ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS; + ep_params.address = (ucp_address_t *)(wk_raddrs + wk_roffs[i]); + err = ucp_ep_create(mca_spml_ucx.ucp_worker, - (ucp_address_t *)(wk_raddrs + wk_roffs[i]), - &mca_spml_ucx.ucp_peers[i].ucp_conn); + &ep_params, + &mca_spml_ucx.ucp_peers[i].ucp_conn); if (UCS_OK != err) { SPML_ERROR("ucp_ep_create failed!!!\n"); goto error2; @@ -367,6 +372,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr, ucs_status_t err; spml_ucx_mkey_t *ucx_mkey; size_t len; + ucp_mem_map_params_t mem_map_params; *count = 0; mkeys = (sshmem_mkey_t *) calloc(1, sizeof(*mkeys)); @@ -380,8 +386,13 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr, } mkeys[0].spml_context = ucx_mkey; - err = ucp_mem_map(mca_spml_ucx.ucp_context, - &addr, size, 0, &ucx_mkey->mem_h); + + mem_map_params.field_mask = UCP_MEM_MAP_PARAM_FIELD_ADDRESS | + UCP_MEM_MAP_PARAM_FIELD_LENGTH; + mem_map_params.address = addr; + mem_map_params.length = size; + + err = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h); if (UCS_OK != err) { goto error_out1; } @@ -407,7 +418,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr, } mkeys[0].len = len; - mkeys[0].va_base = addr; + mkeys[0].va_base = mem_map_params.address; *count = 1; return mkeys; diff --git a/oshmem/mca/spml/ucx/spml_ucx_component.c b/oshmem/mca/spml/ucx/spml_ucx_component.c index ad9908091d8..445d4791c3c 100644 --- a/oshmem/mca/spml/ucx/spml_ucx_component.c +++ b/oshmem/mca/spml/ucx/spml_ucx_component.c @@ -159,9 +159,13 @@ static int mca_spml_ucx_component_close(void) static int spml_ucx_init(void) { + ucp_worker_params_t params; ucs_status_t err; - err = ucp_worker_create(mca_spml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE, + params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE; + params.thread_mode = UCS_THREAD_MODE_SINGLE; + + err = ucp_worker_create(mca_spml_ucx.ucp_context, ¶ms, &mca_spml_ucx.ucp_worker); if (UCS_OK != err) { return OSHMEM_ERROR;