On Tue, Jan 10, 2012 at 5:28 PM, Geoffrey Irving <span dir="ltr"><<a href="mailto:irving@naml.us">irving@naml.us</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">
On Tue, Jan 10, 2012 at 5:52 AM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> wrote:<br>
> On Tue, Jan 10, 2012 at 00:08, Geoffrey Irving <<a href="mailto:irving@naml.us">irving@naml.us</a>> wrote:<br>
>><br>
>> For now, I believe I can get away with a single linear iteration.<br>
><br>
><br>
> Single linear iteration (e.g. one GMRES cycle) or single linear solve (e.g.<br>
> one Newton step)?<br>
<br>
Single linear solve (one Newton step).<br>
<br>
>> Even if I need a few, the extra cost of the first linear solve appears<br>
>> to be drastic. However, it appears you're right that this isn't due<br>
>> to preconditioner setup. The first solve takes over 50 times as long<br>
>> as the other solves:<br>
>><br>
>> step 1<br>
>> dt = 0.00694444, time = 0<br>
>> cg icc converged: iterations = 4, rtol = 0.001, error = 9.56519e-05<br>
>> actual L2 residual = 1.10131e-05<br>
>> max speed = 0.00728987<br>
>> END step 1 0.6109 s<br>
><br>
><br>
> How are you measuring this time? In -log_summary, I see 0.02 seconds in<br>
> KSPSolve(). Maybe the time you see is because there are lots of page faults<br>
> until you get the code loaded into memory?<br>
<br>
It turns out the initial overhead was due to a bug in my computation<br>
of row lengths. It's much faster with the bug fixed. Is there a way<br>
to detect reallocations so as avoid this kind of error in future? I<br>
looked through the seqaij code and didn't see anything obvious, and<br>
also couldn't find a function to compute the actual final row lengths.<br></blockquote><div><br></div><div>MatSetOption(A, <span style="background-color:rgb(255,255,255)">MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_TRUE);</span></div>
<div><span style="background-color:rgb(255,255,255)"><br></span></div><div><span style="background-color:rgb(255,255,255)"><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetOption.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetOption.html</a></span></div>
<div><span style="background-color:rgb(255,255,255)"><br></span></div><div><span style="background-color:rgb(255,255,255)"> Matt</span></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks,<br>
Geoffrey<br>
</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>