Files
Estia-MCNP/csubmit

20 lines
652 B
Bash
Executable File

#!/bin/bash
CURRENT_VERSION=`git describe --tags --long`
CONTINUE_VERSION=${1:-$CURRENT_VERSION}
if [ ! -f "runs/e2-estia_$CONTINUE_VERSION.run" ]; then
# get describe from previous version
echo "No run for revision $CONTINUE_VERSION, try to use previous version"
PREV_ID=`git log -n 2 --oneline --pretty=format:"%h" | tail -1`
CONTINUE_VERSION=`git describe --tags --long $PREV_ID`
fi
if [ ! -f "runs/e2-estia_$CONTINUE_VERSION.run" ]; then
exit 1
fi
sbatch cbatch.tsh $CONTINUE_VERSION-c $CONTINUE_VERSION
# waiting for batch job to start and send all output directly to terminal
sleep 2
tail -qf tmp/stdout.log tmp/stderr.log