NordicESMhub / NEGI-Abisko-2019

Climate science at high latitudes: eScience for linking Arctic measurements and modeling
https://nordicesmhub.github.io/NEGI-Abisko-2019/
Other
5 stars 33 forks source link

Kernel restarting #35

Open siljeci opened 4 years ago

siljeci commented 4 years ago

When I try to run a code by using JupyterHub I get the message:

"Kernel restarting: The kernel for Untitled1.ipynb appears to have died. It will restart automatically."

It seems like this happens when I use large arrays. Is this a "normal" message, such that the only fix is to slice every dataset before using them?

annefou commented 4 years ago

It depends how you manipulate your xarray and what kind of data processing you perform. We can increase resources but before can we look at what you do? Do you want to look at here now? Where are you?

siljeci commented 4 years ago

It happens when I calculate weighted averages by using groupby().sum() on arrays which are large(!). We don't have to fix this tonight - I figured that the code works if I slice the datasets. So if I run into this problem again (and don't figure out what to do), I'll ask again!

annefou commented 4 years ago

Yes. Slicing is the right approach and actually you can use dask cluster to run your computation in parallel.

daliagachc commented 4 years ago

Hi! i'll write an example notebook on using xarray with dask so we can circumvent this problem. @annefou can you point me how to profile how much ram im using in the notebook?

jrieksta commented 4 years ago

Hei! Has this been fixed? I cannot plot any of my data as kernel crashes.

annefou commented 4 years ago

Do you use dask cluster?

jrieksta commented 4 years ago

No! @daliagachc earlier in the comments mentioned he will make a notebook for that, can we find it somewhere?

annefou commented 4 years ago

I put a very simple example at https://nordicesmhub.github.io/NEGI-Abisko-2019/training/CMIP6_dask.html Will add some more on how to profile and optimize.

daliagachc commented 4 years ago

Hi! @jrieksta here is another example notebook location

sarambl commented 4 years ago

Hey, @daliagachc! Maybe you can add the client thing here? https://nordicesmhub.github.io/NEGI-Abisko-2019/training/gridded_model_data_dask_rolling_mean.html Might be misleading if people go here

daliagachc commented 4 years ago

@sarambl agreed! how? :)

sarambl commented 4 years ago

Are you telling me I should do it, @daliagachc ?!
image

daliagachc commented 4 years ago

lets see.... i forked, modified and pull requested.

sarambl commented 4 years ago

Ahhh, now I get the question! Yes, if you don't already have a fork (in which case u sync it ) https://nordicesmhub.github.io/NEGI-Abisko-2019/training/github/synchronise_github.html

jrieksta commented 4 years ago

Is this error also related to dask? Worker exceeded 95% memory budget. Restarting I have chunks 10 and kernel still sometimes dies, would a suggestion would be to decrease chunks?

annefou commented 4 years ago

@jrieksta can you point to your notebook?

daliagachc commented 4 years ago

Hi @jrieksta! can you post the path to your notebook? (right click on the notebook in the file browser of jupyterhub and select 'copy shareable link')

annefou commented 4 years ago

@siljeci got it work. my visio finishes in few minutes.