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><div class="gmail_quote"><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></blockquote><div><br></div><div>There is 1 fewer adds than multiplies in every row:</div><div><br></div><div>
3332-494 = 2838</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>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>