gvegayon / parallel

PARALLEL: Stata module for parallel computing
https://rawgit.com/gvegayon/parallel/master/ado/parallel.html
MIT License
117 stars 26 forks source link

Allow parent Stata process to terminate child Stata processes #38

Closed bquistorff closed 8 years ago

bquistorff commented 8 years ago

One way that we can make parallelizing existing code easier is by having break work like it does in the normal setup. I think we should allow the parent process to forcefully terminate child processes without having users add parallel break commands to their code (they might not even be able to find locations where they can make it responsive). We would have to keep track of the child process IDs, but there's already some code to do this.

In fact I think this should be the default response to a user break, but we can deal with that once the feature is implemented. The details will differ across platforms so we might want to keep around the existing system as a fall-back.

gvegayon commented 8 years ago

That is what I wanted to accomplish/had in mind. Do you have code for this?

George G. Vega Yon +1 (626) 381 8171 http://www.its.caltech.edu/~gvegayon/

On Sat, May 7, 2016 at 9:52 PM, Brian Quistorff notifications@github.com wrote:

One way that we can make parallelizing existing code easier is by having break work like it does in the normal setup. I think we should allow the parent process to forcefully terminate child processes without having users add parallel break commands to their code (they might not even be able to find locations where they can make it responsive). We would have to keep track of the child process IDs, but there's already some code to do this.

In fact I think this should be the default response to a user break, but we can deal with that once the feature is implemented. The details will differ across platforms so we might want to keep around the existing system as a fall-back.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/gvegayon/parallel/issues/38

bquistorff commented 8 years ago

The winproc branch does it.

gvegayon commented 8 years ago

So is it working for windows only? Or did you implemented it for Win/OSX/Unix?

bquistorff commented 8 years ago

That branch only has it working for Windows. We may be able to do the same stuff in the other OSes without plugins.

gvegayon commented 8 years ago

I think I got it work (partially) here: https://github.com/gvegayon/parallel/commit/eb9788d40a17ce9f16040dd6e75a7b548bd78380 now a file called __pll[parallelid]_pids is generated on OS != Windows. Will include changes after merging with your new branch.

bquistorff commented 8 years ago

Great! I've expanded upon it so that mata reads in the PIDS. It should be ready to go once we merge the winproc branch.

bquistorff commented 8 years ago

Done on c6bb22f.