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

Max worker issue #3

Open
jenna-tomkinson opened this issue Aug 30, 2024 · 2 comments
Open

Max worker issue #3

jenna-tomkinson opened this issue Aug 30, 2024 · 2 comments

Comments

@jenna-tomkinson
Copy link
Member

Consider finding the max between multiprocessing.cpu_count() and num_processes to help avoid this exception case. If there are fewer CPU than commands the pool will handle the start and finish of each one.

Originally posted by @d33bs in #1 (comment)

@jenna-tomkinson
Copy link
Member Author

This issue references the function only calling the exact number of workers as the command or processes as determined by the dictionary (e.g., 3 plates in the dictionary means 3 workers needed).

Per CellProfiler, it is default to run one job at a time, but states:

If you're willing to script some ways to scatter the CellProfiler jobs, though, or don't mind running one job at a time, headless processing can be incredibly helpful!

This potentially opens the door for future work.

@d33bs
Copy link
Member

d33bs commented Aug 30, 2024

Adding comments from my reply in #1:

But if someone has 3 commands to run based on their dictionary, for example, why would they need to start more than that number of processes?

Yes, great point! This would I think be an edge case that could be covered by another if-condition.

My initial comments mostly pertained to times where someone would want to only provide a limited number of processors (they may have other things running). For example, if there are 5 CP runs to accomplish but the person wants to only use 3 cores to accomplish that work (each additional job beyond 3 would begin as the earlier submitted ones complete).

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

No branches or pull requests

2 participants