From 1dafe5d39384a22c89aafbb50a5c3cca4543a455 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 17 Nov 2022 09:27:07 +0100 Subject: [PATCH] ENH: use full scratch buffer capacity for ensight output - improves overall buffering ability across parts --- .../ensight/output/ensightOutputTemplates.C | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) 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