BUG: decomposeParDict: operate with masterUncollated. Fixes #2368.

This commit is contained in:
mattijs
2022-02-16 09:59:03 +00:00
committed by Mark Olesen
parent 34a3e0abe3
commit 3d842aac93

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2021 OpenCFD Ltd.
Copyright (C) 2015-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -1355,7 +1355,9 @@ void Foam::argList::parse
// Disable any parallel comms happening inside the fileHandler
// since we are on master. This can happen e.g. inside
// the masterUncollated/collated handler.
// the masterUncollated/collated handler. Note that we
// also have to protect the actual dictionary parsing since
// it might trigger file access (e.g. #include, #codeStream)
const bool oldParRun = Pstream::parRun(false);
autoPtr<ISstream> dictStream
@ -1363,8 +1365,6 @@ void Foam::argList::parse
fileHandler().NewIFstream(source)
);
Pstream::parRun(oldParRun); // Restore parallel state
if (dictStream && dictStream->good())
{
dictionary decompDict(*dictStream);
@ -1413,6 +1413,8 @@ void Foam::argList::parse
}
}
Pstream::parRun(oldParRun); // Restore parallel state
if (Pstream::nProcs() == 1)
{
Warning