-
Notifications
You must be signed in to change notification settings - Fork 113
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
Multiprocessing behavior differs across Ubuntu/MacOS #2842
Comments
@anilbey : could you check this #2094 (comment) ? Just from the title, without looking into details, I wonder if it's multiprocessing module itself and not neuron. |
Yes it is the same issue. Thanks for pointing to it. It is indeed the difference of the multiprocessing module between the platforms. However, this subtle but critical implementation difference in the behavior is very difficult for the users of NEURON to spot. When not considered, the simulation results become corrupted. Can we not make a decision between the |
thanks for confirming, @anilbey! As neuron is loaded into Python as a C/C++ library and has a global state, I don't have clarity into how such a thing could be ("easily") achieved on the NEURON side. Tagging @ferdonline and @1uc if they have any thoughts/ideas. |
I don't immediately see a quick fix. In a library, e.g. bluepyopt, you can use Likely something close to:
|
Thanks for the information. And also the |
I guess there is no (easy) change to do on the neuron side. So I will close this ticket. |
I'm reopening because I see two easy ways of addressing this: Option 1: We could make sure our documentation points to the multiprocessing documentation section about this and just tell everyone to always call mp.set_start_method... and we could make sure all of our examples do so (currently: they do not). Option 2: NEURON could call mp.set_start_method('spawn') on import. I think option 2 is a bad idea because (1) it changes the behavior of existing code and (2) I don't think we should be in the business of changing default behaviors in other packages. That's likely to lead to nasty surprises for uses and confusion whenever someone looks at the documentation. (It would have to be |
Agree, Option 1 seems reasonable. I don't see examples of |
Context
Overview of the issue
Neuron global parameters are passed to sub processes on Ubuntu.
Neuron global parameters are not passed to sub processes on MacOS.
Expected result/behavior
The behavior should not differ between operating systems.
NEURON setup
NEURON 8.2.4
Minimal working example - MWE
MWE that can be used for reproducing the issue and testing. A couple of examples:
Prints the following on Ubuntu
Prints this on MacOS
The issue applies to all global parameters.
The text was updated successfully, but these errors were encountered: