SETERRQ#

Macro to be called when an error has been detected,

Synopsis#

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

Collective

Input Parameters#

  • comm - A communicator, use PETSC_COMM_SELF unless you know all ranks of another communicator will detect the error

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

  • message - error message

Notes#

This is rarely needed, one should use PetscCheck() and PetscCall() and friends to automatically handle error conditions. Once the error handler is called the calling function is then returned from with the given error code.

Experienced users can set the error handler with PetscPushErrorHandler().

Fortran Note#

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

See Also#

PetscCheck(), PetscAssert(), PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), PetscCall(), CHKMEMQ, CHKERRA(), PetscCallMPI()

Level#

beginner

Location#

include/petscerror.h

Examples#

src/dm/field/tutorials/ex1.c
src/dm/impls/plex/tutorials/ex11.c
src/dm/impls/stag/tutorials/ex4.c
src/dm/impls/stag/tutorials/ex6.c
src/dm/impls/stag/tutorials/ex8.c
src/dm/tutorials/ex3.c
src/dm/tutorials/swarm_ex1.c
src/ksp/ksp/tutorials/ex27.c
src/ksp/ksp/tutorials/ex32.c
src/ksp/ksp/tutorials/ex35.cxx
src/ksp/ksp/tutorials/ex42.c


Edit on GitLab

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