Skip to main content
`Ctrl`+`K`

# 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)

Not Collective

## Input Parameter

- pc - the `PC` preconditioner context

## Output Parameter

- reason - the reason it failed

## Note

After a call to `KSPCheckDot()` or `KSPCheckNorm()` inside a `KSPSolve()` or a call to `PCReduceFailedReason()` this is the maximum reason over all MPI processes in the `PC` communicator and hence logically collective. Otherwise it returns the local value.

## See Also

KSP: Linear System Solvers, `PC`, `PCCreate()`, `PCApply()`, `PCDestroy()`, `PCSetFailedReason()`, `PCFailedReason`

## Level

advanced

## Location

src/ksp/pc/interface/precon.c

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