calculated chunksizes greater than zero#762
Merged
emanuel-schmid merged 1 commit intodevelopfrom Aug 4, 2023
Merged
Conversation
chahank
reviewed
Aug 3, 2023
| if pool: | ||
| LOGGER.info('Using %s CPUs.', pool.ncpus) | ||
| chunksize = min(unc_data.n_samples // pool.ncpus, 100) | ||
| chunksize = max(min(unc_data.n_samples // pool.ncpus, 100), 1) |
Member
There was a problem hiding this comment.
I am currently rewriting the parallel computing for the unsequa module as it was not working properly. So these changes are probably not needed. I will update at the end of today.
Member
Member
There was a problem hiding this comment.
Actually, since #763 might take some time to review, we can also merge this pull request first.
13 tasks
chahank
reviewed
Aug 3, 2023
| if pool: | ||
| LOGGER.info('Using %s CPUs.', pool.ncpus) | ||
| chunksize = min(unc_sample.n_samples // pool.ncpus, 100) | ||
| chunksize = max(min(unc_sample.n_samples // pool.ncpus, 100), 1) |
Member
There was a problem hiding this comment.
Suggested change
| chunksize = max(min(unc_sample.n_samples // pool.ncpus, 100), 1) | |
| chunksize = min(unc_sample.n_samples // pool.ncpus + 1, 100) |
I think this is more elegant.
Collaborator
Author
There was a problem hiding this comment.
Hm. Maybe. But when you have 6 samples and 3 cpus the chunksize is 3 where 2 would fit better- right?
Doesn't matter I guess, but the elegance comes at a price of reduced readability imho.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this PR:
This PR fixes #761
PR Author Checklist
develop)PR Reviewer Checklist