Both sides previous revision Previous revision Next revision | Previous revision |
habrok:examples:r [2023/03/21 13:16] – admin | habrok:examples:r [2023/03/22 13:29] (current) – [Multiple nodes] fokke |
---|
#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 |
</code> | </code> |
#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 |
</code> | </code> |
| |
The file containing the R code is named ''%%parallel.R%%''. Note that the package ''%%parallel%%'' and ''%%snow%%'' are used but others might be available as well. If necessary additional packages have to be installed, see [[peregrine:software_environment:installation_of_extra_applications_or_libraries#r|this page]]. | The file containing the R code is named ''%%parallel.R%%''. Note that the package ''%%parallel%%'' and ''%%snow%%'' are used but others might be available as well. If necessary additional packages have to be installed, see [[habrok:software_environment:installation_of_extra_applications_or_libraries#r|this page]]. |
| |
<code r parallel.R> | <code r parallel.R> |
#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}/lib64/R/library/snow/RMPISNOW < parallel.R | srun ${EBROOTR}/lib64/R/library/snow/RMPISNOW < parallel.R |
==== GPU ==== | ==== GPU ==== |
| |
In order to let R use the GPUs of the Peregrine cluster, we first have install the R library ''gpuR''. Unfortunately, this library has been removed from CRAN, and we will need to install it from GitHub. To do this, we first start an interactive job on one of the GPU nodes with an NVidia V100 GPU. You can similarly install it from a node with an NVidia K40 GPU, but we have fewer of those. This is how you start an interactive job from the command line on the login node: | In order to let R use the GPUs of the Hábrók cluster, we first have install the R library ''gpuR''. Unfortunately, this library has been removed from CRAN, and we will need to install it from GitHub. To do this, we first start an interactive job on one of the GPU nodes with an NVidia V100 GPU. You can similarly install it from a node with an NVidia K40 GPU, but we have fewer of those. This is how you start an interactive job from the command line on the login node: |
<code bash> | <code bash> |
srun --time=00:30:00 --partition=gpushort --gres=gpu:v100:1 --cpus-per-task=12 --pty bash -i | srun --time=00:30:00 --partition=gpushort --gres=gpu:v100:1 --cpus-per-task=12 --pty bash -i |