-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (59 loc) · 2.12 KB
/
Makefile
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#######################
# Setup
######
# Savio configuration.
# This allows us to use environmental variables to override this default.
ifndef ACCOUNT
ACCOUNT=co_biostat
endif
# This allows us to use environmental variables to override this default.
ifndef PARTITION
PARTITION=savio2
endif
# This allows us to override the default QOS by setting an environmental variable.
# e.g. we run in BASH: "export QOS=biostat_normal"
ifndef QOS
# Choose one QOS and comment out the other, or use environmental variables.
QOS=biostat_savio2_normal
#QOS=savio_lowprio
endif
SBATCH=sbatch -A ${ACCOUNT} -p ${PARTITION} --qos ${QOS}
######
# Makefile configuration.
SCRIPT_DIR=scripts
OUTPUT_DIR=output
#######################
# Targets
all: setup data analysis
data: merge-data create-dataset
analysis: predict-indiv predict-cumu vim
setup: setup.R
${SBATCH} --nodes 1 --job-name=$< ${SCRIPT_DIR}/sbatch-r.sh --file=$<
test: test.R
${SBATCH} --nodes 2 --job-name=$< ${SCRIPT_DIR}/sbatch-r.sh --file=$<
# Dependencies: merge-data
create-dataset: create-dataset.Rmd
${SBATCH} --nodes 1 --job-name=$< ${SCRIPT_DIR}/sbatch-rmd.sh --file=$< --dir=${OUTPUT_DIR}
# Dependencies: install
merge-data: merge-data.Rmd
${SBATCH} --nodes 1 --job-name=$< ${SCRIPT_DIR}/sbatch-rmd.sh --file=$< --dir=${OUTPUT_DIR}
# Dependencies: create-dataset
vim: variable-importance.Rmd
${SBATCH} --nodes 1 --job-name=$< --output=$<.out ${SCRIPT_DIR}/sbatch-rmd.sh --file=$< --dir=${OUTPUT_DIR}
# Dependencies: create-dataset
predict-cumu: predict-cumulative.Rmd
${SBATCH} --nodes 1 --job-name=$< --output=$<.out ${SCRIPT_DIR}/sbatch-rmd.sh --file=$< --dir=${OUTPUT_DIR}
# Dependencies: create-dataset
predict-indiv: predict-individual.Rmd
${SBATCH} --nodes 4 --job-name=$< --output=$<.out ${SCRIPT_DIR}/sbatch-rmd.sh --file=$< --dir=${OUTPUT_DIR}
bash:
# Start a bash session with 2 nodes, for up to 5 hours.
srun -A ${ACCOUNT} -p ${PARTITION} --qos ${QOS} -N 2 -t 5:00:00 --pty bash
# Next line ensures that this rule works even if there's a file named "clean".
.PHONY : clean
clean:
rm -f *.Rout
rm -f slurm*.out
rm -f install*.out
rm -f cache/*
rm -f output/*.md