Switch from Multi Threading to Multi Processing#206
Draft
r-sharp wants to merge 16 commits intoMetOffice:mainfrom
Draft
Switch from Multi Threading to Multi Processing#206r-sharp wants to merge 16 commits intoMetOffice:mainfrom
r-sharp wants to merge 16 commits intoMetOffice:mainfrom
Conversation
…es which git / VS Code are marking as in conflict. Annoyingly, this seems to have introduced a bug as well.
…esolving clashes. But looking at it, I really can't fathom out 'how'
…n't edited this file...
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.
PR Summary
Sci/Tech Reviewer:
Code Reviewer:
Some performance tests on the original code, used to scan a full UM clone, revealed that altering the maximum number of workers anywhere between 1 and 64 gave no noticaable performance improvement whatsoever. Whils only a little imrpvement at low thread counts it was a little surprising to see nothing whatsoever.
However, there had always been an intention to switch to using multiple processes, as the tasks of opening files and scanning the contents was likely to work well with completely independant tasks on different processes.
Initial tests of this change have demonstrated timing improvements on the VDI when using 2 processors :
Where the numbers in the file names indicate the maximum number of workers specified at runtime.
Also when submitted to 16 processors on SPICE using
salloc --time=30 --mem=8G --ntasks=16 --x11 --bellreasonable scaling occurs up to the 16 processors requested.Where the numbers in the file names indicate the maximum number of workers specified at runtime.
All timings were simply gathered with bash buit-in
timefunction.Based on these results, it is also presumed that setting the default maximum number of workers to '2', anticipating use on the VDI is probably best. Automated use, such as within rose-stem or as a GitHub action can specify other values more suitable for those environments.
Purely by virtue of being 'built' on top of those changes.
Code Quality Checklist
Testing
Run on command line on both VDI and SPICE to test a full clone of the UM and also a UM branch.
R3esults were as expected, performance on 2 or more processors was improved.
Security Considerations
AI Assistance and Attribution
AI has been used for line completion. Curiously, quite a bit of what it suggested (Using multiprocessing.Pool instead of ThreadPoolExecuter) was taken back out to make the code easier to follow and didn't affect performance.
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review