bsub_py.sh 554 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash --login
#if [ -z "$1" ]; then
#  QUEUE=`pick_queue`
#else
#  QUEUE=$1
#fi
QUEUE=allnodes
echo $QUEUE

PY_SCRIPT=extract_interim
PY_DIR=`pwd`
LOG_DIR=$PY_DIR/log
mkdir -p $LOG_DIR

for YEAR in {1979..2018}; do
  JOB_NAME=$PY_SCRIPT"_"$YEAR
  echo $JOB_NAME `date`
  LOG_FILE=$LOG_DIR/$JOB_NAME.log
  ERR_FILE=$LOG_DIR/$JOB_NAME.err


  rm $LOG_FILE $ERR_FILE
  bsub \
    -J $JOB_NAME \
    -o $LOG_FILE \
    -e $ERR_FILE \
    -q $QUEUE \
    -n 1 -R "span[hosts=1]" -W 48:00 \
    -sp 75 \
    python -u $PY_DIR/$PY_SCRIPT.py $YEAR


done