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

chunking pressure in eos at the wrong time? #148

Open
mnlevy1981 opened this issue Sep 23, 2022 · 1 comment
Open

chunking pressure in eos at the wrong time? #148

mnlevy1981 opened this issue Sep 23, 2022 · 1 comment

Comments

@mnlevy1981
Copy link
Collaborator

@sgyeager ran into an issue where calling eos() when salt and temp are dask arrays but depth is a numpy array (well, all three are of type DataArray, but under the xarray wrapper it's dask, dask, numpy) took several minutes while still returning a dask object, but chunking depth so it was a dask array as well let eos() finish in under a second. I think the problem is in https://github.com/NCAR/pop-tools/blob/main/pop_tools/eos.py#L100

        salt, temp, pressure = xr.broadcast(salt, temp, pressure)
        if isinstance(salt.data, dask.array.Array):
            pressure = pressure.chunk(salt.chunks)

wouldn't it make more sense to chunk pressure before the xr.broadcast()? I.e.

        if isinstance(salt.data, dask.array.Array):
            pressure = pressure.chunk(salt.chunks)
        salt, temp, pressure = xr.broadcast(salt, temp, pressure)
@sgyeager
Copy link
Contributor

It turns out that sending depth as a dask array causes a Failed to Serialize error, so this is not a fix. There appears to be issues with eos() when salt and temp are large dask arrays. It can take several minutes to complete the lazy eos() call and memory use on master can grow huge. I have not pinpointed the problem yet.

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

No branches or pull requests

2 participants