Skip to content

Commit

Permalink
UCT/API: Add new MD resource query API
Browse files Browse the repository at this point in the history
  • Loading branch information
tvegas1 committed Sep 18, 2024
1 parent cfe1e09 commit 1e716b3
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
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;
} 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 [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.
* @param [in] params Parameters as defined in @ref
* uct_md_query_tl_resources_params_t.
*
* @return Error code.
*/
ucs_status_t
uct_md_query_tl_resources_v2(uct_md_h md,
uct_tl_resource_desc_v2_t **resources_p,
unsigned *num_resources_p,
uct_md_query_tl_resources_params_t *params);


/**
* @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);


/**
* @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_tl_resource_desc_v2_t **UCS_V_UNUSED resources_p,
unsigned *UCS_V_UNUSED num_resources_p,
uct_md_query_tl_resources_params_t *UCS_V_UNUSED params)
{
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

0 comments on commit 1e716b3

Please sign in to comment.