[petsc-users] -log_summary problem
Max Rudolph
rudolph at berkeley.edu
Tue Jan 3 21:57:18 CST 2012
> On Tue, Dec 20, 2011 at 19:35, Max Rudolph <rudolph at berkeley.edu> wrote:
> When I run my code with the -log_summary option, it hangs indefinitely after displaying:
>
> ========================================================================================================================
> Average time to get PetscTime(): 9.53674e-08
> Average time for MPI_Barrier(): 0.00164938
>
> Is this a common problem, and if so, how do I fix it? This does not happen when I run the example programs - only my own code, so I must be at fault but without an error message I am not sure where to start. I am using petsc-3.1-p7. Thanks for your help.
>
> Are all processes calling PetscFinalize()?
>
> How did you set -log_summary? It should be provided at the time you invoke PetscInitialize() on all processes.
>
> Try running in a debugger, then break when it hangs and print the stack trace.
I found the problem, or at least a workaround. I have a PetscRandom and freed it in the second to last line of my main subroutine:
...
ierr= PetscRandomCreate(PETSC_COMM_WORLD, &r);CHKERRQ(ierr);
ierr = PetscRandomSetType(r,PETSCRAND48);CHKERRQ(ierr);
...
ierr = PetscRandomDestroy( r );CHKERRQ(ierr);
ierr = PetscFinalize();
}
If I comment out the line with PetscRandomDestroy, -log_summary seems to work.
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120103/1b31fc77/attachment.htm>
More information about the petsc-users
mailing list