Example – Connecting to Kernel on Local Machine

Running Simulation

  1. Use libyt API yt_run_JupyterKernel in simulation and compile:

    if (yt_run_JupyterKernel("LIBYT_STOP", false) != YT_SUCCESS) {
        // some error message
    }
    

    It will launch libyt kernel once it detects LIBYT_STOP. To make libyt find and bind to unused port automatically, set it to false.

  2. Wait for connection from Jupyter Notebook / JupyterLab (See below Connecting to Kernel)

  3. Shutdown the kernel (See How to Exit).

Connecting to Kernel

Go through Starting Jupyter Notebook/JupyterLab.