<div dir="ltr">On Fri, Aug 30, 2013 at 1:04 PM, France Boillod-Cerneux <span dir="ltr"><<a href="mailto:boillod.france@gmail.com" target="_blank">boillod.france@gmail.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Dear PETSc user,<div>
<br></div><div>I am using MatMult() function in a C++ program.</div><div><br></div><div>Currently, my matrix is <span style>MATMPIAIJ</span> format type, and I load the matrix from a binary file at petsc format. let's call the matrix A:</div>

<div><br></div><div>I know before the execution the global rows, columns and nnz.</div><div><br></div><div>my program is doing something like:</div><div><br></div><div>global loop</div><div>     //begin to measure flop rate</div>

<div>     inner loop</div><div>           MatMult(A,x,y)</div><div>     end inner loop</div><div>     //want to know Flop rate of Matmult at this point</div><div>end global loop</div><div><br>
</div><div>I am looking for a function to know at runtime the flop rate for each process regarding matmult function.</div></div></blockquote><div><br></div><div>You can do what Barry suggests, however there might be intervening work, so you can be more precise using:</div>
<div><br></div><div><div>  PetscStageLog      stageLog;</div><div>  PetscEventPerfLog  eventLog;</div><div>  PetscInt           stage = 0;</div><div>  PetscLogEvent      event;</div><div>  PetscEventPerfInfo eventInfo;</div>
<div><br></div><div>  PetscLogGetStageLog(&stageLog);</div><div>  PetscStageLogGetEventPerfLog(stageLog, stage, &eventLog);</div><div>  eventInfo = eventLog->eventInfo[MAT_Mult];<br></div></div><div>  <Use eventInfo.flops/eventInfo.time></div>
<div><br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>I had a look at pdf of Loic Gouarin (introduction to pertsc, performance May 2013) but it does not correspond to what i want, or i missunderstood?</div>
<div><br></div><div>My other solution is using the matmpiaijsetpreallocation and therefore know the complete parallel distribution of A, but this implies a pre-treatment on my matrix A.</div><div><br></div>
<div>I was wondering if i can create my matrix A without knowing in advance the parallel distribution and then collect the information about parallel distribution?</div><div><br></div><div>Or more easier, if a function like PetscGetFlops could solve my problem? </div>

<div>so far i understood that this function measure the flop since the begining of program, but this is not what i want to use, i want to have the flop ratio right after ending the inner loop, and this, for each global iteration</div>

<div><br></div><div>Any ideas/suggestions would help,</div><div><br></div><div>Thank you very much,</div><div><br></div><div>France</div><div><br></div><div><br>-- <br><div dir="ltr">
<div style="text-align:left">Bien cordialement - Best regards - Mit freundlichen Grüßen,  </div>
<div style="text-align:left"> </div>
<div style="text-align:left"><strong><font color="#000066">France BOILLOD-CERNEUX </font></strong></div>
<div style="text-align:left"><strong><font color="#000066">PhD Student, Laboratoire d'Informatique Fondamentale de Lille </font></strong></div>
<div style="text-align:left"><strong><font color="#000066">(LIFL), CNRS</font></strong></div>
<div style="text-align:left">
<div style="text-align:left"> </div>
<div style="text-align:left"><a href="mailto:France.Boillod-Cerneux@cea.fr" target="_blank">France.Boillod-Cerneux@cea.fr</a></div></div>
<div style="text-align:left"><font color="#330099">Tel. :</font> <a href="tel:%2B33%20%280%29%201%206908%20-%209527" value="+33169089527" target="_blank">+33 (0) 1 6908 - 9527</a></div>
<div style="text-align:left"><font color="#330099">Tel. :</font> <a href="tel:%2B33%20%280%29%206%204781%20-%203059" value="+33647813059" target="_blank">+33 (0) 6 4781 - 3059</a></div>
<div style="text-align:left"> </div>
<div style="text-align:left"><font color="#330099">DEN/DANS/DM2S<br>CEA Saclay<br>91191 Gif-sur-Yvette<br>FRANCE</font></div>
<div style="text-align:left"><font color="#000000"></font> </div>
<div style="text-align:left"><a href="http://www.lifl.fr/" target="_blank">http://www.lifl.fr/</a></div>
<div style="text-align:left"><a href="http://www-centre-saclay.cea.fr/en" target="_blank">www-centre-saclay.cea.fr</a></div>
<div style="text-align:left"> </div></div>
</div></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
</div></div>