[ofiwg] fi_msg : Is it possible to receive partial data from the message?
Hefty, Sean
sean.hefty at intel.com
Thu Jan 21 10:34:53 PST 2016
> My next approach will be to ask the user to provide me with a
> 'maximum' size of the expected message, and allocate buffers of that
> size during the reception... indeed it doesn't sound the best, but I
> can avoid copying data around.
>
> If I understand correctly, in order to receive any kind of data data
> with libfabric I will need to:
>
> 1) Post the receive buffers (with fi_recv*)
> 2) Wait for a receive CQ event
Basically, this is correct for your situation.
> However I was wondering... is there any way to wait for a 'data
> pending' event, containing the size of them? Or perhaps another kind
> of channel through I can send some lightweight (64-bit long) messages?
You could implement a RTS-CTS protocol to do this. Have the sender post a ready to send message with the size. The receive would need to allocate the final destination buffer, then respond to the sender that it's clear to send. The sender could either send the rest of the data via a send or perform an RMA operation into the destination buffer.
This is what MPI does for larger messages. For smaller messages, you would likely want to just send the entire message up front, and use the size to determine which method to invoke at the receiving side.
Note that the tagged message operations enables (but does not require) the ability for providers to implement this functionality under the API, rather than over it. See FI_CLAIM.
More information about the ofiwg
mailing list