Because 2838 + 494 = 3332, I believe PETSc calculates flops of an inner product as n-1, where n is the vector length.<br><br><div class="gmail_quote">On Fri, Dec 30, 2011 at 4:30 PM, Junchao Zhang <span dir="ltr"><<a href="mailto:junchao.zhang@gmail.com">junchao.zhang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div> I have a sparse matrix A. Its size is 494 x 494. It has 1666 nonzeros.</div><div> I call MatMult(A, x, y). From the profiling result (got by -log_summary), I find MatMult's flops is 2838.</div>
<div> I think the flops should be nnz x 2 = 1666 x 2 = 3332. I don't know how PETSc got this number (2838).</div>
<div> I also observed the phenomena with other matrices. It seems PETSc always give smaller flops. Why?</div><div><div> </div><div> Thank you!</div><span class="HOEnZb"><font color="#888888">-- Junchao Zhang<br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Junchao Zhang<br>