Skip to content

Commit c63137e

Browse files
committed
oshmem: sshmem ucx: minor code cleanup
Signed-off-by: Alex Mikheev <alexm@mellanox.com>
1 parent 132fbd9 commit c63137e

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

oshmem/mca/spml/ucx/spml_ucx.c

+12-11
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,14 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
420420
int *count)
421421
{
422422
sshmem_mkey_t *mkeys;
423-
ucs_status_t err;
423+
ucs_status_t status;
424424
spml_ucx_mkey_t *ucx_mkey;
425425
size_t len;
426-
int my_pe = oshmem_my_proc_id();
427426
ucp_mem_map_params_t mem_map_params;
428427
int segno;
429428
map_segment_t *mem_seg;
430429
unsigned flags;
430+
int my_pe = oshmem_my_proc_id();
431431

432432
*count = 0;
433433
mkeys = (sshmem_mkey_t *) calloc(1, sizeof(*mkeys));
@@ -455,17 +455,18 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
455455
mem_map_params.length = size;
456456
mem_map_params.flags = flags;
457457

458-
err = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h);
459-
if (UCS_OK != err) {
458+
status = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h);
459+
if (UCS_OK != status) {
460460
goto error_out;
461461
}
462+
462463
} else {
463464
ucx_mkey->mem_h = (ucp_mem_h)mem_seg->context;
464465
}
465466

466-
err = ucp_rkey_pack(mca_spml_ucx.ucp_context, ucx_mkey->mem_h,
467-
&mkeys[0].u.data, &len);
468-
if (UCS_OK != err) {
467+
status = ucp_rkey_pack(mca_spml_ucx.ucp_context, ucx_mkey->mem_h,
468+
&mkeys[0].u.data, &len);
469+
if (UCS_OK != status) {
469470
goto error_unmap;
470471
}
471472
if (len >= 0xffff) {
@@ -475,10 +476,10 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
475476
oshmem_shmem_abort(-1);
476477
}
477478

478-
err = ucp_ep_rkey_unpack(mca_spml_ucx.ucp_peers[oshmem_group_self->my_pe].ucp_conn,
479-
mkeys[0].u.data,
480-
&ucx_mkey->rkey);
481-
if (UCS_OK != err) {
479+
status = ucp_ep_rkey_unpack(mca_spml_ucx.ucp_peers[oshmem_group_self->my_pe].ucp_conn,
480+
mkeys[0].u.data,
481+
&ucx_mkey->rkey);
482+
if (UCS_OK != status) {
482483
SPML_ERROR("failed to unpack rkey");
483484
goto error_unmap;
484485
}

oshmem/mca/sshmem/ucx/sshmem_ucx_module.c

-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ segment_create(map_segment_t *ds_buf,
118118
ds_buf->context = mem_h;
119119
ds_buf->type = MAP_SEGMENT_ALLOC_UCX;
120120

121-
/* TODO: ucp_mem_advise when UCX has it */
122-
123121
out:
124122
OPAL_OUTPUT_VERBOSE(
125123
(70, oshmem_sshmem_base_framework.framework_output,

0 commit comments

Comments
 (0)