HPC Grid Tutorial: How to Run STATA

Follow these steps to run STATA on the Grid.

How to Run STATA - Interactive

You will need to download an X Window System. If you are using Unix, Linux, or OSX you can use X11. Follow the steps in the X11 Tutorial here, then continue at step four below.

For Windows users, follow the Xming Tutorial here.

1. Launch Xming.

2. Log on to the Grid.

3. Submit an interactive job: srun -q debug -t 10:0 --mem=10G --pty bash


4. Type: module load stata


5. Type: xstata


6. You are now running STATA.


How to Run STATA Non-Interactive

1. Log in to the Grid.

2. Create a job script myStataJob.sh similar to:


# Job name

#SBATCH --job-name Stata

# Submit to the Primary QoS

#SBATCH -q primary

# Request one node


# Total number of cores

#SBATCH -n 8

# Request memory

#SBATCH --mem=5G

# Mail when the job begins, ends, fails, requeues

#SBATCH --mail-type=ALL

# Where to send email alerts

#SBATCH --mail-user=xxyyyy@wayne.edu

# Create an output file that will be output_<jobid>.out

#SBATCH -o output_%j.out

# Create an error file that will be error_<jobid>.out

#SBATCH -e errors_%j.err

# Set maximum time limit

#SBATCH -t 1:0:0

module load stata

stata myJobOutput.txt



Press the Escape key and type :wq to save and quit.

4. To submit the job type: sbatch myStataJob.sh

Once the job is submitted you can check to see what node it is running on with the following command: qme