Skip to main content
`Ctrl`+`K`

# SlepcInitialize

Initializes the SLEPc library. `SlepcInitialize()` calls `PetscInitialize()` if it has not been called yet, so this function should always be called near the beginning of your program.

## Synopsis

    #include "slepcsys.h"
    PetscErrorCode SlepcInitialize(int *argc,char ***args,const char file[],const char help[])

Collective on `MPI_COMM_WORLD` or `PETSC_COMM_WORLD` if it has been set

## Input Parameters

- argc - count of number of command line arguments

- args - the command line arguments

- file - [optional] PETSc database file

- help - [optional] Help message to print, use `NULL` for no message

## Note

Works in the same way as `PetscInitialize()`, but in addition initializes SLEPc. The same considerations apply with respect to command line options and environment variables.

## Fortran Notes

In Fortran this routine can be called with

           call SlepcInitialize(ierr)

           call SlepcInitialize(file,ierr)

or

           call SlepcInitialize(file,help,ierr)

If your main program is C but you call Fortran code that also uses SLEPc you need to call `SlepcInitializeFortran()` soon after calling `SlepcInitialize()`.

## See Also

Writing SLEPc Programs, `SlepcFinalize()`, `PetscInitialize()`, `SlepcInitializeFortran()`

## Level

beginner

## Location

src/sys/slepcinit.c

## Examples

src/pep/tutorials/ex16f.F90
src/pep/tutorials/ex50.c
src/pep/tutorials/ex38.c
src/pep/tutorials/ex40.c
src/pep/tutorials/ex16.c
src/mfn/tutorials/ex39.c
src/mfn/tutorials/ex23f.F90
src/pep/tutorials/ex17.c
src/pep/tutorials/ex28.c
src/mfn/tutorials/ex23.c

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