BUG: RunFunctions: missing fi. Renamed variable. Updated Allrun scripts

This commit is contained in:
mattijs
2015-12-08 14:35:02 +00:00
parent acecae7e44
commit 2e7d7d1609
4 changed files with 26 additions and 37 deletions

View File

@ -40,7 +40,7 @@ getApplication()
runApplication() runApplication()
{ {
APP_LOGFILE= LOG_NAME=
APP_RUN= APP_RUN=
LOG_IGNORE=false LOG_IGNORE=false
LOG_APPEND=false LOG_APPEND=false
@ -57,7 +57,7 @@ runApplication()
LOG_IGNORE=true LOG_IGNORE=true
;; ;;
-log) -log)
APP_LOGFILE=$1 LOG_NAME=$2
shift shift
;; ;;
*) *)
@ -68,24 +68,24 @@ runApplication()
shift shift
done done
APP_LOGFILE=${APP_LOGFILE:="log.$APP_NAME"} LOG_NAME=${LOG_NAME:="log.$APP_NAME"}
if [ -f $APP_LOGFILE ] && [ "$LOG_IGNORE" = "false" ] if [ -f $LOG_NAME ] && [ "$LOG_IGNORE" = "false" ]
then then
echo "$APP_NAME already run on $PWD: remove log file $APP_LOGFILE to re-run" echo "$APP_NAME already run on $PWD: remove log file $LOG_NAME to re-run"
else else
echo "Running $APP_RUN on $PWD" echo "Running $APP_RUN on $PWD"
$APP_RUN "$@" > $APP_LOGFILE 2>&1
if [ "$LOG_APPEND" = "true" ]; then if [ "$LOG_APPEND" = "true" ]; then
$APP_RUN "$@" >> $APP_LOGFILE 2>&1 $APP_RUN "$@" >> $LOG_NAME 2>&1
else else
$APP_RUN "$@" > $APP_LOGFILE 2>&1 $APP_RUN "$@" > $LOG_NAME 2>&1
fi fi
fi
} }
runParallel() runParallel()
{ {
APP_LOGFILE= LOG_NAME=
APP_RUN= APP_RUN=
LOG_IGNORE=false LOG_IGNORE=false
LOG_APPEND=false LOG_APPEND=false
@ -102,7 +102,7 @@ runParallel()
LOG_IGNORE=true LOG_IGNORE=true
;; ;;
-log) -log)
APP_LOGFILE=$1 LOG_NAME=$2
shift shift
;; ;;
*) *)
@ -116,28 +116,17 @@ runParallel()
shift shift
done done
APP_LOGFILE=${APP_LOGFILE:="log.$APP_NAME"} LOG_NAME=${LOG_NAME:="log.$APP_NAME"}
if [ -f $APP_LOGFILE ] && [ "$LOG_IGNORE" = "false" ] if [ -f $LOG_NAME ] && [ "$LOG_IGNORE" = "false" ]
then then
echo "$APP_NAME already run on $PWD: remove log file $APP_LOGFILE to re-run" echo "$APP_NAME already run on $PWD: remove log file $LOG_NAME to re-run"
else else
nProcs=$1
shift
echo "Running $APP_RUN in parallel on $PWD using $nProcs processes" echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"
#if [ "$WM_SCHEDULER" ]
#then
# echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2
# $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > $APP_LOGFILE 2>&1 )"
#else
( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > $APP_LOGFILE 2>&1 )
#fi
if [ "$LOG_APPEND" = "true" ]; then if [ "$LOG_APPEND" = "true" ]; then
( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null >> $APP_LOGFILE 2>&1 ) ( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null >> $LOG_NAME 2>&1 )
else else
( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > $APP_LOGFILE 2>&1 ) ( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > $LOG_NAME 2>&1 )
fi fi
fi fi
} }

View File

@ -8,14 +8,14 @@ rm -f log.* constant/polyMesh/*Level
runApplication blockMesh runApplication blockMesh
runApplication -l log.createPatch.cyclic \ runApplication -log log.createPatch.cyclic \
createPatch -dict system/createPatchDict.cyclic -overwrite createPatch -dict system/createPatchDict.cyclic -overwrite
runApplication snappyHexMesh -overwrite runApplication snappyHexMesh -overwrite
rm -rf 0 rm -rf 0
runApplication -l log.createPatch.ami \ runApplication -log log.createPatch.ami \
createPatch -dict system/createPatchDict.ami -overwrite createPatch -dict system/createPatchDict.ami -overwrite
runApplication transformPoints -scale '(0.01 0.01 0.01)' runApplication transformPoints -scale '(0.01 0.01 0.01)'

View File

@ -13,23 +13,23 @@ runApplication blockMesh
runParallel redistributePar 2 -decompose runParallel redistributePar 2 -decompose
#- bit of renumbering and running #- bit of renumbering and running
runParallel -l log.renumberMesh-CuthillMcKee renumberMesh 2 -overwrite runParallel -log log.renumberMesh-CuthillMcKee renumberMesh 2 -overwrite
runParallel -l log.icoFoam-CuthillMcKee icoFoam 2 runParallel -log log.icoFoam-CuthillMcKee icoFoam 2
#- bit of bad renumbering and running #- bit of bad renumbering and running
runParallel -l log.renumberMesh-parallel renumberMesh 2 -overwrite -dict system/renumberMeshDict-random runParallel -log log.renumberMesh-parallel renumberMesh 2 -overwrite -dict system/renumberMeshDict-random
runParallel -l log.icoFoam-random icoFoam 2 runParallel -log log.icoFoam-random icoFoam 2
#- pick up last result #- pick up last result
cp system/controlDict-latestTime system/controlDict cp system/controlDict-latestTime system/controlDict
#- redistribute to 5 processors #- redistribute to 5 processors
runParallel -l log.redistributePar-5 redistributePar 5 -decomposeParDict system/decomposeParDict-5 -cellDist runParallel -log log.redistributePar-5 redistributePar 5 -decomposeParDict system/decomposeParDict-5 -cellDist
#- run a bit more #- run a bit more
runParallel -l log.icoFoam-5 icoFoam 5 -decomposeParDict system/decomposeParDict-5 runParallel -log log.icoFoam-5 icoFoam 5 -decomposeParDict system/decomposeParDict-5
#- reconstruct mesh and results #- reconstruct mesh and results
runParallel -l log.redistributePar-1 redistributePar 5 -reconstruct -decomposeParDict system/decomposeParDict runParallel -log log.redistributePar-1 redistributePar 5 -reconstruct -decomposeParDict system/decomposeParDict
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -24,10 +24,10 @@ runApplication $application
runParallel redistributePar 3 -decompose -cellDist runParallel redistributePar 3 -decompose -cellDist
#- Continue running for a bit more #- Continue running for a bit more
runParallel -l log.reactingParcelFoam-par $application 3 runParallel -log log.reactingParcelFoam-par $application 3
#- Reconstruct all times #- Reconstruct all times
runParallel -l log.redistributePar-1 redistributePar 3 -reconstruct runParallel -log log.redistributePar-1 redistributePar 3 -reconstruct
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file