Use Stata Big Red II at IU

On Big Red II at Indiana University, you can use Stata interactively from the command line or in batch mode using a TORQUE job script. If your interactive session will require more than 20 minutes of processor time, you must run it as an interactive job on one of Big Red II's compute nodes in the Cluster Compatibility Mode (CCM) execution environment.

On this page:

Setting up your user environment

On the research computing resources at Indiana University, the Modules environment management system provides a convenient method for dynamically customizing your software environment.

To use Stata on Big Red II, you must first add the stata module to your user environment. To run Stata jobs on Big Red II's compute nodes in the CCM execution environment, you also must add the ccm module to your user environment. To make sure both modules are loaded every time you log into Big Red II, add the following lines to your ~/.modules file:

  module load stata 
  module load ccm

For more about using Modules to configure your user environment, see On the research computing systems at IU, how do I use Modules to manage my software environment?

Submitting a Stata batch job

To submit a Stata batch job that will run on Big Red II's compute nodes in the CCM execution environment:

  1. Create a do-file (e.g., containing the commands Stata should run.
  2. Create a job script (e.g., stata_job) for the TORQUE resource manager on Big Red II. Your job script must include the ccmrun command, which will launch Stata on a compute node in the CCM environment, and the -l gres=ccm flag; for example (replace username with your IU username and with your IU email address):
     #PBS -l nodes=1:ppn=32
     #PBS -l walltime=01:00:00
     #PBS -l gres=ccm
     #PBS -m ae
     #PBS -M
     #PBS -N stata_job_name
     #PBS -V
     cd /N/u/username/BigRed2/new_directory
     ccmrun stata -b do

    The above example job script will:

    • Change the working directory to the directory where the do-file is located
    • Invoke ccmrun to launch Stata
    • Have Stata run the commands in the do-file
    • Have Big Red II email you when the job is complete
  3. Submit the job script to the TORQUE resource manager; on the command prompt, enter:
      qsub stata_job
  4. To check the status of your job, use the qstat command (replace username with your IU username):
      qstat -u username 

Running Stata interactively

If your interactive session will require less than 20 minutes of processor time, you can load the stata module and launch the application from the Big Red II command line; for example:

  statmath@login1:~> module load stata
  statmath@login1:~> stata

Interactive sessions requiring more than 20 minutes of processor time must be run as interactive jobs on a Big Red II compute node in the CCM execution environment. This method of interactive execution is strongly recommended, as the login nodes are not intended for computational work.

To run an interactive Stata job on Big Red II:

  1. Make sure your user environment is configured properly; see Setting up your user environment above.
  2. From the command line, enter the qsub command with the -I (interactive), -l gres=ccm, and -q cpu (CPU queue) flags added; for example:
      statmath@login1:~> qsub -I -l walltime=01:00:00 -l nodes=1:ppn=32 -l gres=ccm -q cpu  

    When the resources needed to run your job are available, your job will start. Once the CCM execution environment is initialized, you'll be placed on one of Big Red II's aprun nodes:

      qsub: waiting for job 79064 to start
      qsub: job 79064 ready
      In CCM JOB:  79064  JID  79064  USER  statmath  GROUP  uits
      Initializing CCM environment, Please Wait
      waiting for jid....
      CCM Start success, 1 of 1 responses
      Directory: /N/u/statmath/BigRed2
      Tue Sep 10 15:29:21 EDT 2013
  3. From the aprun command line, enter the ccmlogin command:
      statmath@aprun1:~> ccmlogin

    This will place you on a Big Red II compute node (e.g., nid00885):

      Warning: Permanently added '[nid00885]:203' (RSA) to the list of known hosts.
  4. From the compute node command prompt, enter stata to launch Stata:
      statmath@nid00885:~> stata
      ___  ____  ____  ____  ____ (R)
     /__    /   ____/   /   ____/
    ___/   /   /___/   /   /___/   13.0   Copyright 1985-2013 StataCorp LP
      Statistics/Data Analysis            StataCorp
                                          4905 Lakeway Drive
         Special Edition                  College Station, Texas 77845 USA
                                          979-696-4601 (fax)
    2-user Stata network license expires 15 Aug 2014:
           Serial number:  501306204900
             Licensed to:  Indiana University
                           Research Analytics
          1.  (-v# option or -set maxvar-) 5000 maximum variables
          2.  Command line editing enabled
    Note:  Your site can add messages to the introduction by editing the file
           stata.msg in the directory where Stata is installed.

To use the features of the Stata graphical user interface (GUI), you must SSH to Big Red II with X forwarding enabled, and then use qsub with the -I (interactive) and -X (X forwarding) switches, as well as the -l gres=ccm switch; for example:

  statmath@login1:~> qsub -I -X -l walltime=01:00:00 -l nodes=1:ppn=32 -l gres=ccm -q cpu

For instructions on setting up and using X forwarding, see On my personal computer, how do I use X forwarding to securely run graphical applications installed on IU's research computing systems?

Getting help

Support for IU research computing systems, software, and services is provided by the Research Technologies division of UITS. To ask a question or get help, contact UITS Research Technologies.

Back to top

This is document bdrt in the Knowledge Base.
Last modified on 2018-07-19 13:10:49.

Contact us

For help or to comment, email the UITS Support Center.