From 30dc4656150b407eed167f5900780913c29bca70 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 24 Nov 2022 09:00:00 +0000 Subject: [PATCH] ENH: update timeActivatedFileUpdate with distributed fileHandler --- .../timeActivatedFileUpdate.C | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C b/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C index 2067c283d6..f512435430 100644 --- a/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C +++ b/src/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C @@ -75,7 +75,14 @@ void Foam::functionObjects::timeActivatedFileUpdate::updateFile() << "to : " << time_.relativePath(fileToUpdate_, true) << nl << endl; - if (Pstream::master() || time_.distributed()) + if + ( + UPstream::master() + || ( + fileHandler().distributed() + && UPstream::master(fileHandler().comm()) + ) + ) { // Copy on master only for non-distributed fileName tmpFile(fileToUpdate_ + Foam::name(pid())); @@ -141,7 +148,9 @@ bool Foam::functionObjects::timeActivatedFileUpdate::read Info<< " " << tuple.first() << tab << time_.relativePath(srcFile, true) << nl; - if (Pstream::master() || time_.distributed()) + // No need for distributed test since dictionaries are read on the + // master only or otherwise they need to be copied everywhere + if (UPstream::master()) // || time_.distributed()) { if (!Foam::isFile(srcFile)) {