Commit 6091cdb0 authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: incorrect log-check in runParallel (RunFunctions)

STYLE: minor rewording, drop grep/sed in favour of sed only
parent 185d4175
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -25,23 +25,23 @@
# RunFunctions
#
# Description
#
# Miscellaneous functions for running tutorial cases
#------------------------------------------------------------------------------
getApplication()
{
grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/"
sed -ne 's/^ *application *\([a-zA-Z]*\) *;.*$/\1/p' system/controlDict
}
runApplication()
{
APP_RUN=$1
APP_NAME=${1##*/}
shift
APP_NAME=${APP_RUN##*/}
if [ -f log.$APP_NAME ]
then
echo "$APP_NAME already run on $PWD: remove log file to run"
echo "$APP_NAME already run on $PWD: remove log file to re-run"
else
echo "Running $APP_RUN on $PWD"
$APP_RUN $* > log.$APP_NAME 2>&1
......@@ -51,14 +51,15 @@ runApplication()
runParallel()
{
APP_RUN=$1
APP_NAME=${1##*/}
shift
if [ -f $log.$APP_RUN ]
if [ -f log.$APP_NAME ]
then
echo "$APP_RUN already run on $PWD: remove log file to run"
echo "$APP_NAME already run on $PWD: remove log file to re-run"
else
echo "Running $APP_RUN in parallel on $PWD using $1 processes"
( mpirun -np $1 $APP_RUN -parallel < /dev/null > log.$APP_RUN 2>&1 )
( mpirun -np $1 $APP_RUN -parallel < /dev/null > log.$APP_NAME 2>&1 )
fi
}
......
......@@ -11,7 +11,7 @@ runAnsysToFoam()
{
if [ -f log.ansysToFoam ]
then
echo "ansysToFoam already run on $PWD: remove log file to run"
echo "ansysToFoam already run on $PWD: remove log file to re-run"
else
echo "ansysToFoam: converting mesh $1"
ansysToFoam $1 -scale $2 > log.ansysToFoam 2>&1
......
......@@ -11,7 +11,7 @@ runKivaToFoam()
{
if [ -f log.kivaToFoam ]
then
echo "kivaToFoam already run: remove log file to run"
echo "kivaToFoam already run: remove log file to re-run"
else
echo "kivaToFoam: converting kiva file"
kivaToFoam -file $1 > log.kivaToFoam 2>&1
......@@ -23,7 +23,7 @@ restartApplication()
{
if [ -f log-2.$1 ]
then
echo "$1 already run: remove log file to run"
echo "$1 already run: remove log file to re-run"
else
echo "Running $1"
$1 > log-2.$1 2>&1
......
......@@ -11,7 +11,7 @@ runStarToFoam()
{
if [ -f log.star3ToFoam -o -f log.starToFoam ]
then
echo "star3ToFoam already run on $PWD: remove log file to run"
echo "star3ToFoam already run on $PWD: remove log file to re-run"
else
echo "star3ToFoam: converting mesh $1"
star3ToFoam $1 > log.star3ToFoam 2>&1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment