Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turning on single-threaded handling in dask #457

Merged

Conversation

davidorme
Copy link
Collaborator

Description

This PR is to fix segfaults in testing and docs building when xarray.open_mfdataset is used. This is due to underlying issues with the netCDF code not being thread safe. We previously turned on lock=False in that command, following advice here:

pydata/xarray#3961

And that worked, but the issue has started occurring again. Following the advice in this issue thread:

pydata/xarray#7079

this PR now explicitly sets the dask scheduler to use single-threading.

Fixes #354

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@davidorme davidorme linked an issue Jun 27, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.75%. Comparing base (327ad85) to head (5ff2268).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #457   +/-   ##
========================================
  Coverage    94.75%   94.75%           
========================================
  Files           70       70           
  Lines         3791     3793    +2     
========================================
+ Hits          3592     3594    +2     
  Misses         199      199           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works, it looks good!

Copy link
Collaborator

@jacobcook1995 jacobcook1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@davidorme davidorme merged commit e1ee433 into develop Jun 27, 2024
12 checks passed
@davidorme davidorme deleted the 354-xarrayopen_mfdataset-can-cause-problems-in-vr_run branch June 27, 2024 12:16
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.

xarray.open_mfdataset can cause problems in vr_run
4 participants