-
Notifications
You must be signed in to change notification settings - Fork 4
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
Attempt to fix threadsafe
on skin
#39
Conversation
Ok so running the tests from a script in the from test_flux_xr import Test_xarray
test_class = Test_xarray()
shape = (10, 13, 12)
chunks = {"dim_0": 1}
skin_correction = True
test_class.test_chunked(shape, chunks, skin_correction) gives me these sort of errors:
switching the algo shows a similar thing for ecmwf:
These errors go back to the aerobulk code here and here, both parts of the codebase seem to allocate some internal optional output variable. Does anyone have a hint to why this would not sit well with threadsafe (cc @rabernat)? |
This might be relevant: https://stackoverflow.com/questions/34579769/f2py-error-with-allocatable-arrays |
Quick update. This only applies when using dask arrays, interestingly. The tests with the numpy only wrappers in |
Is that because Dask uses threads? Also, what is different about skin that makes it not thread safe vs. noskin. |
Sorry the previous comment was circular:
|
Any of my dask test cases has used the threaded scheduler (default). Before setting threadsafe, this worked for either skin/noskin but was very slow (basically running in serial). After setting threadsafe the noskin wrapper parallelizes as expected but the skin version actually FAILS. |
Note that once #40 is merged, the |
Ill close this for now, since we have decided to move on without threadsafe for the skin option for now. We can reopen if needed |
As a first step I wanted to verify that the problem is actually related to threadsafe. And indeed when I remove the threadsafe from the 'skin' wrapper only, all tests pass locally.
So there must be something specific to the skin correction that is not threadsafe?