Repository navigation
orchestrator: run Phase 1 sequentially with netCDF4 >= 1.6 (HDF5 is not thread-safe) - #79
Merged
Merged
Conversation
…ot thread-safe); NOS_PREP_WORKERS overrides
…s sequential, accurate log, more tests)
Open
7 tasks done
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.
Description
STOFS-3D-ATL prep segfaulted in the STOFS container on AWS ParallelWorks. dmesg showed:
python3 segfault ... in libhdf5-0b47eb58.so.310.2.0.Cause.
PrepOrchestratorruns its Phase 1 steps (GFS, HRRR, NWM, TIDAL) in aThreadPoolExecutor. Since netCDF4-python 1.6.0, the netCDF-C calls run without the GIL. netCDF-C and the HDF5 bundled in the wheels are not thread-safe, so concurrent netCDF I/O from two threads can crash; here GFS was writing its forcing file while NWM read 139 netCDF files. The same run passed on a faster machine only because the steps did not overlap.Fix. A new
_phase1_workers(n_tasks)helper picks the executor size:NOS_PREP_WORKERS(an integer >= 1) overrides, capped at the number of tasks. An invalid value logs a warning and is ignored.The executor, result collection and error handling are unchanged. The log line now states the worker count and the reason. The docs index feature bullet is updated.
No other thread pool in nos_utils does netCDF I/O;
post/geopkg.pyuses processes.Type of change
Change characteristics
How has this been tested?
tests/test_phase1_workers.pycovers the env override, the cap, invalid values, versions 1.5.8, 1.6.0rc1, 1.7.2 and 1.10.0, an unparseable version, and netCDF4 not importable.Checklist