Allowing the user to modify parameters and options easily at runtime
is very desirable for many applications. PETSc 2.0 provides a simple
mechanism to enable such customization. To print a list of
available options for a given program, simply specify the option
-help (or -h) at runtime, e.g.,
mpirun -np 1 ex1 -helpNote that all runtime options correspond to particular PETSc routines that can be explicitly called from within a program to set compile-time defaults. For many applications it is natural to use a combination of compile-time and runtime choices. For example, when solving a linear system, one could explicitly specify use of the Krylov subspace technique BiCGStab by calling
ierr = KSPSetType(ksp,KSPBCGS);One could then override this choice at runtime with the option
-ksp_type tfqmrto select the Transpose-Free QMR algorithm. (See Chapter SLES: Linear Equations Solvers for details.)
The remainder of this section discusses details of runtime options.