-
Notifications
You must be signed in to change notification settings - Fork 263
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
Parallelisation hangs #125
Comments
Yup, also hangs here. Only for standard strategies, cheaters and basic go through fine. I am not versed well enough with the code in #122 to tell what the matter is. |
Now I see you are using |
let me tag @meatballs just in case he hasn't seen this... |
I think the problem here, as @langner says, is a deadlocked multiprocessing queue. Specifically, it's the 'done' queue. I think the problem has been there all along. If you look at lines 92-95 of tournament.py:
I had to add a timeout to deal with the occasional hang on my machine. That timeout simply causes the process to terminate early and, although it stops the hang, it means the results are mostly an empty matrix. Increasing the the timeout to something like 60s hides the problem completely, but doesn't solve it! I think the combination of the deterministic cache being passed by #122, the extra strategies added by #121 and the removal of the timeout in #122 have combined to bring the problem to a head. The crux of the problem is that multiprocessing can't cope with the size of output queue that we are creating. Even setting the queue's maxsize property to 0 (supposedly infinite) doesn't solve the problem. It might be worth looking at using threading instead of multiprocessing. |
Another potential solution might be to kick off a daemon process first which reads from the done queue and appends to the payoffs list. |
Seems I've fallen for a well known gotcha: https://docs.python.org/2/library/multiprocessing.html#all-platforms
|
I think I have this fixed. Branch 125 in my repo. I'm still testing it out. |
Works fine for me! |
A relevant SO thread: http://stackoverflow.com/questions/21641887/python-multiprocessing-process-hangs-on-join-for-large-queue (there are also others) |
Fixed by #127 |
As far as I can tell this is something to do with #122 but I have no idea.
It hangs at this stage:
The text was updated successfully, but these errors were encountered: