From 58e4cfbc8a4071be1c13a45f3bc57d4b20d356c5 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 16 Feb 2023 13:24:07 +0100 Subject: [PATCH] REGRESSION: PstreamBuffers gather was clearing 'send-to-self' on master --- .../db/IOstreams/Pstreams/PstreamBuffers.C | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C index b3286dac5f..90a17969a5 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C @@ -112,19 +112,11 @@ void Foam::PstreamBuffers::finalExchangeGatherScatter { // gather mode (all-to-one) - if (UPstream::master(comm_)) - { - // Master: has no sends - clearSends(); - } - else - { - // Non-master: only sends to master [0] + // Only send to master [0]. Master is also allowed to 'send' to itself - for (label proci=1; proci < sendBuffers_.size(); ++proci) - { - sendBuffers_[proci].clear(); - } + for (label proci=1; proci < sendBuffers_.size(); ++proci) + { + sendBuffers_[proci].clear(); } } else