[petsc-users] lying about nullspaces

Geoffrey Irving irving at naml.us
Tue Jan 10 17:28:43 CST 2012


On Tue, Jan 10, 2012 at 5:52 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Tue, Jan 10, 2012 at 00:08, Geoffrey Irving <irving at naml.us> wrote:
>>
>> For now, I believe I can get away with a single linear iteration.
>
>
> Single linear iteration (e.g. one GMRES cycle) or single linear solve (e.g.
> one Newton step)?

Single linear solve (one Newton step).

>> Even if I need a few, the extra cost of the first linear solve appears
>> to be drastic.  However, it appears you're right that this isn't due
>> to preconditioner setup.  The first solve takes over 50 times as long
>> as the other solves:
>>
>>    step 1
>>      dt = 0.00694444, time = 0
>>      cg icc converged: iterations = 4, rtol = 0.001, error = 9.56519e-05
>>      actual L2 residual = 1.10131e-05
>>      max speed = 0.00728987
>>    END step 1                                      0.6109 s
>
>
> How are you measuring this time? In -log_summary, I see 0.02 seconds in
> KSPSolve(). Maybe the time you see is because there are lots of page faults
> until you get the code loaded into memory?

It turns out the initial overhead was due to a bug in my computation
of row lengths.  It's much faster with the bug fixed.  Is there a way
to detect reallocations so as avoid this kind of error in future?  I
looked through the seqaij code and didn't see anything obvious, and
also couldn't find a function to compute the actual final row lengths.

Thanks,
Geoffrey


More information about the petsc-users mailing list