FairMQ icon indicating copy to clipboard operation
FairMQ copied to clipboard

Add support for custom alignment

Open rbx opened this issue 5 years ago • 0 comments

The message creation interface should accept an alignment parameter that will return the buffer with the requested alignment.

Several scenarios need to be implemented in the transports:

  • [x] Shmem Sending - allocate the buffer with the requested alignment, receiver should see the same alignment. #264 adds this part.
  • [ ] Shmem receiver - Specific alignment can be requested prior to receiving. Transport should check if the incoming data has the requested alignment, reallocate if it doesn't. Ideally and usually sender/receiver would be synchronized in this regard, so no reallocations are necessary.
  • [x] ZeroMQ Sending. ZeroMQ gives no alignment guarantees with the buffer allocated by them. What we can do is allocate our own (aligned) buffer and give it to ZMQ to transfer. This should have no performance penalty.
  • [x] ZeroMQ Receiving. If a specific alignment is requested for incoming data, we can check it and reallocate if it doesn't match.
  • [ ] Ofi Sending.
  • [ ] Ofi Receiving.

If reallocations do happen, they should be added to socket metrics, as reallocated bytes/reallocated msgs.

rbx avatar May 19 '20 19:05 rbx