Reduced the number of processes used by default when testing.#2888
Merged
DPeterK merged 1 commit intoSciTools:masterfrom Oct 31, 2017
Merged
Reduced the number of processes used by default when testing.#2888DPeterK merged 1 commit intoSciTools:masterfrom
DPeterK merged 1 commit intoSciTools:masterfrom
Conversation
cd963cd to
9253f2e
Compare
Member
Author
|
I don't think it is a fluke that there are not TimeoutExceptions here... 🎉 |
| self.num_processors = multiprocessing.cpu_count() - 1 | ||
| # Choose a magic number that works reasonably well for the default | ||
| # number of processes. | ||
| self.num_processors = (multiprocessing.cpu_count() + 1) // 4 + 1 |
Member
There was a problem hiding this comment.
@pelson What's the logic behind this lovely piece of maths?
Member
Author
There was a problem hiding this comment.
It's a magic number... there is no solid/defensible logic other than:
- It should be at least one
- It shouldn't fill all CPUs if there are lots of them
😄
Closed
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.
Given we are far more parallelised now in iris (thanks to our new-found dask abilities) we don't need to use as many processes in parallel when testing. I didn't do any particularly sophisticated analysis of the "sweet spot", but leave that as an exercise for the interested reader...
In summary: we don't need to flood the machine with processes, and anything is better than what we currently do...
On Travis (where the numbers are extremely erratic), using 8 processes appears to take a similar amount of time to using 3. On my laptop (4 core), using 1 process takes about the same amount of time as 3.