Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
habrok:examples:r [2021/03/02 12:44] – external edit 127.0.0.1 | habrok:examples:r [2023/03/22 13:29] (current) – [Multiple nodes] fokke | ||
---|---|---|---|
Line 26: | Line 26: | ||
#SBATCH --mem=1000 | #SBATCH --mem=1000 | ||
- | ml R/3.4.4-foss-2018a-X11-20180131 | + | module purge |
+ | module load R/4.2.1-foss-2022a | ||
Rscript R_example1.R | Rscript R_example1.R | ||
</ | </ | ||
Line 72: | Line 73: | ||
#SBATCH --mem=10GB | #SBATCH --mem=10GB | ||
- | module load R/3.4.4-foss-2018a-X11-20180131 | + | module purge |
+ | module load R/4.2.1-foss-2022a | ||
Rscript parallel.R | Rscript parallel.R | ||
</ | </ | ||
- | The file containing the R code is named '' | + | The file containing the R code is named '' |
<code r parallel.R> | <code r parallel.R> | ||
Line 140: | Line 142: | ||
#SBATCH --mem=10GB | #SBATCH --mem=10GB | ||
- | module load R/3.4.4-foss-2018a-X11-20180131 | + | module purge |
+ | module load R/4.2.1-foss-2022a | ||
srun ${EBROOTR}/ | srun ${EBROOTR}/ | ||
Line 147: | Line 150: | ||
==== GPU ==== | ==== GPU ==== | ||
- | In order to let R use the GPUs of the Peregrine | + | In order to let R use the GPUs of the Hábrók |
<code bash> | <code bash> | ||
srun --time=00: | srun --time=00: | ||
Line 205: | Line 208: | ||
Now we can submit the job using '' | Now we can submit the job using '' | ||
In this example the matrix multiplication is slower for the GPU when small matrices are used (100x100); however, as the matrix gets larger, the GPU speed will scale better as can be seen from the output. | In this example the matrix multiplication is slower for the GPU when small matrices are used (100x100); however, as the matrix gets larger, the GPU speed will scale better as can be seen from the output. | ||
+ | |||
+ | ===== Installing additional R libraries ===== | ||
+ | |||
+ | R provides the '' | ||
+ | |||
+ | * log in and load the R module that you would like to use, e.g.: '' | ||
+ | * launch R by running the command: '' | ||
+ | * run the appropriate '' | ||
+ | * quit using '' | ||
+ | |||
+ | Now the packages will be available for any job that you run. Note that you do have to do this again once you switch to a completely different R version. | ||
+ | |||
+ | ==== Login node limits ==== | ||
+ | |||
+ | Note that if you are trying to install something on the login node, you may run into certain limits that prevent you from using too much memory on the login node. See [[: | ||
===== Useful packages ===== | ===== Useful packages ===== | ||
- | One of our Peregrine | + | One of our users has developed an R package to send function calls as jobs on Slurm via SSH. You can find the documentation and installation instructions on [[https:// |