From ce995d849fea0ad115a787fb6598a0de70c06187 Mon Sep 17 00:00:00 2001 From: Andrea Valassi Date: Tue, 13 Jun 2023 18:48:04 +0200 Subject: [PATCH] [nobm] improve lauX.sh script, add support for a generic process #683 --- epochX/cudacpp/tlau/lauX.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/epochX/cudacpp/tlau/lauX.sh b/epochX/cudacpp/tlau/lauX.sh index 15e9d209e5..8e0f5728c0 100755 --- a/epochX/cudacpp/tlau/lauX.sh +++ b/epochX/cudacpp/tlau/lauX.sh @@ -7,23 +7,27 @@ set -e # fail on error function usage() { - echo "Usage: $0 <-FORTRAN|-CUDA|-CPP>" + echo "Usage: $0 <-FORTRAN|-CUDA|-CPP> " + echo "Example: $0 -CPP gg_tt.mad" exit 1 } bckend= +proc= while [ "$1" != "" ]; do if [ "$1" == "-FORTRAN" ] || [ "$1" == "-CUDA" ] || [ "$1" == "-CPP" ]; then if [ "$bckend" == "" ]; then bckend=${1/-/}; else echo "ERROR! Backend already set"; usage; fi - shift + elif [ "$proc" == "" ]; then + proc=$1 else - echo "ERROR! Invalid option '$1'" + echo "ERROR! Invalid option '$1': process directory already set to '${proc}'" usage fi + shift done if [ "$bckend" == "" ]; then echo "ERROR! No backend was specified"; usage; fi - -proc=gg_tt.mad +if [ "$proc" == "" ]; then echo "ERROR! No process directory was specified"; usage; fi +if [ ! -d $proc ]; then echo "ERROR! Process directory '${proc}' does not exist"; usage; fi cd $(dirname $0)/.. echo "Execute $(basename $0) for process ${proc} in directory $(pwd)"