Skip to content
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

Fixes multithreading problem from ipython kernel #287

Merged
merged 2 commits into from
May 15, 2019

Conversation

llorracc
Copy link
Collaborator

See if this works on Windows

@llorracc llorracc requested a review from mnwhite May 15, 2019 19:33
Somehow the non-delinted version of HARK.core (from before PyCon) ended up in this branch.  This commit simply reverts it.
@mnwhite
Copy link
Contributor

mnwhite commented May 15, 2019

Chris and I discovered that HARK.parallel.multithreadCommands did not work on some of our project code... but only in some Python environments. On Windows, I could only generate this error on Python 3, but everything worked correctly on Python 2. On Mac and/or Linux, Chris found that the error came up when running Python in a terminal, but not when running Spyder; he also tested various web servers.

After some digging, Chris found that recent versions of joblib (which multithreadCommands uses) changed the default backend of joblib from multiprocessing to loky. Apparently something in loky does not play nicely with our class structure, as it can't (de)serialize at least some AgentType subclasses.

This branch fixes this by simply changing the backend argument on the call to Parallel. It also fixes one typo in a comment.

@mnwhite mnwhite merged commit 3ed97e4 into master May 15, 2019
@llorracc
Copy link
Collaborator Author

llorracc commented May 16, 2019

Release notes: Fix multithreading problems by using Parallels(backend='multiprocessing')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants