| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | = Running R on Cypress = |
| | 4 | |
| | 5 | == Python Modules == |
| | 6 | As of August 18th, 2015 there is one version of R installed on Cypress in the module |
| | 7 | |
| | 8 | * R/3.1.2 |
| | 9 | |
| | 10 | == Installing Packages == |
| | 11 | |
| | 12 | |
| | 13 | == Running R Interactively == |
| | 14 | |
| | 15 | Start an interactive session using idev |
| | 16 | |
| | 17 | {{{ |
| | 18 | [tulaneID@cypress1 pp-1.6.4]$ idev |
| | 19 | Requesting 1 node(s) task(s) to normal queue of defq partition |
| | 20 | 1 task(s)/node, 20 cpu(s)/task, 2 MIC device(s)/node |
| | 21 | Time: 0 (hr) 60 (min). |
| | 22 | Submitted batch job 52311 |
| | 23 | Seems your requst is pending. |
| | 24 | JOBID=52311 begin on cypress01-035 |
| | 25 | --> Creating interactive terminal session (login) on node cypress01-035. |
| | 26 | --> You have 0 (hr) 60 (min). |
| | 27 | [tulaneID@cypress01-035 pp-1.6.4]$ |
| | 28 | }}} |
| | 29 | |
| | 30 | Load the R module |
| | 31 | |
| | 32 | {{{ |
| | 33 | [tulaneID@cypress01-035 pp-1.6.4]$ module load R/3.1.2 |
| | 34 | [tulaneID@cypress01-035 pp-1.6.4]$ module list |
| | 35 | Currently Loaded Modulefiles: |
| | 36 | 1) git/2.4.1 3) idev 5) R/3.1.2 |
| | 37 | 2) slurm/14.03.0 4) bbcp/amd64_rhel60 |
| | 38 | }}} |
| | 39 | |
| | 40 | Run R in the command line window |
| | 41 | |
| | 42 | {{{ |
| | 43 | [tulaneID@cypress01-035 pp-1.6.4]$R |
| | 44 | |
| | 45 | R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" |
| | 46 | Copyright (C) 2014 The R Foundation for Statistical Computing |
| | 47 | Platform: x86_64-unknown-linux-gnu (64-bit) |
| | 48 | |
| | 49 | R is free software and comes with ABSOLUTELY NO WARRANTY. |
| | 50 | You are welcome to redistribute it under certain conditions. |
| | 51 | Type 'license()' or 'licence()' for distribution details. |
| | 52 | |
| | 53 | Natural language support but running in an English locale |
| | 54 | |
| | 55 | R is a collaborative project with many contributors. |
| | 56 | Type 'contributors()' for more information and |
| | 57 | 'citation()' on how to cite R or R packages in publications. |
| | 58 | |
| | 59 | Type 'demo()' for some demos, 'help()' for on-line help, or |
| | 60 | 'help.start()' for an HTML browser interface to help. |
| | 61 | Type 'q()' to quit R. |
| | 62 | |
| | 63 | > |
| | 64 | |
| | 65 | }}} |
| | 66 | |
| | 67 | == Running a R script in Batch mode == |
| | 68 | |
| | 69 | You can also submit your Python job to the batch nodes (compute nodes) on Cypress. Inside your SLURM script, include a command to load the desired Python module. Then invoke '''python''' on your python script. |
| | 70 | |
| | 71 | {{{#!bash |
| | 72 | #!/bin/bash |
| | 73 | #SBATCH --qos=workshop # Quality of Service |
| | 74 | #SBATCH --partition=workshop # Partition |
| | 75 | #SBATCH --job-name=R # Job Name |
| | 76 | #SBATCH --time=00:01:00 # WallTime |
| | 77 | #SBATCH --nodes=1 # Number of Nodes |
| | 78 | #SBATCH --ntasks-per-node=1 # Number of tasks (MPI processes) |
| | 79 | #SBATCH --cpus-per-task=1 # Number of threads per task (OMP threads) |
| | 80 | |
| | 81 | module load R/3.1.2 |
| | 82 | python myRscript.py |
| | 83 | }}} |
| | 84 | |
| | 85 | == Running a Parallel R Job == |
| | 86 | |