meta_launch_nsc.sh 668 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash -ue
  2. #
  3. # K. Wyser, July 2016
  4. #
  5. while getopts C:R:i:e: option ; do
  6. case $option in
  7. C) conf=${OPTARG} ;;
  8. R) expname=${OPTARG} ;;
  9. i) y1=${OPTARG} ;;
  10. e) y2=${OPTARG} ;;
  11. esac
  12. done
  13. job_name=b-$expname
  14. launch_cmd='sbatch -A snic2014-10-1 --reservation=dcs -n 1 -t 4:0:0'
  15. ll=$( $launch_cmd -J $job_name-1 barakuda.sh -C $conf -R $expname )
  16. echo $ll
  17. job1_id=$(echo $ll | awk '{print $4}')
  18. ll=$( $launch_cmd -J $job_name-2 build_clim.sh -C $conf -R $expname -i $y1 -e $y2)
  19. echo $ll
  20. job2_id=$(echo $ll | awk '{print $4}')
  21. $launch_cmd -d afterok:$job1_id:$job2_id -J $job_name-3 barakuda.sh -C $conf -R $expname -E
  22. exit 0