Submitting jobs to the cluster with R - CoBrALab/documentation GitHub Wiki
Running large statistical models in R on your local machine can take a very long time. In order to speed up the process, you can break up your jobs and send them to the cluster.
First you will need to load the following modules:
$ module load anaconda R rstudio minc-toolkit-v2 RMINC
Now you can launch your rstudio
session.
In order to parallelize your jobs and send them to the cluster, you will have to include the following in your model: `parallel=c("slurm",200)`. The number you choose corresponds to how many jobs you are chunking your model into. An exmaple model will look something like this:
```R
mincLmer(abs_jac ~ ns(age,1)*new_groups+(1|mouse_id),filtered.data, mask=votedmask, parallel=c("slurm",100))
Note: if you are using an old script that contains the line "options(RMINC_BATCH_CONF = "sge_resources.R")" -- this has been depreciated since installing the new software on the workstations. You can revert this by telling R to use the current (default) cluster set up, as follows:
options(RMINC_BATCH_CONF = "/opt/quarantine/software/RMINC/dnp_batchtools.R")