-
Notifications
You must be signed in to change notification settings - Fork 2
/
sbc_run.sh
47 lines (38 loc) · 1.71 KB
/
sbc_run.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
#!/usr/bin/env bash
#SBATCH --partition=broadwl
#SBATCH --job-name=sbc-takeup # create a short name for your job
#SBATCH --nodes=1 # node count
#SBATCH --ntasks=1 # total number of tasks across all nodes
#SBATCH --cpus-per-task=24 # cpu-cores per task (>1 if multi-threaded tasks)
#SBATCH --mem-per-cpu=2G # memory per cpu-core (4G is default)
#SBATCH --time=0-06:00:00 # maximum time needed (HH:MM:SS)
#SBATCH --mail-type=begin # send email when job begins
#SBATCH --mail-type=end # send email when job ends
#SBATCH --mail-user=edjee96@gmail.com
#SBATCH --output=temp/log/takeup_sbc-%j.log
#SBATCH --error=temp/log/takeup_sbc-%j.log
#SBATCH --export=IN_SLURM=1
LATEST_VERSION=53
VERSION=${1:-$LATEST_VERSION} # Get version from command line if provided
CMDSTAN_ARGS="--cmdstanr --include-paths=takeup/stan_models"
if [[ -v IN_SLURM ]]; then
echo "Running in SLURM..."
module load midway2 gdal/2.4.1 udunits cmake R/4.2.0 openmpi
CORES=$SLURM_CPUS_PER_TASK
echo "Running with ${CORES} cores."
else
CORES=12
fi
STAN_THREADS=1
# SBC
Rscript ./takeup_reduced_sbc.R sbc --cmdstanr \
--num-sbc-draws=200 \
--iter=2000 \
--chains=1 \
--outputname=reduced_form_sbc \
--models=REDUCED_FORM_NO_RESTRICT \
--output-path=data/sbc_output_data \
--include-paths=stan_models \
--multilevel \
--save-mem \
--num-cores=2