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
8596a86a
Commit
8596a86a
authored
May 27, 2011
by
mattijs
Browse files
ENH: bin/foamRunTutorials: run in parallel
parent
9b38b768
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/foamRunTutorials
View file @
8596a86a
...
...
@@ -3,7 +3,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
...
...
@@ -31,6 +31,39 @@
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Select the version of make to be used
#------------------------------------------------------------------------------
# normally use "make"
make
=
"make"
# set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set
if
[
-z
"
$WM_NCOMPPROCS
"
-a
-n
"
$WM_HOSTS
"
-a
-n
"
$WM_SCHEDULER
"
]
then
WM_NCOMPPROCS
=
$(
wmakeScheduler
-count
)
[
$?
-eq
0
]
||
unset
WM_NCOMPPROCS
fi
if
[
"
$WM_NCOMPPROCS
"
]
then
if
[
"
$WM_NCOMPPROCS
"
-gt
1
-a
!
"
$MAKEFLAGS
"
]
then
lockDir
=
$HOME
/.
$WM_PROJECT
/.wmake
if
[
-d
$lockDir
]
then
rm
-f
$lockDir
/
*
else
mkdir
-p
$lockDir
fi
make
=
"make --no-print-directory -j "
$WM_NCOMPPROCS
fi
fi
# Source tutorial functions
.
$WM_PROJECT_DIR
/bin/tools/RunFunctions
...
...
@@ -62,13 +95,15 @@ else
fi
done
# Recurse to subdirectories
for
caseName
in
*
do
if
[
-d
$caseName
]
then
(
cd
$caseName
&&
$thisScript
)
fi
done
#for caseName in *
#do
# if [ -d $caseName ]
# then
# ( cd $caseName && $thisScript )
# fi
#done
FOAM_TARGETS
=
$(
for
d
in
*
;
do
[
-d
"
$d
"
]
&&
echo
"
$d
"
;
done
| xargs
)
$make
-k
-f
$WM_PROJECT_DIR
/bin/tools/MakefileDirs
FOAM_TARGETS
=
"
$FOAM_TARGETS
"
FOAM_APP
=
$thisScript
fi
#------------------------------------------------------------------------------
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