Multiprocessing with Pool
won't work on Mac with M1 chip
#87
Labels
enhancement
New feature or request
Pool
won't work on Mac with M1 chip
#87
Hi @nespinoza,
If I try to use
nthreads
option injuliet.fit
for using multiprocessing withdynesty
, I would get the following error:At first, I thought it is the multiprocessing implemented in
dynesty
that is causing this issue. However, upon digging into the details I found that this has rather do with how multiprocessing is implemented injuliet
: the culprit is line 1723. A proper way to do this (according to this StackOverflow answer) is following:(instead of directly calling
Pool
frommultiprocessing
, one should call it frommultiprocessing.get_context("fork").Pool
). Making this change would solve the above issue.However, I am not opening a pull request since it looks like this issue is specific to Mac users with an M1 chip. And I have no idea how implementing this would affect other systems which don't have M1. Also since this is the issue with
Pool
implementation, it should also affectemcee
andzeus
samplers which also usePool
for multiprocessing (though I haven't tested for samplers other thandynesty
).Cheers,
Jayshil
The text was updated successfully, but these errors were encountered: