Changes between Version 18 and Version 19 of cypress/R


Ignore:
Timestamp:
Aug 21, 2019 4:56:38 PM (2 years ago)
Author:
cbaribault
Comment:

Improved presentation flow - manage packages before introducing batch scripts.

Legend:

Unmodified
Added
Removed
Modified
  • cypress/R

    v18 v19  
    3939
    4040==== For Workshop ====
    41 If you use a temporary workshop account, in order to use only 2 cpu's per node and thus allow for sharing of nodes among many users, do this.
     41If you use a temporary workshop account, in order to use only 2 cpu's per node and thus allow for sharing the few available nodes in the interactive partition among many users, do this.
    4242{{{
    4343[tulaneID@cypress1 ~]$ idev -c 2
     
    8080}}}
    8181
     82== R Package Dependency ==
     83
     84In order to run any of the SLURM scripts below, we would submit the SLURM script via '''sbatch''' command, but in general we would not expect the code to run successfully  the very first time with out additional setup.  We can try running the script without any additional setup, but we can expect to get the error such as in the following R session.
     85
     86{{{#!r
     87> library(doParallel)
     88Error in library(doParallel) : there is no package called ‘doParallel’
     89}}}
     90
     91Thus we should first ensure that the required R package, in this case the R package '''doParallel''', is available and installed in your environment. For a range of options for installing R packages - depending on the desired level of reproducibility, see the section [#InstallingRPackages Installing R Packages on Cypress].
     92
     93'''For Workshop''' :
     94If you use a temporary workshop account, use [#RPackageAlternative1 Alternative 1] for installing R packages.
     95
     96Thus we need to install the R package '''doParallel'''.
     97
     98{{{#!r
     99install.packages("doParallel")
     100...
     101> library(doParallel)
     102Loading required package: foreach
     103Loading required package: iterators
     104Loading required package: parallel
     105>
     106}}}
     107
     108Once we have resolved our package dependencies, we now expect the job to run without errors.
     109
    82110== Running a R script in Batch mode ==
    83111
    84 You can also submit your R job to the batch nodes (compute nodes) on Cypress. Inside your SLURM script, include a command to load the desired R module. Then invoke the '''Rscript''' command on your R script.
     112Besides running R interactively in an idev session, you can also submit your R job to the batch nodes (compute nodes) on Cypress. Inside your SLURM script, include a command to load the desired R module. Then invoke the '''Rscript''' command on your R script.
    85113
    86114{{{#!bash
     
    186214}}}
    187215
    188 Edit the new file '''bootstrap.sh''' to contain the above SLURM script code.
    189 
    190 === R Package Dependency ===
    191 
    192 So, for example, in order to run the above, we would submit the above SLURM script via '''sbatch''' command, but in general we would not expect this code to run the very first time with out additional setup.  We can try running the above scripts thus far without any additional setup, but we can expect to get the error such as in the following R session.
    193 
    194 {{{#!r
    195 > library(doParallel)
    196 Error in library(doParallel) : there is no package called ‘doParallel’
    197 }}}
    198 
    199 Thus we should first ensure that the required R package, in this case the R package '''doParallel''', is available and installed in your environment. For a range of options for installing R packages - depending on the desired level of reproducibility, see the section [#InstallingRPackages Installing R Packages on Cypress].
    200 
    201 '''For Workshop''' :
    202 If you use a temporary workshop account, use [#RPackageAlternative1 Alternative 1] for installing R packages.
    203 
    204 Once we have resolved our package dependencies, we now expect the job to run without errors.
     216Edit the new file '''bootstrap.sh''' to contain the above SLURM script code and submit as shown below.
    205217
    206218Also, note that since we did not specify an output file in the SLURM script, the output will be written to slurm-<!JobNumber>.out. For example:
     
    218230[tulaneID@cypress2 R]$
    219231}}}
     232
     233
    220234
    221235=== Passing Parameters ===