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
d703f09d
Commit
d703f09d
authored
May 29, 2018
by
mattijs
Browse files
BUG: fileOperation: avoid par syn in uncollated. Fixes
#846
.
parent
9d5cb575
Changes
5
Hide whitespace changes
Inline
Side-by-side
applications/utilities/parallelProcessing/redistributePar/redistributePar.C
View file @
d703f09d
...
...
@@ -2396,7 +2396,10 @@ int main(int argc, char *argv[])
instantList
timeDirs
;
if
(
Pstream
::
master
())
{
const
bool
oldParRun
=
Pstream
::
parRun
();
Pstream
::
parRun
()
=
false
;
timeDirs
=
Time
::
findTimes
(
args
.
path
(),
"constant"
);
Pstream
::
parRun
()
=
oldParRun
;
}
Pstream
::
scatter
(
timeDirs
);
for
(
const
instant
&
t
:
timeDirs
)
...
...
@@ -2432,7 +2435,10 @@ int main(int argc, char *argv[])
if
(
Pstream
::
master
())
{
const
bool
oldParRun
=
Pstream
::
parRun
();
Pstream
::
parRun
()
=
false
;
timeDirs
=
Time
::
findTimes
(
basePath
,
"constant"
);
Pstream
::
parRun
()
=
oldParRun
;
}
Pstream
::
scatter
(
timeDirs
);
for
(
const
instant
&
t
:
timeDirs
)
...
...
src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C
View file @
d703f09d
...
...
@@ -238,7 +238,11 @@ bool Foam::fileOperation::isFileOrDir(const bool isFile, const fileName& f)
Foam
::
tmpNrc
<
Foam
::
fileOperation
::
dirIndexList
>
Foam
::
fileOperation
::
lookupProcessorsPath
(
const
fileName
&
fName
)
const
Foam
::
fileOperation
::
lookupAndCacheProcessorsPath
(
const
fileName
&
fName
,
const
bool
syncPar
)
const
{
// If path is local to a processor (e.g. contains 'processor2')
// find the corresponding actual processor directory (e.g. 'processors4')
...
...
@@ -344,7 +348,11 @@ Foam::fileOperation::lookupProcessorsPath(const fileName& fName) const
}
}
if
(
returnReduce
(
procDirs
.
size
(),
sumOp
<
label
>
()))
if
(
(
syncPar
&&
returnReduce
(
procDirs
.
size
(),
sumOp
<
label
>
()))
||
(
!
syncPar
&&
procDirs
.
size
())
)
{
procsDirs_
.
insert
(
procPath
,
procDirs
);
...
...
@@ -362,6 +370,14 @@ Foam::fileOperation::lookupProcessorsPath(const fileName& fName) const
}
Foam
::
tmpNrc
<
Foam
::
fileOperation
::
dirIndexList
>
Foam
::
fileOperation
::
lookupProcessorsPath
(
const
fileName
&
fName
)
const
{
// Use parallel synchronisation
return
lookupAndCacheProcessorsPath
(
fName
,
true
);
}
bool
Foam
::
fileOperation
::
exists
(
IOobject
&
io
)
const
{
// Generate output filename for object
...
...
src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.H
View file @
d703f09d
...
...
@@ -131,12 +131,20 @@ protected:
//- Helper: check for file (isFile) or directory (!isFile)
static
bool
isFileOrDir
(
const
bool
isFile
,
const
fileName
&
);
//- Detect presence of processorsDDD
void
cacheProcessorsPath
(
const
fileName
&
fName
)
const
;
//- Lookup name of processorsDDD using cache. Return empty fileName
// if not found.
tmpNrc
<
dirIndexList
>
lookupAndCacheProcessorsPath
(
const
fileName
&
,
const
bool
syncPar
)
const
;
//- Lookup name of processorsDDD using cache. Return empty fileName
// if not found
tmpNrc
<
dirIndexList
>
lookupProcessorsPath
(
const
fileName
&
)
const
;
// if not found. To be called on all processors
virtual
tmpNrc
<
dirIndexList
>
lookupProcessorsPath
(
const
fileName
&
)
const
;
//- Does ioobject exist. Is either a directory (empty name()) or
// a file
...
...
src/OpenFOAM/global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C
View file @
d703f09d
...
...
@@ -113,7 +113,11 @@ Foam::fileName Foam::fileOperations::uncollatedFileOperation::filePathInfo
{
tmpNrc
<
dirIndexList
>
pDirs
(
lookupProcessorsPath
(
io
.
objectPath
())
fileOperation
::
lookupAndCacheProcessorsPath
(
io
.
objectPath
(),
false
)
);
forAll
(
pDirs
(),
i
)
{
...
...
@@ -159,6 +163,17 @@ Foam::fileName Foam::fileOperations::uncollatedFileOperation::filePathInfo
}
Foam
::
tmpNrc
<
Foam
::
fileOperation
::
dirIndexList
>
Foam
::
fileOperations
::
uncollatedFileOperation
::
lookupProcessorsPath
(
const
fileName
&
fName
)
const
{
// Do not use parallel synchronisation
return
lookupAndCacheProcessorsPath
(
fName
,
false
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
fileOperations
::
uncollatedFileOperation
::
uncollatedFileOperation
...
...
src/OpenFOAM/global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.H
View file @
d703f09d
...
...
@@ -50,7 +50,9 @@ class uncollatedFileOperation
:
public
fileOperation
{
// Private Member Functions
protected:
// Protected Member Functions
//- Search for an object.
// checkGlobal : also check undecomposed case
...
...
@@ -63,6 +65,13 @@ class uncollatedFileOperation
const
bool
search
)
const
;
//- Lookup name of processorsDDD using cache. Return empty fileName
// if not found. Do not use any parallel synchronisation
virtual
tmpNrc
<
dirIndexList
>
lookupProcessorsPath
(
const
fileName
&
)
const
;
public:
...
...
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