{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "60af6089",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:46:59.239786Z",
     "iopub.status.busy": "2026-10-02T14:46:59.239578Z",
     "iopub.status.idle": "2026-10-02T14:46:59.243881Z",
     "shell.execute_reply": "2026-10-02T14:46:59.243265Z"
    },
    "papermill": {
     "duration": 0.007827,
     "end_time": "2026-10-02T14:46:59.244359+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:59.236532+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input",
     "active-ipynb",
     "remove-output"
    ]
   },
   "outputs": [],
   "source": [
    "try:\n",
    "    from openmdao.utils.notebook_utils import notebook_mode  # noqa: F401\n",
    "except ImportError:\n",
    "    !python -m pip install openmdao[notebooks]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c0b934a8",
   "metadata": {
    "papermill": {
     "duration": 0.001913,
     "end_time": "2026-10-02T14:46:59.248797+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:59.246884+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "# Command Line Tools\n",
    "\n",
    "OpenMDAO has a number of command line tools that are available at your operating system command prompt via the `openmdao` command.\n",
    "These can also be accessed using the more pythonic `python -m openmdao` command.\n",
    "These two commands are equivalent and will be used interchangably in this documentation.\n",
    "\n",
    "```{note}\n",
    "The `openmdao` sub-commands, as well as any other console scripts associated with OpenMDAO, will\n",
    "only be available if you have installed OpenMDAO using *pip*. See [Getting Started](../getting_started/getting_started.ipynb)\n",
    "```\n",
    "\n",
    "```{note}\n",
    "When using a command line tool on a script that takes its own command line arguments, those\n",
    "arguments must be placed after a `--` on the command line.  Anything to the right of the\n",
    "`--` will be ignored by the openmdao command line parser and passed on to the user script.\n",
    "For example: `openmdao n2 -o foo.html myscript.py -- -x --myarg=bar` would pass\n",
    "`-x` and `--myarg=bar` as args to `myscript.py`.\n",
    "```\n",
    "\n",
    "All available `openmdao` sub-commands can be shown using the following command:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f9aaeeaa",
   "metadata": {
    "papermill": {
     "duration": 0.001837,
     "end_time": "2026-10-02T14:46:59.252557+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:59.250720+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "python -m openmdao -h\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0777144d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:46:59.307452Z",
     "iopub.status.busy": "2026-10-02T14:46:59.307226Z",
     "iopub.status.idle": "2026-10-02T14:47:03.593812Z",
     "shell.execute_reply": "2026-10-02T14:47:03.592890Z"
    },
    "papermill": {
     "duration": 4.340421,
     "end_time": "2026-10-02T14:47:03.594901+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:46:59.254480+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952422.810959] [runnervm8df0l:10980:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x5558c73f8210 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952422.811217] [runnervm8df0l:10980:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:10980] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: __main__.py [-h] [--version | --dependency_versions | --view_reports]\r\n",
      "                    ...\r\n",
      "\r\n",
      "OpenMDAO Command Line Tools\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help            show this help message and exit\r\n",
      "  --version             show program's version number and exit\r\n",
      "  --dependency_versions\r\n",
      "                        show versions of OpenMDAO and all dependencies, then\r\n",
      "                        exit\r\n",
      "  --view_reports        after running an OpenMDAO script, display any\r\n",
      "                        generated reports\r\n",
      "\r\n",
      "Tools:\r\n",
      "  \r\n",
      "    call_tree           Display the call tree for the specified class method\r\n",
      "                        and all 'self' class methods it calls.\r\n",
      "    check               Perform a number of configuration checks on the\r\n",
      "                        problem.\r\n",
      "    cite                Print citations referenced by the problem.\r\n",
      "    clean               Remove OpenMDAO output directories.\r\n",
      "    comm_info           Print MPI communicator info for systems.\r\n",
      "    compute_entry_points\r\n",
      "                        Compute entry point declarations to add to the\r\n",
      "                        setup.py file.\r\n",
      "    conn_graph          Generate a graph for a group.\r\n",
      "    dist_conns          Display connection information for variables across\r\n",
      "                        multiple MPI processes.\r\n",
      "    find_repos          Find repos on github having openmdao topics.\r\n",
      "    graph               Generate a graph for a group.\r\n",
      "    iprof               Profile calls to particular object instances.\r\n",
      "    iprof_totals        Generate total timings of calls to particular object\r\n",
      "                        instances.\r\n",
      "    list_installed      List installed types recognized by OpenMDAO.\r\n",
      "    list_pre_post       Show pre and post setup systems.\r\n",
      "    list_reports        List available reports.\r\n",
      "    mem                 Profile memory used by OpenMDAO related functions.\r\n",
      "    mempost             Post-process memory profile output.\r\n",
      "    n2                  Display an interactive N2 diagram of the problem.\r\n",
      "    partial_coloring    Compute coloring(s) for specified partial jacobians.\r\n",
      "    realtime_plot       Run the realtime optimization progress plot tool\r\n",
      "    rtplot              Run the realtime optimization progress plot tool once\r\n",
      "                        the driver recorder file is started\r\n",
      "    scaffold            Generate a simple scaffold for a component.\r\n",
      "    scaling             View driver scaling report.\r\n",
      "    skills              Install OpenMDAO agent skills into AI coding tools.\r\n",
      "    summary             Print a short top-level summary of the problem.\r\n",
      "    timing              Collect timing information for all systems.\r\n",
      "    to_compute_primal   Convert a component to use compute_primal instead of\r\n",
      "                        compute or apply_nonlinear.\r\n",
      "    total_coloring      Compute a coloring for the total jacobian.\r\n",
      "    trace               Dump trace output.\r\n",
      "    tree                Print the system tree.\r\n",
      "    view_cases          View a case recorder file.\r\n",
      "    view_coloring       View a colored jacobian.\r\n",
      "    view_connections    View connections showing values and source/target\r\n",
      "                        units.\r\n",
      "    view_dyn_shapes     View the dynamic shape dependency graph.\r\n",
      "    view_dyn_units      View the dynamic units dependency graph.\r\n",
      "    view_mm             View a metamodel.\r\n",
      "    view_reports        View existing reports.\r\n",
      "\r\n",
      "Use -h after any sub-command for sub-command help, for example, \"openmdao tree\r\n",
      "-h\" for help on the \"tree\" command. If using a tool on a script that takes its\r\n",
      "own command line arguments, place those arguments after a \"--\". For example:\r\n",
      "\"openmdao n2 -o foo.html myscript.py -- -x --myarg=bar\"\r\n"
     ]
    }
   ],
   "source": [
    "!python -m openmdao -h"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "db1c7467",
   "metadata": {
    "papermill": {
     "duration": 0.003184,
     "end_time": "2026-10-02T14:47:03.601357+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:03.598173+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "ac3b276d",
   "metadata": {
    "papermill": {
     "duration": 0.009783,
     "end_time": "2026-10-02T14:47:03.644291+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:03.634508+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "To get further info on any sub-command, follow the command with a *-h*.  For example:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3507cc96",
   "metadata": {
    "papermill": {
     "duration": 0.002967,
     "end_time": "2026-10-02T14:47:03.650512+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:03.647545+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "python -m openmdao n2 -h\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "8886be49",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:03.657717Z",
     "iopub.status.busy": "2026-10-02T14:47:03.657460Z",
     "iopub.status.idle": "2026-10-02T14:47:08.254970Z",
     "shell.execute_reply": "2026-10-02T14:47:08.254483Z"
    },
    "papermill": {
     "duration": 4.602919,
     "end_time": "2026-10-02T14:47:08.256280+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:03.653361+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952427.423047] [runnervm8df0l:11025:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x555b19946ac0 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952427.423325] [runnervm8df0l:11025:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11025] pml_ucx.c:313  Error: Failed to create UCP worker\r\n",
      "usage: __main__.py n2 [-h] [-o OUTFILE] [--no_values] [--no_browser] [--embed]\r\n",
      "                      [--title TITLE] [--path PATH] [--problem PROBLEM_NAME]\r\n",
      "                      file\r\n",
      "\r\n",
      "positional arguments:\r\n",
      "  file                  Python script or recording containing the model. If\r\n",
      "                        metadata from a parallel run was recorded in a\r\n",
      "                        separate file, specify both database filenames\r\n",
      "                        delimited with a comma.\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help            show this help message and exit\r\n",
      "  -o OUTFILE            html output file.\r\n",
      "  --no_values           don't display variable values.\r\n",
      "  --no_browser          don't display in a browser.\r\n",
      "  --embed               create embeddable version.\r\n",
      "  --title TITLE         diagram title.\r\n",
      "  --path PATH           initial system path to zoom into.\r\n",
      "  --problem PROBLEM_NAME\r\n",
      "                        name of sub-problem, if target is a sub-problem\r\n"
     ]
    }
   ],
   "source": [
    "!python -m openmdao n2 -h"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "17095739",
   "metadata": {
    "papermill": {
     "duration": 0.003042,
     "end_time": "2026-10-02T14:47:08.262570+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:08.259528+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```{note}\n",
    "Several of the example commands below make use of the files `circuit.py` and `circle_opt.py`. These files are located in the openmdao/test_suite/scripts directory.\n",
    "```\n",
    "\n",
    "## Running an OpenMDAO Script\n",
    "\n",
    "The `openmdao` command can be used without any sub-commands to run an OpenMDAO script.  Currently, the only advantage to using it this way versus just using the `python` command is the ability to specify the `--view_reports` option, which will open a browser window after script execution is complete that lists all the OpenMDAO [reports](reports-system) generated during the run for easy viewing.\n",
    "\n",
    "```\n",
    "openmdao --view_reports circle_opt.py\n",
    "```\n",
    "\n",
    "## Viewing and Checking Commands\n",
    "\n",
    "Usually these commands will exit after executing, rather than continuing to the end of the user's\n",
    "run script. This makes it convenient to view or check the configuration of a model in any\n",
    "run script without having to wait around for the entire script to run.\n",
    "\n",
    "\n",
    "### openmdao check\n",
    "\n",
    "The `openmdao check` command will perform a number of checks on a model and display\n",
    "errors, warnings, or informational messages describing what it finds. Some of the available\n",
    "checks are *unconnected_inputs*, which lists any input variables that are not connected, and\n",
    "*out_of_order*, which displays any systems that are being executed out-of-order.\n",
    "You can supply individual checks on the command line using *-c* args.  For example:"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "id": "2356bd2b",
   "metadata": {
    "papermill": {
     "duration": 0.002843,
     "end_time": "2026-10-02T14:47:08.268473+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:08.265630+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "source": [
    "If you are in Colab or Binder, the shell command will not find the file because it is a single notebook without the included file."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ab2117cc",
   "metadata": {
    "papermill": {
     "duration": 0.002909,
     "end_time": "2026-10-02T14:47:08.274341+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:08.271432+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao check -c cycles circuit.py\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "8f9d885b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:08.281560Z",
     "iopub.status.busy": "2026-10-02T14:47:08.281234Z",
     "iopub.status.idle": "2026-10-02T14:47:12.707792Z",
     "shell.execute_reply": "2026-10-02T14:47:12.706945Z"
    },
    "papermill": {
     "duration": 4.431041,
     "end_time": "2026-10-02T14:47:12.708362+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:08.277321+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952431.962905] [runnervm8df0l:11115:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x5590c18deda0 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952431.963160] [runnervm8df0l:11115:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11115] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/relevance.py:1294: OpenMDAOWarning:The following groups have a nonlinear solver that computes gradients and will be treated as atomic for the purposes of determining which systems are included in the optimization iteration: \r\n",
      "circuit\r\n",
      "\r\n",
      "INFO: checking cycles...\r\n",
      "INFO: The following groups contain cycles:\r\n",
      "INFO:    Group 'circuit' has the following cycles:\r\n",
      "INFO:       ['n1', 'n2', 'R1', 'R2', 'D1']\r\n",
      "INFO: \r\n",
      "INFO:     cycles check complete (0.000210 sec).\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao check -c cycles circuit.py"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5f406b9b",
   "metadata": {
    "papermill": {
     "duration": 0.002237,
     "end_time": "2026-10-02T14:47:12.713022+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:12.710785+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "Otherwise, a set of default checks will be done. To see lists of the available and default checks, run the following command:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c456a8eb",
   "metadata": {
    "papermill": {
     "duration": 0.001943,
     "end_time": "2026-10-02T14:47:12.717024+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:12.715081+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao check -h\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "5f0ba9ce",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:12.722068Z",
     "iopub.status.busy": "2026-10-02T14:47:12.721890Z",
     "iopub.status.idle": "2026-10-02T14:47:16.705626Z",
     "shell.execute_reply": "2026-10-02T14:47:16.704524Z"
    },
    "papermill": {
     "duration": 3.987255,
     "end_time": "2026-10-02T14:47:16.706297+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:12.719042+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952436.003045] [runnervm8df0l:11175:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x56506c9d49b0 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952436.003369] [runnervm8df0l:11175:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11175] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: openmdao check [-h] [-o OUTFILE] [-p PROBLEM] [-c CHECKS] file\r\n",
      "\r\n",
      "positional arguments:\r\n",
      "  file                  Python file containing the model\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help            show this help message and exit\r\n",
      "  -o OUTFILE            output file\r\n",
      "  -p, --problem PROBLEM\r\n",
      "                        Problem name\r\n",
      "  -c CHECKS             Only perform specific check(s). Default checks are:\r\n",
      "                        ['comp_has_no_outputs', 'dup_inputs',\r\n",
      "                        'missing_recorders', 'out_of_order', 'solvers',\r\n",
      "                        'system', 'unserializable_options']. Other available\r\n",
      "                        checks are: ['all_unserializable_options', 'cycles',\r\n",
      "                        'promotions', 'sparsity', 'unconnected_inputs']\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao check -h"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "46e716ab",
   "metadata": {
    "papermill": {
     "duration": 0.019936,
     "end_time": "2026-10-02T14:47:16.728723+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:16.708787+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "(om-command-clean)=\n",
    "### openmdao clean\n",
    "\n",
    "OpenMDAO creates an output directory for each problem it runs. This directory contains recording files, optimizer output files, derivative coloring information (if generated), and reports (if generated).\n",
    "The `openmdao clean` command recurses through the given path and remove any OpenMDAO output directories found.\n",
    "\n",
    "OpenMDAO output directories are identified by the presence of an `.openmdao_out` file, which is automatically added upon their creation.\n",
    "\n",
    "One note regarding the `pattern` argument. This pattern provides the glob pattern which the directory names must match to be cleaned.\n",
    "By default, this is `'*_out'`. This pattern will be applied regardless of the depth of recursion. On the other hand, providing a glob\n",
    "pattern to the command such as `openmdao clean *_out` will only clean directories whose name matches `'*_out'` in the current working directory.\n",
    "To prevent expansion of the wildcard pattern, surround the argument of pattern with quotes: `--pattern=\"foo*_out\"`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "4d71c5c1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:16.862481Z",
     "iopub.status.busy": "2026-10-02T14:47:16.862271Z",
     "iopub.status.idle": "2026-10-02T14:47:20.560381Z",
     "shell.execute_reply": "2026-10-02T14:47:20.559267Z"
    },
    "papermill": {
     "duration": 3.70225,
     "end_time": "2026-10-02T14:47:20.561003+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:16.858753+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952439.926982] [runnervm8df0l:11221:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x557882770910 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952439.927269] [runnervm8df0l:11221:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11221] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: openmdao clean [-h] [-f] [-n] [-d] [-p PATTERN] [path ...]\r\n",
      "\r\n",
      "positional arguments:\r\n",
      "  path                  Path(s) from which OpenMDAO output directories should\r\n",
      "                        be removed.\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help            show this help message and exit\r\n",
      "  -f, --noprompt        Remove output directories without confirmation.\r\n",
      "  -n, --norecurse       Do not recurse into subdirectories to find directories\r\n",
      "                        to remove.\r\n",
      "  -d, --dryrun          Highlight directories to be removed but do not\r\n",
      "                        actually remove them.\r\n",
      "  -p, --pattern PATTERN\r\n",
      "                        Only directories whose name matches this glob pattern\r\n",
      "                        will be removed. This glob pattern applies to\r\n",
      "                        directory names found when recursing through the given\r\n",
      "                        paths. Surround this argument with quotation marks to\r\n",
      "                        prevent the OS from interpreting the glob pattern.\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao clean --help"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0401426e",
   "metadata": {
    "papermill": {
     "duration": 0.002444,
     "end_time": "2026-10-02T14:47:20.566315+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:20.563871+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "(om-command-n2)=\n",
    "### openmdao n2\n",
    "\n",
    "The `openmdao n2` command will generate an $N^2$ diagram of the model that is\n",
    "viewable in a browser, for example:\n",
    "\n",
    "```\n",
    "openmdao n2 circuit.py\n",
    "```\n",
    "\n",
    "will generate an $N^2$ diagram like the one below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "80433339",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:20.572294Z",
     "iopub.status.busy": "2026-10-02T14:47:20.572109Z",
     "iopub.status.idle": "2026-10-02T14:47:22.468163Z",
     "shell.execute_reply": "2026-10-02T14:47:22.467759Z"
    },
    "papermill": {
     "duration": 1.900196,
     "end_time": "2026-10-02T14:47:22.468978+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:20.568782+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input",
     "remove-output"
    ]
   },
   "outputs": [
    {
     "data": {
      "application/papermill.record/text/html": "<style>pre { line-height: 125%; }\ntd.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\nspan.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\ntd.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\nspan.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\n.output_html .hll { background-color: #ffffcc }\n.output_html { background: #f8f8f8; }\n.output_html .c { color: #3D7B7B; font-style: italic } /* Comment */\n.output_html .err { border: 1px solid #F00 } /* Error */\n.output_html .k { color: #008000; font-weight: bold } /* Keyword */\n.output_html .o { color: #666 } /* Operator */\n.output_html .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */\n.output_html .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */\n.output_html .cp { color: #9C6500 } /* Comment.Preproc */\n.output_html .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */\n.output_html .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */\n.output_html .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */\n.output_html .gd { color: #A00000 } /* Generic.Deleted */\n.output_html .ge { font-style: italic } /* Generic.Emph */\n.output_html .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */\n.output_html .gr { color: #E40000 } /* Generic.Error */\n.output_html .gh { color: #000080; font-weight: bold } /* Generic.Heading */\n.output_html .gi { color: #008400 } /* Generic.Inserted */\n.output_html .go { color: #717171 } /* Generic.Output */\n.output_html .gp { color: #000080; font-weight: bold } /* Generic.Prompt */\n.output_html .gs { font-weight: bold } /* Generic.Strong */\n.output_html .gu { color: #800080; font-weight: bold } /* Generic.Subheading */\n.output_html .gt { color: #04D } /* Generic.Traceback */\n.output_html .kc { color: #008000; font-weight: bold } /* Keyword.Constant */\n.output_html .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */\n.output_html .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */\n.output_html .kp { color: #008000 } /* Keyword.Pseudo */\n.output_html .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */\n.output_html .kt { color: #B00040 } /* Keyword.Type */\n.output_html .m { color: #666 } /* Literal.Number */\n.output_html .s { color: #BA2121 } /* Literal.String */\n.output_html .na { color: #687822 } /* Name.Attribute */\n.output_html .nb { color: #008000 } /* Name.Builtin */\n.output_html .nc { color: #00F; font-weight: bold } /* Name.Class */\n.output_html .no { color: #800 } /* Name.Constant */\n.output_html .nd { color: #A2F } /* Name.Decorator */\n.output_html .ni { color: #717171; font-weight: bold } /* Name.Entity */\n.output_html .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */\n.output_html .nf { color: #00F } /* Name.Function */\n.output_html .nl { color: #767600 } /* Name.Label */\n.output_html .nn { color: #00F; font-weight: bold } /* Name.Namespace */\n.output_html .nt { color: #008000; font-weight: bold } /* Name.Tag */\n.output_html .nv { color: #19177C } /* Name.Variable */\n.output_html .ow { color: #A2F; font-weight: bold } /* Operator.Word */\n.output_html .w { color: #BBB } /* Text.Whitespace */\n.output_html .mb { color: #666 } /* Literal.Number.Bin */\n.output_html .mf { color: #666 } /* Literal.Number.Float */\n.output_html .mh { color: #666 } /* Literal.Number.Hex */\n.output_html .mi { color: #666 } /* Literal.Number.Integer */\n.output_html .mo { color: #666 } /* Literal.Number.Oct */\n.output_html .sa { color: #BA2121 } /* Literal.String.Affix */\n.output_html .sb { color: #BA2121 } /* Literal.String.Backtick */\n.output_html .sc { color: #BA2121 } /* Literal.String.Char */\n.output_html .dl { color: #BA2121 } /* Literal.String.Delimiter */\n.output_html .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */\n.output_html .s2 { color: #BA2121 } /* Literal.String.Double */\n.output_html .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */\n.output_html .sh { color: #BA2121 } /* Literal.String.Heredoc */\n.output_html .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */\n.output_html .sx { color: #008000 } /* Literal.String.Other */\n.output_html .sr { color: #A45A77 } /* Literal.String.Regex */\n.output_html .s1 { color: #BA2121 } /* Literal.String.Single */\n.output_html .ss { color: #19177C } /* Literal.String.Symbol */\n.output_html .bp { color: #008000 } /* Name.Builtin.Pseudo */\n.output_html .fm { color: #00F } /* Name.Function.Magic */\n.output_html .vc { color: #19177C } /* Name.Variable.Class */\n.output_html .vg { color: #19177C } /* Name.Variable.Global */\n.output_html .vi { color: #19177C } /* Name.Variable.Instance */\n.output_html .vm { color: #19177C } /* Name.Variable.Magic */\n.output_html .il { color: #666 } /* Literal.Number.Integer.Long */</style><div class=\"highlight\"><pre><span></span><span class=\"k\">class</span><span class=\"w\"> </span><span class=\"nc\">Circuit</span><span class=\"p\">(</span><span class=\"n\">om</span><span class=\"o\">.</span><span class=\"n\">Group</span><span class=\"p\">):</span>\n\n    <span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">setup</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_subsystem</span><span class=\"p\">(</span><span class=\"s1\">&#39;n1&#39;</span><span class=\"p\">,</span> <span class=\"n\">Node</span><span class=\"p\">(</span><span class=\"n\">n_in</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">n_out</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">),</span> <span class=\"n\">promotes_inputs</span><span class=\"o\">=</span><span class=\"p\">[(</span><span class=\"s1\">&#39;I_in:0&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;I_in&#39;</span><span class=\"p\">)])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_subsystem</span><span class=\"p\">(</span><span class=\"s1\">&#39;n2&#39;</span><span class=\"p\">,</span> <span class=\"n\">Node</span><span class=\"p\">())</span>  <span class=\"c1\"># leaving defaults</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_subsystem</span><span class=\"p\">(</span><span class=\"s1\">&#39;R1&#39;</span><span class=\"p\">,</span> <span class=\"n\">Resistor</span><span class=\"p\">(</span><span class=\"n\">R</span><span class=\"o\">=</span><span class=\"mf\">100.</span><span class=\"p\">),</span> <span class=\"n\">promotes_inputs</span><span class=\"o\">=</span><span class=\"p\">[(</span><span class=\"s1\">&#39;V_out&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Vg&#39;</span><span class=\"p\">)])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_subsystem</span><span class=\"p\">(</span><span class=\"s1\">&#39;R2&#39;</span><span class=\"p\">,</span> <span class=\"n\">Resistor</span><span class=\"p\">(</span><span class=\"n\">R</span><span class=\"o\">=</span><span class=\"mf\">10000.</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_subsystem</span><span class=\"p\">(</span><span class=\"s1\">&#39;D1&#39;</span><span class=\"p\">,</span> <span class=\"n\">Diode</span><span class=\"p\">(),</span> <span class=\"n\">promotes_inputs</span><span class=\"o\">=</span><span class=\"p\">[(</span><span class=\"s1\">&#39;V_out&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Vg&#39;</span><span class=\"p\">)])</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"s1\">&#39;n1.V&#39;</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"s1\">&#39;R1.V_in&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;R2.V_in&#39;</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"s1\">&#39;R1.I&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;n1.I_out:0&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"s1\">&#39;R2.I&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;n1.I_out:1&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"s1\">&#39;n2.V&#39;</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"s1\">&#39;R2.V_out&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;D1.V_in&#39;</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"s1\">&#39;R2.I&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;n2.I_in:0&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"s1\">&#39;D1.I&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;n2.I_out:0&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nonlinear_solver</span> <span class=\"o\">=</span> <span class=\"n\">om</span><span class=\"o\">.</span><span class=\"n\">NewtonSolver</span><span class=\"p\">(</span><span class=\"n\">solve_subsystems</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nonlinear_solver</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;iprint&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nonlinear_solver</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;maxiter&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">20</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">linear_solver</span> <span class=\"o\">=</span> <span class=\"n\">om</span><span class=\"o\">.</span><span class=\"n\">DirectSolver</span><span class=\"p\">()</span>\n</pre></div>\n",
      "application/papermill.record/text/latex": "\\begin{Verbatim}[commandchars=\\\\\\{\\}]\n\\PY{k}{class}\\PY{+w}{ }\\PY{n+nc}{Circuit}\\PY{p}{(}\\PY{n}{om}\\PY{o}{.}\\PY{n}{Group}\\PY{p}{)}\\PY{p}{:}\n\n    \\PY{k}{def}\\PY{+w}{ }\\PY{n+nf}{setup}\\PY{p}{(}\\PY{n+nb+bp}{self}\\PY{p}{)}\\PY{p}{:}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{add\\PYZus{}subsystem}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n1}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{n}{Node}\\PY{p}{(}\\PY{n}{n\\PYZus{}in}\\PY{o}{=}\\PY{l+m+mi}{1}\\PY{p}{,} \\PY{n}{n\\PYZus{}out}\\PY{o}{=}\\PY{l+m+mi}{2}\\PY{p}{)}\\PY{p}{,} \\PY{n}{promotes\\PYZus{}inputs}\\PY{o}{=}\\PY{p}{[}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{I\\PYZus{}in:0}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{I\\PYZus{}in}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{)}\\PY{p}{]}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{add\\PYZus{}subsystem}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n2}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{n}{Node}\\PY{p}{(}\\PY{p}{)}\\PY{p}{)}  \\PY{c+c1}{\\PYZsh{} leaving defaults}\n\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{add\\PYZus{}subsystem}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R1}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{n}{Resistor}\\PY{p}{(}\\PY{n}{R}\\PY{o}{=}\\PY{l+m+mf}{100.}\\PY{p}{)}\\PY{p}{,} \\PY{n}{promotes\\PYZus{}inputs}\\PY{o}{=}\\PY{p}{[}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{V\\PYZus{}out}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{Vg}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{)}\\PY{p}{]}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{add\\PYZus{}subsystem}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R2}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{n}{Resistor}\\PY{p}{(}\\PY{n}{R}\\PY{o}{=}\\PY{l+m+mf}{10000.}\\PY{p}{)}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{add\\PYZus{}subsystem}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{D1}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{n}{Diode}\\PY{p}{(}\\PY{p}{)}\\PY{p}{,} \\PY{n}{promotes\\PYZus{}inputs}\\PY{o}{=}\\PY{p}{[}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{V\\PYZus{}out}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{Vg}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{)}\\PY{p}{]}\\PY{p}{)}\n\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{connect}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n1.V}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{p}{[}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R1.V\\PYZus{}in}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R2.V\\PYZus{}in}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{]}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{connect}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R1.I}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n1.I\\PYZus{}out:0}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{connect}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R2.I}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n1.I\\PYZus{}out:1}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{)}\n\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{connect}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n2.V}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{p}{[}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R2.V\\PYZus{}out}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{D1.V\\PYZus{}in}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{]}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{connect}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{R2.I}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n2.I\\PYZus{}in:0}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{connect}\\PY{p}{(}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{D1.I}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{,} \\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{n2.I\\PYZus{}out:0}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{)}\n\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{nonlinear\\PYZus{}solver} \\PY{o}{=} \\PY{n}{om}\\PY{o}{.}\\PY{n}{NewtonSolver}\\PY{p}{(}\\PY{n}{solve\\PYZus{}subsystems}\\PY{o}{=}\\PY{k+kc}{False}\\PY{p}{)}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{nonlinear\\PYZus{}solver}\\PY{o}{.}\\PY{n}{options}\\PY{p}{[}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{iprint}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{]} \\PY{o}{=} \\PY{l+m+mi}{2}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{nonlinear\\PYZus{}solver}\\PY{o}{.}\\PY{n}{options}\\PY{p}{[}\\PY{l+s+s1}{\\PYZsq{}}\\PY{l+s+s1}{maxiter}\\PY{l+s+s1}{\\PYZsq{}}\\PY{p}{]} \\PY{o}{=} \\PY{l+m+mi}{20}\n        \\PY{n+nb+bp}{self}\\PY{o}{.}\\PY{n}{linear\\PYZus{}solver} \\PY{o}{=} \\PY{n}{om}\\PY{o}{.}\\PY{n}{DirectSolver}\\PY{p}{(}\\PY{p}{)}\n\\end{Verbatim}\n",
      "application/papermill.record/text/plain": "class Circuit(om.Group):\n\n    def setup(self):\n        self.add_subsystem('n1', Node(n_in=1, n_out=2), promotes_inputs=[('I_in:0', 'I_in')])\n        self.add_subsystem('n2', Node())  # leaving defaults\n\n        self.add_subsystem('R1', Resistor(R=100.), promotes_inputs=[('V_out', 'Vg')])\n        self.add_subsystem('R2', Resistor(R=10000.))\n        self.add_subsystem('D1', Diode(), promotes_inputs=[('V_out', 'Vg')])\n\n        self.connect('n1.V', ['R1.V_in', 'R2.V_in'])\n        self.connect('R1.I', 'n1.I_out:0')\n        self.connect('R2.I', 'n1.I_out:1')\n\n        self.connect('n2.V', ['R2.V_out', 'D1.V_in'])\n        self.connect('R2.I', 'n2.I_in:0')\n        self.connect('D1.I', 'n2.I_out:0')\n\n        self.nonlinear_solver = om.NewtonSolver(solve_subsystems=False)\n        self.nonlinear_solver.options['iprint'] = 2\n        self.nonlinear_solver.options['maxiter'] = 20\n        self.linear_solver = om.DirectSolver()"
     },
     "metadata": {
      "scrapbook": {
       "mime_prefix": "application/papermill.record/",
       "name": "code_src93"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from openmdao.utils.notebook_utils import get_code\n",
    "from myst_nb import glue\n",
    "glue(\"code_src93\", get_code(\"openmdao.test_suite.scripts.circuit_analysis.Circuit\"), display=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d5734b04",
   "metadata": {
    "papermill": {
     "duration": 0.002271,
     "end_time": "2026-10-02T14:47:22.473962+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:22.471691+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    ":::{dropdown} `Circuit` class definition \n",
    "\n",
    "{glue:}`code_src93`\n",
    ":::"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "3eda65e4",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:22.479386Z",
     "iopub.status.busy": "2026-10-02T14:47:22.479236Z",
     "iopub.status.idle": "2026-10-02T14:47:23.716962Z",
     "shell.execute_reply": "2026-10-02T14:47:23.716285Z"
    },
    "papermill": {
     "duration": 1.24132,
     "end_time": "2026-10-02T14:47:23.717467+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:22.476147+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952443.663067] [runnervm8df0l:10962:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x5635eed049b0 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\n",
      "[1790952443.663313] [runnervm8df0l:10962:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[runnervm8df0l:10962] pml_ucx.c:313  Error: Failed to create UCP worker\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "        <iframe\n",
       "            width=\"100%\"\n",
       "            height=\"700\"\n",
       "            src=\"n2.html\"\n",
       "            frameborder=\"0\"\n",
       "            allowfullscreen\n",
       "            \n",
       "        ></iframe>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.lib.display.IFrame at 0x7ff627968ad0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import openmdao.api as om\n",
    "from openmdao.test_suite.scripts.circuit_analysis import Circuit\n",
    "\n",
    "p = om.Problem()\n",
    "model = p.model\n",
    "model.add_subsystem('circuit', Circuit())\n",
    "\n",
    "p.setup()\n",
    "\n",
    "om.n2(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "335b6c5d",
   "metadata": {
    "papermill": {
     "duration": 0.044275,
     "end_time": "2026-10-02T14:47:23.764475+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:23.720200+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```{note}\n",
    "To make use of the `--problem` argument, it is helpful to give your subproblem a meaningful name when it is instantiated, which you can use to identify it on the command line. \n",
    "\n",
    "For example:\n",
    "\n",
    "    subprob = om.Problem(name='subproblem1')\n",
    "\n",
    "    subcomp = om.SubmodelComp(problem=subprob)\n",
    "\n",
    "Then:\n",
    "\n",
    "    openmdao n2 --problem subproblem1\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c379f2aa",
   "metadata": {
    "papermill": {
     "duration": 0.002167,
     "end_time": "2026-10-02T14:47:23.769005+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:23.766838+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "If the test module happens to be part of a python package, then you can also use the dotted\n",
    "module pathname of the test module instead of the filename.\n",
    "\n",
    "A number of other openmdao commands, includng `view_connections` and `tree`, also support this\n",
    "functionality\n",
    "\n",
    "(om-command-view-connections)=\n",
    "### openmdao view_connections\n",
    "\n",
    "The `openmdao view_connections` command generates a table of connection information for all input and\n",
    "output variables in the model. Each row represents a connection between an output and a single input. The viewer's primary purpose is to help debug a model by making the following things easier:\n",
    "\n",
    "\n",
    "- Identifying unconnected inputs\n",
    "- Highlighting unit conversions or missing units\n",
    "- Identifying missing or unwanted implicit connections\n",
    "\n",
    "\n",
    "The table can be sorted by any column by clicking on the\n",
    "column header, and a column can be filtered by typing text into the 'filter column' field found\n",
    "at the top of each column.  Also, any column can be shown or hidden using the toggle buttons at\n",
    "the bottom of the table.  When input and output units differ, they are highlighted in\n",
    "red.  In the promoted input and output columns, variables that are promoted at some level in\n",
    "the model are shown in blue, while variables that are never promoted are shown in black.\n",
    "\n",
    "Below is an example of a connection viewer for a pycycle propulsor model obtained using the command:\n",
    "\n",
    "```\n",
    "openmdao view_connections -v propulsor.py\n",
    "```\n",
    "\n",
    "![An example of a connection viewer](images/view_connections.png)\n",
    "\n",
    "<div align=\"center\"><b>An example of a connection viewer</b></div>\n",
    "<br>\n",
    "\n",
    "By default the promoted names columns of both inputs and outputs are shown and their absolute\n",
    "names are hidden.\n",
    "\n",
    "When showing promoted output and promoted input columns, if the promoted output name equals the\n",
    "promoted input name, that means the connection is an implicit connection.  Otherwise the\n",
    "connection is explicit, meaning somewhere in the model there is an explicit call to `connect`\n",
    "that produced the connection.\n",
    "\n",
    "In OpenMDAO, multiple inputs can be promoted to the same name, and by sorting the promoted inputs\n",
    "column, all such inputs will be grouped together.  This can make it much easier to spot either\n",
    "missing or unwanted implicit connections.\n",
    "\n",
    "(om-command-scaling)=\n",
    "### openmdao scaling\n",
    "The `openmdao scaling` command generates tables of information for design variables, objectives,\n",
    "and constraints, as well as a viewer that shows magnitudes of subjacobians of the total jacobian.\n",
    "\n",
    "#### Design variable/objective/constraint tables\n",
    "\n",
    "Any of the columns in the design variable, objective, and constraint tables can be sorted by clicking on\n",
    "the header of the desired column.  Each row in a table corresponds to an individual design variable,\n",
    "objective, or constraint, and if that variable happens to be an array then the row can be expanded\n",
    "vertically using the \"+\" button on the far left to show a row for each entry in that array.  In\n",
    "the constraints table, if a constraint is linear it will have a green check mark in the \"linear\"\n",
    "column.\n",
    "\n",
    "\n",
    "#### Jacobian viewer\n",
    "\n",
    "The jacobian viewer displays magnitude information for each subjacobian of the total jacobian. It\n",
    "contains one column for each design variable and one row for each objective and constraint.  If there\n",
    "are linear constraints, the part of the total jacobian that depends on them will be displayed in\n",
    "a separate tab.  A detailed view of a given sub-jacobian can be see by left clicking on the corresponding\n",
    "cell in the total jacobian view.  It will open a new tab containing the detailed sub-jacobian view.\n",
    "The detailed sub-jacobian view can be closed by right clicking on the tab.\n",
    "\n",
    "Cells in both the top level and detailed sub-jacobian views will be colored based on the maximum\n",
    "absolute value found in that location.  If the location is known to be zero because a total coloring\n",
    "has been computed, it will be dark gray in color.  If the location happens to have a value of zero\n",
    "for some other reason, it will be colored light gray.  All other values will be displayed using a color\n",
    "map that goes from red at large values down to blue for small values.\n",
    "\n",
    "\n",
    "Below is an example of what the driver scaling tables and the jacobian view look like:\n",
    "\n",
    "![An example of driver scaling report tables](images/scaling_report_tables.png)\n",
    "\n",
    "<div align=\"center\"><b>An example of driver scaling report tables.</b></div>\n",
    "<br>\n",
    "\n",
    "![An example of driver scaling report jacobian view](images/scaling_report_jac.png)\n",
    "\n",
    "<div align=\"center\"><b>An example of driver scaling report jacobian view.</b></div>\n",
    "<br>\n",
    "\n",
    "#### openmdao tree\n",
    "\n",
    "The `openmdao tree` command prints an indented list of all systems in the model tree.  Each system's\n",
    "type and name are shown, along with their linear and nonlinear solvers if\n",
    "they differ from the defaults, which are LinearRunOnce and NonlinearRunOnce respectively.\n",
    "If the `-c` option is used, the tree will print in color if the terminal supports it and\n",
    "the *colorama* package is installed. If colors are used, implicit and explicit components will be\n",
    "displayed using different colors.\n",
    "\n",
    "The input and output sizes can also be displayed using the `--sizes` arg, and the `--approx` arg\n",
    "will display the approximation method and the number of approximated partials for systems that use\n",
    "approximated derivatives.\n",
    "\n",
    "The tree command also allows specific attributes and/or vector variables to be printed out along with their\n",
    "corresponding system in the tree using the `--attr` and `--var` args respectively.\n",
    "\n",
    "Here's an example of the tree output for a simple circuit model:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6b405b17",
   "metadata": {
    "papermill": {
     "duration": 0.002188,
     "end_time": "2026-10-02T14:47:23.773368+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:23.771180+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao tree --sizes --approx circuit.py\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "dfd323c6",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:23.778944Z",
     "iopub.status.busy": "2026-10-02T14:47:23.778751Z",
     "iopub.status.idle": "2026-10-02T14:47:27.561467Z",
     "shell.execute_reply": "2026-10-02T14:47:27.560663Z"
    },
    "papermill": {
     "duration": 3.786732,
     "end_time": "2026-10-02T14:47:27.562313+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:23.775581+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952446.929756] [runnervm8df0l:11230:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x55ad8ad0ee40 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952446.930147] [runnervm8df0l:11230:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11230] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/relevance.py:1294: OpenMDAOWarning:The following groups have a nonlinear solver that computes gradients and will be treated as atomic for the purposes of determining which systems are included in the optimization iteration: \r\n",
      "circuit\r\n",
      "\r\n",
      "Driver: \u001b[0mDriver\r\n",
      "\u001b[0m    \u001b[0mGroup \u001b[0m\u001b[0m (11 / 7)\u001b[0m\r\n",
      "\u001b[0m        \u001b[0mIndepVarComp \u001b[0mground\u001b[0m (0 / 1)\u001b[0m\r\n",
      "\u001b[0m        \u001b[0mIndepVarComp \u001b[0msource\u001b[0m (0 / 1)\u001b[0m\r\n",
      "\u001b[0m        \u001b[0mCircuit \u001b[0mcircuit\u001b[0m (11 / 5)\u001b[0m  LN: \u001b[0mDirectSolver\u001b[0m  NL: \u001b[0mNewtonSolver\u001b[0m\r\n",
      "\u001b[0m            \u001b[0mNode \u001b[0mn1\u001b[0m (3 / 1)\u001b[0m  APPROX: \u001b[0m['cs'] (3 of 3)\u001b[0m\r\n",
      "\u001b[0m            \u001b[0mNode \u001b[0mn2\u001b[0m (2 / 1)\u001b[0m  APPROX: \u001b[0m['cs'] (2 of 2)\u001b[0m\r\n",
      "\u001b[0m            \u001b[0mResistor \u001b[0mR1\u001b[0m (2 / 1)\u001b[0m  APPROX: \u001b[0m['cs'] (2 of 3)\u001b[0m\r\n",
      "\u001b[0m            \u001b[0mResistor \u001b[0mR2\u001b[0m (2 / 1)\u001b[0m  APPROX: \u001b[0m['cs'] (2 of 3)\u001b[0m\r\n",
      "\u001b[0m            \u001b[0mDiode \u001b[0mD1\u001b[0m (2 / 1)\u001b[0m  APPROX: \u001b[0m['cs'] (2 of 3)\u001b[0m\r\n",
      "\u001b[0m\u001b[0m"
     ]
    }
   ],
   "source": [
    "!openmdao tree --sizes --approx circuit.py"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ab0806fa",
   "metadata": {
    "papermill": {
     "duration": 0.123172,
     "end_time": "2026-10-02T14:47:27.688231+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:27.565059+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "### openmdao summary\n",
    "\n",
    "The `openmdao summary` command prints a high level summary of the model.  For example:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2dd4522e",
   "metadata": {
    "papermill": {
     "duration": 0.002615,
     "end_time": "2026-10-02T14:47:27.693767+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:27.691152+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao summary circle_opt.py\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "045b7cd6",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:27.700241Z",
     "iopub.status.busy": "2026-10-02T14:47:27.700009Z",
     "iopub.status.idle": "2026-10-02T14:47:31.493636Z",
     "shell.execute_reply": "2026-10-02T14:47:31.492518Z"
    },
    "papermill": {
     "duration": 3.797918,
     "end_time": "2026-10-02T14:47:31.494314+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:27.696396+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952450.836371] [runnervm8df0l:11235:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x55e80e47bc20 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952450.836662] [runnervm8df0l:11235:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11235] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "============== Problem Summary ============\r\n",
      "Groups:               1\r\n",
      "Components:           8\r\n",
      "Max tree depth:       1\r\n",
      "\r\n",
      "Design variables:            3   Total size:       21\r\n",
      "\r\n",
      "Nonlinear Constraints:       4   Total size:       21\r\n",
      "    equality:                2                     11\r\n",
      "    inequality:              2                     10\r\n",
      "\r\n",
      "Linear Constraints:          1   Total size:        1\r\n",
      "    equality:                1                      1\r\n",
      "    inequality:              0                      0\r\n",
      "\r\n",
      "Objectives:                  1   Total size:        1\r\n",
      "\r\n",
      "Input variables:            11   Total size:       82\r\n",
      "Output variables:           10   Total size:       77\r\n",
      "\r\n",
      "Total connections: 11   Total transfer data size: 82\r\n",
      "\r\n",
      "Driver type: ScipyOptimizeDriver\r\n",
      "Linear Solvers: [LinearRunOnce]\r\n",
      "Nonlinear Solvers: [NonlinearRunOnce]\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao summary circle_opt.py"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b2d19d1f",
   "metadata": {
    "papermill": {
     "duration": 0.002619,
     "end_time": "2026-10-02T14:47:31.500006+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:31.497387+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "### openmdao cite\n",
    "\n",
    "The `openmdao cite` command prints citations for any classes in the model that have them.\n",
    "It supports optional `-c` arguments to allow you to limit displayed citations to\n",
    "only those belonging to a particular class or group of classes.  By default, all citations for\n",
    "any class used in the problem will be displayed. For example:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fcc02408",
   "metadata": {
    "papermill": {
     "duration": 0.002522,
     "end_time": "2026-10-02T14:47:31.505078+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:31.502556+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao cite circuit.py\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "2a1dd340",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:31.511395Z",
     "iopub.status.busy": "2026-10-02T14:47:31.511196Z",
     "iopub.status.idle": "2026-10-02T14:47:35.289379Z",
     "shell.execute_reply": "2026-10-02T14:47:35.288414Z"
    },
    "papermill": {
     "duration": 3.782482,
     "end_time": "2026-10-02T14:47:35.290146+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:31.507664+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952454.603974] [runnervm8df0l:11240:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x558771bea5f0 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952454.604287] [runnervm8df0l:11240:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11240] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/relevance.py:1294: OpenMDAOWarning:The following groups have a nonlinear solver that computes gradients and will be treated as atomic for the purposes of determining which systems are included in the optimization iteration: \r\n",
      "circuit\r\n",
      "\r\n",
      "Class: <class 'openmdao.core.problem.Problem'>\r\n",
      "    @article{openmdao_2019,\r\n",
      "        Author={Justin S. Gray and John T. Hwang and Joaquim R. R. A.\r\n",
      "                Martins and Kenneth T. Moore and Bret A. Naylor},\r\n",
      "        Title=\"{OpenMDAO: An Open-Source Framework for Multidisciplinary\r\n",
      "                Design, Analysis, and Optimization}\",\r\n",
      "        Journal=\"{Structural and Multidisciplinary Optimization}\",\r\n",
      "        Year={2019},\r\n",
      "        Publisher={Springer},\r\n",
      "        pdf={http://openmdao.org/pubs/openmdao_overview_2019.pdf},\r\n",
      "        note= {In Press}\r\n",
      "        }\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao cite circuit.py"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "10b8974e",
   "metadata": {
    "papermill": {
     "duration": 0.002451,
     "end_time": "2026-10-02T14:47:35.295436+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:35.292985+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "## Profiling and Tracing Commands\n",
    "\n",
    "The following commands perform profiling or tracing on a run script, filtering their target\n",
    "functions based on pre-defined groups of functions that can be specified using the `-g` command line option. The available group will be displayed using the `-h` command line option.  For example, here's the usage output for the `openmdao trace` command, which includes the function groups available at the time of this writing:\n",
    "\n",
    "```\n",
    "usage: openmdao trace [-h] [-g METHODS] [-v] file\n",
    "\n",
    "positional arguments:\n",
    "  file                  Python file to be traced.\n",
    "\n",
    "optional arguments:\n",
    "  -h, --help            show this help message and exit\n",
    "  -g METHODS, --group METHODS\n",
    "                        Determines which group of methods will be traced.\n",
    "                        Default is \"openmdao\". Options are: ['dataflow',\n",
    "                        'linear', 'mpi', 'openmdao', 'openmdao_all', 'setup']\n",
    "  -v, --verbose         Show function locals and return values.\n",
    "\n",
    "```\n",
    "\n",
    "### openmdao iprof\n",
    "\n",
    "The `openmdao iprof` command will display an icicle plot showing the time elapsed in all of the target\n",
    "methods corresponding to each object instance that they were called on.  For more details, see\n",
    "[Instance-based Profiling](../features/debugging/profiling/inst_profile.ipynb).\n",
    "\n",
    "\n",
    "\n",
    "### openmdao iprof_totals\n",
    "\n",
    "The `openmdao iprof_totals` command performs the same profiling as `openmdao iprof`, but it outputs a simple,\n",
    "text-based summary of the total time spent in each method.  The [Instance-based Profiling](../features/debugging/profiling/inst_profile.ipynb) section contains more details.\n",
    "\n",
    "### openmdao trace\n",
    "\n",
    "The `openmdao trace` command prints a call trace for a specified set of functions.  Optionally it can\n",
    "display values of function locals and return values.  For more detail, see [Instance-based Call Tracing](../features/debugging/profiling/inst_call_tracing.ipynb).\n",
    "\n",
    "\n",
    "### openmdao timing\n",
    "\n",
    "The `openmdao timing` command, like the `openmdao iprof` command, is meant to show how much time is being spent in methods of particular instances under MPI.  The `timing` command focuses specifically on methods of openmdao components and groups, and it also has features to make it easier to understand how an openmdao model is performing when running under MPI.  Aside from the addition of MPI related information, it has the added advantage over `openmdao iprof` that its overhead is much lower so it shouldn't increase run time very much, and it shouldn't distort the timing results as can happen with `openmdao iprof`. For more details, see\n",
    "[Timing Systems under MPI](../features/debugging/profiling/timing.ipynb).\n",
    "\n",
    "\n",
    "Memory Profiling\n",
    "\n",
    "### openmdao mem\n",
    "\n",
    "The `openmdao mem` command profiles the memory usage of python functions.  For more detail,\n",
    "see [Memory Profiling](../features/debugging/profiling/inst_mem_profile.ipynb).\n",
    "\n",
    "### openmdao mempost\n",
    "\n",
    "The `openmdao mempost` command postprocesses the raw memory dump file generated by `openmdao mem`.\n",
    "For more detail, see [Memory Profiling](../features/debugging/profiling/inst_mem_profile.ipynb).\n",
    "\n",
    "\n",
    "\n",
    "## Other Commands\n",
    "\n",
    "### openmdao call_tree\n",
    "\n",
    "The `openmdao call_tree` command takes the full module path of a class method and displays the\n",
    "call tree for that method.  It's purpose is to show which class 'owns' the specified method\n",
    "call and any other 'self.*' methods that it calls. Note that it shows all of the methods called,\n",
    "regardless of the result of conditionals within any function, so the displayed tree does not\n",
    "necessarily represent a trace of the function as it executes.  The functions are ordered top to\n",
    "bottom as they are encountered in the source code, and a given subfunction is only displayed\n",
    "once within a given function, even if it is actually called in multiple places within the function.\n",
    "Here's an example:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0882fff8",
   "metadata": {
    "papermill": {
     "duration": 0.00232,
     "end_time": "2026-10-02T14:47:35.300395+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:35.298075+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao call_tree openmdao.api.LinearBlockGS.solve\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "1d996e3b",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:35.306022Z",
     "iopub.status.busy": "2026-10-02T14:47:35.305831Z",
     "iopub.status.idle": "2026-10-02T14:47:39.093562Z",
     "shell.execute_reply": "2026-10-02T14:47:39.092479Z"
    },
    "papermill": {
     "duration": 3.791425,
     "end_time": "2026-10-02T14:47:39.094187+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:35.302762+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952458.451110] [runnervm8df0l:11245:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x55c477441810 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952458.451752] [runnervm8df0l:11245:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11245] pml_ucx.c:313  Error: Failed to create UCP worker\r\n",
      "BlockLinearSolver.solve\r\n",
      "  LinearSolver._solve\r\n",
      "    Solver._mpi_print_header\r\n",
      "    LinearBlockGS._iter_initialize\r\n",
      "      BlockLinearSolver._iter_initialize\r\n",
      "        BlockLinearSolver._update_rhs_vec\r\n",
      "          BlockLinearSolver._create_rhs_vec\r\n",
      "        BlockLinearSolver._run_apply\r\n",
      "          BlockLinearSolver._union_matvec_scope\r\n",
      "        BlockLinearSolver._iter_get_norm\r\n",
      "    Solver._mpi_print\r\n",
      "    LinearBlockGS._single_iteration\r\n",
      "      BlockLinearSolver._union_matvec_scope\r\n",
      "    BlockLinearSolver._run_apply\r\n",
      "    BlockLinearSolver._iter_get_norm\r\n",
      "    Solver._inf_nan_failure\r\n",
      "      Solver.report_failure\r\n",
      "    Solver._convergence_failure\r\n",
      "      Solver.report_failure\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao call_tree openmdao.api.LinearBlockGS.solve"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d7df93f6",
   "metadata": {
    "papermill": {
     "duration": 0.002551,
     "end_time": "2026-10-02T14:47:39.099527+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:39.096976+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "(ref-scaffold)=\n",
    "### openmdao scaffold\n",
    "\n",
    "The `openmdao scaffold` command generates simple scaffolding, or 'skeleton' code for\n",
    "a class that inherits from an allowed OpenMDAO base class.  The allowed base classes are shown as\n",
    "part of the description of the `--base` arg below:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3da32176",
   "metadata": {
    "papermill": {
     "duration": 0.002423,
     "end_time": "2026-10-02T14:47:39.104315+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:39.101892+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao scaffold -h\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "11ee04d8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:39.309215Z",
     "iopub.status.busy": "2026-10-02T14:47:39.309019Z",
     "iopub.status.idle": "2026-10-02T14:47:42.956944Z",
     "shell.execute_reply": "2026-10-02T14:47:42.955462Z"
    },
    "papermill": {
     "duration": 3.654198,
     "end_time": "2026-10-02T14:47:42.957675+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:39.303477+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952462.353265] [runnervm8df0l:11250:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x562886c1b890 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952462.353538] [runnervm8df0l:11250:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11250] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: openmdao scaffold [-h] [-c CLASS_NAME] [-b BASE] [-p PACKAGE]\r\n",
      "                         [--cmd COMMAND_NAME]\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help            show this help message and exit\r\n",
      "  -c, --class CLASS_NAME\r\n",
      "                        Name of the new class. If an output file is not\r\n",
      "                        provided, this name will be used to generate the\r\n",
      "                        output file name.\r\n",
      "  -b, --base BASE       Name of the base class for the new class. Allowed base\r\n",
      "                        classes are: ['BaseCaseReader', 'CaseRecorder',\r\n",
      "                        'Driver', 'ExplicitComponent', 'Group',\r\n",
      "                        'ImplicitComponent', 'LinearSolver',\r\n",
      "                        'NonlinearSolver', 'SurrogateModel']\r\n",
      "  -p, --package PACKAGE\r\n",
      "                        Specify name of python package. If this is specified,\r\n",
      "                        the directory structure for a python package will be\r\n",
      "                        created.\r\n",
      "  --cmd COMMAND_NAME    Create scaffolding for an OpenMDAO command line tool.\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao scaffold -h"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "958f69a4",
   "metadata": {
    "papermill": {
     "duration": 0.002565,
     "end_time": "2026-10-02T14:47:42.963237+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:42.960672+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "In addition, the command will generate the scaffolding for a simple\n",
    "test file for that class, and if the `--package` option is used, it will generate the directory\n",
    "structure for a simple installable python package and will declare an entry point in the\n",
    "`setup.py` file so that the given class can be discoverable as an OpenMDAO plugin when installed.\n",
    "\n",
    "To build scaffolding for an OpenMDAO command line tool plugin, use the `--cmd` option.\n",
    "\n",
    "(list-installed)=\n",
    "### openmdao list_installed\n",
    "\n",
    "The `openmdao list_installed` command lists installed classes of the specified type(s).\n",
    "Its options are shown below:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7b370738",
   "metadata": {
    "papermill": {
     "duration": 0.003005,
     "end_time": "2026-10-02T14:47:43.121746+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:43.118741+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao list_installed -h\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "ebf074be",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:43.128284Z",
     "iopub.status.busy": "2026-10-02T14:47:43.128089Z",
     "iopub.status.idle": "2026-10-02T14:47:46.841835Z",
     "shell.execute_reply": "2026-10-02T14:47:46.840914Z"
    },
    "papermill": {
     "duration": 3.718066,
     "end_time": "2026-10-02T14:47:46.842427+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:43.124361+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952466.234928] [runnervm8df0l:11255:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x561a0784a6f0 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952466.235159] [runnervm8df0l:11255:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11255] pml_ucx.c:313  Error: Failed to create UCP worker\r\n",
      "usage: openmdao list_installed [-h] [-d] [-x EXCLUDES] [-i INCLUDES]\r\n",
      "                               [types ...]\r\n",
      "\r\n",
      "positional arguments:\r\n",
      "  types                 List these types of installed classes. Allowed types\r\n",
      "                        are ['case_reader', 'case_recorder', 'command',\r\n",
      "                        'component', 'driver', 'group', 'lin_solver',\r\n",
      "                        'nl_solver', 'report', 'surrogate_model'].\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help            show this help message and exit\r\n",
      "  -d, --docs            Display the class docstrings.\r\n",
      "  -x, --exclude EXCLUDES\r\n",
      "                        Package to exclude.\r\n",
      "  -i, --include INCLUDES\r\n",
      "                        Package to include.\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao list_installed -h"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a8a568a6",
   "metadata": {
    "papermill": {
     "duration": 0.002602,
     "end_time": "2026-10-02T14:47:46.848245+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:46.845643+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "By default, installed types from all installed packages are shown, but the output can be filtered\n",
    "by the use of the `-i` option to include only specified packages, or the `-x` option\n",
    "to exclude specified packages.\n",
    "\n",
    "For example, to show only those linear and nonlinear solver types that are part of the `openmdao`\n",
    "package, do the following:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8c244bdc",
   "metadata": {
    "papermill": {
     "duration": 0.085514,
     "end_time": "2026-10-02T14:47:46.936317+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:46.850803+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao list_installed lin_solver nl_solver -i openmdao\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "a52a4fa2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:46.942855Z",
     "iopub.status.busy": "2026-10-02T14:47:46.942629Z",
     "iopub.status.idle": "2026-10-02T14:47:50.628851Z",
     "shell.execute_reply": "2026-10-02T14:47:50.627809Z"
    },
    "papermill": {
     "duration": 3.690778,
     "end_time": "2026-10-02T14:47:50.629950+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:46.939172+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952469.996402] [runnervm8df0l:11260:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x5565dbb68160 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952469.996711] [runnervm8df0l:11260:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11260] pml_ucx.c:313  Error: Failed to create UCP worker\r\n",
      "Installed lin_solvers:\r\n",
      "\r\n",
      "  Package: openmdao  Version: 3.45.2-dev \r\n",
      "\r\n",
      "    Class or Function  Module  \r\n",
      "    -----------------  ------  \r\n",
      "    DirectSolver       openmdao.solvers.linear.direct\r\n",
      "    LinearBlockGS      openmdao.solvers.linear.linear_block_gs\r\n",
      "    LinearBlockJac     openmdao.solvers.linear.linear_block_jac\r\n",
      "    LinearRunOnce      openmdao.solvers.linear.linear_runonce\r\n",
      "    PETScDirectSolver  openmdao.solvers.linear.petsc_direct_solver\r\n",
      "    PETScKrylov        openmdao.solvers.linear.petsc_ksp\r\n",
      "    ScipyKrylov        openmdao.solvers.linear.scipy_iter_solver\r\n",
      "    LinearUserDefined  openmdao.solvers.linear.user_defined\r\n",
      "\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Installed nl_solvers:\r\n",
      "\r\n",
      "  Package: openmdao  Version: 3.45.2-dev \r\n",
      "\r\n",
      "    Class or Function  Module  \r\n",
      "    -----------------  ------  \r\n",
      "    ArmijoGoldsteinLS  openmdao.solvers.linesearch.backtracking\r\n",
      "    BoundsEnforceLS    openmdao.solvers.linesearch.backtracking\r\n",
      "    BrentSolver        openmdao.solvers.nonlinear.brent\r\n",
      "    BroydenSolver      openmdao.solvers.nonlinear.broyden\r\n",
      "    NewtonSolver       openmdao.solvers.nonlinear.newton\r\n",
      "    NonlinearBlockGS   openmdao.solvers.nonlinear.nonlinear_block_gs\r\n",
      "    NonlinearBlockJac  openmdao.solvers.nonlinear.nonlinear_block_jac\r\n",
      "    NonlinearRunOnce   openmdao.solvers.nonlinear.nonlinear_runonce\r\n",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao list_installed lin_solver nl_solver -i openmdao"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "277239e4",
   "metadata": {
    "papermill": {
     "duration": 0.003041,
     "end_time": "2026-10-02T14:47:50.636286+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:50.633245+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "Similarly, to hide all of the built-in (openmdao) solver types and only see installed plugin\n",
    "solver types, do the following.\n",
    "\n",
    "```\n",
    "openmdao list_installed lin_solver nl_solver -x openmdao\n",
    "```\n",
    "\n",
    "### openmdao find_repos\n",
    "\n",
    "The `openmdao find_repos` command finds github repositories with `openmdao` or openmdao plugin specific\n",
    "strings registered as topics.\n",
    "\n",
    "Its options are shown below:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "098e5a4d",
   "metadata": {
    "papermill": {
     "duration": 0.002811,
     "end_time": "2026-10-02T14:47:50.642006+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:50.639195+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao find_repos -h\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "aecbb8b8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:50.650446Z",
     "iopub.status.busy": "2026-10-02T14:47:50.650242Z",
     "iopub.status.idle": "2026-10-02T14:47:54.621897Z",
     "shell.execute_reply": "2026-10-02T14:47:54.620800Z"
    },
    "papermill": {
     "duration": 3.976111,
     "end_time": "2026-10-02T14:47:54.622639+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:50.646528+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952473.830987] [runnervm8df0l:11265:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x558a526c6660 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952473.831266] [runnervm8df0l:11265:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11265] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: openmdao find_repos [-h] [--format TABLEFMT] [topics ...]\r\n",
      "\r\n",
      "positional arguments:\r\n",
      "  topics             Find github repos with these topics. Allowed topics are\r\n",
      "                     ['case_reader', 'case_recorder', 'command', 'component',\r\n",
      "                     'driver', 'group', 'lin_solver', 'nl_solver', 'openmdao',\r\n",
      "                     'report', 'surrogate_model'].\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help         show this help message and exit\r\n",
      "  --format TABLEFMT  Format for generated table. Defaults to 'tabulator' which\r\n",
      "                     generates a sortable, filterable web-based table. Other\r\n",
      "                     options include 'html', 'text', 'rst' and 'grid'.\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao find_repos -h"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d49b1323",
   "metadata": {
    "papermill": {
     "duration": 0.003035,
     "end_time": "2026-10-02T14:47:54.629166+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:54.626131+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "One example of its use would be to display any github repositories claiming to contain openmdao command\n",
    "line tools.  At the time this documentation was created, the following repositories were found:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7af77fb9",
   "metadata": {
    "papermill": {
     "duration": 0.002826,
     "end_time": "2026-10-02T14:47:54.634947+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:54.632121+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao find_repos command --format text\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "43f73154",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:54.664545Z",
     "iopub.status.busy": "2026-10-02T14:47:54.664333Z",
     "iopub.status.idle": "2026-10-02T14:47:58.757564Z",
     "shell.execute_reply": "2026-10-02T14:47:58.756450Z"
    },
    "papermill": {
     "duration": 4.120471,
     "end_time": "2026-10-02T14:47:58.758319+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:54.637848+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952477.801354] [runnervm8df0l:11270:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x56505286dc50 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952477.801986] [runnervm8df0l:11270:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11270] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "| ----------------------------------------------------------------------------------------------------------------------------------- |\r\n",
      "| Pkg Name      | URL                                     | Topics           | Last Update | Description                              |\r\n",
      "| ------------- | --------------------------------------- | ---------------- | ----------- | ---------------------------------------- |\r\n",
      "| OpenMDAO-XDSM | https://github.com/onodip/OpenMDAO-XDSM | openmdao-command | 2024-02-10  | XDSM viewer plugin for OpenMDAO          |\r\n",
      "| om_devtools   | https://github.com/naylor-b/om_devtools | openmdao-command | 2022-04-28  | Some low level OpenMDAO developer tools. |\r\n",
      "| ----------------------------------------------------------------------------------------------------------------------------------- |\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao find_repos command --format text"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "81ef2323",
   "metadata": {
    "papermill": {
     "duration": 0.00267,
     "end_time": "2026-10-02T14:47:58.764084+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:58.761414+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "(compute-entry-points)=\n",
    "### openmdao compute_entry_points\n",
    "\n",
    "The `openmdao compute_entry_points` command lists entry point groups and entry points for\n",
    "any openmdao compatible classes, e.g., Component, Group, etc., that it finds within a given\n",
    "python package. Its options are shown below:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bdabd848",
   "metadata": {
    "papermill": {
     "duration": 0.00268,
     "end_time": "2026-10-02T14:47:58.769410+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:58.766730+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "openmdao compute_entry_points -h\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "72649b11",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:47:58.775979Z",
     "iopub.status.busy": "2026-10-02T14:47:58.775824Z",
     "iopub.status.idle": "2026-10-02T14:48:02.501630Z",
     "shell.execute_reply": "2026-10-02T14:48:02.500272Z"
    },
    "papermill": {
     "duration": 3.730352,
     "end_time": "2026-10-02T14:48:02.502364+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:47:58.772012+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952481.871620] [runnervm8df0l:11275:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x564d8810a330 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952481.872446] [runnervm8df0l:11275:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11275] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: openmdao compute_entry_points [-h] [-o OUTFILE] package\r\n",
      "\r\n",
      "positional arguments:\r\n",
      "  package     Compute entry points for this package.\r\n",
      "\r\n",
      "options:\r\n",
      "  -h, --help  show this help message and exit\r\n",
      "  -o OUTFILE  output file.\r\n"
     ]
    }
   ],
   "source": [
    "!openmdao compute_entry_points -h"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6284aafa",
   "metadata": {
    "papermill": {
     "duration": 0.002851,
     "end_time": "2026-10-02T14:48:02.512220+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:48:02.509369+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "For example, to show all of the potential openmdao entry point groups and entry points for an\n",
    "installed python package called `mypackage`, you would do the following:\n",
    "\n",
    "```\n",
    "openmdao compute_entry_points mypackage\n",
    "```\n",
    "\n",
    "The entry point information will be printed in a form that can easily be pasted into the\n",
    "`setup.py` file for the specified package.\n",
    "\n",
    "## Using Commands under MPI\n",
    "\n",
    "In general, usage of openmdao subcommands under MPI is the same as usual, except the command will\n",
    "be preceded by `mpirun -n <num_procs>`.  For example:"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "caafeef9",
   "metadata": {
    "papermill": {
     "duration": 0.002844,
     "end_time": "2026-10-02T14:48:02.517690+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:48:02.514846+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "mpirun -n 2 openmdao summary multipoint_beam_opt.py\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "2259d948",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-02T14:48:02.524095Z",
     "iopub.status.busy": "2026-10-02T14:48:02.523896Z",
     "iopub.status.idle": "2026-10-02T14:48:06.987617Z",
     "shell.execute_reply": "2026-10-02T14:48:06.986758Z"
    },
    "papermill": {
     "duration": 4.467817,
     "end_time": "2026-10-02T14:48:06.988142+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:48:02.520325+00:00",
     "status": "completed"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1790952484.239272] [runnervm8df0l:11283:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x5636607727c0 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952484.239379] [runnervm8df0l:11284:0]        ib_iface.c:1269 UCX  ERROR mana_0: iface 0x561203745d70 failed to create UD QP TX wr:256 sge:6 inl:64 resp:0 RX wr:4096 sge:1 resp:0 failed: Operation not supported\r\n",
      "[1790952484.239743] [runnervm8df0l:11283:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[1790952484.239794] [runnervm8df0l:11284:0]      ucp_worker.c:1412 UCX  ERROR uct_iface_open(ud_verbs/mana_0:1) failed: Input/output error\r\n",
      "[runnervm8df0l:11283] pml_ucx.c:313  Error: Failed to create UCP worker\r\n",
      "[runnervm8df0l:11284] pml_ucx.c:313  Error: Failed to create UCP worker\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "============== Problem Summary ============\r\n",
      "Groups:               4\r\n",
      "Components:          10\r\n",
      "Traceback (most recent call last):\r\n",
      "Traceback (most recent call last):\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/bin/openmdao\"\u001b[0m, line \u001b[35m6\u001b[0m, in \u001b[35m<module>\u001b[0m\r\n",
      "    sys.exit(\u001b[31mopenmdao_cmd\u001b[0m\u001b[1;31m()\u001b[0m)\r\n",
      "             \u001b[31m~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/om.py\"\u001b[0m, line \u001b[35m905\u001b[0m, in \u001b[35mopenmdao_cmd\u001b[0m\r\n",
      "    \u001b[31moptions.executor\u001b[0m\u001b[1;31m(options, user_args)\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/om.py\"\u001b[0m, line \u001b[35m256\u001b[0m, in \u001b[35m_config_summary_cmd\u001b[0m\r\n",
      "    \u001b[31m_load_and_exec\u001b[0m\u001b[1;31m(options.file[0], user_args)\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/file_utils.py\"\u001b[0m, line \u001b[35m208\u001b[0m, in \u001b[35m_load_and_exec\u001b[0m\r\n",
      "    \u001b[31mexec\u001b[0m\u001b[1;31m(code, globals_dict)\u001b[0m  # nosec: private, internal use only\r\n",
      "    \u001b[31m~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"multipoint_beam_opt.py\"\u001b[0m, line \u001b[35m36\u001b[0m, in \u001b[35m<module>\u001b[0m\r\n",
      "    \u001b[31mprob.run_driver\u001b[0m\u001b[1;31m()\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/core/problem.py\"\u001b[0m, line \u001b[35m735\u001b[0m, in \u001b[35mrun_driver\u001b[0m\r\n",
      "    \u001b[31mself.final_setup\u001b[0m\u001b[1;31m()\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m370\u001b[0m, in \u001b[35m__call__\u001b[0m\r\n",
      "    \u001b[31mself._run_hooks\u001b[0m\u001b[1;31m(self.post_hooks, args, kwargs, ret)\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m350\u001b[0m, in \u001b[35m_run_hooks\u001b[0m\r\n",
      "    \u001b[31mhook\u001b[0m\u001b[1;31m(inst, args, kwargs, ret)\u001b[0m\r\n",
      "    \u001b[31m~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m162\u001b[0m, in \u001b[35m__call__\u001b[0m\r\n",
      "    ret = self._call_hook(inst, args, kwargs, ret)\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m194\u001b[0m, in \u001b[35m_call_hook\u001b[0m\r\n",
      "    return \u001b[31mself.hook\u001b[0m\u001b[1;31m(inst, **self.reg_kwargs)\u001b[0m\r\n",
      "           \u001b[31m~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/devtools/debug.py\"\u001b[0m, line \u001b[35m270\u001b[0m, in \u001b[35mconfig_summary\u001b[0m\r\n",
      "    printer(\u001b[31m\"Max tree depth:   %5d\" \u001b[0m\u001b[1;31m%\u001b[0m\u001b[31m global_max_depth\u001b[0m)\r\n",
      "            \u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^\u001b[0m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/bin/openmdao\"\u001b[0m, line \u001b[35m6\u001b[0m, in \u001b[35m<module>\u001b[0m\r\n",
      "    sys.exit(\u001b[31mopenmdao_cmd\u001b[0m\u001b[1;31m()\u001b[0m)\r\n",
      "             \u001b[31m~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^\u001b[0m\r\n",
      "\u001b[1;35mTypeError\u001b[0m: \u001b[35m%d format: a real number is required, not numpy.ndarray\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/om.py\"\u001b[0m, line \u001b[35m905\u001b[0m, in \u001b[35mopenmdao_cmd\u001b[0m\r\n",
      "    \u001b[31moptions.executor\u001b[0m\u001b[1;31m(options, user_args)\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/om.py\"\u001b[0m, line \u001b[35m256\u001b[0m, in \u001b[35m_config_summary_cmd\u001b[0m\r\n",
      "    \u001b[31m_load_and_exec\u001b[0m\u001b[1;31m(options.file[0], user_args)\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/file_utils.py\"\u001b[0m, line \u001b[35m208\u001b[0m, in \u001b[35m_load_and_exec\u001b[0m\r\n",
      "    \u001b[31mexec\u001b[0m\u001b[1;31m(code, globals_dict)\u001b[0m  # nosec: private, internal use only\r\n",
      "    \u001b[31m~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"multipoint_beam_opt.py\"\u001b[0m, line \u001b[35m36\u001b[0m, in \u001b[35m<module>\u001b[0m\r\n",
      "    \u001b[31mprob.run_driver\u001b[0m\u001b[1;31m()\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/core/problem.py\"\u001b[0m, line \u001b[35m735\u001b[0m, in \u001b[35mrun_driver\u001b[0m\r\n",
      "    \u001b[31mself.final_setup\u001b[0m\u001b[1;31m()\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m370\u001b[0m, in \u001b[35m__call__\u001b[0m\r\n",
      "    \u001b[31mself._run_hooks\u001b[0m\u001b[1;31m(self.post_hooks, args, kwargs, ret)\u001b[0m\r\n",
      "    \u001b[31m~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m350\u001b[0m, in \u001b[35m_run_hooks\u001b[0m\r\n",
      "    \u001b[31mhook\u001b[0m\u001b[1;31m(inst, args, kwargs, ret)\u001b[0m\r\n",
      "    \u001b[31m~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m162\u001b[0m, in \u001b[35m__call__\u001b[0m\r\n",
      "    ret = self._call_hook(inst, args, kwargs, ret)\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/utils/hooks.py\"\u001b[0m, line \u001b[35m194\u001b[0m, in \u001b[35m_call_hook\u001b[0m\r\n",
      "    return \u001b[31mself.hook\u001b[0m\u001b[1;31m(inst, **self.reg_kwargs)\u001b[0m\r\n",
      "           \u001b[31m~~~~~~~~~\u001b[0m\u001b[1;31m^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\r\n",
      "  File \u001b[35m\"/home/runner/work/OpenMDAO/OpenMDAO/.pixi/envs/dev/lib/python3.13/site-packages/openmdao/devtools/debug.py\"\u001b[0m, line \u001b[35m270\u001b[0m, in \u001b[35mconfig_summary\u001b[0m\r\n",
      "    printer(\u001b[31m\"Max tree depth:   %5d\" \u001b[0m\u001b[1;31m%\u001b[0m\u001b[31m global_max_depth\u001b[0m)\r\n",
      "            \u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[0m\u001b[1;31m^\u001b[0m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[0m\r\n",
      "\u001b[1;35mTypeError\u001b[0m: \u001b[35m%d format: a real number is required, not numpy.ndarray\u001b[0m\r\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--------------------------------------------------------------------------\r\n",
      "prterun detected that one or more processes exited with non-zero status,\r\n",
      "thus causing the job to be terminated. The first process to do so was:\r\n",
      "\r\n",
      "   Process name: [prterun-runnervm8df0l-11280@1,0]\r\n",
      "   Exit code:    1\r\n",
      "--------------------------------------------------------------------------\r\n"
     ]
    }
   ],
   "source": [
    "!mpirun -n 2 openmdao summary multipoint_beam_opt.py"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f9a5eec2",
   "metadata": {
    "papermill": {
     "duration": 0.002753,
     "end_time": "2026-10-02T14:48:06.994313+00:00",
     "exception": false,
     "start_time": "2026-10-02T14:48:06.991560+00:00",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "```\n",
    "============== Problem Summary ============\n",
    "Groups:               4\n",
    "Components:          10\n",
    "Max tree depth:       3\n",
    "\n",
    "Design variables:            1   Total size:        5\n",
    "\n",
    "Nonlinear Constraints:       1   Total size:        1\n",
    "    equality:                1                      1\n",
    "    inequality:              0                      0\n",
    "\n",
    "Linear Constraints:          0   Total size:        0\n",
    "    equality:                0                      0\n",
    "    inequality:              0                      0\n",
    "\n",
    "Objectives:                  1   Total size:        1\n",
    "\n",
    "Input variables:            10   Total size:     1961\n",
    "Output variables:           10   Total size:     1117\n",
    "\n",
    "Total connections: 10   Total transfer data size: 1961\n",
    "\n",
    "Driver type: ScipyOptimizeDriver\n",
    "Linear Solvers: [LinearRunOnce x 4]\n",
    "Nonlinear Solvers: [NonlinearRunOnce x 4]\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.14"
  },
  "papermill": {
   "default_parameters": {},
   "duration": 69.057476,
   "end_time": "2026-10-02T14:48:07.612709+00:00",
   "environment_variables": {},
   "exception": null,
   "input_path": "/home/runner/work/OpenMDAO/OpenMDAO/openmdao/docs/openmdao_book/other_useful_docs/om_command.ipynb",
   "output_path": "/home/runner/work/OpenMDAO/OpenMDAO/openmdao/docs/_executed_book/other_useful_docs/om_command.ipynb",
   "parameters": {},
   "start_time": "2026-10-02T14:46:58.555233+00:00",
   "version": "2.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}