Changes between Initial Version and Version 1 of cypress/STATA


Ignore:
Timestamp:
03/23/20 09:47:11 (5 years ago)
Author:
fuji
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/STATA

    v1 v1  
     1[[PageOutline]]
     2= STATA =
     3STATA is a general-purpose statistical software package created in 1985 by [http://www.stata.com/ StataCorp]
     4
     5'''STATA on cypress is licensed to Freeman School of Business.'''
     6
     7== Run with GUI interactively ==
     8You must have X-window and ssh with X-window forwarding. See [[cypress/SshUsage#TunnelingXWindowsSessionviaSSH]].
     9
     10GUI needs faster network connection. It is not good idea to do this at outside of Campus.
     11
     12Start an interactive session,
     13{{{#!bash
     14[fuji@cypress2 ~]$ idev
     15Requesting 1 node(s)  task(s) to normal queue of defq partition
     161 task(s)/node, 20 cpu(s)/task, 2 MIC device(s)/node
     17Time: 0 (hr) 60 (min).
     18Submitted batch job 47343
     19JOBID=47343 begin on cypress01-063
     20--> Creating interactive terminal session (login) on node cypress01-063.
     21--> You have 0 (hr) 60 (min).
     22Last login: Mon Jun  8 20:18:50 2015 from cypress1.cm.cluster
     23}}}
     24The 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]].
     25
     26Load the module
     27{{{#!bash
     28[fuji@cypress01-063 ~]$ module load stata
     29}}}
     30
     31Run STATA with GUI,
     32{{{#!bash
     33[fuji@cypress01-063 ~]$ xstata &
     34}}}
     35
     36GUI window will show up.
     37
     38[[Image(xstata.png, 50%)]]
     39
     40'''Note that when `idev` session expires, your STATA session will be killed and all unsaved data will be lost. '''
     41
     42== Run on commandline interactively ==
     43
     44Start an interactive session,
     45{{{#!bash
     46[fuji@cypress2 ~]$ idev
     47Requesting 1 node(s)  task(s) to normal queue of defq partition
     481 task(s)/node, 20 cpu(s)/task, 2 MIC device(s)/node
     49Time: 0 (hr) 60 (min).
     50Submitted batch job 47343
     51JOBID=47343 begin on cypress01-063
     52--> Creating interactive terminal session (login) on node cypress01-063.
     53--> You have 0 (hr) 60 (min).
     54Last login: Mon Jun  8 20:18:50 2015 from cypress1.cm.cluster
     55}}}
     56The 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]].
     57
     58Load the module
     59{{{#!bash
     60[fuji@cypress01-063 ~]$ module load stata
     61}}}
     62
     63Run STATA on commandline,
     64{{{#!bash
     65[fuji@cypress01-063 ~]$ stata
     66  ___  ____  ____  ____  ____ (R)
     67 /__    /   ____/   /   ____/
     68___/   /   /___/   /   /___/   14.1   Copyright 1985-2015 StataCorp LP
     69  Statistics/Data Analysis            StataCorp
     70                                      4905 Lakeway Drive
     71                                      College Station, Texas 77845 USA
     72                                      800-STATA-PC        http://www.stata.com
     73                                      979-696-4600        stata@stata.com
     74                                      979-696-4601 (fax)
     75
     76Single-user Stata network license expires 29 Feb 2016:
     77       Serial number:  501409275699
     78         Licensed to:  Freeman School of Business
     79                       Tulane University
     80
     81Notes:
     82      1.  Unicode is supported; see help unicode_advice.
     83
     84.
     85}}}
     86
     87Use `exit` command to finalize STATA.
     88
     89'''Note that when `idev` session expires, your STATA session will be killed and all unsaved data will be lost. '''
     90
     91== Run STATA in batch mode ==
     92
     93First, you should become familiar with do-files.
     94
     95Make 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.
     96
     97Suppose we have `hello.do` file that contains:
     98{{{#!bash
     99[fuji@cypress2 ~]$ cat hello.do
     100clear
     101display "Hello, STATA!!!"
     102exit
     103}}}
     104
     105SLURM script will be:
     106{{{#!bash
     107#!/bin/bash
     108#SBATCH --partition=defq        # Partition
     109#SBATCH --qos=normal            # Quality of Service
     110#SBATCH --job-name=STATA        # Job Name
     111#SBATCH --time=24:00:00         # WallTime
     112#SBATCH --nodes=1               # Number of Nodes
     113#SBATCH --ntasks-per-node=1     # Number of tasks (MPI presseces)
     114#SBATCH --cpus-per-task=2       # Number of processors per task OpenMP threads()
     115#SBATCH --gres=mic:0            # Number of Co-Processors
     116
     117module load stata
     118
     119stata -b do hello
     120}}}
     121
     122Submit a job
     123{{{#!bash
     124[fuji@cypress2 ~]$ sbatch slurmscript
     125}}}
     126
     127''''slurmscript'''' is the file name of above SLURM script. The results will be stored in ''''hello.log''''.