Register the stages outside the time loop.<div><br></div><div> Matt<br><br><div class="gmail_quote">On Mon, Oct 8, 2012 at 10:19 AM, TAY wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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!<span class="HOEnZb"><font color="#888888"><br>
<pre cols="72">--
Yours sincerely,
TAY wee-beng</pre>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div>