mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: bin/foamRunTutorials: run in parallel
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# 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
|
# Source tutorial functions
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
@ -62,13 +95,15 @@ else
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# Recurse to subdirectories
|
# Recurse to subdirectories
|
||||||
for caseName in *
|
#for caseName in *
|
||||||
do
|
#do
|
||||||
if [ -d $caseName ]
|
# if [ -d $caseName ]
|
||||||
then
|
# then
|
||||||
( cd $caseName && $thisScript )
|
# ( cd $caseName && $thisScript )
|
||||||
fi
|
# fi
|
||||||
done
|
#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
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user