Launch single-process Python programs

You can launch single-process Python programs from the command line.

Before you begin, verify that your Python environment meets the requirements in Python debugging supported platforms and requirements.

About the TotalView Python wrapper

TotalView uses a Python wrapper program to launch and control Python debugging sessions. The TotalView distribution includes the wrapper program and an MPI interposer shared library, which automatically load the Python debug module into the interpreter.

The wrapper is installed at:

<install-root>/<platform>/bin/tv_python_wrapper

TotalView supports the %tv_python_wrapper% token, which expands to the path of the wrapper in the TotalView distribution. Use this token when specifying the program to debug.

Launch a single-process Python program

  1. From the command line, use the following syntax to launch your Python program in TotalView:

    totalview -args %tv_python_wrapper% python <script.py>

    TotalView opens and displays the Python wrapper program (tv_python_wrapper.c) in the Source view.

    TotalView Source view showing the Python wrapper program

  2. Select Go (Go command icon). TotalView loads your Python script and stops at the first line of code.

    TotalView Source view showing the Python script loaded and stopped at the first line

    Status bar showing the current stopped source line

  3. (Optional) Set any breakpoints you want in your Python code. See Set breakpoints in Python code.

  4. Select Go (Go command icon) to run your Python script.

If execution stops in the wrapper before reaching your Python code, select Go to continue.

Resolve launch errors

If you encounter the following warning when launching a single-process Python program, use the recommended action to resolve the issue.

Warning: A program named '%tv_python_wrapper%' cannot be found

This warning occurs when launching a single-process Python program using a TotalView version that does not support native Python debugging. To resolve this warning, use a TotalView version that supports native Python debugging.

Warning dialog: A program named '%tv_python_wrapper%' cannot be found