SETERRA — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# SETERRA

Fortran-only macro that can be called when an error has been detected from the main program

## Synopsis

    #include <petscsys.h>
    PetscErrorCode SETERRA(MPI_Comm comm, PetscErrorCode ierr, char *message)

Collective

## Input Parameters

- comm - An MPI communicator, so that the error can be collective

- ierr - nonzero error code, see the list of standard error codes in include/petscerror.h

- message - error message in the `printf()` format

## Notes

This should only be used with Fortran. With C/C++, use `SETERRQ()`.

`SETERRQ()` may be called from Fortran subroutines but `SETERRA()` must be called from the Fortran main program.

## See Also

`SETERRQ()`, `SETERRABORT()`, `PetscCall()`, `CHKERRA()`, `PetscCallAbort()`, `PetscErrorCode`

## Level

beginner

## Location

include/petscerror.h

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