Using Jupyter Notebook and JupyterLab

Frontend

Python Prompt and libyt Defined Commands

The cell takes Python statements and libyt Defined Commands. It can also import other Python modules.

Tip

Put Python statements and libyt defined commands in separate cells.

How does it execute Python statements and libyt defined commands?

  1. Takes user inputs in the cell.

  2. MPI root process broadcasts the inputs to other processes.

  3. Every MPI process executes the same piece of input synchronously.

  4. Get outputs from each process and print feedbacks on the screen.

Tip

Changes is kept and maintained in user’s inline script’s namespace, and it will be brought to the following round of in situ analysis.

Auto-Completion

Use TAB key to do auto-completion.

jedi must be installed to use this feature. Generally, if you have IPython installed, you probably already have jedi.

User Interface

This is the same as traditional Jupyter Notebook UI. Be careful when sending kernel related instructions (ex: shutdown/interrupt/restart a kernel). Interrupting and restarting the kernel is not supported in libyt kernel yet.

Attention

If the notebook is connected to libyt kernel, restarting only exits the kernel, and libyt API yt_run_JupyterKernel returns. It won’t restart another kernel by itself.

Interruption is not supported in libyt kernel yet.

How to Exit

Go to Running Terminals and Kernels -> Shutdown Kernel.

Reconnecting to libyt Jupyter Kernel

After exiting the kernel, the simulation process may continue its job. While waiting for a new libyt kernel being launched, we don’t need to close the entire notebook to reconnect to it. We can choose the libyt kernel from the kernel list once it is activated again.