Skip to content
Snippets Groups Projects
Commit b1eb3e87 authored by mattijs's avatar mattijs
Browse files

BUG: fileHandler: disable parallel side effects. Fixes #3105

parent bc03a538
No related branches found
No related tags found
1 merge request!695OpenFOAM v2406
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020-2023 OpenCFD Ltd. Copyright (C) 2020-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -716,6 +716,14 @@ bool Foam::fileOperations::uncollatedFileOperation::read ...@@ -716,6 +716,14 @@ bool Foam::fileOperations::uncollatedFileOperation::read
const bool oldMasterOnly = regIOobject::masterOnlyReading; const bool oldMasterOnly = regIOobject::masterOnlyReading;
regIOobject::masterOnlyReading = masterOnly; regIOobject::masterOnlyReading = masterOnly;
const bool oldParRun = UPstream::parRun();
if (masterOnly)
{
// Reading on master only.
// Avoid side effects from io.readStream below.
UPstream::parRun(false);
}
// Read file // Read file
ok = io.readData(io.readStream(typeName)); ok = io.readData(io.readStream(typeName));
io.close(); io.close();
...@@ -723,6 +731,7 @@ bool Foam::fileOperations::uncollatedFileOperation::read ...@@ -723,6 +731,7 @@ bool Foam::fileOperations::uncollatedFileOperation::read
// Restore flags // Restore flags
io.globalObject(oldGlobal); io.globalObject(oldGlobal);
regIOobject::masterOnlyReading = oldMasterOnly; regIOobject::masterOnlyReading = oldMasterOnly;
UPstream::parRun(oldParRun);
if (debug) if (debug)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment