ucx icon indicating copy to clipboard operation
ucx copied to clipboard

UCP: Copy memh flags from parent to child

Open iyastreb opened this issue 1 year ago • 2 comments

What

UCP_MEMH_FLAG_IMPORTED was added in https://github.com/openucx/ucx/pull/8584, as the only memory handle flag. But this flag is only set in the memh parent, and never propagated to user memh. Despite that, flag is used on user memh:

ucp_am_params_check_memh(const ucp_request_param_t *param, uint32_t *flags_p)
{
 ...
    if (ucs_unlikely(param->memh->flags & UCP_MEMH_FLAG_IMPORTED)) {
        if (ENABLE_PARAMS_CHECK &&
            ucs_unlikely(*flags_p & UCP_AM_SEND_FLAG_EAGER)) {
            return UCS_ERR_INVALID_PARAM;
        }

        *flags_p |= UCP_AM_SEND_FLAG_RNDV;
    }

I think this flag must copied from parent to child in ucp_memh_init_from_parent, so that we can distinguish whether user memh is attached to imported memory or not

iyastreb avatar May 21 '24 15:05 iyastreb

@iyastreb can we add a unit test for it?

yosefe avatar May 22 '24 10:05 yosefe

@iyastreb can we add a unit test for it?

Sure, good idea indeed!

iyastreb avatar May 22 '24 13:05 iyastreb