Use Stata Big Red II at IU

On this page:

Note:

Big Red II will be retired from service on November 12, 2019. After that date, you will no longer be able to log into Big Red II; however, the data in your Big Red II home directory will remain accessible from your home directory on any of the other IU research supercomputers. Following the October 13, 2019, maintenance window, UITS will no longer accept requests for new software installations on Big Red II. An expanded Big Red II+ will be made available to IU graduate students, faculty, and staff in October of 2019; Big Red 200 will be available for use by IU graduate students, faculty, and staff in January of 2020. Undergraduate students and affiliates will be able to get Big Red II+ and Big Red 200 accounts if they are sponsored by full-time IU faculty or staff members. For more, see Upcoming changes to research supercomputers at IU.


Overview

On Big Red II at Indiana University, you can use Stata interactively from the command line or in batch mode using a 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.

Set 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 first must 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 Use Modules to manage your software environment on IU's research computing systems.

Submit 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 (for example, stata_input.do) containing the commands Stata should run.
  2. Create a job script (for example, 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 username@iu.edu with your IU email address):
    #!/bin/bash
    #PBS -l nodes=1:ppn=32
    #PBS -l walltime=01:00:00
    #PBS -l gres=ccm
    #PBS -m ae
    #PBS -M username@iu.edu
    #PBS -N stata_job_name
    #PBS -V
    
    cd /N/u/username/BigRed2/new_directory
    
    ccmrun stata -b do stata_input.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 (for example, stata_job 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
    

Run 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:

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

If your interactive session will require more than 20 minutes of processor time, you must run it as an interactive job on a Big Red II compute node in the CCM execution environment. UITS Research Technologies strongly recommends this method of interactive execution, 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 Set 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:
    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 at the command prompt on one of Big Red II's aprun nodes (where username is your IU username):

    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/username/BigRed2
    Tue May 14 15:29:21 EDT 2019
    username@aprun1:~>
  3. On the aprun command line, enter:
    ccmlogin
    

    This will place you at the command prompt on a Big Red II compute node (for example, nid00885, where username is your IU username):

    Warning: Permanently added '[nid00885]:203' (RSA) to the list of known hosts.
    username@nid00885:~>
    
  4. To launch Stata, on the compute node command line, enter:
    stata
    

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:

qsub -I -X -l walltime=01:00:00 -l nodes=1:ppn=32 -l gres=ccm -q cpu

Get help

If you need help or have questions regarding the use of Stata on Big Red II, contact the UITS Research Applications and Deep Learning team.

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.

This is document bdrt in the Knowledge Base.
Last modified on 2019-08-01 13:02:08.

Contact us

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