Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
15709858
Commit
15709858
authored
17 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
decomposePar gets -lazy option
parent
98e1cd02
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+51
-5
51 additions, 5 deletions
.../utilities/parallelProcessing/decomposePar/decomposePar.C
with
51 additions
and
5 deletions
applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+
51
−
5
View file @
15709858
...
@@ -48,7 +48,15 @@ Usage
...
@@ -48,7 +48,15 @@ Usage
@param -force \n
@param -force \n
Remove any existing @a processor subdirectories before decomposing the
Remove any existing @a processor subdirectories before decomposing the
geometry.
geometry. Has precedence over the @a -lazy option.
@param -lazy \n
Only decompose the geometry if the number of domains has changed
from a previous decomposition. Any existing @a processor subdirectories
are removed as necessary. This option can be used to avoid redundant
geometry decomposition (eg, in scripts), but should be used with caution
when the underlying (serial) geometry or the decomposition method etc
have been changed between decompositions.
\*---------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
...
@@ -80,6 +88,7 @@ int main(int argc, char *argv[])
...
@@ -80,6 +88,7 @@ int main(int argc, char *argv[])
argList
::
validOptions
.
insert
(
"fields"
,
""
);
argList
::
validOptions
.
insert
(
"fields"
,
""
);
argList
::
validOptions
.
insert
(
"filterPatches"
,
""
);
argList
::
validOptions
.
insert
(
"filterPatches"
,
""
);
argList
::
validOptions
.
insert
(
"force"
,
""
);
argList
::
validOptions
.
insert
(
"force"
,
""
);
argList
::
validOptions
.
insert
(
"lazy"
,
""
);
# include "setRootCase.H"
# include "setRootCase.H"
...
@@ -88,6 +97,7 @@ int main(int argc, char *argv[])
...
@@ -88,6 +97,7 @@ int main(int argc, char *argv[])
bool
decomposeFieldsOnly
(
args
.
options
().
found
(
"fields"
));
bool
decomposeFieldsOnly
(
args
.
options
().
found
(
"fields"
));
bool
filterPatches
(
args
.
options
().
found
(
"filterPatches"
));
bool
filterPatches
(
args
.
options
().
found
(
"filterPatches"
));
bool
forceOverwrite
(
args
.
options
().
found
(
"force"
));
bool
forceOverwrite
(
args
.
options
().
found
(
"force"
));
bool
lazyDecomposition
(
args
.
options
().
found
(
"lazy"
));
# include "createTime.H"
# include "createTime.H"
...
@@ -115,6 +125,8 @@ int main(int argc, char *argv[])
...
@@ -115,6 +125,8 @@ int main(int argc, char *argv[])
{
{
if
(
nProcs
)
if
(
nProcs
)
{
{
bool
hasProcDirs
=
true
;
if
(
forceOverwrite
)
if
(
forceOverwrite
)
{
{
Info
<<
"Removing "
<<
nProcs
Info
<<
"Removing "
<<
nProcs
...
@@ -130,13 +142,47 @@ int main(int argc, char *argv[])
...
@@ -130,13 +142,47 @@ int main(int argc, char *argv[])
rmDir
(
procDir
);
rmDir
(
procDir
);
}
}
hasProcDirs
=
false
;
}
}
else
else
if
(
lazyDecomposition
)
{
// lazy decomposition
IOdictionary
decompDict
(
IOobject
(
"decomposeParDict"
,
runTime
.
time
().
system
(),
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
,
false
)
);
label
nDomains
(
readInt
(
decompDict
.
lookup
(
"numberOfSubdomains"
))
);
// avoid repeated decomposition
if
(
nDomains
==
nProcs
)
{
decomposeFieldsOnly
=
true
;
hasProcDirs
=
false
;
Info
<<
"Using existing processor directories"
<<
nl
;
}
}
if
(
hasProcDirs
)
{
{
FatalErrorIn
(
args
.
executable
())
FatalErrorIn
(
args
.
executable
())
<<
"Case is already decomposed, "
<<
"Case is already decomposed with "
<<
nProcs
"use the -force option or manually remove"
<<
nl
<<
" domains, use the -force option or manually"
<<
nl
<<
"processor directories before decomposing. e.g.,"
<<
nl
<<
"remove processor directories before decomposing. e.g.,"
<<
nl
<<
" rm -rf "
<<
runTime
.
path
().
c_str
()
<<
"/processor*"
<<
" rm -rf "
<<
runTime
.
path
().
c_str
()
<<
"/processor*"
<<
nl
<<
nl
<<
exit
(
FatalError
);
<<
exit
(
FatalError
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment