submit_tm5_step_run 948 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # testing ...
  15. module list
  16. ## unlimit stacksize:
  17. #ulimit -s unlimited
  18. # file that is written just before program stops,
  19. # indicating a normal end of the run:
  20. okfile='tm5.ok'
  21. /bin/rm -f ${okfile}
  22. echo "$prog - "
  23. echo "$prog - command line : ${cmndline}"
  24. echo "$prog - "
  25. echo "$prog - wall time before run : `/bin/date`"
  26. echo ""
  27. t1=$(date +%s)
  28. ${cmndline}
  29. t2=$(date +%s)
  30. set +e
  31. tr=$(date -d "0 -$t1 sec + $t2 sec" +%T)
  32. set -e
  33. echo " "
  34. echo "$prog - wall time after run : `/bin/date` after ${tr} (hh:mm:ss)"
  35. echo "$prog - "
  36. if [ ! -f ${okfile} ]; then
  37. echo "$prog - ok file '${okfile}' not found;"
  38. echo "$prog - no normal end of program "
  39. exit 1
  40. fi