This shows you the differences between two versions of the page.
| 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 '' | The '' | ||
| Line 19: | Line 19: | ||
| <file bash my_R_job.qsub> | <file bash my_R_job.qsub> | ||
| #!/bin/bash | #!/bin/bash | ||
| - | #PBS -l select=10: | + | #PBS -l select=2: |
| #PBS -P SHORTNAME | #PBS -P SHORTNAME | ||
| #PBS -q normal | #PBS -q normal | ||
| Line 47: | Line 47: | ||
| * And replace '' | * And replace '' | ||
| * And change '' | * And change '' | ||
| + | |||
| + | ===Running the script=== | ||
| + | |||
| + | Submit to the scheduler | ||
| + | < | ||
| + | qsub my_R_job.qsub | ||
| + | </ | ||
| + | |||
| + | Check the list of current jobs in the queue | ||
| + | < | ||
| + | qstat -w | ||
| + | </ | ||
| + | |||
| + | ==== R/ | ||
| + | |||
| + | Here is a more complete example | ||
| + | |||
| + | === pbdR example === | ||
| + | == Job scripts == | ||
| + | <file bash pbdtest.qsub> | ||
| + | #PBS -l select=2: | ||
| + | #PBS -l walltime=00: | ||
| + | #PBS -q normal | ||
| + | #PBS -P SHORTNAME | ||
| + | #PBS -M YOUREMAILADDRESS | ||
| + | #PBS -m be | ||
| + | #PBS -e / | ||
| + | #PBS -o / | ||
| + | #PBS -N PBDR_TEST | ||
| + | #PBS -mb | ||
| + | |||
| + | module add chpc/ | ||
| + | |||
| + | NP=`cat ${PBS_NODEFILE} | wc -l` | ||
| + | |||
| + | cd / | ||
| + | mpirun -np ${NP} -machinefile ${PBS_NODEFILE} Rscript test_script.R | ||
| + | |||
| + | </ | ||
| + | Note: __USERNAME__ should contain your actual user name! | ||
| + | |||
| + | <file R test_script.R> | ||
| + | library(pbdMPI, | ||
| + | init() | ||
| + | my.rank <- comm.rank() | ||
| + | comm.print(my.rank, | ||
| + | |||
| + | finalize() | ||
| + | </ | ||
| + | |||
| + | == Submit your job == | ||
| + | Finally submit your job using:< | ||
| + | |||