[petsc-users] Error with PETSc logging

TAY wee-beng zonexo at gmail.com
Mon Oct 8 16:44:44 CDT 2012


On 8/10/2012 11:39 PM, Matthew Knepley wrote:
> Register the stages outside the time loop.
>
>   Matt

Hi Matt,

I did that in my 2nd attempt (as in the org email), but it only shows 1 
main stage in the end:

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/
>
> On Mon, Oct 8, 2012 at 10:19 AM, TAY wee-beng <zonexo at gmail.com 
> <mailto: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/511cc8fc/attachment.html>


More information about the petsc-users mailing list