submit_tm5_step_run 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #! /bin/sh
  2. #
  3. # Usage:
  4. # <thisscript> <cmndline>
  5. #
  6. # exit on error
  7. set -e
  8. # name of this job in messages:
  9. prog=`basename $0`
  10. # arguments:
  11. cmndline=`eval echo $1`
  12. # set display environment for CINECA/SP6:
  13. test -f "${HOME}/.display_vnc" && export DISPLAY=`${HOME}/.display_vnc`
  14. ## unlimit stacksize:
  15. #ulimit -s unlimited
  16. # file that is written just before program stops,
  17. # indicating a normal end of the run:
  18. okfile='tm5.ok'
  19. /bin/rm -f ${okfile}
  20. echo "$prog - "
  21. echo "$prog - command line : ${cmndline}"
  22. echo "$prog - "
  23. echo "$prog - wall time before run : `/bin/date`"
  24. echo ""
  25. t1=$(date +%s)
  26. ${cmndline}
  27. t2=$(date +%s)
  28. set +e
  29. tr=$(date -d "0 -$t1 sec + $t2 sec" +%T)
  30. set -e
  31. echo " "
  32. echo "$prog - wall time after run : `/bin/date` after ${tr} (hh:mm:ss)"
  33. echo "$prog - "
  34. if [ ! -f ${okfile} ]; then
  35. echo "$prog - ok file '${okfile}' not found;"
  36. echo "$prog - no normal end of program "
  37. exit 1
  38. fi