oshmem: sshmem ucx: minor code cleanup
Signed-off-by: Alex Mikheev <alexm@mellanox.com>
Этот коммит содержится в:
родитель
132fbd9ae9
Коммит
c63137e1c0
@ -420,14 +420,14 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
|
|||||||
int *count)
|
int *count)
|
||||||
{
|
{
|
||||||
sshmem_mkey_t *mkeys;
|
sshmem_mkey_t *mkeys;
|
||||||
ucs_status_t err;
|
ucs_status_t status;
|
||||||
spml_ucx_mkey_t *ucx_mkey;
|
spml_ucx_mkey_t *ucx_mkey;
|
||||||
size_t len;
|
size_t len;
|
||||||
int my_pe = oshmem_my_proc_id();
|
|
||||||
ucp_mem_map_params_t mem_map_params;
|
ucp_mem_map_params_t mem_map_params;
|
||||||
int segno;
|
int segno;
|
||||||
map_segment_t *mem_seg;
|
map_segment_t *mem_seg;
|
||||||
unsigned flags;
|
unsigned flags;
|
||||||
|
int my_pe = oshmem_my_proc_id();
|
||||||
|
|
||||||
*count = 0;
|
*count = 0;
|
||||||
mkeys = (sshmem_mkey_t *) calloc(1, sizeof(*mkeys));
|
mkeys = (sshmem_mkey_t *) calloc(1, sizeof(*mkeys));
|
||||||
@ -455,17 +455,18 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
|
|||||||
mem_map_params.length = size;
|
mem_map_params.length = size;
|
||||||
mem_map_params.flags = flags;
|
mem_map_params.flags = flags;
|
||||||
|
|
||||||
err = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h);
|
status = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h);
|
||||||
if (UCS_OK != err) {
|
if (UCS_OK != status) {
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ucx_mkey->mem_h = (ucp_mem_h)mem_seg->context;
|
ucx_mkey->mem_h = (ucp_mem_h)mem_seg->context;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ucp_rkey_pack(mca_spml_ucx.ucp_context, ucx_mkey->mem_h,
|
status = ucp_rkey_pack(mca_spml_ucx.ucp_context, ucx_mkey->mem_h,
|
||||||
&mkeys[0].u.data, &len);
|
&mkeys[0].u.data, &len);
|
||||||
if (UCS_OK != err) {
|
if (UCS_OK != status) {
|
||||||
goto error_unmap;
|
goto error_unmap;
|
||||||
}
|
}
|
||||||
if (len >= 0xffff) {
|
if (len >= 0xffff) {
|
||||||
@ -475,10 +476,10 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
|
|||||||
oshmem_shmem_abort(-1);
|
oshmem_shmem_abort(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ucp_ep_rkey_unpack(mca_spml_ucx.ucp_peers[oshmem_group_self->my_pe].ucp_conn,
|
status = ucp_ep_rkey_unpack(mca_spml_ucx.ucp_peers[oshmem_group_self->my_pe].ucp_conn,
|
||||||
mkeys[0].u.data,
|
mkeys[0].u.data,
|
||||||
&ucx_mkey->rkey);
|
&ucx_mkey->rkey);
|
||||||
if (UCS_OK != err) {
|
if (UCS_OK != status) {
|
||||||
SPML_ERROR("failed to unpack rkey");
|
SPML_ERROR("failed to unpack rkey");
|
||||||
goto error_unmap;
|
goto error_unmap;
|
||||||
}
|
}
|
||||||
|
@ -118,8 +118,6 @@ segment_create(map_segment_t *ds_buf,
|
|||||||
ds_buf->context = mem_h;
|
ds_buf->context = mem_h;
|
||||||
ds_buf->type = MAP_SEGMENT_ALLOC_UCX;
|
ds_buf->type = MAP_SEGMENT_ALLOC_UCX;
|
||||||
|
|
||||||
/* TODO: ucp_mem_advise when UCX has it */
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
OPAL_OUTPUT_VERBOSE(
|
OPAL_OUTPUT_VERBOSE(
|
||||||
(70, oshmem_sshmem_base_framework.framework_output,
|
(70, oshmem_sshmem_base_framework.framework_output,
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user