<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">Brad:</div><div class="gmail_quote">You must call MatDestroySubMatrices(), not MatDestroyMatrices().</div><div class="gmail_quote">SeeĀ petsc/src/mat/examples/tests/ex54.c</div><div class="gmail_quote"><br></div><div class="gmail_quote">I'll add it to the help menu of MatCreateSubMatrices().</div><div class="gmail_quote"><br></div><div class="gmail_quote">Hong</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
In PyLith we call MatCreateSubMatrices() and MatDestroyMatrices() with potentially different numbers of submatrices on each process. If each process has a nonzero number of submatrices things appear to be working fine. If a process has zero submatrices, I am getting a memory leak on that process (as reported by -malloc_dump). I did not get this behavior with PETSc 3.7.2 and earlier with MatGetSubMatrices() and MatDestroyMatrices().<br>
<br>
Do I need to do something special when calling MatCreateSubMatrices() or MatDestroyMatrices() when the number of submatrices on a process is zero?<br>
<br>
The log with the petsc log summary and malloc dump output is attached.<br>
<br>
Thanks,<br>
Brad<br>
<br>
<br>
</blockquote></div><br></div></div>