diff --git a/src/fileFormats/ensight/output/ensightOutputTemplates.C b/src/fileFormats/ensight/output/ensightOutputTemplates.C index b6470dd9b5..0c31833954 100644 --- a/src/fileFormats/ensight/output/ensightOutputTemplates.C +++ b/src/fileFormats/ensight/output/ensightOutputTemplates.C @@ -120,24 +120,30 @@ void Foam::ensightOutput::Detail::writeFieldComponents if (Pstream::master()) { + // Scratch buffer: + // - allocate enough space to process an individual rank + // - potentially enough to process multiple ranks before writing + // - permit use of the full buffer capacity + // Buffer size needed for an individual rank const label minSize(max(localSize, procAddr.maxSize())); - // Buffer size needed for all nonLocal ranks - const label nonLocalSize(procAddr.totalSize() - localSize); - // Maximum off-processor transfer size - const label maxTransfer = + const label maxSize = ( (ensightOutput::maxChunk_ > 0) - ? min(static_cast