[petsc-users] Error with PETSc logging

Matthew Knepley knepley at gmail.com
Mon Oct 8 16:39:02 CDT 2012


Register the stages outside the time loop.

  Matt

On Mon, Oct 8, 2012 at 10:19 AM, TAY wee-beng <zonexo at gmail.com> wrote:

>  Hi,
>
> I am trying to log my PETSc performance in stages.
>
> I initially used:
>
> *PetscLogStage  stages(2)**
> **
> **do time = 1,n**
> **    **
> **    ...**
> **
> **    call PetscLogStageRegister("momentum_eqn",stages(1),ierr)**
> **
> **    call PetscLogStagePush(stages(1),ierr)**
> **
> **    stage 1 logging**
> **
> **    call PetscLogStagePop(ierr)**
> **
> **    ...**
> **
> **    call PetscLogStageRegister("poisson_eqn",stages(2),ierr)**
> **
> **    call PetscLogStagePush(stages(2),ierr)**
> **
> **    stage 2 logging**
> **
> **    call PetscLogStagePop(ierr)**
> **
> **end do*
>
>
> The log_summary shows that results in stages 1 and 2, but I also get the
> error:
>
> Invalid argument!
> [1]PETSC ERROR: Duplicate stage name given: poisson_eqn!
>
> I changed my code to only call PetscLogStageRegister once:
>
> *PetscLogStage  stages(2)**
> **
> **call PetscLogStageRegister("momentum_eqn",stages(1),ierr)**
> **
> ** call PetscLogStageRegister("poisson_eqn",stages(2),ierr)**
> * *
> ** do time = 1,n**
> **     **
> **     ...**
> * *
> **     call PetscLogStagePush(stages(1),ierr)**
> * *
> **     stage 1 logging**
> * *
> **     call PetscLogStagePop(ierr)**
> * *
> **    **...**
> * *
> **     call PetscLogStagePush(stages(2),ierr)**
> * *
> **     stage 2 logging**
> * *
> **     call PetscLogStagePop(ierr)**
> * *
> ** end do*
>
> Now there's no error but all logging are now grouped together into just 1
> main stage.
>
> How can I correct it to have separate logging? Tks!
>
> --
> Yours sincerely,
>
> TAY wee-beng
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121008/522720d5/attachment.html>


More information about the petsc-users mailing list