Skip to content

Disable lock=True in open_mfdataset when reading netCDF3 files #824

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

Closed
shoyer opened this issue Apr 15, 2016 · 7 comments
Closed

Disable lock=True in open_mfdataset when reading netCDF3 files #824

shoyer opened this issue Apr 15, 2016 · 7 comments
Labels

Comments

@shoyer
Copy link
Member

shoyer commented Apr 15, 2016

This slows things down unnecessarily.

@pwolfram
Copy link
Contributor

@shoyer, is this related to #800? If I recall correctly based on #793 there may be some issues with dask/multithreading without the lock. Am I missing something here?

It may make sense to just to set lock=False by default in https://github.com/pydata/xarray/blob/master/xarray/backends/api.py#L247 and if issues are encountered lock=True can be set by the user. Is this what you are thinking? If so, I can submit the super simple PR if that is helpful.

@shoyer
Copy link
Member Author

shoyer commented Apr 15, 2016

The issues with multithreading without a lock come up only when using netCDF4/HDF5. With netCDF3, you don't need the lock when reading data.

I don't like changing to lock=False in all circumstances, because that will lead to segfaults and segfaults make for a bad new user experience! Instead, lock=None should do something smart.

@pwolfram
Copy link
Contributor

@shoyer, makes sense. Are you thinking of something like the following pseudo code?

if lock is None:
    if type(file) is netCDF4/HDF5:
        lock=True
    else:
        lock=False

@pwolfram
Copy link
Contributor

We could also just filter the other way too which is probably cleaner:

if lock is None and type(file) is netCDF3:
   lock=False

@stale
Copy link

stale bot commented Jan 28, 2019

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity
If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically

@stale stale bot added the stale label Jan 28, 2019
@jhamman
Copy link
Member

jhamman commented Jan 30, 2019

@shoyer - this was addressed in the backend refactor this summer, no?

@shoyer
Copy link
Member Author

shoyer commented Jan 30, 2019

Yes it was

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants