[[PageOutline]] = STATA = STATA is a general-purpose statistical software package created in 1985 by [http://www.stata.com/ StataCorp] '''STATA on cypress is licensed to Freeman School of Business.''' == Run with GUI interactively == You must have X-window and ssh with X-window forwarding. See [[cypress/SshUsage#TunnelingXWindowsSessionviaSSH]]. GUI needs faster network connection. It is not good idea to do this at outside of Campus. Start an interactive session, {{{#!bash [fuji@cypress2 ~]$ idev Requesting 1 node(s) task(s) to normal queue of defq partition 1 task(s)/node, 20 cpu(s)/task, 2 MIC device(s)/node Time: 0 (hr) 60 (min). Submitted batch job 47343 JOBID=47343 begin on cypress01-063 --> Creating interactive terminal session (login) on node cypress01-063. --> You have 0 (hr) 60 (min). Last login: Mon Jun 8 20:18:50 2015 from cypress1.cm.cluster }}} The default `idev` session reserve a node for '''one hour'''. If you want to work on for longer time, use `-t` option. See [[cypress/using#SubmittingInteractiveJobs]]. Load the module {{{#!bash [fuji@cypress01-063 ~]$ module load stata }}} Run STATA with GUI, {{{#!bash [fuji@cypress01-063 ~]$ xstata & }}} GUI window will show up. [[Image(xstata.png, 50%)]] '''Note that when `idev` session expires, your STATA session will be killed and all unsaved data will be lost. ''' == Run on commandline interactively == Start an interactive session, {{{#!bash [fuji@cypress2 ~]$ idev Requesting 1 node(s) task(s) to normal queue of defq partition 1 task(s)/node, 20 cpu(s)/task, 2 MIC device(s)/node Time: 0 (hr) 60 (min). Submitted batch job 47343 JOBID=47343 begin on cypress01-063 --> Creating interactive terminal session (login) on node cypress01-063. --> You have 0 (hr) 60 (min). Last login: Mon Jun 8 20:18:50 2015 from cypress1.cm.cluster }}} The default `idev` session reserve a node for '''one hour'''. If you want to work on for longer time, use `-t` option. See [[cypress/using#SubmittingInteractiveJobs]]. Load the module {{{#!bash [fuji@cypress01-063 ~]$ module load stata }}} Run STATA on commandline, {{{#!bash [fuji@cypress01-063 ~]$ stata ___ ____ ____ ____ ____ (R) /__ / ____/ / ____/ ___/ / /___/ / /___/ 14.1 Copyright 1985-2015 StataCorp LP Statistics/Data Analysis StataCorp 4905 Lakeway Drive College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) Single-user Stata network license expires 29 Feb 2016: Serial number: 501409275699 Licensed to: Freeman School of Business Tulane University Notes: 1. Unicode is supported; see help unicode_advice. . }}} Use `exit` command to finalize STATA. '''Note that when `idev` session expires, your STATA session will be killed and all unsaved data will be lost. ''' == Run STATA in batch mode == First, you should become familiar with do-files. Make sure your do-files work correctly. It is recommended to test your do-files on local machine or on an interactive session with a small data for a short time. Suppose we have `hello.do` file that contains: {{{#!bash [fuji@cypress2 ~]$ cat hello.do clear display "Hello, STATA!!!" exit }}} SLURM script will be: {{{#!bash #!/bin/bash #SBATCH --partition=defq # Partition #SBATCH --qos=normal # Quality of Service #SBATCH --job-name=STATA # Job Name #SBATCH --time=24:00:00 # WallTime #SBATCH --nodes=1 # Number of Nodes #SBATCH --ntasks-per-node=1 # Number of tasks (MPI presseces) #SBATCH --cpus-per-task=2 # Number of processors per task OpenMP threads() #SBATCH --gres=mic:0 # Number of Co-Processors module load stata stata -b do hello }}} Submit a job {{{#!bash [fuji@cypress2 ~]$ sbatch slurmscript }}} ''''slurmscript'''' is the file name of above SLURM script. The results will be stored in ''''hello.log''''.