#! /bin/sh # # Usage: # # # exit on error set -e # name of this job in messages: prog=`basename $0` # arguments: cmndline=`eval echo $1` # set display environment for CINECA/SP6: test -f "${HOME}/.display_vnc" && export DISPLAY=`${HOME}/.display_vnc` # testing ... module list ## unlimit stacksize: #ulimit -s unlimited # file that is written just before program stops, # indicating a normal end of the run: okfile='tm5.ok' /bin/rm -f ${okfile} echo "$prog - " echo "$prog - command line : ${cmndline}" echo "$prog - " echo "$prog - wall time before run : `/bin/date`" echo "" t1=$(date +%s) ${cmndline} t2=$(date +%s) set +e tr=$(date -d "0 -$t1 sec + $t2 sec" +%T) set -e echo " " echo "$prog - wall time after run : `/bin/date` after ${tr} (hh:mm:ss)" echo "$prog - " if [ ! -f ${okfile} ]; then echo "$prog - ok file '${okfile}' not found;" echo "$prog - no normal end of program " exit 1 fi