Memory Allocation of Channel Buffers of type Array

I have distributed workers wishing to perform an in-place distributed transpose. In this particular example, each worker has access to a ‘column block’ of a dense matrix, and workers must send off-diagonal sections of the matrix to other workers.

So far this is implemented by means of (buffer size one) RemoteChannels, generated like so:


If a worker, ‘n’ needs to communicate with another ‘m’, then ‘n’ will retrieve a copy of the RemoteChannel object from ‘m’ via serialisation.

The blocks of the matrix that must be sent in this way can be of variable size, but the maximum size required can be specified by the program.

My question is - does there exist a way of specifying on creation of a Channel of Bit-type matrices what the maximum size of the matrix and avoiding reallocation of the Channel buffer on repeated usage?

I want to ensure that every invocation of take! from the Channel owner will return a reference to exactly one memory region.


1 Like