Skip to content

Commit

Permalink
[nobm] improve lauX.sh script, add support for a generic process #683
Browse files Browse the repository at this point in the history
  • Loading branch information
valassi committed Jun 14, 2023
1 parent 2132516 commit ce995d8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions epochX/cudacpp/tlau/lauX.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,27 @@ set -e # fail on error

function usage()
{
echo "Usage: $0 <-FORTRAN|-CUDA|-CPP>"
echo "Usage: $0 <-FORTRAN|-CUDA|-CPP> <procdir>"
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)"
Expand Down

0 comments on commit ce995d8

Please sign in to comment.