Skip to content

Should messages smaller than receive buffer be considered truncated? #104

Open
@pentschev

Description

@pentschev

We were until now considering TAG messages received that are smaller than the destination buffer to be truncated, which is how UCX-Py dealt with it. This behavior has been reverted in #105 until we decide on the proper behavior.

However, there are legitimate use case where the destination buffer may be smaller from the user's perspective, for example (but not limited to) when the user wants to receive a message that it is known to be the size of or smaller than the destination buffer.

Python users tend to use more high-level objects, in which cases knowing that a mismatch in size might be due to a potential user error, for example by mixing dtypes in NumPy the following is valid if we don't explicitly truncate, even if not intended by the user:

a = np.zeros(10, dtype=np.uint8)
server_ep.send(a)

b = np.zeros(10, dtype=np.unit64)
client_ep.recv(b)

Should any messages received on both C++ and Python UCXX APIs that are different than the buffer size provided by the user be considered truncated? Should we consider different behavior for C++ and Python?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions