[petsc-users] PetscFinalize()

Barry Smith bsmith at mcs.anl.gov
Wed Oct 3 14:16:07 CDT 2012


    This error occurs if more than 250 functions are registered with PetscRegisterFinalize(). Under normal usage that should never happen. 

    Likely something is calling PetscRegisterFinalize() unprotected, that is, calling it many times with the same function to register. Likely this is in SLEPc. 

    The other possibility is some strange interaction with .dll on Microsoft Windows?   

    First I would start your program in the debugger, put a break point in PetscRegisterFinalize() and then run the program. Each time it breaks in PetscRegisterFinalize() note where it is called from. Under normal circumstances PETSc should call 
PetscRegisterFinalize() around 10 times.  If you see it called 30 times note what functions are calling it over and over again and send back that information.

    Barry



On Oct 3, 2012, at 11:58 AM, Eleni Siampli <siaeleni at hotmail.com> wrote:

>  
> Hello again,
>  
> It doen't work good. I have created a dll for solving the eigenPorblem (eigenSolver.dll) and I included it in my current project.
> lets say that eigenSolver is the name of my class.. What I use is:
> eigensolver eig; 
> for a lot of iterations and works fine. I call only one the PetscInitialize();
>  
> I want also to use:
> eigensolver eig1;
> eigensolver eig2;
>  
> I call only once PetscInitialize(); for each eig1 and eig 2.
>  
> I have the same error as before.
>  
> Why does it give me the same error?I  call only once the PetscInitialize().
> Thanks a lot in advance,
> Helen
>  
> Date: Fri, 28 Sep 2012 20:23:20 -0400
> From: knepley at gmail.com
> To: petsc-users at mcs.anl.gov
> Subject: Re: [petsc-users] PetscFinalize()
> 
> On Fri, Sep 28, 2012 at 5:09 PM, Eleni Siampli <siaeleni at hotmail.com> wrote:
>  
> Thank you for the answer. Problem solved, but now I have another one:
>  
> After a lot of iterations (around 246) It gives me the following error:
>  
> 
>  [0]PETSC ERROR: Petsc has generated inconsistent data!
> [0]PETSC ERROR: No more room in array, limit 256
>  recompile src/sys/objects/destroy.c with larger value for MAXREGFIN
>  
> Do you have any idea about this problem?
> 
> You are also calling PetscInitialize() a bunch of times. Its intended for just one.
> 
>    Matt
>  
>  
> Thanks,
> Helen
> Date: Fri, 28 Sep 2012 11:17:51 -0400
> From: knepley at gmail.com
> To: petsc-users at mcs.anl.gov
> Subject: Re: [petsc-users] PetscFinalize()
> 
> On Fri, Sep 28, 2012 at 11:16 AM, Eleni Siampli <siaeleni at hotmail.com> wrote:
> Hey all,
>  
> I would like to solve the eigenvalue problem.
> My code is working for 2 loops and give the right values, but after two loops it gives me the following error:
>  
> [0]PETSC ERROR: PetscFinalize() line 1221 in src/sys/objects/C:\cygwin\home\liyi
> 0000\PETSC-~1.2-P\src\sys\objects\pinit.c
> [0]PETSC ERROR: SlepcFinalize() line 224 in src/sys/C:\cygwin\home\liyi0000\SLEP
> C-~1.2-P\src\sys\slepcinit.c
> Options have not been enabled.
> You might have forgotten to call PetscInitialize().
>  
> Do you have any idea what this error mean?
> 
> You are only intended to call PetscFinalize() once, at the end of your program.
> 
>    Matt
>  
>  
> Thank you in advance,
> Helen
>  
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener



More information about the petsc-users mailing list