Release: auto-parallel ensembles + remaining parallelization#127
Merged
Conversation
* perf: parallelize remaining NEX-GDDP ensembles + add --workers flags The three remaining per-model ensemble loops ran models serially. Each per-model run is an independent, I/O-bound GEE fetch, so run them concurrently via ThreadPoolExecutor, with deterministic input-model ordering restored afterward and per-model errors isolated: - climate_statistics/ensemble_statistics.py (analyze_ensemble_nex_gddp) - compare_periods/ensemble_periods.py (ensemble_compare) - season_analysis/ensemble.py (run_ensemble) Each gains a max_workers param (default 8) and a --workers CLI flag (use 1 to disable). statistics.py already span-fetches the full period once per model, so this targets the across-models dimension. Also reconfigure stdout/stderr to UTF-8 in all three CLIs: a '->' arrow printed by statistics.py crashed cp1252 Windows consoles with UnicodeEncodeError (pre-existing; surfaced once errors were caught per-model). Verified parallel JSON output is identical to serial (only the analysis_date timestamp differs); ~1.7x on a 4-model x 5-year run. * perf: auto-scale ensemble workers by default (no --workers flag needed) Change the default worker count across all five ensemble CLIs from a fixed 8 to 'auto': max_workers<=0 resolves to one worker per model/job, capped at 16. Running the original commands (without --workers) now parallelizes maximally out of the box. --workers N still overrides; --workers 1 disables parallelism. Applies to ensemble_hazards, long_term_climatology, ensemble_statistics, ensemble_periods, and season_analysis/ensemble.
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.
Summary
Promotes #126 from staging to main: parallelizes the three remaining serial ensembles (ensemble_statistics, ensemble_periods, season_analysis/ensemble), auto-scales worker count by default across all five ensemble CLIs (bare commands parallelize with no --workers flag; one per model capped at 16), and adds the UTF-8 console fix to the three CLIs that lacked it.