Skip to content

Release: auto-parallel ensembles + remaining parallelization#127

Merged
Sammyjoseph999 merged 4 commits into
mainfrom
staging
Jun 15, 2026
Merged

Release: auto-parallel ensembles + remaining parallelization#127
Sammyjoseph999 merged 4 commits into
mainfrom
staging

Conversation

@Sammyjoseph999

Copy link
Copy Markdown
Owner

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.

Sammyjoseph999 and others added 4 commits June 15, 2026 02:15
* 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.
@Sammyjoseph999
Sammyjoseph999 merged commit c902be6 into main Jun 15, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant