RavenPy icon indicating copy to clipboard operation
RavenPy copied to clipboard

Kernel dying when repeatedly accessing OutputReader.hydrograph

Open huard opened this issue 2 years ago • 3 comments

  • RavenPy version: 0.12
  • Python version: 3.9
  • Operating System: Linux

Description

The CANOPEX notebook had kernel failures that seem to be resolved by accessing out.hydrograph.q_sim only once. For some reason, making multiple calls to xr.open_dataset seem to create problems.

This probably calls for caching the opened file.

huard avatar Jun 01 '23 14:06 huard

Similar issue observed with #320, where repeated calls to from_nc methods to create the model configuration slowed down the calculations and generated apparently random kernel failures.

huard avatar Nov 02 '23 14:11 huard

This is definitely a cause of many failures, both here and elsewhere. The tests that tend to fail with segfaults are those that rely on many open_dataset calls. Whether this is related to the async troubles with libnetcdf or not, we should try reducing the read operations if possible. Maybe having pytest fixtures that yield copied objects would be safer?

Zeitsperre avatar Nov 02 '23 15:11 Zeitsperre

This issue is seen in notebooks that describe real use cases, not in the test suite, so it's bit trickier. I think for the moment we can "solve" this by documenting the problem. Could you link to online resources that capture the issue?

huard avatar Nov 02 '23 15:11 huard