Skip to content

Inconsistency between macos and linux for neuron under multiprocessing #2100

Answered by pramodk
AurelienJaquier asked this question in Q&A
Discussion options

You must be logged in to vote

thanks @AurelienJaquier for the report with a reproducer!

I believe this is related to the differences in multi-processing module itself on Linux vs macOS:

  • fork mode (default for Unix): all resources of the parent are inherited by the child process
  • spawn mode (default for MacOS): child process will only inherit those resources necessary to run the process objects run() method

Fork is the default on Linux, while Windows and MacOS use spawn by default.

If you explicitly set the start method (e.g. multiprocessing.set_start_method('fork')) then you should see the same behaviour.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by alexsavulescu
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
4 participants
Converted from issue

This discussion was converted from issue #2094 on November 23, 2022 08:44.