User Tools

Site Tools


howto:r

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howto:r [2016/04/05 11:31]
dane updated for new cluster
howto:r [2021/12/09 16:42] (current)
Line 9: Line 9:
  
  
-=====Parallel R=====+===== Parallel R =====
  
 The ''Rmpi'', ''doMPI'' and other packages are already installed to allow R to use MPI to distribute its work across multiple nodes of the cluster. **Please submit a request to helpdesk should you need any other packages installed.** The ''Rmpi'', ''doMPI'' and other packages are already installed to allow R to use MPI to distribute its work across multiple nodes of the cluster. **Please submit a request to helpdesk should you need any other packages installed.**
Line 19: Line 19:
 <file bash my_R_job.qsub> <file bash my_R_job.qsub>
 #!/bin/bash #!/bin/bash
-#PBS -l select=10:ncpus=24:mpiprocs=24:nodetype=haswell_reg+#PBS -l select=2:ncpus=24:mpiprocs=24
 #PBS -P SHORTNAME #PBS -P SHORTNAME
 #PBS -q normal #PBS -q normal
Line 47: Line 47:
   * And replace ''my_R_data'' with your program's //working directory// (which **must** be under ''/mnt/lustre/users/USERNAME/'').   * And replace ''my_R_data'' with your program's //working directory// (which **must** be under ''/mnt/lustre/users/USERNAME/'').
   * And change ''myScRipt.r'' to be your //script file name//.   * And change ''myScRipt.r'' to be your //script file name//.
 +
 +===Running the script===
 +
 +Submit to the scheduler
 +<code>
 +qsub my_R_job.qsub
 +</code>
 +
 +Check the list of current jobs in the queue
 +<code>
 +qstat -w
 +</code>
 +
 +==== R/bioconductor ====
 +
 +Here is a more complete example
 +
 +=== pbdR example ===
 +== Job scripts ==
 +<file bash pbdtest.qsub>
 +#PBS -l select=2:ncpus=24:mpiprocs=24:place=excl
 +#PBS -l walltime=00:01:00
 +#PBS -q normal
 +#PBS -P SHORTNAME
 +#PBS -M YOUREMAILADDRESS
 +#PBS -m be
 +#PBS -e /mnt/luster/users/USERNAME/pbdR_test/std_err.txt
 +#PBS -o /mnt/lustre/users/USERNAME/pbdR_test/std_out.txt
 +#PBS -N PBDR_TEST
 +#PBS -mb
 +
 +module add chpc/R/3.2.3-gcc5.1.0
 +
 +NP=`cat ${PBS_NODEFILE} | wc -l`
 +
 +cd /mnt/lustre/users/USERNAME/pbdR_test/
 +mpirun -np ${NP} -machinefile ${PBS_NODEFILE} Rscript test_script.R
 +
 +</file>
 +Note: __USERNAME__ should contain your actual user name!
 +
 +<file R test_script.R>
 +library(pbdMPI, quiet=TRUE)
 +init()
 +my.rank <- comm.rank()
 +comm.print(my.rank, all.rank=TRUE)
 +
 +finalize()
 +</file>
 +
 +== Submit your job ==
 +Finally submit your job using:<code bash>user@login01:~ $ qsub pbdtest.qsub</code>
 +
/app/dokuwiki/data/attic/howto/r.1459848667.txt.gz · Last modified: 2021/12/09 16:42 (external edit)