[petsc-users] Logging the same pieces of code several times using PetscLogEventBegin/PetscLogEventEnd

Satish Balay balay at mcs.anl.gov
Thu Nov 11 13:55:21 CST 2010


I suspect you have PetscLogEventRegister() in a loop aswell..

Satish

On Thu, 11 Nov 2010, Filippo Spiga wrote:

> Dear all,
>     I would like to timing the same pieces of code several times using
> PetscLogEventBegin/PetscLogEventEnd. My code does, more or less, something
> like that
> 
> PetscLogEvent  logA, logB;
> 
> PetscLogEventRegister( "Log A", 0, &logA);
> PetscLogEventRegister( "Log B", 0, &logB);
> 
> for (i=0...10) {
> 
>     PetscLogEventBegin(logA, 0, 0, 0, 0);
>     ...
>     PetscLogEventEnd(logA, 0, 0, 0, 0);
> 
>     PetscLogEventBegin(logB 0, 0, 0, 0);
>     ..
>     PetscLogEventEnd(logB, 0, 0, 0, 0);
> 
> }
> 
> At the end, when I print the summary of all the evens using -log_summary, "Log
> A" and "Log B" appear many times... as many times as I performed the loop. How
> can change this behaviour?
> 
> Thank you very much in advance!
> 
> Cheers
> 
> 



More information about the petsc-users mailing list