-
Notifications
You must be signed in to change notification settings - Fork 430
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
Parallelization of emcee is working not as fast as expected #447
Comments
This could have something to do with the communication overhead on your specific system or the load on your CPU from other process. Another option is that this has something to do with how Jupyter handles parallelization. One experiment to try would be running this from a script instead of from Jupyter and monitoring the CPU usage during the run. Hope this helps! |
Thanks so much for the reply! I wrapped the code into a (Note that the final run was much faster, at 26 iterations/s) So instead of seeing just the output from one serial run and one parallel run, I got ten different MCMC run outputs. And yes my CPU cores were at full speed during the parallel run: |
Good discovery! I think that if you now wrap your script as follows: if __name__ == "__main__":
# The rest of the script goes here... Then it'll only run everything once! This is probably because |
Thanks! The result I got in my previous reply was actually exactly the effect of adding If I don't add anything, I got an error pop out:
|
General information:
Problem description:
Expected behavior:
Hi all,
I was following this example for Parallelization using Multiprocessing. From the documentation, the code should run 3.3 times faster in parallel, compared to running in serial, given that we have a 4-core CPU.
Actual behavior:
This didn't happen on my side. When using 8 cores, I only obtained a 1.1x performance boost.
Minimal example:
Please see the attachment for the notebook I was using.
emceeTest.zip
The text was updated successfully, but these errors were encountered: