R: Difference between revisions

Jump to navigation Jump to search
50 bytes removed ,  7 years ago
no edit summary
No edit summary
No edit summary
Line 85: Line 85:


====Installing==== <!--T:18-->
====Installing==== <!--T:18-->
Below is the procedure to install [https://cran.r-project.org/web/packages/Rmpi/index.html Rmpi], an interface (wrapper) to MPI routines, which allow R to run in parallel.
This next procedure installs [https://cran.r-project.org/web/packages/Rmpi/index.html Rmpi], an interface (wrapper) to MPI routines, which allow R to run in parallel.


 
1. See the available R modules by running:
<!--T:19-->
  <source lang="bash">
First, load the R module.  You can find out which are available by running:
 
  <!--T:20-->
<source lang="bash">
  module spider r
  module spider r
</source>
</source>


<!--T:21-->
<!--T:21-->
In this case we choose the latest (as of November, 2017), and also load the required OpenMPI module:
2.  Select the version (here, we indicate the latest Novembre 2017 version), and also load the required OpenMPI module:
 
  <source lang="bash">
  <!--T:22-->
<source lang="bash">
  module load r/3.4.0
  module load r/3.4.0
  module load openmpi/1.10.7
  module load openmpi/1.10.7
Line 106: Line 100:


<!--T:23-->
<!--T:23-->
Next, download the latest version of the software from [https://cran.r-project.org/web/packages/Rmpi/index.html].  Change the version number to whatever is desired.
3. Download [https://cran.r-project.org/web/packages/Rmpi/index.html the latest R version]; change the version number to whatever is desired.
 
  <source lang="bash">
  <!--T:24-->
<source lang="bash">
wget https://cran.r-project.org/src/contrib/Rmpi_0.6-6.tar.gz
wget https://cran.r-project.org/src/contrib/Rmpi_0.6-6.tar.gz
</source>
</source>


<!--T:25-->
<!--T:25-->
Then specify the directory to install the package files in a directory you can write to. The name can be changed as desired.
4. Specify the directory where you want to install the package files; you must have write permission for this directory. The directory name can be changed if desired.
 
  <source lang="bash">
  <!--T:26-->
<source lang="bash">
  mkdir -p ~/local/R_libs/
  mkdir -p ~/local/R_libs/
  export R_LIBS=~/local/R_libs/
  export R_LIBS=~/local/R_libs/
Line 123: Line 113:


<!--T:27-->
<!--T:27-->
Finally, run the install command.
5. Run the install command.
 
<source lang="bash">
<!--T:28-->
<source lang="bash">
R CMD INSTALL --configure-args="--with-Rmpi-include=$EBROOTOPENMPI/include  --with-Rmpi-libpath=$EBROOTOPENMPI/lib --with-Rmpi-type='OPENMPI' " Rmpi_0.6-6.tar.gz  
R CMD INSTALL --configure-args="--with-Rmpi-include=$EBROOTOPENMPI/include  --with-Rmpi-libpath=$EBROOTOPENMPI/lib --with-Rmpi-type='OPENMPI' " Rmpi_0.6-6.tar.gz  
</source>
</source>
Line 136: Line 124:


<!--T:31-->
<!--T:31-->
Place your R code in a script file, in this case test.R.
1. Place your R code in a script file, in this case the file is called ''test.R''.


  <!--T:32-->
  <!--T:32-->
Line 157: Line 145:


<!--T:33-->
<!--T:33-->
Then place the following in a job submission script, job.sh :
2. Copy the following content in a job submission script called ''job.sh'':


  <!--T:34-->
  <!--T:34-->
Line 173: Line 161:


<!--T:35-->
<!--T:35-->
Finally, submit the job with:
3. Submit the job with:


  <!--T:36-->
  <!--T:36-->
rsnt_translations
58,130

edits

Navigation menu