#[repr(C)]pub struct ucp_request_param_t {
pub op_attr_mask: u32,
pub flags: u32,
pub request: *mut c_void,
pub cb: ucp_request_param_t__bindgen_ty_1,
pub datatype: ucp_datatype_t,
pub user_data: *mut c_void,
pub reply_buffer: *mut c_void,
pub memory_type: ucs_memory_type_t,
pub recv_info: ucp_request_param_t__bindgen_ty_2,
}Expand description
@ingroup UCP_CONTEXT @brief Operation parameters passed to @ref ucp_tag_send_nbx, @ref ucp_tag_send_sync_nbx, @ref ucp_tag_recv_nbx, @ref ucp_put_nbx, @ref ucp_get_nbx, @ref ucp_am_send_nbx and @ref ucp_am_recv_data_nbx.
The structure @ref ucp_request_param_t is used to specify datatype of operation, provide user request in case the external request is used, set completion callback and custom user data passed to this callback.
Example: implementation of function to send contiguous buffer to ep and invoke callback function at operation completion. If the operation completed immediately (status == UCS_OK) then callback is not called.
@code{.c} ucs_status_ptr_t send_data(ucp_ep_h ep, void *buffer, size_t length, ucp_tag_t tag, void *request) { ucp_request_param_t param = { .op_attr_mask = UCP_OP_ATTR_FIELD_CALLBACK | UCP_OP_ATTR_FIELD_REQUEST, .request = request, .cb.send = custom_send_callback_f, .user_data = pointer_to_user_context_passed_to_cb };
ucs_status_ptr_t status;
status = ucp_tag_send_nbx(ep, buffer, length, tag, ¶m);
if (UCS_PTR_IS_ERR(status)) {
handle_error(status);
} else if (status == UCS_OK) {
// operation is completed
}
return status;} @endcode
Fields§
§op_attr_mask: u32Mask of valid fields in this structure and operation flags, using bits from @ref ucp_op_attr_t. Fields not specified in this mask will be ignored. Provides ABI compatibility with respect to adding new fields.
flags: u32§request: *mut c_voidRequest handle allocated by the user. There should be at least UCP request size bytes of available space before the @a request. The size of the UCP request can be obtained by @ref ucp_context_query function.
cb: ucp_request_param_t__bindgen_ty_1§datatype: ucp_datatype_tDatatype descriptor for the elements in the buffer. In case the op_attr_mask & UCP_OP_ATTR_FIELD_DATATYPE bit is not set, then use default datatype ucp_dt_make_contig(1)
user_data: *mut c_voidPointer to user data passed to callback function.
reply_buffer: *mut c_voidReply buffer. Can be used for storing operation result, for example by @ref ucp_atomic_op_nbx.
memory_type: ucs_memory_type_tMemory type of the buffer. see @ref ucs_memory_type_t for possible memory types. An optimization hint to avoid memory type detection for request buffer. If this value is not set (along with its corresponding bit in the op_attr_mask - @ref UCP_OP_ATTR_FIELD_MEMORY_TYPE), then use default @ref UCS_MEMORY_TYPE_UNKNOWN which means the memory type will be detected internally.
recv_info: ucp_request_param_t__bindgen_ty_2Trait Implementations§
Source§impl Clone for ucp_request_param_t
impl Clone for ucp_request_param_t
Source§fn clone(&self) -> ucp_request_param_t
fn clone(&self) -> ucp_request_param_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more