PyROS Solver Output Log

Default Format

When the PyROS solve() method is called to solve a robust optimization problem, your console output will, by default, look like this:

Listing 1 PyROS solver output log for the Quickstart example.
 1==============================================================================
 2PyROS: The Pyomo Robust Optimization Solver, v1.3.11.
 3       Pyomo version: 6.9.5
 4       Commit hash: unknown
 5       Invoked at UTC 2025-10-18T00:00:00.000000+00:00
 6
 7Developed by: Natalie M. Isenberg (1), Jason A. F. Sherman (1),
 8              John D. Siirola (2), Chrysanthos E. Gounaris (1)
 9(1) Carnegie Mellon University, Department of Chemical Engineering
10(2) Sandia National Laboratories, Center for Computing Research
11
12The developers gratefully acknowledge support from the U.S. Department
13of Energy's Institute for the Design of Advanced Energy Systems (IDAES).
14==============================================================================
15================================= DISCLAIMER =================================
16PyROS is currently under active development.
17Please provide feedback and/or report any issues by creating a ticket at
18https://github.com/Pyomo/pyomo/issues/new/choose
19==============================================================================
20User-provided solver options:
21 objective_focus=<ObjectiveType.worst_case: 1>
22 decision_rule_order=1
23 solve_master_globally=True
24------------------------------------------------------------------------------
25Model Statistics (before preprocessing):
26  Number of variables : 4
27    First-stage variables : 1
28    Second-stage variables : 1
29    State variables : 2
30  Number of uncertain parameters : 2
31  Number of constraints : 4
32    Equality constraints : 2
33    Inequality constraints : 2
34------------------------------------------------------------------------------
35Preprocessing...
36Done preprocessing; required wall time of 0.004s.
37------------------------------------------------------------------------------
38Itn  Objective    1-Stg Shift  2-Stg Shift  #CViol  Max Viol     Wall Time (s)
39------------------------------------------------------------------------------
400     5.4079e+03  -            -            3       7.9226e+00   0.209
411     5.4079e+03  6.0451e-10   1.0717e-10   2       1.0250e-01   0.476
422     6.5403e+03  1.0018e-01   7.4564e-03   1       1.0249e-02   0.786
433     6.5403e+03  1.9372e-16   2.0321e-05   2       8.7074e-03   1.132
444     6.5403e+03  0.0000e+00   2.0311e-05   0       1.2310e-06g  1.956
45------------------------------------------------------------------------------
46Robust optimal solution identified.
47------------------------------------------------------------------------------
48Termination stats:
49 Iterations            : 5
50 Solve time (wall s)   : 1.956
51 Final objective value : 6.5403e+03
52 Termination condition : pyrosTerminationCondition.robust_optimal
53------------------------------------------------------------------------------
54All done. Exiting PyROS.
55==============================================================================

Observe that the log contains the following information (listed in order of appearance):

  • Introductory information and disclaimer (lines 1–19): Includes the version number, author information, (UTC) time at which the solver was invoked, and, if available, information on the local Git branch and commit hash.

  • Summary of solver options (lines 20–24): Enumeration of specifications for optional arguments to the solver.

  • Model component statistics (lines 25–34): Breakdown of component statistics for the user-provided model and variable selection (before preprocessing).

  • Preprocessing information (lines 35–37): Wall time required for preprocessing the deterministic model and associated components, i.e., standardizing model components and adding the decision rule variables and equations.

  • Iteration log table (lines 38–45): Summary information on the problem iterates and subproblem outcomes. The constituent columns are defined in detail in the table that follows.

  • Termination message (lines 46–47): One-line message briefly summarizing the reason the solver has terminated.

  • Final result (lines 48–53): A printout of the ROSolveResults object that is finally returned.

  • Exit message (lines 54–55): Confirmation that the solver has been exited properly.

The iteration log table is designed to provide, in a concise manner, important information about the progress of the iterative algorithm for the problem of interest. The constituent columns are defined in the table below.

Table 3 PyROS iteration log table columns.

Column Name

Definition

Itn

Iteration number, equal to one less than the total number of elapsed iterations.

Objective

Master solution objective function value. If the objective of the deterministic model provided has a maximization sense, then the negative of the objective function value is displayed. Expect this value to trend upward as the iteration number increases. A dash (“-”) is produced in lieu of a value if the master problem of the current iteration is not solved successfully.

1-Stg Shift

Infinity norm of the relative difference between the first-stage variable vectors of the master solutions of the current and previous iterations. Expect this value to trend downward as the iteration number increases. A dash (“-”) is produced in lieu of a value if the current iteration number is 0, there are no first-stage variables, or the master problem of the current iteration is not solved successfully.

2-Stg Shift

Infinity norm of the relative difference between the second-stage variable vectors (evaluated subject to the nominal uncertain parameter realization) of the master solutions of the current and previous iterations. Expect this value to trend downward as the iteration number increases. A dash (“-”) is produced in lieu of a value if the current iteration number is 0, there are no second-stage variables, or the master problem of the current iteration is not solved successfully. An asterisk (“*”) is appended to the value if decision rule polishing was unsuccessful.

#CViol

Number of second-stage inequality constraints found to be violated during the separation step of the current iteration. Unless a custom prioritization of the model’s second-stage inequality constraints is specified (through the separation_priority_order argument), expect this number to trend downward as the iteration number increases. A “+” is appended if not all of the separation problems were solved successfully, either due to custom prioritization, a time out, or an issue encountered by the subordinate optimizers. A dash (“-”) is produced in lieu of a value if the separation routine is not invoked during the current iteration.

Max Viol

Maximum scaled second-stage inequality constraint violation. Expect this value to trend downward as the iteration number increases. A ‘g’ is appended to the value if the separation problems were solved globally during the current iteration. A dash (“-”) is produced in lieu of a value if the separation routine is not invoked during the current iteration, or if there are no second-stage inequality constraints.

Wall time (s)

Total time elapsed by the solver, in seconds, up to the end of the current iteration.

Configuring the Output Log

The PyROS solver output log is produced by the Python logger (logging.Logger) object derived from the optional argument progress_logger to the PyROS solve() method. By default, the PyROS solver argument progress_logger is taken to be the logging.INFO-level logger with name "pyomo.contrib.pyros". The verbosity level of the output log can be adjusted by setting the logging level of the progress logger. For example, the level of the default logger can be adjusted to logging.DEBUG as follows:

import logging
logging.getLogger("pyomo.contrib.pyros").setLevel(logging.DEBUG)

We refer the reader to the official Python logging library documentation for further guidance on (customization of) Python logger objects.

The following table describes the information logged by PyROS at the various logging levels. Messages of a lower logging level than that of the progress logger are excluded from the solver log.

Table 4 PyROS solver log output at the various standard Python logging levels.

Logging Level

Output Messages

logging.ERROR

  • Elaborations of exceptions stemming from expression evaluation errors or issues encountered by the subordinate solvers

logging.WARNING

  • Elaboration of unacceptable subproblem termination statuses for critical subproblems

  • Caution about solution robustness guarantees in event that user passes bypass_global_separation=True

logging.INFO

  • PyROS version, author, and disclaimer information

  • Summary of user options

  • Model component statistics (before preprocessing)

  • Summary of preprocessing outcome

  • Iteration log table

  • Termination message and summary statistics

  • Exit message

logging.DEBUG

  • Detailed progress through the various preprocessing subroutines

  • Detailed component statistics for the preprocessed model

  • Termination outcomes, backup solver invocation statements, and summaries of results for all subproblems

  • Summary of separation subroutine overall outcomes: second-stage inequality constraints violated and uncertain parameter realization(s) added to the master problem

  • Solve time profiling statistics