ARCHIVED: Use R on Karst at IU

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.
Note:
Karst was retired from service on December 18, 2020. Although you can no longer log into Karst, you can access files in your Karst home directory from any of the other IU research supercomputers until December 31, 2021. For information about Quartz, Karst's replacement system, see About Quartz at IU.

To use R on Karst at Indiana University, first set up your user environment by loading the r module and its prerequisite modules (the cURL multi-protocol file transfer library and the Java Runtime Environment). To make the necessary modules load automatically every time you log into Karst, add the following lines to your ~/.modules file:

  module load curl
  module load java
  module load r

If your R session requires fewer than 20 minutes, you can load the necessary modules and launch the application from the command line. If your session requires more than 20 minutes, submit a batch job:

  1. Create an R file (for example, R_input.r) containing the commands R should run.
  2. Create a TORQUE script (for example, R_job); for example (replace username with your IU username and my_iu_email with your IU email address):
      #!/bin/bash 
      #PBS -l nodes=1:ppn=16
      #PBS -l walltime=01:00:00
      #PBS -m ae
      #PBS -M my_iu_email
      #PBS -N R_job_name
      #PBS -V
    
      cd /N/u/username/Karst/working_directory
    
      module load curl
      module load java
      module load r
    
      R CMD BATCH R_input.r
    

    To use parallel CPUs, add the following command to your execution line to enable MKL threading:

      export MKL_NUM_THREADS="8"
    

    On Karst, you can set up to 16 threads.

  3. To submit your job script (for example, R_job), on the command prompt, enter qsub R_job . To check the status of your job, enter qstat -u username (replace username with your IU username).

If you have questions or need help regarding the use of R on IU's research supercomputers, contact the UITS Research Applications and Deep Learning team.

This is document amsh in the Knowledge Base.
Last modified on 2023-05-09 14:45:10.