[petsc-users] What caused this problem."PetscInitialize() must be called before PetscFinalize()"

Barry Smith bsmith at mcs.anl.gov
Fri Aug 26 10:49:44 CDT 2016


    You got this message because you did not check the error code for PetscInitialize() and so your program continued running until it reached PetscFinalize() where it could not handle the state since PETSc was not properly initialized.

    You should have code something like

       call PetscInitialize(PETSC_NULL_CHARACTER, ierr)

       if (ierr .ne. 0) then
          print*,'Error in PetscInitialize ',ierr
       endif


> On Aug 26, 2016, at 2:42 AM, 丁老师 <ztdepyahoo at 163.com> wrote:
> 
> Dear friends:
>    My code run without any problem yesterday, but it gives me the following error. I do not know what is the reason?
> Regards
> 
> [0]PETSC ERROR: #1 PetscOptionsInsertFile() line 563 in /home/ztdep/Downloads/petsc-3.6.3/src/sys/objects/options.c
> [0]PETSC ERROR: #2 PetscOptionsInsert() line 720 in /home/ztdep/Downloads/petsc-3.6.3/src/sys/objects/options.c
> [0]PETSC ERROR: #3 PetscInitialize() line 828 in /home/ztdep/Downloads/petsc-3.6.3/src/sys/objects/pinit.c
> 
> PetscInitialize() must be called before PetscFinalize()
> 
> Regards
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
>  
> 
> 
>  



More information about the petsc-users mailing list