<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 3, 2017 at 10:27 PM, Florian Lindner <span dir="ltr"><<a href="mailto:mailinglists@xgm.de" target="_blank">mailinglists@xgm.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 03.10.2017 um 16:05 schrieb Matthew Knepley:<br>
> On Mon, Oct 2, 2017 at 10:11 PM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a> <mailto:<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>>> wrote:<br>
><br>
><br>
><br>
> Am 02.10.2017 um 21:04 schrieb Matthew Knepley:<br>
> > On Mon, Oct 2, 2017 at 6:21 AM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a> <mailto:<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>><br>
> <mailto:<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a> <mailto:<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>>>> wrote:<br>
> ><br>
> > Hello,<br>
> ><br>
> > I have a matrix and vector that live on 4 ranks, but only rank 2 and 3 have values:<br>
> ><br>
> > Doing a simple LSQR solve does not converge. However, when the values are distributed equally, it converges<br>
> within 3<br>
> > iterations.<br>
> ><br>
> > What can I do about that?<br>
> ><br>
> > I have attached a simple program and creates the matrix and vector or loads them from a file.<br>
> ><br>
> ><br>
> > There are a few problems with this program. I am attaching a cleaned up version. However, convergence still<br>
> differs starting<br>
> > at iteration 2. It appears that LSQR has a problem with this system, or we have a bug that I cannot see.<br>
><br>
> Thanks for having a look at it!<br>
><br>
> And good to hear it's not by design. If I can be of any more help tracking this down, pleae let me know.<br>
><br>
> In the meantime, what could be a good way to work around this? This is admittedly a very malformed example. Is there a<br>
> way to force solving on a single CPU and then distribute the results resp. KSP object to the original parallel layout?<br>
> Of course, we would first try to solve in parallel, but we have little influence about the actual parallel layout, since<br>
> we are just a library and other solvers give us the data.<br>
><br>
><br>
> I need to be more clear. I do not think convergence has anything to do with being on 1 process. I think this is an<br>
> ill-conditioned<br>
> example and convergence is an accident in one case. Unless you see this in a bunch of cases, I would not worry about<br>
> gathering<br>
> to a single process. However, that can be done using PCREDUNDANT if this is really a problem.<br>
<br>
Why do think it is ill-conditioned? The condition number is around 5, The singular values are [5.93710645, 1.85088733,<br>
1.15107911] (both according to NumPy) and QR decomposition with NumPy works fine.<br>
<br>
I believe you're right about that, giving your proficiency in the subject, just want to learn and maybe fix my input<br>
data, if it's possible.<br></blockquote><div><br></div><div>I don't know if that is right. However, the sequential and parallel algorithms agree on both the initial residual (so that parallel</div><div>matrix and rhs appear correct) and the first iterate. Divergence of the second iterate could still be a bug in our code, but it</div><div>was harder for me to see how.</div><div><br></div><div>The real thing to do, which should not be that much work but I don't have time for now unfortunately, is to step through the</div><div>algorithm in serial and parallel and see what number changes. The algorithm only has 20 or so steps per iterate, so this</div><div>would probably take one day to do right.</div><div><br></div><div> Thanks,</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>
Florian<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>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</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>