• Skip to Main Content
  • Go to the Website's Home
  • Go to Website News
  • Go to About this site
  • Skip to Audience Navigation Menu
  • About
    • Welcome to the College
    • Facts and Figures
    • Message from the Dean
    • Visit Us
    • College Administration
    • News Center
  • Research
    • Research Home
    • Departments
    • Centers & Labs
    • Faculty Directory
    • Opportunities for Undergraduates
  • Admissions
    • Undergraduate Admissions
    • Undergraduate Recruiting
    • Graduate Admissions
  • Academics
    • Departments
    • Undergraduate Programs and Degrees
    • Graduate Programs and Degrees
    • Course Guide/Bulletin
    • Teaching
    • Support Services
  • Departments
    • Aerospace Engineering
    • Atmospheric, Oceanic and Space Sciences
    • Biomedical Engineering
    • Chemical Engineering
    • Civil and Environmental Engineering
    • Electrical Engineering and Computer Science
    • Industrial and Operations Engineering
    • Interdisciplinary Professional Programs
    • Materials Science and Engineering
    • Mechanical Engineering
    • Naval Architecture and Marine Engineering
    • Nuclear Engineering and Radiological Sciences
  • Support the College
    • Giving
    • Involve Yourself
    • Corporate Relationships
  •   

College of Engineering

Center for Advanced Computing

  • Welcome
  • About
  • Getting Started
    • Getting Started
    • Learning About HPC
    • CAC Training Courses
  • Resources
    • Resources
    • Systems
    • Software
    • Storage
    • Networking
    • Visualization
    • Teragrid
  • Academics
  • Contact Us
  • Frequently Asked Questions
Follow Us On Twitter

Contact Information

[Contact] Center for Advanced Computing
College of Engineering
cac-support@umich.edu Link

Center for Advanced Computing  /  Resources  /  Software  /  Stata in Serial

Stata in Serial

To access Stata on the clusters, you must first type: module load stata

A sample PBS script that shows a 1-CPU Stata job looks like this:

#PBS -N stata1
#PBS -q route
#PBS -l nodes=1,walltime=24:00:00
#PBS -M your-email-address
#PBS -m abe
#PBS -W x=GRES:stata+1
#PBS -V
#
echo "I ran on:"
cat $PBS_NODEFILE
#
#cd to your execution directory first
cd /home/your-user-name/your-stata-directory
#
stata -b "do my-stata-file.do"
#

Note that your Stata job will not have any access to a graphical display or terminal, so all of your input must be handled by one .do file (which can call other .do files) and all of your output must be written to either a file or the screen (standard out) by Stata.

The example file my-stata-file.do looks like this:

use http://www.stata-press.com/data/r9/auto
sort foreign
by foreign: summarize price mpg

After creating the sample .do file and the PBS script (as shown above), you can submit your job using the qsub MyPBSscript command (where MyPBSscript is whatever you named your PBS script) and Stata will write the output to my-stata-file.log unless you tell it to do otherwise.

XHTML 1.0 Valid
CSS 2.1 Valid
University of Michigan
  • Home
  • Contact Us
  • Site Map
  • Site Feedback
  • Accessibility
  • Emergency Procedures
  • Jump to top of the page
© 2009 College of Engineering, University of Michigan