On Thu, Aug 25, 2011 at 4:58 PM, Likun Tan <span dir="ltr">&lt;<a href="mailto:likunt@andrew.cmu.edu">likunt@andrew.cmu.edu</a>&gt;</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,<br>
<br>
I am computing Ax=b, while using petsc (currently uniprocessor) the<br>
computation is much slower.<br>
<br>
I realize generation of the matrix is very time-consuming, the elements<br>
are integrals of functions with complicated form, i.e.\\\int(f(r(x,y,z),<br>
s(x,y,z), t(x,y,z), phi(x,y,z,node)dxdydz, where the shape function has<br>
different forms on each node. In my C code, i calculated r, s, t and phi<br>
on the integration points first and saved the data in 3D array. In petsc,<br>
i use the same strategy by applying DA to set values to r, s, t and phi on<br>
each integration points.<br>
<br>
Since i need to solve Ax=b for million times, A is changing every time and<br>
i use DAVecGetArray repeatly, is that the reason for low efficiency and<br>
any suggestions for performance enhancement?<br>
<br>
btw, calculation of r,s,t..is the only part i use parallel computing,<br>
since I think the assemble of A and b is fast once the entries have been<br>
computed.<br></blockquote><div><br></div><div>There is no way to know what you are doing. As we say online and in the manual,</div><div>configure with --with-debugging=0, look at the performance guidance chapter,</div><div>
and send the output of -log_summary to <a href="mailto:petsc-maint@mcs.anl.gov">petsc-maint@mcs.anl.gov</a>.</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;">

Thanks,<br>
<font color="#888888">Likun<br>
<br>
<br>
<br>
</font></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>