Is Pymp supported on MacOS?
When running my parallel code on MacOS, I get the following Error in all but one process:
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
objc[23721]: +[NSNumber initialize] may have been in progress in another thread when fork() was called.
objc[23721]: +[NSNumber initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
I googled this error and found that it should be able to work by setting multiprocessing.set_start_method('spawn') but I tried adding it in various spots in my code as well as modifying the pymp source code to add this line without success. Do you have any recommendations on how to work around this issue.
Hi @susannasiebert,
Yes, PyMP is in principle supported on MacOS and works well! You can run the tests in a cloned PyMP folder using python setup.py test to confirm this: they are quite comprehensive and complete successfully for me on the latest MacOS. I assume that your specific application contains compiled native code that makes assumptions about threads that are violated. If you use PyMP it forks the initial Python process and the code seems to be unhappy about that. Changing the multiprocessing start method does not impact that behavior.