Skip to content
Snippets Groups Projects
Commit 30dc4656 authored by mattijs's avatar mattijs Committed by Mark OLESEN
Browse files

ENH: update timeActivatedFileUpdate with distributed fileHandler

parent 4984153d
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,14 @@ void Foam::functionObjects::timeActivatedFileUpdate::updateFile() ...@@ -75,7 +75,14 @@ void Foam::functionObjects::timeActivatedFileUpdate::updateFile()
<< "to : " << time_.relativePath(fileToUpdate_, true) << nl << "to : " << time_.relativePath(fileToUpdate_, true) << nl
<< endl; << endl;
if (Pstream::master() || time_.distributed()) if
(
UPstream::master()
|| (
fileHandler().distributed()
&& UPstream::master(fileHandler().comm())
)
)
{ {
// Copy on master only for non-distributed // Copy on master only for non-distributed
fileName tmpFile(fileToUpdate_ + Foam::name(pid())); fileName tmpFile(fileToUpdate_ + Foam::name(pid()));
...@@ -141,7 +148,9 @@ bool Foam::functionObjects::timeActivatedFileUpdate::read ...@@ -141,7 +148,9 @@ bool Foam::functionObjects::timeActivatedFileUpdate::read
Info<< " " << tuple.first() << tab Info<< " " << tuple.first() << tab
<< time_.relativePath(srcFile, true) << nl; << 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)) if (!Foam::isFile(srcFile))
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment