Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Access and Setup

The JupyterHub service enables the interactive execution of JupyterLab on Piz Daint.Alps on a single compute node.

The service for Piz Daint is accessed at at https://jupyter-daint.cscs.ch.

Once logged in, you will be redirected to the JupyterHub Spawner Options form, where typical job configuration options can be selected in order to allocate resources. These options might include the type and number of compute nodes, the wall time limit, and your project account.

Single-node notebooks are launched in a dedicated queue, minimizing queueing time. For these notebooks, servers should be up and running within a few minutes. The maximum waiting time for a server to be running is 5 minutes, after which the job will be cancelled and you will be redirected back to the spawner options page. If your single-node server is not spawned within 7 5 minutes we encourage you to contact us.

When resources are granted the page redirects to the JupyterLab session, where you can browse, open and execute notebooks on the compute nodes. A new notebook with Python 3 kernel can be created with the menu new and then Python 3 . Under new it is also possible to create new text files and folders, as well as to open a terminal session on the allocated compute node.

Debugging

The log file of a JuptyerLab JupyterLab server session is saved on $SCRATCH in a file named jupyterhub_<jobid>.log. If you encounter problems with your JupyterLab session, the contents of this file can be a good first clue to debug the issue.

If you receive the error message Unexpected error while saving file: disk I/O error. it is possible that you have run out of disk quota. Quotas can be checked by logging in to Ela, and issuing the command quota.

Accessing file systems

The Jupyter sessions are started in your $HOME folder. All non-hidden files and folders in $HOME are visible and accessible through the JupyterLab file browser. However, you can not browse directly to folders above $HOME. To enable access your $SCRATCH folder, it is therefore necessary to create a symbolic link to your $SCRATCH folder. This can be done with by issuing the following command in a terminal from your $HOME directory:

...

Alternatively, you can issue the following command directly in a notebook cell: !ln -s $SCRATCH scratch.

Creating Jupyter kernels for Python

A kernel, in the context of Jupyter, is a program that runs the user code within the Jupyter notebooks. Jupyter kernels make it possible to access virtual environments, custom python installations like anaconda/miniconda or any custom python setting, from Jupyter notebooks.

A kernel can be created from from an active Python virtual environmentl environment with  ipykernel :

Code Block
languagebash
themeRDark
. /myenv/bin/activate

python -m ipykernel install --user --name=<your_env_name> --display-name "Python (<your_env_name>)"

Jupyter kernels are powered by ipykernel. As a result, ipykernel must be installed in every environment that will be used as a kernel. That could be done with pip install ipykernel.

Ending your interactive session and logging out

The Jupyter servers can be shut down through the Hub. To end a JupyterLab session, please select Control Panel under the File menu and then Stop My Server. By contrast, clicking Logout will log you out of the server, but the server will continue to run until the Slurm job reaches its maximum wall time.

MPI in the Notebook via IPyParallel and mpi4py

MPI for Python provides bindings of the Message Passing Interface (MPI) standard for Python, allowing any Python program to exploit multiple processors.

...

Further details on MPI for Python (mpi4py): https://mpi4py.readthedocs.io/en/stable/

Further Documentation

Jupyter

JupyterLab

JupyterHub