TaoMonitor — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# TaoMonitor

Monitor the solver and the current solution. This routine will record the iteration number and residual statistics, and call any monitors specified by the user.

## Synopsis

    #include "petsctao.h"
    PetscErrorCode TaoMonitor(Tao tao, PetscInt its, PetscReal f, PetscReal res, PetscReal cnorm, PetscReal steplength)

## Input Parameters

- tao - the `Tao` context

- its - the current iterate number (>=0)

- f - the current objective function value

- res - the gradient norm, square root of the duality gap, or other measure indicating distance from optimality. This measure will be recorded and used for some termination tests.

- cnorm - the infeasibility of the current solution with regard to the constraints.

- steplength - multiple of the step direction added to the previous iterate.

## Options Database Key

- -tao_monitor - Use the default monitor, which prints statistics to standard output

## See Also

TAO: Optimization Solvers, `Tao`, `TaoGetConvergedReason()`, `TaoMonitorDefault()`, `TaoMonitorSet()`

## Level

developer

## Location

src/tao/interface/taosolver.c

Index of all Tao routines
Table of Contents for all manual pages
Index of all manual pages