-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathr-batch-submit.sh
executable file
·109 lines (95 loc) · 2.64 KB
/
r-batch-submit.sh
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
#PBS -N "takeup-all-run-800"
#PBS -j oe
#PBS -V
#PBS -e /home/edjee/projects/takeup/logs/error.txt
#PBS -o /home/edjee/projects/takeup/logs/output.txt
#PBS -l procs=20,mem=100gb
cd $PBS_O_WORKDIR
fit_models () {
AKARING_OUTPUT_PATH="/share/akaringlab/takeup-output/"
LATEST_VERSION=92
CMDSTAN_ARGS="--cmdstanr --include-paths=stan_models"
VERSION=${1:-$LATEST_VERSION}
#OUTPUT_ARGS="--output-path=$PBS_O_WORKDIR/data/stan_analysis_data"
OUTPUT_ARGS="--output-path=${AKARING_OUTPUT_PATH}/data/stan_analysis_data"
POSTPROCESS_INOUT_ARGS="--input-path=${AKARING_OUTPUT_PATH}/data/stan_analysis_data --output-path=${AKARING_OUTPUT_PATH}/temp-data"
STAN_THREADS=4
ITER=800
#models=(
# "STRUCTURAL_LINEAR_U_SHOCKS_PHAT_MU_REP"
# "STRUCTURAL_LINEAR_U_SHOCKS_PHAT_MU_REP_HIGH_SD_WTP_VAL"
# "STRUCTURAL_LINEAR_U_SHOCKS_PHAT_MU_REP_HIGH_MU_WTP_VAL"
# "REDUCED_FORM_NO_RESTRICT_DIST_CTS")
#
# for model in "${models[@]}"
# do
# Rscript --no-save \
# --no-restore \
# --verbose \
# run_takeup.R takeup fit \
# --models=${model} \
# ${CMDSTAN_ARGS} \
# ${OUTPUT_ARGS} \
# --update \
# --threads=${STAN_THREADS} \
# --outputname=dist_fit${VERSION} \
# --num-mix-groups=1 \
# --iter=${ITER} \
# --sequential > logs/output-${model}-fit${VERSION}.txt 2>&1
#
# Rscript --no-save \
# --no-restore \
# --verbose \
# run_takeup.R takeup prior \
# --models=${model} \
# ${CMDSTAN_ARGS} \
# ${OUTPUT_ARGS} \
# --update \
# --threads=${STAN_THREADS} \
# --outputname=dist_prior${VERSION} \
# --num-mix-groups=1 \
# --iter=${ITER} \
# --sequential > logs/output-${model}-prior${VERSION}.txt 2>&1
# done
#
Rscript --no-save \
--no-restore \
--verbose \
run_takeup.R takeup fit \
--models=REDUCED_FORM_NO_RESTRICT \
${CMDSTAN_ARGS} \
${OUTPUT_ARGS} \
--update \
--threads=${STAN_THREADS} \
--outputname=dist_fit${VERSION} \
--num-mix-groups=1 \
--multilevel \
--iter=${ITER} \
--sequential > output-rf-fit${VERSION}.txt 2>&1
Rscript --no-save \
--no-restore \
--verbose \
run_takeup.R takeup prior \
--models=REDUCED_FORM_NO_RESTRICT \
${CMDSTAN_ARGS} \
${OUTPUT_ARGS} \
--update \
--threads=${STAN_THREADS} \
--outputname=dist_prior${VERSION} \
--multilevel \
--num-mix-groups=1 \
--iter=${ITER} \
--sequential > output-rf-prior${VERSION}.txt 2>&1
# Rscript --no-save \
# --no-restore \
# --verbose \
# postprocess_dist_fit.R \
# ${VERSION} \
# --load-from-csv \
# --cores=1 \
# ${POSTPROCESS_INOUT_ARGS} > logs/postprocess-output${VERSION}.txt 2>&1
}
export -f fit_models
# call mpi
mpirun -n 1 -machinefile $PBS_NODEFILE bash -c 'fit_models'