Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
cb8bf9f7
Commit
cb8bf9f7
authored
Aug 09, 2011
by
mattijs
Browse files
ENH: codeStream: make it work with master-only reading (timeStampMaster)
parent
6d970f6c
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C
View file @
cb8bf9f7
...
...
@@ -39,9 +39,17 @@ void Foam::IOdictionary::readFile(const bool masterOnly)
Pout
<<
"IOdictionary : Reading "
<<
objectPath
()
<<
" from file "
<<
endl
;
}
// Set flag for e.g. codeStream
bool
oldFlag
=
regIOobject
::
masterOnlyReading
;
regIOobject
::
masterOnlyReading
=
masterOnly
;
// Read file
readStream
(
typeName
)
>>
*
this
;
close
();
regIOobject
::
masterOnlyReading
=
oldFlag
;
if
(
writeDictionaries
&&
Pstream
::
master
())
{
Sout
<<
nl
...
...
src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C
View file @
cb8bf9f7
...
...
@@ -197,25 +197,12 @@ Foam::functionEntries::codeStream::getFunction
}
}
//- We don't know whether this code was from IOdictionary
// (possibly read on master only) or from e.g. Field so cannot
// decide here.
//// all processes must wait for compile to finish - except if this
//// file is only read on the master
//bool masterOnly =
// (
// regIOobject::fileModificationChecking
// == regIOobject::timeStampMaster
// )
// || (
// regIOobject::fileModificationChecking
// == regIOobject::inotifyMaster
// );
//
//if (!masterOnly)
//{
//- Only block if we're not doing master-only reading. (flag set by
// regIOobject::read, IOdictionary constructor)
if
(
!
regIOobject
::
masterOnlyReading
)
{
reduce
(
create
,
orOp
<
bool
>
());
//
}
}
if
(
isA
<
IOdictionary
>
(
topDict
(
parentDict
)))
{
...
...
src/OpenFOAM/db/regIOobject/regIOobject.C
View file @
cb8bf9f7
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -69,6 +69,9 @@ Foam::regIOobject::fileCheckTypes Foam::regIOobject::fileModificationChecking
);
bool
Foam
::
regIOobject
::
masterOnlyReading
=
false
;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from IOobject
...
...
src/OpenFOAM/db/regIOobject/regIOobject.H
View file @
cb8bf9f7
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -49,6 +49,11 @@ SourceFiles
namespace
Foam
{
namespace
functionEntries
{
class
codeStream
;
}
/*---------------------------------------------------------------------------*\
Class regIOobject Declaration
\*---------------------------------------------------------------------------*/
...
...
@@ -72,6 +77,12 @@ public:
static
const
NamedEnum
<
fileCheckTypes
,
4
>
fileCheckTypesNames
;
protected:
//- To flag master-only reading of objects
static
bool
masterOnlyReading
;
private:
// Private data
...
...
@@ -103,6 +114,11 @@ private:
public:
//- Declare friendship with any classes that need access to
// masterOnlyReading
friend
class
functionEntries
::
codeStream
;
// Static data
//- Runtime type information
...
...
src/OpenFOAM/db/regIOobject/regIOobjectRead.C
View file @
cb8bf9f7
...
...
@@ -186,8 +186,16 @@ bool Foam::regIOobject::read()
<<
"reading object "
<<
name
()
<<
" from file "
<<
endl
;
}
// Set flag for e.g. codeStream
bool
oldFlag
=
regIOobject
::
masterOnlyReading
;
regIOobject
::
masterOnlyReading
=
masterOnly
;
// Read file
ok
=
readData
(
readStream
(
type
()));
close
();
regIOobject
::
masterOnlyReading
=
oldFlag
;
}
if
(
masterOnly
&&
Pstream
::
parRun
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment