<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I am trying to log my PETSc performance in stages.<br>
<br>
I initially used:<br>
<br>
<i>PetscLogStage stages(2)</i><i><br>
</i><i><br>
</i><i>do time = 1,n</i><i><br>
</i><i> </i><i><br>
</i><i> ...</i><i><br>
</i><i><br>
</i><i> call PetscLogStageRegister("momentum_eqn",stages(1),ierr)</i><i><br>
</i><i><br>
</i><i> call PetscLogStagePush(stages(1),ierr)</i><i><br>
</i><i><br>
</i><i> stage 1 logging</i><i><br>
</i><i><br>
</i><i> call PetscLogStagePop(ierr)</i><i><br>
</i><i><br>
</i><i> ...</i><i><br>
</i><i><br>
</i><i> call PetscLogStageRegister("poisson_eqn",stages(2),ierr)</i><i><br>
</i><i><br>
</i><i> call PetscLogStagePush(stages(2),ierr)</i><i><br>
</i><i><br>
</i><i> stage 2 logging</i><i><br>
</i><i><br>
</i><i> call PetscLogStagePop(ierr)</i><i><br>
</i><i><br>
</i><i>end do</i><br>
<br>
<br>
The log_summary shows that results in stages 1 and 2, but I also get
the error:<br>
<br>
Invalid argument!<br>
[1]PETSC ERROR: Duplicate stage name given: poisson_eqn!<br>
<br>
I changed my code to only call PetscLogStageRegister once:<br>
<br>
<i>PetscLogStage stages(2)</i><i><br>
</i><i><br>
</i><i>call PetscLogStageRegister("momentum_eqn",stages(1),ierr)</i><i><br>
</i><i><br>
</i><i> call PetscLogStageRegister("poisson_eqn",stages(2),ierr)</i><i><br>
</i>
<i><br>
</i><i>
do time = 1,n</i><i><br>
</i><i>
</i><i><br>
</i><i>
...</i><i><br>
</i>
<i><br>
</i><i>
call PetscLogStagePush(stages(1),ierr)</i><i><br>
</i>
<i><br>
</i><i>
stage 1 logging</i><i><br>
</i>
<i><br>
</i><i>
call PetscLogStagePop(ierr)</i><i><br>
</i>
<i><br>
</i><i>
</i><i>...</i><i><br>
</i>
<i><br>
</i><i>
call PetscLogStagePush(stages(2),ierr)</i><i><br>
</i>
<i><br>
</i><i>
stage 2 logging</i><i><br>
</i>
<i><br>
</i><i>
call PetscLogStagePop(ierr)</i><i><br>
</i>
<i><br>
</i><i>
end do</i><br>
<br>
Now there's no error but all logging are now grouped together into
just 1 main stage. <br>
<br>
How can I correct it to have separate logging? Tks!<br>
<pre class="moz-signature" cols="72">--
Yours sincerely,
TAY wee-beng</pre>
</body>
</html>