Struct ucp_generic_dt_ops

struct ucp_generic_dt_ops

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.

Public Members

void *(*start_pack)(void *context, const void *buffer, size_t count)

Start a packing request.

The pointer refers to application defined start-to-pack routine. It will be called from the ucp_tag_send_nb routine.

Parameters
  • context[in] User-defined context.

  • buffer[in] Buffer to pack.

  • count[in] Number of elements to pack into the buffer.

Returns

A custom state that is passed to the following pack() routine.

void *(*start_unpack)(void *context, void *buffer, size_t count)

Start an unpacking request.

The pointer refers to application defined start-to-unpack routine. It will be called from the ucp_tag_recv_nb routine.

Parameters
  • context[in] User-defined context.

  • buffer[in] Buffer to unpack to.

  • count[in] Number of elements to unpack in the buffer.

Returns

A custom state that is passed later to the following unpack() routine.

size_t (*packed_size)(void *state)

Get the total size of packed data.

The pointer refers to user defined routine that returns the size of data in a packed format.

Parameters

state[in] State as returned by start_pack() routine.

Returns

The size of the data in a packed form.

size_t (*pack)(void *state, size_t offset, void *dest, size_t max_length)

Pack data.

The pointer refers to application defined pack routine.

Parameters
  • state[in] State as returned by start_pack() routine.

  • offset[in] Virtual offset in the output stream.

  • dest[in] Destination buffer to pack the data.

  • max_length[in] Maximum length to pack.

Returns

The size of the data that was written to the destination buffer. Must be less than or equal to max_length.

ucs_status_t (*unpack)(void *state, size_t offset, const void *src, size_t length)

Unpack data.

The pointer refers to application defined unpack routine.

Parameters
  • state[in] State as returned by start_unpack() routine.

  • offset[in] Virtual offset in the input stream.

  • src[in] Source to unpack the data from.

  • length[in] Length to unpack.

Returns

UCS_OK or an error if unpacking failed.

void (*finish)(void *state)

Finish packing/unpacking.

The pointer refers to application defined finish routine.

Parameters

state[in] State as returned by start_pack() and start_unpack() routines.