:orphan: # PCGetFailedReason Gets the reason a `PCSetUp()` failed or `PC_NOERROR` if it did not fail ## Synopsis ``` #include "petscksp.h" PetscErrorCode PCGetFailedReason(PC pc, PCFailedReason *reason) ``` Logically Collective ## Input Parameter - ***pc -*** the preconditioner context ## Output Parameter - ***reason -*** the reason it failed ## Note This is the maximum over reason over all ranks in the PC communicator. It is only valid after a call `KSPCheckDot()` or `KSPCheckNorm()` inside a `KSPSolve()`. It is not valid immediately after a `PCSetUp()` or `PCApply()`, then use `PCGetFailedReasonRank()` ## See Also PC`, ``PCCreate()`, `PCApply()`, `PCDestroy()`, `PCGetFailedReasonRank()`, `PCSetFailedReason()` ## Level advanced ## Location src/ksp/pc/interface/precon.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/interface/precon.c) [Index of all PC routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)