-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-pipeline
executable file
·64 lines (56 loc) · 1.56 KB
/
run-pipeline
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/config.sh
array_size=$(wc -l < $LIBRARIES_LIST)
prepare_scratch () {
echo "Copying files to scratch..."
bash $SCRIPT_DIR/steps/0-prepare-scratch.bash
mkdir -p $OUT_DIR/logs
}
submit_giraffe () {
giraffe_job_id=$(sbatch \
-a 1-${array_size} \
--clusters $CLUSTER \
-p $PARTITION \
--cpus-per-task $GIRAFFE_CPUS \
--mem $GIRAFFE_MEM \
-t $GIRAFFE_TIME \
-o $OUT_DIR/logs/giraffe.%a.out \
-e $OUT_DIR/logs/giraffe.%a.err \
--parsable \
$SCRIPT_DIR/steps/1-giraffe-align.slurm \
| sed 's/;.\+$//')
echo "Submitted job ${giraffe_job_id}."
}
submit_surject () {
surject_job_id=$(sbatch \
-a 1-${array_size} \
--clusters $CLUSTER \
-p $PARTITION \
--cpus-per-task $SURJECT_CPUS \
--mem $SURJECT_MEM \
-t $SURJECT_TIME \
-o $OUT_DIR/logs/surject.%a.out \
-e $OUT_DIR/logs/surject.%a.err \
--dependency=aftercorr:${giraffe_job_id} \
--parsable \
$SCRIPT_DIR/steps/2-surject.slurm \
| sed 's/;.\+$//')
}
if [ -z $1 ]; then
prepare_scratch
submit_giraffe
submit_surject
elif [ $1 == "prepare" ]; then
prepare_scratch
elif [ $1 == "giraffe" ]; then
submit_giraffe
elif [ $1 == "surject" ]; then
submit_surject
else
echo "That's not a real argument."
fi
echo "Done submitting jobs. Results will be in"
echo "$SCRATCH_DIR"
echo "once they are finished."