SCRP nodes have Stata 16-18.5 installed.

Option 1: Remote Desktop

  1. Connect to a login node through remote desktop.
  2. Launch from the pull-down menu on the top-right corner, Applications > Statistics > Stata 17.

Option 2: JupyterHub

  1. Navigate to one of the following URLs on a browser:

  2. Create a Stata notebook.

Option 3: SSH

All the instructions below assume you have connected to a login node through SSH. See Account and Access for details.

Launch Stata in console mode:

stata-mp

Launch Stata with graphical user interface (GUI):

xstata-mp

If the Stata GUI does not launch, make sure you have an X server running on your computer (e.g. VcXsrv on Windows).

You can also run .do files under Stata’s batch mode:

stata-mp -b do file_path

Installing Additional Packages

You can install additional packages from the Statistical Software Components (SSC) a.k.a. Boston College Archive within Stata:

ssc install package_name

Downloaded packages are placed under your home directory and will be immediately available on all nodes.

Switch between Different Stata Versions

You can switch between different Stata versions in a terminal using Environment Modules. Follow the instructions here.

Running on a Compute Node - Short Duration

You should run your job on a compute node if you need more processing power. Compute nodes support running Stata on up to 16 logical CPUs.

To run Stata on a compute node in remote desktop, launch Applications > Slurm (x cores) > Stata 17, where x is the number of desirable cores.

Jupyter Notebooks

To run Jupyter notebooks on a compute node, following the instructions here.

Stata Console

To run Stata on a compute node in a terminal, simply prepend compute:

# Console mode
compute stata-mp

# Batch mode
compute stata-mp -b do file_path

Both options launch Stata’s console on a compute node with four logical CPUs and 8GB of RAM, for a duration of 24 hours.

Stata GUI

Launch Stata with GUI on a compute node is slightly more complicated, requiring two lines of command:

# The new line is necessary
compute
xstata-mp

You can request more logical CPUs with the -c option, more memory with the --mem option and more time with the t option. For example, to request 16 CPUs and 40G of memory for three days:

compute -c 16 --mem=40G -t 3-0 stata-mp

See compute for a full list of options, or srun and sbatch for maximum flexibility.

Running on a Compute Node - Long Duration

All of the above options will terminate Stata when you close the terminal. There are two options if you do not want this to happen:

  • Use sbatch. First create a script, hypothetically named my_job.sh:

    #!/bin/bash
    #SBATCH --job-name=my_sid
    #SBATCH --ntasks=1
    #SBATCH --cpus-per-task=2
    stata-mp -b do file_path
    

    The #SBATCH comments specify various options. In this example, we are requesting two logical CPUs for a single task.

    Now submit your job:

    sbatch my_job.sh
    

    Subject to available resources, your code will run even if you disconnect from the cluster. The maximum job duration is 5 days.

  • Use linux screen. Do note that we reserve the right to terminate processes that have been running for more than 24 hours on the login nodes.