#[repr(C)]pub struct ucp_generic_dt_ops {
pub start_pack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *const c_void, count: size_t) -> *mut c_void>,
pub start_unpack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *mut c_void, count: size_t) -> *mut c_void>,
pub packed_size: Option<unsafe extern "C" fn(state: *mut c_void) -> size_t>,
pub pack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, dest: *mut c_void, max_length: size_t) -> size_t>,
pub unpack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, src: *const c_void, length: size_t) -> ucs_status_t>,
pub finish: Option<unsafe extern "C" fn(state: *mut c_void)>,
}Expand description
@ingroup UCP_DATATYPE @brief UCP generic data type descriptor
This structure provides a generic datatype descriptor that is used for definition of application defined datatypes.
Typically, the descriptor is used for an integration with datatype engines implemented within MPI and SHMEM implementations.
@note In case of partial receive, any amount of received data is acceptable which matches buffer size.
Fields§
§start_pack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *const c_void, count: size_t) -> *mut c_void>@ingroup UCP_DATATYPE @brief Start a packing request.
The pointer refers to application defined start-to-pack routine. It will be called from the @ref ucp_tag_send_nb routine.
@param [in] context User-defined context. @param [in] buffer Buffer to pack. @param [in] count Number of elements to pack into the buffer.
@return A custom state that is passed to the following @ref ucp_generic_dt_ops::pack “pack()” routine.
start_unpack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *mut c_void, count: size_t) -> *mut c_void>@ingroup UCP_DATATYPE @brief Start an unpacking request.
The pointer refers to application defined start-to-unpack routine. It will be called from the @ref ucp_tag_recv_nb routine.
@param [in] context User-defined context. @param [in] buffer Buffer to unpack to. @param [in] count Number of elements to unpack in the buffer.
@return A custom state that is passed later to the following @ref ucp_generic_dt_ops::unpack “unpack()” routine.
packed_size: Option<unsafe extern "C" fn(state: *mut c_void) -> size_t>@ingroup UCP_DATATYPE @brief Get the total size of packed data.
The pointer refers to user defined routine that returns the size of data in a packed format.
@param [in] state State as returned by @ref ucp_generic_dt_ops::start_pack “start_pack()” routine.
@return The size of the data in a packed form.
pack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, dest: *mut c_void, max_length: size_t) -> size_t>@ingroup UCP_DATATYPE @brief Pack data.
The pointer refers to application defined pack routine.
@param [in] state State as returned by @ref ucp_generic_dt_ops::start_pack “start_pack()” routine. @param [in] offset Virtual offset in the output stream. @param [in] dest Destination buffer to pack the data. @param [in] max_length Maximum length to pack.
@return The size of the data that was written to the destination buffer. Must be less than or equal to @e max_length.
unpack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, src: *const c_void, length: size_t) -> ucs_status_t>@ingroup UCP_DATATYPE @brief Unpack data.
The pointer refers to application defined unpack routine.
@param [in] state State as returned by @ref ucp_generic_dt_ops::start_unpack “start_unpack()” routine. @param [in] offset Virtual offset in the input stream. @param [in] src Source to unpack the data from. @param [in] length Length to unpack.
@return UCS_OK or an error if unpacking failed.
finish: Option<unsafe extern "C" fn(state: *mut c_void)>@ingroup UCP_DATATYPE @brief Finish packing/unpacking.
The pointer refers to application defined finish routine.
@param [in] state State as returned by @ref ucp_generic_dt_ops::start_pack “start_pack()” and @ref ucp_generic_dt_ops::start_unpack “start_unpack()” routines.
Trait Implementations§
Source§impl Clone for ucp_generic_dt_ops
impl Clone for ucp_generic_dt_ops
Source§fn clone(&self) -> ucp_generic_dt_ops
fn clone(&self) -> ucp_generic_dt_ops
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more