Skip to content

Commit e9d2d02

Browse files
committed
PML/SPML/UCX: Adapt to the API changes in the UCX lib.
Signed-off-by: Alina Sklarevich <[email protected]>
1 parent 804a784 commit e9d2d02

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,17 @@ int mca_pml_ucx_close(void)
175175

176176
int mca_pml_ucx_init(void)
177177
{
178+
ucp_worker_params_t params;
178179
ucs_status_t status;
179180
int rc;
180181

181182
PML_UCX_VERBOSE(1, "mca_pml_ucx_init");
182183

183184
/* TODO check MPI thread mode */
184-
status = ucp_worker_create(ompi_pml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE,
185+
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
186+
params.thread_mode = UCS_THREAD_MODE_SINGLE;
187+
188+
status = ucp_worker_create(ompi_pml_ucx.ucp_context, &params,
185189
&ompi_pml_ucx.ucp_worker);
186190
if (UCS_OK != status) {
187191
return OMPI_ERROR;
@@ -231,6 +235,7 @@ int mca_pml_ucx_cleanup(void)
231235

232236
ucp_ep_h mca_pml_ucx_add_proc(ompi_communicator_t *comm, int dst)
233237
{
238+
ucp_ep_params_t ep_params;
234239
ucp_address_t *address;
235240
ucs_status_t status;
236241
size_t addrlen;
@@ -254,7 +259,11 @@ ucp_ep_h mca_pml_ucx_add_proc(ompi_communicator_t *comm, int dst)
254259
}
255260

256261
PML_UCX_VERBOSE(2, "connecting to proc. %d", proc_peer->super.proc_name.vpid);
257-
status = ucp_ep_create(ompi_pml_ucx.ucp_worker, address, &ep);
262+
263+
ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS;
264+
ep_params.address = address;
265+
266+
status = ucp_ep_create(ompi_pml_ucx.ucp_worker, &ep_params, &ep);
258267
free(address);
259268
if (UCS_OK != status) {
260269
PML_UCX_ERROR("Failed to connect to proc: %d, %s", proc_peer->super.proc_name.vpid,
@@ -269,6 +278,7 @@ ucp_ep_h mca_pml_ucx_add_proc(ompi_communicator_t *comm, int dst)
269278

270279
int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
271280
{
281+
ucp_ep_params_t ep_params;
272282
ucp_address_t *address;
273283
ucs_status_t status;
274284
ompi_proc_t *proc;
@@ -299,7 +309,11 @@ int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
299309
}
300310

301311
PML_UCX_VERBOSE(2, "connecting to proc. %d", proc->super.proc_name.vpid);
302-
status = ucp_ep_create(ompi_pml_ucx.ucp_worker, address, &ep);
312+
313+
ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS;
314+
ep_params.address = address;
315+
316+
status = ucp_ep_create(ompi_pml_ucx.ucp_worker, &ep_params, &ep);
303317
free(address);
304318

305319
if (UCS_OK != status) {

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ int mca_spml_ucx_add_procs(ompi_proc_t** procs, size_t nprocs)
255255
size_t wk_addr_len;
256256
int *wk_roffs, *wk_rsizes;
257257
char *wk_raddrs;
258+
ucp_ep_params_t ep_params;
258259

259260

260261
mca_spml_ucx.ucp_peers = (ucp_peer_t *) calloc(nprocs, sizeof(*(mca_spml_ucx.ucp_peers)));
@@ -280,9 +281,13 @@ int mca_spml_ucx_add_procs(ompi_proc_t** procs, size_t nprocs)
280281
for (n = 0; n < nprocs; ++n) {
281282
i = (my_rank + n) % nprocs;
282283
dump_address(i, (char *)(wk_raddrs + wk_roffs[i]), wk_rsizes[i]);
284+
285+
ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS;
286+
ep_params.address = (ucp_address_t *)(wk_raddrs + wk_roffs[i]);
287+
283288
err = ucp_ep_create(mca_spml_ucx.ucp_worker,
284-
(ucp_address_t *)(wk_raddrs + wk_roffs[i]),
285-
&mca_spml_ucx.ucp_peers[i].ucp_conn);
289+
&ep_params,
290+
&mca_spml_ucx.ucp_peers[i].ucp_conn);
286291
if (UCS_OK != err) {
287292
SPML_ERROR("ucp_ep_create failed!!!\n");
288293
goto error2;
@@ -390,6 +395,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
390395
spml_ucx_mkey_t *ucx_mkey;
391396
size_t len;
392397
int my_pe = oshmem_my_proc_id();
398+
ucp_mem_map_params_t mem_map_params;
393399
int seg;
394400
unsigned flags;
395401

@@ -408,7 +414,15 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
408414
if (mca_spml_ucx.heap_reg_nb && memheap_is_va_in_segment(addr, HEAP_SEG_INDEX)) {
409415
flags = UCP_MEM_MAP_NONBLOCK;
410416
}
411-
err = ucp_mem_map(mca_spml_ucx.ucp_context, &addr, size, flags, &ucx_mkey->mem_h);
417+
418+
mem_map_params.field_mask = UCP_MEM_MAP_PARAM_FIELD_ADDRESS |
419+
UCP_MEM_MAP_PARAM_FIELD_LENGTH |
420+
UCP_MEM_MAP_PARAM_FIELD_FLAGS;
421+
mem_map_params.address = addr;
422+
mem_map_params.length = size;
423+
mem_map_params.flags = flags;
424+
425+
err = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h);
412426
if (UCS_OK != err) {
413427
goto error_out;
414428
}
@@ -434,7 +448,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
434448
}
435449

436450
mkeys[0].len = len;
437-
mkeys[0].va_base = addr;
451+
mkeys[0].va_base = mem_map_params.address;
438452
*count = 1;
439453
mca_spml_ucx_cache_mkey(&mkeys[0], seg, my_pe);
440454
return mkeys;

oshmem/mca/spml/ucx/spml_ucx_component.c

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

150150
static int spml_ucx_init(void)
151151
{
152+
ucp_worker_params_t params;
152153
ucs_status_t err;
153154

154-
err = ucp_worker_create(mca_spml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE,
155+
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
156+
params.thread_mode = UCS_THREAD_MODE_SINGLE;
157+
158+
err = ucp_worker_create(mca_spml_ucx.ucp_context, &params,
155159
&mca_spml_ucx.ucp_worker);
156160
if (UCS_OK != err) {
157161
return OSHMEM_ERROR;

0 commit comments

Comments
 (0)