enqueue_pipeline.sh 1.25 KB
Newer Older
Chris Jewell's avatar
Chris Jewell committed
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

#####################################################
# Name: enqueue_pipeline.sh			    #
# Author: Chris Jewell <c.jewell@lancaster.ac.uk>   #
# Created: 2021-02-07				    #
# License: MIT					    #
# Copyright: Chris Jewell 2021			    #
# Purpose: Launch a COVID pipeline on a SGE cluster #
# Usage: enqueue_pipeline.sh <ISO8601 date>	    #
#####################################################

Chris Jewell's avatar
Chris Jewell committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39


while getopts 'c:d:s:r:' OPTION; do
    case "$OPTION" in
	c)
	    arg_config=${OPTARG}
	    ;;
	d)
	    arg_date=${OPTARG}
	    ;;
	s)
	    arg_staging_dir=${OPTARG}
	    ;;
	r)
	    arg_results_dir=${OPTARG}
	    ;;
	:)
	    exit 1
	    ;;
	*)
	    echo "usage: enqueue_pipeline.sh -c <config file> -d <ISO6801 date> -s <staging dir> -r <results_dir>"
	    exit 1
	    ;;
    esac
done


Chris Jewell's avatar
Chris Jewell committed
40
41
42
43
# Fix for Lancaster HEC environment
source /usr/shared_apps/admin/etc/sge/switch-gpu.sh

# Environment variables for date and results staging
44
JOBNAME=c19_${arg_date}_${arg_config}
Chris Jewell's avatar
Chris Jewell committed
45
STDOUT=$arg_staging_dir/stdout.txt
Chris Jewell's avatar
Chris Jewell committed
46
47
48
49

# Final results dir
RESULTS_DEST_DIR=/mnt/covid/c19/covid_pipeline

Chris Jewell's avatar
Chris Jewell committed
50
51
52
53
54
55
56
mkdir -p ${arg_staging_dir}
qsub -N $JOBNAME -o $STDOUT \
     pipeline.sge \
     -c "$arg_config" \
     -d "$arg_date" \
     -s "$arg_staging_dir" \
     -r "$arg_results_dir"
Chris Jewell's avatar
Chris Jewell committed
57
58

exit 0