<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 21, 2015 at 1:35 PM, Sanjay Kharche <span dir="ltr"><<a href="mailto:Sanjay.Kharche@manchester.ac.uk" target="_blank">Sanjay.Kharche@manchester.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">
<div><br>
</div>
<div>Hi</div>
<div><br>
</div>
<div>I just tried Matt's suggestion and tried to guess other preconditioning options as well. I didnt have the time to think about their appropriateness.<br>
</div>
<div><br>
</div>
<div>All preconditioners worked with the actual ts/ex15. gmag took 13 times longer to finish than the case when I ran without any preconditioner. The fastest was the jacobi, followed by sor and bjacobi options to -pc_type I could not guess the names of the
 other listed preconditioners associated with ts and snes.<br></div></div></div></div></blockquote><div><br></div><div>With a small timestep, Jacobi is going to beat the crap out of anything else. However, in this case you should just be using</div><div>an explicit method, not solving the system. With a large timestep, GAMG will win, although it will be beaten by GMG.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div>
</div>
<div><br>
</div>
<div>In my code however, I  found that sor and gamg did not work. I got error messages, and the first few lines are pasted below. My test was on 1 proc and 4 procs, both giving similar errors with differnent line numbers. The petsc part of my code is virtually
 identical to the example. Any comments on what is missing or can be changed?<br></div></div></div></div></blockquote><div><br></div><div>You have a bug. There are not zeros on the diagonal of the heat oeprator.</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 style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><div>
cheers<br>
Sanjay<br>
<br>
<br>
<br>
<br>
[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[1]PETSC ERROR: Arguments are incompatible<br>
[1]PETSC ERROR: Zero diagonal on row 39<br>
[1]PETSC ERROR: Petsc Release Version 3.5.2, unknown <br>
[1]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named <a href="http://atriumpc.ex.ac.uk" target="_blank">atriumpc.ex.ac.uk</a> by sanjay Tue Apr 21 19:28:53 2015<br>
[1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-sundials --download-scalapack --with-c2html=0<br>
[1]PETSC ERROR: #1 MatInvertDiagonal_SeqAIJ() line 1724 in /media/6c6201d2-4e2e-4b24-8d04-263b5bc06dfa/sanjay/petsc/src/mat/impls/aij/seq/aij.c<br>
[1]PETSC ERROR: #2 MatSOR_SeqAIJ() line 1756 in /media/6c6201d2-4e2e-4b24-8d04-263b5bc06dfa/sanjay/petsc/src/mat/impls/aij/seq/aij.c<br>
[1]PETSC ERROR: #3 MatSOR_MPIAIJ() line 1483 in /media/6c6201d2-4e2e-4b24-8d04-263b5bc06dfa/sanjay/petsc/src/mat/impls/aij/mpi/mpiaij.c<br>
[1]PETSC ERROR: #4 MatSOR() line 3643 in /media/6c6201d2-4e2e-4b24-8d04-263b5bc06dfa/sanjay/petsc/src/mat/interface/matrix.c<br>
[1]PETSC ERROR: #5 PCApply_SOR() line 35 in /media/6c6201d2-4e2e-4b24-8d04-263b5bc06dfa/sanjay/petsc/src/ksp/pc/impls/sor/sor.c<br>
[1]PETSC ERROR: #6 PCApply() line 440 in /media/6c6201d2-4e2e-4b24-8d04-263b5bc06dfa/sanjay/petsc/src/ksp/pc/interface/precon.c<br>
<br>
</div>
<div><br>
</div>
<br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Matthew Knepley [<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>]<br>
<b>Sent:</b> 21 April 2015 16:51<br>
<b>To:</b> Sanjay Kharche<br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] preconditioning<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Tue, Apr 21, 2015 at 10:49 AM, Sanjay Kharche <span dir="ltr">
<<a href="mailto:Sanjay.Kharche@manchester.ac.uk" target="_blank">Sanjay.Kharche@manchester.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi<br>
<br>
I am working through the KSP examples, but I will ask for any comments in the mean time.<br>
<br>
I have a TS code for 2D/3D heat equation, starting from ts/ex15. How can I easily modify this code to include a parallel preconditioner. As of now, I just need to add a preconditioner which is easy to program. The coefficients in my systems matrix are constant,
 but RHS changes at each iteration.<br>
</blockquote>
<div><br>
</div>
<div>Use -pc_type gamg. You have the Laplacian + Identity, so this should work fine.</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">
cheers<br>
<span><font color="#888888">Sanjay<span class="HOEnZb"><font color="#888888"><br>
</font></span></font></span></blockquote><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888">
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<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>
</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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></div>