Stata/Example

From ScientificComputing
Revision as of 07:16, 28 October 2016 by Sfux (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

As an example for a Stata job, we are calculating the Euler-Mascheroni constant.

[leonhard@euler02 ~]$ cat test.do 
di %12.10f -digamma(1) 
[leonhard@euler02 ~]$ module load stata/13
[leonhard@euler02 ~]$ bsub -n 1 -W 0:10 -R "rusage[mem=50]" "stata -b do test.do"
Stata job.
Job <30754160> is submitted to queue <normal.4h>.
[leonhard@euler02 ~]$ bjobs
JOBID      USER     STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
30754160   leonhard PEND  normal.4h  euler02                 *o test.do Oct 27 16:31
[leonhard@euler02 ~]$ bjobs
JOBID      USER     STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
30754160   leonhard RUN   normal.4h  euler02     e1245       *o test.do Oct 27 16:31
[leonhard@euler02 ~]$ bjobs
No unfinished job found
[leonhard@euler02 ~]$ grep -A1 digamma test.log 
. di %12.10f -digamma(1)
0.5772156649

Stata does automatically create a log file with the same basename as the input file.