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

2016-08-26 Thread Barry Smith
You should still check the error code after the call to PetscInitialize() because if the initialization failed the rest of the code will crash badly. Barry > On Aug 26, 2016, at 5:54 PM, 丁老师 wrote: > > thanks, but i use c++ language, there is no need to call the error code. > > > >

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

2016-08-26 Thread Barry Smith
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 Pets

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

2016-08-26 Thread Matthew Knepley
On Fri, Aug 26, 2016 at 2:42 AM, 丁老师 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? > I agree with Patrick, send the entire message. However, are you using Fortran? Matt > Regards > > [0]PETSC

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

2016-08-26 Thread Patrick Sanan
I mean the entire message between the dotted lines [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: End of Error Message ---send entire error message to petsc-ma...@mcs.anl.gov---

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

2016-08-26 Thread Patrick Sanan
Could you send the entire error message? On Fri, Aug 26, 2016 at 9:42 AM, 丁老师 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 > /ho

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

2016-08-26 Thread 丁老师
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() l