Difference between revisions of "R and Rmpi"
Line 5: | Line 5: | ||
'''Rmpi''' is a package that provides MPI bindings for the R programming language. In much the same way parallel code is written in other languages such as C or Fortran, R codes can run in parallel across multiple processors or nodes. | '''Rmpi''' is a package that provides MPI bindings for the R programming language. In much the same way parallel code is written in other languages such as C or Fortran, R codes can run in parallel across multiple processors or nodes. | ||
=== Version === | === Latest Version === | ||
*R: 3.4.2 | *R: 3.4.2 | ||
=== Installed Packages === | === Installed Packages === | ||
Installed packages (with version numbers) can be listed using the command 'pip freeze' after loading the appropriate module file. | Installed packages (with version numbers) can be listed using the command 'pip freeze' after loading the appropriate module file. | ||
{{AuthorizedUsers}} | {{AuthorizedUsers}} | ||
Line 21: | Line 17: | ||
{{Platforms}} | {{Platforms}} | ||
=== Modules === | |||
Multiple versions of R are available for use on the cluster. Modules are used to load a specific version into your profile. To see which versions of R are available, use the command: | |||
*module avail apps/R | |||
*See [[Modules]] for more information. | |||
{{AppRunningOnAll}} | {{AppRunningOnAll}} | ||
Line 30: | Line 33: | ||
<pre style="white-space:pre-wrap; width:50%; border:1px solid lightgrey; background:#000000; color:white;">cp /apps/R/3.4.2/share/Rprofile $WORK/rmpi_test/.Rprofile</pre> | <pre style="white-space:pre-wrap; width:50%; border:1px solid lightgrey; background:#000000; color:white;">cp /apps/R/3.4.2/share/Rprofile $WORK/rmpi_test/.Rprofile</pre> | ||
=== Submitting a Job === | === Submitting a Job === | ||
Line 36: | Line 40: | ||
*The script below (for testing, name it “r-test.sh”) can be copied into your job directory (the folder with your input files) and modified so that you can submit batch processes to the queue. | *The script below (for testing, name it “r-test.sh”) can be copied into your job directory (the folder with your input files) and modified so that you can submit batch processes to the queue. | ||
*'''Note: Rmpi is not available in all versions of R on CIRCE, but is compiled with R versions 3.1.2 and 3.4.2. | *'''Note: Rmpi is not available in all versions of R on CIRCE, but is compiled with R versions 3.1.2 and 3.4.2 (among others). | ||
''' | ''' | ||
<pre style="white-space:pre-wrap; width:45%; border:1px solid lightgrey; background:#E0E0E0; color:black;"> | <pre style="white-space:pre-wrap; width:45%; border:1px solid lightgrey; background:#E0E0E0; color:black;"> |
Revision as of 17:35, 27 October 2017
Description
From the R Project Home Page: R is a free software environment for statistical computing and graphics. R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible.
Rmpi is a package that provides MPI bindings for the R programming language. In much the same way parallel code is written in other languages such as C or Fortran, R codes can run in parallel across multiple processors or nodes.
Latest Version
- R: 3.4.2
Installed Packages
Installed packages (with version numbers) can be listed using the command 'pip freeze' after loading the appropriate module file.
Authorized Users
CIRCE
account holdersRRA
account holdersSC
account holders
Platforms
CIRCE
clusterRRA
clusterSC
cluster
Modules
Multiple versions of R are available for use on the cluster. Modules are used to load a specific version into your profile. To see which versions of R are available, use the command:
- module avail apps/R
- See Modules for more information.
Running R and Rmpi on CIRCE/SC
The R and Rmpi user guide is essential to understanding the application and making the most of it. The guide and this page should help you to get started with your simulations. Please refer to the Documentation section for a link to the guide.
- Note on CIRCE: Make sure to run your jobs from your $WORK directory!
- Note: Scripts are provided as examples only. Your SLURM executables, tools, and options may vary from the example below. For help on submitting jobs to the queue, see our SLURM User’s Guide.
Prepare your R Environment
Copy this file to /path/to/job/directory/.Rprofile to allow Rmpi jobs to work, e.g.:
cp /apps/R/3.4.2/share/Rprofile $WORK/rmpi_test/.Rprofile
Submitting a Job
A sample submit script is listed below. If, for example, you have an R input file named r-test.R, you would set up a submit script like this:
- The script below (for testing, name it “r-test.sh”) can be copied into your job directory (the folder with your input files) and modified so that you can submit batch processes to the queue.
- Note: Rmpi is not available in all versions of R on CIRCE, but is compiled with R versions 3.1.2 and 3.4.2 (among others).
#!/bin/bash # #SBATCH --comment=r-test #SBATCH --ntasks=4 #SBATCH --job-name=r-test #SBATCH --output=output.%j.r-test #SBATCH --time=01:00:00 #### SLURM 4 processor R test to run for 1 hour. module purge module add apps/R/3.4.2 mpirun Rmpi r-test.R
Next, you can change to your job’s directory, and run the sbatch command to submit the job:
[user@login0 ~]$ cd my/jobdir [user@login0 jobdir]$ sbatch ./r-test.sh
- You can view the status of your job with the “squeue -u <username>” command
Documentation
Home Page, User Guides, and Manuals
- R Project Home Page:
- R Project Documentation:
Benchmarks, Known Tests, Examples, Tutorials, and Other Resources
- CRAN Package Repository:
- Rmpi Examples
- /apps/R/3.4.2/share/Rmpitest.R
- /apps/R/3.4.2/share/Rmpitest2.R
More Job Information
See the following for more detailed job submission information:
Reporting Bugs
Report bugs with R and Rmpi to the IT Help Desk: rc-help@usf.edu