Created
March 23, 2014 00:08
-
-
Save awhow/9716363 to your computer and use it in GitHub Desktop.
Run file for Stampede
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ${0%/*} || exit 1 # run from this directory | |
# Source tutorial run functions | |
. $WM_PROJECT_DIR/bin/tools/RunFunctions | |
runParallelStampede () | |
{ | |
APP_RUN=$1; shift | |
if [ -f $log.$APP_RUN ] ; then | |
echo "$APP_RUN already run on $PWD: remove log file to run" | |
else | |
echo "Running $APP_RUN in parallel on $PWD using $1 processes" | |
( ibrun $APP_RUN -parallel < /dev/null > log.$APP_RUN 2>&1 ) | |
fi | |
} | |
# Set variables name | |
caseDir=${PWD##*/} | |
solver=`getApplication` | |
statTime=`awk '$1 ~ /startTime/ { print $2 }' system/controlDict | sed 's/\([0-9]*\);/\1/'` | |
outFile="log.case" | |
#nproc=`grep "numberOfSubdomains" system/decomposeParDict | awk '{ print $2 }' | sed 's/\([0-9]*\);/\1/'` | |
cp -rf initial 0.0 | |
runApplication blockMesh | |
runApplication setFields | |
#runApplication funkySetFields -time 0 | |
runApplication decomposePar | |
runParallelStampede $solver | |
runApplication reconstructPar | |
endTime=`date +%s` | |
echo "End time = $endTime" >> $outFile | |
runTime=$(( ($endTime - $startTime)/60 )) | |
echo "Runtime = $runTime mins" >> $outFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment