<div dir="ltr">Preyas,<div>I tested your code (renamed as src/ksp/ksp/examples/tests/ex46.cpp) and got</div><div>mpiexec -n 1 ./ex46<br></div><div>...</div><div><div>1</div><div>1</div><div>1</div><div>1</div><div>1</div><div>Norm of error 3.58644e-10 iterations 1</div></div><div><br></div><div>mpiexec -n 3 ./ex46<br></div><div>...</div><div><div>1</div><div>1</div><div>1</div><div>1</div><div>1</div><div>Norm of error 5.81285e-11 iterations 1</div></div><div><br></div><div>option '-ksp_view' gives</div><div><div>KSP Object: 3 MPI processes</div><div> type: preonly</div><div> maximum iterations=10000, initial guess is zero</div><div> tolerances: relative=1e-05, absolute=1e-16, divergence=10000</div><div> left preconditioning</div><div> using NONE norm type for convergence test</div><div>PC Object: 3 MPI processes</div><div> type: lu</div><div> LU: out-of-place factorization</div><div> tolerance for zero pivot 2.22045e-14</div><div> matrix ordering: natural</div><div> factor fill ratio given 0, needed 0</div><div> Factored matrix follows:</div><div> Mat Object: 3 MPI processes</div><div> type: elemental</div><div> rows=1000, cols=1000</div><div> package used to perform factorization: elemental</div><div> total: nonzeros=334000, allocated nonzeros=334000</div><div> total number of mallocs used during MatSetValues calls =0</div><div> Elemental run parameters:</div><div> allocated entries=334000</div><div> grid height=1, grid width=3</div><div> linear system matrix = precond matrix:</div></div><div>...</div><div><br></div><div>Everything looks correct.</div><div><br></div><div>Hong</div><div><br></div><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 13, 2015 at 12:26 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Apr 13, 2015 at 12:20 PM, Preyas Shah <span dir="ltr"><<a href="mailto:shah.preyas@gmail.com" target="_blank">shah.preyas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">Another beginner's querry:</div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><br></div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">I worked out an example that "combines" </div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><span style="font-size:12.8000001907349px;font-family:arial,sans-serif;color:rgb(34,34,34)">mat/examples/tests/</span>ex145.c</div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"> <span style="font-family:arial,sans-serif;color:rgb(34,34,34);font-size:12.8000001907349px">/ksp/ksp/examples/</span><span style="font-family:arial,sans-serif;color:rgb(34,34,34);font-size:12.8000001907349px">tutorials/</span>ex2.c </div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">/ksp/ksp/examples/tutorials/ex30.c</div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"> </div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">Please see attached code sample. The code compiles but does not solve the system correctly. I would like to know what changes I would need to implement to get it working right. Thanks!</div></div></blockquote><div><br></div></span><div>Check the residual as well (rhs - MM sol). This should be small. Its possible you have not set</div><div>the exact solution correctly, or the discretization error is large, or the condition number is large.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">P.S. Feel free to include the (corrected) code sample in the test/tutorial folders of the development version.</div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Sun, Apr 12, 2015 at 7:47 PM, Hong <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-size:12.8000001907349px">You can either use <span>elemental</span> directly, or use petsc-<span>elemental</span> interface. An example can be found at </div><div style="font-size:12.8000001907349px">~petsc/src/mat/examples/tests/ex145.c </div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">You may use petsc KSP interface instead. I just modified ~petsc/src/ksp/ksp/examples/</span><span style="font-size:12.8000001907349px">tutorials/ex2.c </span><br></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">so this example can be run with </span><span style="font-size:12.8000001907349px;background-color:rgb(255,255,255)">elemental</span><span style="font-size:12.8000001907349px"> with runtime options</span><span style="font-size:12.8000001907349px"><br></span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><div style="font-size:12.8000001907349px">mpiexec -n 3 ./ex2 -pc_type lu -pc_factor_mat_solver_package elemental -mat_type elemental</div><div style="font-size:12.8000001907349px">Norm of error 2.81086e-15 iterations 1</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Please using petsc-dev (master branch) for petsc-</span><span style="font-size:12.8000001907349px;background-color:rgb(255,255,255)">elemental</span><span style="font-size:12.8000001907349px"> interface.</span><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px"><br></span></div><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Hong</span></div></font></span></span></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 12, 2015 at 6:57 PM, Preyas Shah <span dir="ltr"><<a href="mailto:shah.preyas@gmail.com" target="_blank">shah.preyas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)"><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px">Hi,</span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px">I have been recently investigating the use of Petsc for solving a PDE related to my research and web search suggests that I should use petsc with elemental.</span><br style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px"><br style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px"><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px">So far, I was required to solve a matrix equation Ax=b where A was dense (with number of non zeros =0) but the size of the matrix was order 5000x5000. I employed the standard serial LU solver from Gnu Scientific Library and obtained a decent runtime that served my needs.</span></div><div><br style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px"><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px">Now I am investigating the same problem in a particularly singular limit of one parameters in my PDE. As a result, to obtain grid convergence on the physical domain, I am forced to go to sizes of A beyond 30000x30000. I am trying to find a good library that can solve such dense systems in **parallel**. Petsc says its capable of doing dense linear algebra but my web search hasn't shown me any examples where dense equations are solved in **parallel**. A webpage showing a minimum working example would be enough. Or any other advice :)</span><br style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px"><br style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px"><span style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:21px">Thanks for your time!</span></div></div><span><font color="#888888"><div><div style="font-family:verdana,sans-serif;font-size:small;color:rgb(32,18,77)">~Preyas</div><br></div>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div><div dir="ltr"><font face="garamond, serif" size="2">~ </font><div><font face="garamond, serif" size="2">Preyas</font><div><font face="garamond, serif" size="2"><br></font></div><div><font face="garamond, serif" size="2">Doctoral Researcher, MechE, Stanford Univ.</font></div><div><font face="garamond, serif" size="2"><br></font></div><div><font face="garamond, serif" size="2"><i style="margin:0px;padding:0px;color:rgb(51,51,51);line-height:17.90625px">"Can a man still be brave if he's afraid?".</i><i style="margin:0px;padding:0px;color:rgb(51,51,51);line-height:17.90625px">"That is the only time he can be brave."-- George R R Martin</i></font></div></div><div><i style="margin:0px;padding:0px;color:rgb(51,51,51);line-height:17.90625px"><font face="garamond, serif" size="2">"To learn who rules over you, simply find out who you are not allowed to criticize." -- Voltaire</font></i></div><div><i style="margin:0px;padding:0px;color:rgb(51,51,51);line-height:17.90625px"><font face="garamond, serif" size="2">"First they ignore you, then they laugh at you, then they fight you, then you win" -- Gandhi</font></i></div></div></div>
</font></span></div>
</blockquote></span></div><span class=""><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>
</blockquote></div><br></div></div></div>