PetscOptionsMonitorSet#
Sets an ADDITIONAL function to be called at every method that modified the PETSc options database.
Synopsis#
#include "petscsys.h"
PetscErrorCode PetscOptionsMonitorSet(PetscErrorCode (*monitor)(const char name[], const char value[], PetscOptionSource source, void *mctx), void *mctx, PetscCtxDestroyFn *monitordestroy)
Not Collective
Input Parameters#
monitor - pointer to function (if this is
NULL
, it turns off monitoringmctx - [optional] context for private data for the monitor routine (use
NULL
if no context is desired)monitordestroy - [optional] routine that frees monitor context (may be
NULL
), seePetscCtxDestroyFn
for its calling sequence
Calling sequence of monitor
#
name - option name string
value - option value string, a value of
NULL
indicates the option is being removed from the database. A value of “” indicates the option is in the database but has no value.source - option source
mctx - optional monitoring context, as set by
PetscOptionsMonitorSet()
Options Database Keys#
-options_monitor
- turn on default monitoring-options_monitor_cancel - turn off any option monitors except the default monitor obtained with
-options_monitor
Notes#
See PetscInitialize()
for options related to option database monitoring.
The default is to do no monitoring. To print the name and value of options
being inserted into the database, use PetscOptionsMonitorDefault()
as the monitoring routine,
with a NULL
monitoring context. Or use the option -options_monitor
Several different monitoring routines may be set by calling
PetscOptionsMonitorSet()
multiple times; all will be called in the
order in which they were set.
See Also#
PetscOptionsMonitorDefault()
, PetscInitialize()
, PetscCtxDestroyFn
Level#
intermediate
Location#
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages