Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCT/API: Add new MD resource query API #10154

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions src/uct/api/v2/uct_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,83 @@ int uct_iface_is_reachable_v2(uct_iface_h iface,
const uct_iface_is_reachable_params_t *params);


/**
* @ingroup UCT_RESOURCE
* @brief Parameters passed to @ref uct_md_query_tl_resources_v2.
*/
typedef struct uct_md_query_tl_resources_params {
/**
* Mask of valid fields which must currently be set to zero.
* Future fields not specified in this mask will be ignored.
* Provides ABI compatibility with respect to adding new fields.
*/
uint64_t field_mask;
rakhmets marked this conversation as resolved.
Show resolved Hide resolved
} uct_md_query_tl_resources_params_t;


/**
* @ingroup UCT_RESOURCE
* @brief Capability flags of @ref uct_tl_resource_desc_t.
*
* The enumeration defines bit mask of capabilities in @ref
* uct_tl_resource_desc_v2_t::flags, set by @ref uct_md_query_tl_resources_v2.
*/
enum {
/**
* If set, the resource supports inter-node communications.
*/
UCT_TL_RESOURCE_DESC_FLAG_INTER_NODE = UCS_BIT(0)
};


/**
* @ingroup UCT_RESOURCE
* @brief Communication resource descriptor.
*
* Resource descriptor of a standalone communication resource with extraneous
* flags.
*/
typedef struct uct_tl_resource_desc_v2 {
uct_tl_resource_desc_t desc; /**< Main resource descriptor */
uint64_t flags; /**< Associated resource flags */
} uct_tl_resource_desc_v2_t;


/**
* @ingroup UCT_RESOURCE
* @brief Query for transport resources.
*
* This routine queries the @ref uct_md_h "memory domain" for communication
* resources that are available for it.
*
* @param [in] md Handle to memory domain.
* @param [inout] params Parameters as defined in @ref
* uct_md_query_tl_resources_params_t.
* @param [out] resources_p Filled with a pointer to an array of resource
* descriptors.
* @param [out] num_resources_p Filled with the number of resources in the array.
*
* @return Error code.
*/
ucs_status_t
uct_md_query_tl_resources_v2(uct_md_h md,
uct_md_query_tl_resources_params_t *params,
uct_tl_resource_desc_v2_t **resources_p,
unsigned *num_resources_p);


/**
* @ingroup UCT_RESOURCE
* @brief Release the list of resources returned from @ref uct_md_query_tl_resources_v2.
*
* This routine releases the memory associated with the list of resources
* allocated by @ref uct_md_query_tl_resources_v2.
*
* @param [in] resources Array of resource descriptors to release.
*/
void uct_release_tl_resource_list_v2(uct_tl_resource_desc_v2_t *resources);
brminich marked this conversation as resolved.
Show resolved Hide resolved


/**
* @ingroup UCT_RESOURCE
* @brief Connect endpoint to a remote endpoint.
Expand Down
14 changes: 14 additions & 0 deletions src/uct/base/uct_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,20 @@ uct_md_query_empty_md_resource(uct_md_resource_desc_t **resources_p,
return UCS_OK;
}

ucs_status_t uct_md_query_tl_resources_v2(
uct_md_h UCS_V_UNUSED md,
uct_md_query_tl_resources_params_t *UCS_V_UNUSED params,
uct_tl_resource_desc_v2_t **UCS_V_UNUSED resources_p,
unsigned *UCS_V_UNUSED num_resources_p)
{
return UCS_ERR_NOT_IMPLEMENTED;
}

void uct_release_tl_resource_list_v2(
uct_tl_resource_desc_v2_t *UCS_V_UNUSED resources)
{
}

ucs_status_t uct_md_stub_rkey_unpack(uct_component_t *component,
const void *rkey_buffer, uct_rkey_t *rkey_p,
void **handle_p)
Expand Down
Loading