Use R on Karst 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

For help with modules, see On the research computing systems at IU, how do I use Modules to manage my software environment?

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 (e.g., R_input.r) containing the commands R should run.
  2. Create a TORQUE script (e.g., 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 (e.g., 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).

Support for IU research computing systems, software, and services is provided by various UITS Research Technologies units. For help, see Research computing support at IU.

This is document amsh in the Knowledge Base.
Last modified on 2018-01-26 10:35:56.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.