gvegayon/parallel

Can not set Stata directory on Mac

pgseye opened this issue · 5 comments

I'm using Stata 16.1 on a mac and can't seem to set the Stata directory correctly when using the initialize command:

parallel initialize 8, statapath("/Applications/Stata 16/StataSE.app")

gives:

N Child processes: 8
Can not set Stata directory, try using -statapath()- option
r(601);

That is the correct path on my machine, so I'm not sure why the error.

Thanks

P.S. I installed Parallel from github:

. which parallel
~/Library/Application Support/Stata/ado/plus/p/parallel.ado
*! version 1.20.0 19mar2019
*! PARALLEL: Stata module for parallel computing
*! by George G. Vega [cre,aut], Brian Quistorff [aut]
*!
*! Project website:
*! https://github.com/gvegayon/parallel
*! Bug reports:
*! https://github.com/gvegayon/parallel/issues

Currently you have to point inside the package with something like /Applications/Stata 16/StataSE.app/Contents/MacOS/stata64-se (or remove 64 if that's not the right version). Check if that works.

We should improve the docs or handle this automatically.

Thank you.

When I now try this (removing the double quotes in the filepath) I at least get one step further.

. parallel initialize 8, statapath(/Applications/Stata 16/StataSE.app/Contents/MacOS/stata-se)
N Child processes: 8
Stata dir: /Applications/Stata 16/StataSE.app/Contents/MacOS/stata-se

If I then try and use parallel with a command:

. set obs 1000
number of observations (_N) was 0, now 1,000
gen d1 = rnormal(10,5)
. gen p1 = rnormal(1,2)
. gen p2 = rnormal(5,3)
.
. parallel bs, reps(100): reg d1 p1 p2
--------------------------------------------------------------------------------
Parallel Computing with Stata
Child processes: 8
pll_id : w1hj4bi911
Running at : /Users/paulsanfilippo/Downloads/zzTest
Randtype : datetime

cannot find Stata directory
cannot find Stata directory
cannot find Stata directory
cannot find Stata directory
cannot find Stata directory
cannot find Stata directory
cannot find Stata directory
cannot find Stata directory
Waiting for the child processes to finish...
child process 0001 Exited with error -700- while running the command/dofile (view log)...
child process 0002 Exited with error -700- while running the command/dofile (view log)...
child process 0003 Exited with error -700- while running the command/dofile (view log)...
child process 0004 Exited with error -700- while running the command/dofile (view log)...
child process 0005 Exited with error -700- while running the command/dofile (view log)...
child process 0006 Exited with error -700- while running the command/dofile (view log)...
child process 0007 Exited with error -700- while running the command/dofile (view log)...
child process 0008 Exited with error -700- while running the command/dofile (view log)...
--------------------------------------------------------------------------------
Enter -parallel printlog #- to checkout logfiles.
--------------------------------------------------------------------------------
8 child processes encountered errors. Throwing last error.
r(700);

I don't know what the difference between stata-se and StataSE, but if I alternatively specify:

. parallel initialize 8, statapath(/Applications/Stata 16/StataSE.app/Contents/MacOS/StataSE)
N Child processes: 8
Stata dir: /Applications/Stata 16/StataSE.app/Contents/MacOS/StataSE

Parallel seems to run and 8 instances of Stata appear to open. The following files are created in the specified directory (see attached screengrab), but Stata just seems to hang and doesn't progress (perhaps I am not giving it enough time to complete?) I then need to close all instances and restart Stata.

screenshot_200

Since the log files are of size 0, it seems that nothing is actually happening. Perhaps a change in the way that batch jobs are processed in stata16? Need to check more on that.

Ok thanks - I'll keep an eye out. I'm keen to be able to use this as can't afford MP versions.

I have solved this problem by myself. The Stata dir cannot contain spaces between "Stata" and "16".You should correct your Stata dir to "/Applications/Stata16/StataSE.app/Contents/MacOS/stata-se",the right dir is "Stata16" not "Stata 16",Then it will run successfully.