Interactive Python Prompt

Requirements

Interactive mode only works on local machine or submit the job to HPC platform using interactive jobs like qsub -I on PBS scheduler. The reason is that the prompt is exposed through the terminal. Use Reloading Script or Jupyter Notebook Access to avoid this.

Using Interactive Python Prompt

Status Board

At the start of interactive mode, libyt prints the status board to show the current execution state of each inline function.

Python Prompt and libyt Defined Commands

>>> 

It can run any Python statements and libyt Defined Commands here. This includes importing Python modules. This is like using normal Python prompt, except that there are functions, objects, and simulation data already defined in it.

Python statement runs in inline script’s namespace, and it will update and make changes to it. The Python objects defined in it will be brought to next in situ analysis.

To make interactive prompt more smoothly, set lower YT_VERBOSE.

How does the prompt execute Python statements and libyt defined commands?

  1. MPI root process is the user interface, which takes user inputs.

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

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

  4. Print feedbacks to the terminal.

Changes is kept and maintained in user’s inline script’s namespace. The Python objects and function definition will be brought to the following round of in situ analysis.

Exit Interactive Python Prompt

Use %libyt exit to exit the prompt. Then it will exit the API yt_run_InteractiveMode and return back to the simulation process.

Known Limitations

FAQs