petsc-3.4.2 2013-07-02

# PetscFinalize

Checks for options to be called at the conclusion of the program. MPI_Finalize() is called only if the user had not called MPI_Init() before calling PetscInitialize().

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscFinalize(void)

Collective on PETSC_COMM_WORLD

### Options Database Keys

| -options_table | - Calls PetscOptionsView()
| -options_left | - Prints unused options that remain in the database
| -objects_dump [all] | - Prints list of objects allocated by the user that have not been freed, the option all cause all outstanding objects to be listed
| -mpidump | - Calls PetscMPIDump()
| -malloc_dump | - Calls PetscMallocDump()
| -malloc_info | - Prints total memory usage
| -malloc_log | - Prints summary of memory usage

### Note

See PetscInitialize() for more general runtime options.

### See Also

PetscInitialize(), PetscOptionsView(), PetscMallocDump(), PetscMPIDump(), PetscEnd()

Level:beginner
Location: src/sys/objects/pinit.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/sys/classes/viewer/examples/tutorials/ex1.c.html
src/sys/classes/viewer/examples/tutorials/ex2.c.html
src/sys/classes/viewer/examples/tutorials/ex1f90.F90.html
src/sys/classes/random/examples/tutorials/ex1.c.html
src/sys/classes/random/examples/tutorials/ex2.c.html
src/sys/examples/tutorials/ex1.c.html
src/sys/examples/tutorials/ex2.c.html
src/sys/examples/tutorials/ex3.c.html
src/sys/examples/tutorials/ex4.c.html
src/sys/examples/tutorials/ex5.c.html
src/sys/examples/tutorials/ex6.c.html