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

Add multiprocessing capability to make_image.py #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jadball
Copy link

@jadball jadball commented Apr 25, 2021

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 uses poolcontext from here to run the function on multiple processes.

"""
Multithreaded version of self.make_images
"""
from multiprocessing import Pool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiprocessing was imported above?

Copy link
Member

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!!!

@jonwright
Copy link
Member

Hi @jadball - do you think this is ready for merging ?
The pull request seems to be waiting a long time but I am not well qualified to validate it.
Are you seeing this @osholm ?

@osholm
Copy link

osholm commented Apr 11, 2022

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 🙏

Copy link

@osholm osholm left a 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.

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