-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add multiprocessing capability to make_image.py #9
base: master
Are you sure you want to change the base?
Conversation
""" | ||
Multithreaded version of self.make_images | ||
""" | ||
from multiprocessing import Pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiprocessing was imported above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that it looks promising to me. A few things to check:
- Can it run under python27 still ?
- Does it work for both fork and spawn based processes (e.g. linux vs mac+windows) ?
- Could there be a simple testcase script that runs some cases in test/ ands checks the results do not change ? For example, the md5 hashes for the created frames match each other.
If you are confident we can merge now and fix a problem if someone finds one
Thanks!!!
Hi @jonwright, I am seeing it now :-) I had a look at @jadball's multiprocessing capability - and from a look at the code it looks fine. Unfortunately, I am quite new to this Github universe and is far from mastering it, so I haven't managed to "checkout" this new version for a test yet. Hopefully I will manage shortly and can thereafter merge @jadball's fork into master. PS: Thanks @jadball for helping out improving the code 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More descriptive error messages are much in line with the original idea of this feedback to the user. So here it comes.
Added multiprocessing capability to make_image.py
Moves everything after
for i in no_frames:
into a separate function (make_one_frame
).As each frame is independent (unless peakshape is 2) the
make_one_frame
function, it usespoolcontext
from here to run the function on multiple processes.