Guest User

Untitled

a guest
Dec 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # Submit a single test on LSF
  4. # Wrapper around bsub command, then process log result.
  5. #
  6. # This script is used by run-tests-async.sh
  7. #
  8. # Usage:
  9. #
  10. # ./bsub.sh $command
  11.  
  12. index=$1
  13. cmd=$2
  14.  
  15. # Set project code
  16. PROJECT_CODE=TRAIN
  17.  
  18. # Set standard output log and error log
  19. log_dir=$(pwd)/logs
  20. log=$log_dir/bsub_${index}.log
  21. err=$log_dir/bsub_${index}.err
  22.  
  23. # Capture job summary
  24. run_log=$log_dir/summary.log
  25.  
  26. # Clear log
  27. echo " " > ${log}
  28. echo " " > ${err}
  29.  
  30. # Job requierement
  31. rselect="select[rhe6 && os64 && linux && mem > 2048 && swp > 10240]"
  32.  
  33. # BSUB command (blocking mode: -K)
  34. bsub -P $PROJECT_CODE -W 720 -R "${rselect}" -J bsub_${index} -q low -K -o ${log} -e ${err} ${cmd} > ${log}_bsub 2>&1
  35.  
  36. # Post processing
  37. #
  38. # Check if log file is present
  39. if [ ! -f ${log} ]; then
  40. echo "ERROR: ${log} log does not exist !" | tee -a $run_log
  41. exit 2
  42. fi
  43.  
  44. # Check content
  45. if grep 'OK' ${log} > /dev/null 2>&1;
  46. then
  47. echo "OK: ${log} : (${index})" | tee -a $run_log
  48. exit 0
  49. else
  50. echo "FAIL: ${log} (${index})" | tee -a $run_log
  51. exit 1
  52. fi
  53. fi
Add Comment
Please, Sign In to add comment