Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: problem with sleep / winexec / shell


From   "David Elliott" <dcelliott@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: problem with sleep / winexec / shell
Date   Fri, 26 May 2006 14:35:49 -0300

I suspect that Stata is "pausing" by running an arbitrary loop that
checks sytem time.  when I issue -sleep 10000- I get 10 seconds of
~50% CPU utilization by Stata.  This, of course, is inefficient,
especially if the winexeced program takes a lot of CPU itself.

What you might consider doing is turning the problem inside out.

You basically have a program that goes:
1) Part A
2) winexec external program and create file
3) Part B with requiring the new file

Consider running Stata from a shell using commands in this form:.

Stata /e do PartA.do (do the first part)
extpgm.exe (run the program that creates the file)
Stata /e do PartB

For windows from NT onward you could put this together with:
[path]stata.exe /do PartA.do && [path]extpgm.exe && [path]stata.exe
/do PartB.do and run it as a command script. the && combine the
commands and run them in sequence.

For reference:
http://www.stata.com/support/faqs/win/batch.html
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index