Skip to content

Commit dad69c7

Browse files
alinaskyosefe
authored andcommitted
PML/SPML/UCX: Adapt to the API changes in the UCX lib.
Signed-off-by: Alina Sklarevich <[email protected]>
1 parent c14c281 commit dad69c7

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ int mca_pml_ucx_close(void)
193193

194194
int mca_pml_ucx_init(void)
195195
{
196+
ucp_worker_params_t params;
196197
ucs_status_t status;
197198
int rc;
198199

@@ -203,7 +204,10 @@ int mca_pml_ucx_init(void)
203204
}
204205

205206
/* TODO check MPI thread mode */
206-
status = ucp_worker_create(ompi_pml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE,
207+
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
208+
params.thread_mode = UCS_THREAD_MODE_SINGLE;
209+
210+
status = ucp_worker_create(ompi_pml_ucx.ucp_context, &params,
207211
&ompi_pml_ucx.ucp_worker);
208212
if (UCS_OK != status) {
209213
return OMPI_ERROR;
@@ -257,6 +261,7 @@ int mca_pml_ucx_cleanup(void)
257261

258262
int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
259263
{
264+
ucp_ep_params_t ep_params;
260265
ucp_address_t *address;
261266
ucs_status_t status;
262267
ompi_proc_t *proc;
@@ -287,7 +292,11 @@ int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
287292
}
288293

289294
PML_UCX_VERBOSE(2, "connecting to proc. %d", proc->proc_name.vpid);
290-
status = ucp_ep_create(ompi_pml_ucx.ucp_worker, address, &ep);
295+
296+
ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS;
297+
ep_params.address = address;
298+
299+
status = ucp_ep_create(ompi_pml_ucx.ucp_worker, &ep_params, &ep);
291300
free(address);
292301

293302
if (UCS_OK != status) {

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ int mca_spml_ucx_add_procs(oshmem_proc_t** procs, size_t nprocs)
252252
size_t wk_addr_len;
253253
int *wk_roffs, *wk_rsizes;
254254
char *wk_raddrs;
255+
ucp_ep_params_t ep_params;
255256

256257

257258
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)
277278
for (n = 0; n < nprocs; ++n) {
278279
i = (my_rank + n) % nprocs;
279280
dump_address(i, (char *)(wk_raddrs + wk_roffs[i]), wk_rsizes[i]);
281+
282+
ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS;
283+
ep_params.address = (ucp_address_t *)(wk_raddrs + wk_roffs[i]);
284+
280285
err = ucp_ep_create(mca_spml_ucx.ucp_worker,
281-
(ucp_address_t *)(wk_raddrs + wk_roffs[i]),
282-
&mca_spml_ucx.ucp_peers[i].ucp_conn);
286+
&ep_params,
287+
&mca_spml_ucx.ucp_peers[i].ucp_conn);
283288
if (UCS_OK != err) {
284289
SPML_ERROR("ucp_ep_create failed!!!\n");
285290
goto error2;
@@ -367,6 +372,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
367372
ucs_status_t err;
368373
spml_ucx_mkey_t *ucx_mkey;
369374
size_t len;
375+
ucp_mem_map_params_t mem_map_params;
370376

371377
*count = 0;
372378
mkeys = (sshmem_mkey_t *) calloc(1, sizeof(*mkeys));
@@ -380,8 +386,13 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
380386
}
381387

382388
mkeys[0].spml_context = ucx_mkey;
383-
err = ucp_mem_map(mca_spml_ucx.ucp_context,
384-
&addr, size, 0, &ucx_mkey->mem_h);
389+
390+
mem_map_params.field_mask = UCP_MEM_MAP_PARAM_FIELD_ADDRESS |
391+
UCP_MEM_MAP_PARAM_FIELD_LENGTH;
392+
mem_map_params.address = addr;
393+
mem_map_params.length = size;
394+
395+
err = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h);
385396
if (UCS_OK != err) {
386397
goto error_out1;
387398
}
@@ -407,7 +418,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
407418
}
408419

409420
mkeys[0].len = len;
410-
mkeys[0].va_base = addr;
421+
mkeys[0].va_base = mem_map_params.address;
411422
*count = 1;
412423
return mkeys;
413424

oshmem/mca/spml/ucx/spml_ucx_component.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,13 @@ static int mca_spml_ucx_component_close(void)
159159

160160
static int spml_ucx_init(void)
161161
{
162+
ucp_worker_params_t params;
162163
ucs_status_t err;
163164

164-
err = ucp_worker_create(mca_spml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE,
165+
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
166+
params.thread_mode = UCS_THREAD_MODE_SINGLE;
167+
168+
err = ucp_worker_create(mca_spml_ucx.ucp_context, &params,
165169
&mca_spml_ucx.ucp_worker);
166170
if (UCS_OK != err) {
167171
return OSHMEM_ERROR;

0 commit comments

Comments
 (0)