process_main.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #$ -cwd
  2. #$ -A weizhe.li
  3. #$ -l h_rt=001:00:00
  4. #$ -S /bin/sh
  5. #$ -j y
  6. #$ -o sysout_main
  7. #$ -N process_main
  8. echo "Running job $JOB_ID on $HOSTNAME"
  9. QSUB=/opt/sge_root/bin/lx-amd64/qsub
  10. ARRAY_SCRIPT=process_array.sh
  11. # Get params
  12. # source ./config.txt
  13. CNFG_FILE=$1
  14. source $CNFG_FILE
  15. BASE_RUN=/scratch/mikem/UserSupport/weizhe.li/runs_process_cn_V2_"$COLOR_NORM"
  16. mkdir -p $BASE_RUN
  17. BASE_DIR=$BASE_RUN/"$TYPE"_wnorm_"$PATCH_SIZE"_"$SPLIT_SIZE"_"$JOB_ID"
  18. { read; # skip the first (title) line
  19. while read LINE; do
  20. echo "$LINE"
  21. ST=$(echo $LINE | awk -F' ' '{printf $1}' )
  22. EN=$(echo $LINE | awk -F' ' '{printf $2}' )
  23. SUBDIR=$(echo $LINE | awk -F' ' '{printf $3}' )
  24. HDF5_FILE="$SUBDIR"".h5"
  25. IMG_DIR="$BASE_DIR"/"$SUBDIR"
  26. SYSOUT_DIR="$IMG_DIR"/sysout
  27. mkdir -p $SYSOUT_DIR
  28. HEATMAP_DIR="$IMG_DIR"/preds
  29. mkdir -p $HEATMAP_DIR
  30. # LOG_DIR=/home/weizhe.li/log_files
  31. LOG_DIR="$IMG_DIR"/log_files
  32. mkdir -p $LOG_DIR
  33. echo "$QSUB -pe thread -t "$ST"-"$EN" -o $SYSOUT_DIR $ARRAY_SCRIPT $SPLIT_BASE_DIR $HDF5_FILE"
  34. $QSUB -t "$ST"-"$EN" -o $SYSOUT_DIR -N "$SUBDIR"_"$TYPE" $ARRAY_SCRIPT $SPLIT_BASE_DIR $HDF5_FILE $HEATMAP_DIR $LOG_DIR $CNFG_FILE
  35. done
  36. } < $LOOKUP_FILE