-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Currently the multiprocessing backend uses 'fork' rather than 'spawn' to launch processes.
This is helpful in that it carries over state related to which modules are imported, for example.
But, it is harmful in that threading state is not carried over. This is particularly problematic for OpenMP which maintains a thread-pool in the background. In the CI tests, executing the tests in some orders may lead to hangs due to pynbody's use of OpenMP. In normal runs, this doesn't occur because no OpenMP routines are called before the forks take place -- but still, there is potential for significant issues affect real use of tangos.
Probably the best way to resolve this is to move to 'spawn', rather than 'fork', but this will require some work to carry over the required state into the child processes.