<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">  What is the output of -ksp_view  for the two case?</div><div class=""><br class=""></div><div class="">  It is not only the matrix format but also the matrix solver that matters. For example if you are using an iterative solver the elemental format won't be faster, you should use the PETSc MPIDENSE format. The elemental format is really intended when you use a direct LU solver for the matrix. For tiny matrices like this an iterative solver could easily be faster than the direct solver, it depends on the conditioning (eigenstructure) of the dense matrix. Also the default PETSc solver uses block Jacobi with ILU on each process if using a sparse format, ILU applied to a dense matrix is actually LU so your solver is probably different also between the MPIAIJ and the elemental. </div><div class=""><br class=""></div><div class="">  Barry</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">  <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 7, 2020, at 12:30 AM, Nidish <<a href="mailto:nb25@rice.edu" class="">nb25@rice.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="zoom: 0%;" class=""><div dir="auto" class="">Thank you for the response.<br class=""><br class=""></div>
<div dir="auto" class="">I've just been running some tests with matrices up to 2e4 dimensions (dense). When I compared the solution times for "-mat_type elemental" and "-mat_type mpiaij" running with 4 cores, I found the mpidense versions running way faster than elemental. I have not been able to make the elemental version finish up for 2e4 so far (my patience runs out faster). <br class=""><br class=""></div>
<div dir="auto" class="">What's going on here? I thought elemental was supposed to be superior for dense matrices.<br class=""><br class=""></div>
<div dir="auto" class="">I can share the code if that's appropriate for this forum (sorry, I'm new here). <br class=""><br class=""></div>
<div dir="auto" class="">Nidish</div>
<div class="gmail_quote">On Aug 6, 2020, at 23:01, Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank" class="">bsmith@petsc.dev</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="blue"><br class=""><br class=""><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> On Aug 6, 2020, at 7:32 PM, Nidish <<a href="mailto:nb25@rice.edu" class="">nb25@rice.edu</a>> wrote:<br class=""> <br class=""> I'm relatively new to PETSc, and my applications involve (for the most part) dense matrix solves.<br class=""> <br class=""> I read in the documentation that this is an area PETSc does not specialize in but instead recommends external libraries such as Elemental. I'm wondering if there are any "best" practices in this regard. Some questions I'd like answered are:<br class=""> <br class=""> 1. Can I just declare my dense matrix as a sparse one and fill the whole matrix up? Do any of the others go this route? What're possible pitfalls/unfavorable outcomes for this? I understand the memory overhead probably shoots up.<br class=""></blockquote><br class="">  No, this isn't practical, the performance will be terrible.<br class=""><br class=""><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> 2. Are there any specific guidelines on when I can expect elemental to perform better in parallel than in serial?<br class=""></blockquote><br class="">  Because the computation to communication ratio for dense matrices is higher than for sparse you will see better parallel performance for dense problems of a given size than sparse problems of a similar size. In other words parallelism can help for dense matrices for relatively small problems, of course the specifics of your machine hardware and software also play a role.<br class=""><br class="">   Barry<br class=""><br class=""><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> <br class=""> Of course, I'm interesting in any other details that may be important in this regard.<br class=""> <br class=""> Thank you,<br class=""> Nidish<br class=""></blockquote><br class=""></pre></blockquote></div></div></div></blockquote></div><br class=""></div></body></html>