petsc-3.14.5 2021-03-03
Report Typos and Errors

# SETERRQ2

Macro that is called when an error has been detected,

### Synopsis

    #include <petscsys.h>
    PetscErrorCode SETERRQ2(MPI_Comm comm,PetscErrorCode ierr,char *formatmessage,arg1,arg2)

Collective

### Input Parameters

| comm | - A 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
| arg1 | - argument (for example an integer, string or double)
| arg2 | - argument (for example an integer, string or double)

### Notes

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().

### See Also

PetscTraceBackErrorHandler(), PetscPushErrorHandler(), PetscError(), CHKERRQ(), CHKMEMQ, SETERRQ1(), SETERRQ3()

### Level

beginner

### Location

src/sys/error/../../../include/petscerror.h

### Examples

src/sys/tutorials/ex17.c.html
src/dm/impls/plex/tutorials/ex6.c.html
src/ksp/ksp/tutorials/ex56.c.html
src/ksp/ksp/tutorials/ex70.c.html
src/ksp/ksp/tutorials/ex72.c.html
src/ksp/ksp/tutorials/ex73.c.html
src/ksp/ksp/tutorials/ex76.c.html
src/ksp/ksp/tutorials/ex78.c.html
src/snes/tutorials/ex5.c.html
src/snes/tutorials/ex12.c.html
src/snes/tutorials/ex17.c.html
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages