KSPSetUseExplicitTranspose#
Determines whether the explicit transpose of the operator is formed in KSPSolveTranspose() and KSPMatSolveTranspose()
Synopsis#
#include "petscksp.h"
#include "petscmat.h"
PetscErrorCode KSPSetUseExplicitTranspose(KSP ksp, PetscBool flg)
Collective
Input Parameters#
ksp - the
KSPcontextflg -
PETSC_TRUEto transpose the system explicitly,PETSC_FALSEto not transpose explicitly (default)
Options Database Key#
-ksp_use_explicittranspose - transpose the system explicitly in
KSPSolveTranspose()andKSPMatSolveTranspose()
Note#
Explicitly forming the transpose may improve solve performance in some configurations, such as on GPUs. When enabled, the explicitly transposed operators replace the KSP
operators and remain set after KSPSolveTranspose() or KSPMatSolveTranspose(), so KSPGetOperators() returns the transposed operators. A subsequent non-transpose
KSPSolve() or KSPMatSolve(), or disabling this option, restores any cached transposed operator that is still set to its parent operator. Alternating between transpose
and non-transpose solves requires the preconditioner to be set up again on every direction change; use separate KSP objects when both directions are solved repeatedly.
See Also#
KSP: Linear System Solvers, KSPSolveTranspose(), KSPMatSolveTranspose(), KSPSetOperators(), KSPGetOperators(), KSP
Level#
advanced
Location#
src/ksp/ksp/interface/itfunc.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages