Skip to content

Instantly share code, notes, and snippets.

@awhow
Created March 23, 2014 00:08
Show Gist options
  • Save awhow/9716363 to your computer and use it in GitHub Desktop.
Save awhow/9716363 to your computer and use it in GitHub Desktop.
Run file for Stampede
#!/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