-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to macos multiprocessing spawn and context issues #2076
Conversation
0468010
to
262c17f
Compare
package, to avoid any explicit handling from the end user side
262c17f
to
1ecf475
Compare
7c8bab6
to
ba35149
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works on my mac!
This seems to make htex work for me on:
|
@@ -33,6 +33,10 @@ | |||
|
|||
from parsl.dataflow.dflow import DataFlowKernel, DataFlowKernelLoader | |||
|
|||
import multiprocessing | |||
if platform.system() == 'Darwin': | |||
multiprocessing.set_start_method('fork', force=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yongyanrao I don't understand why this needs to be set globally. I'm concerned about how it interacts with other libraries which are equally entitled to set the global multiprocessing start method.
As discussed in Issue#2070, htex did not work on macos under
python3.8
orpython3.9
. There are two folds for the reason.spawn
becomes the default for process creation frompython3.8
, which does not handle resources properly.fork
method, it does not get the context of the main thread properly. We need to explicitly do that.This PR tries to solve the issues. We can use the following code to test on macos. It should work with the installation from
yrao2-macos-fork
branch, and it should not work with the installation frommaster
.