inconsistency in documentation or implementation using Pstream::maxCommsSize
by inspection in Pstreams/exchange.C
The number of exchange iterations is calculated with the byte count:
nIter = (maxNBytes-1)/Pstream::maxCommsSize+1;
but later on in the loop the send sizes per iteration are calculated in the element count, not the byte count:
nSend[proci] = min
(
Pstream::maxCommsSize,
sendBufs[proci].size()-startSend[proci]
);
// and
charSendBufs[proci] = reinterpret_cast<const char*>
(
&(sendBufs[proci][startSend[proci]])
);
I think that requested Pstream::maxCommsSize
needs to be translated into a maxNumElems, with the appropriate sizeof(T) granularity and that is what should be used.
@Mattijs for comments?