<div dir="ltr">You also want:<br><br> PetscCall(PetscViewerPopFormat(viewer));<br> PetscCall(PetscViewerDestroy(&viewer));<br><br>This should not be a problem.<div>If this is a segv and you configure it with '--with-debugging=1', you should get a stack trace, which would help immensely.</div><div>Or run in a debugger to get a stack trace.</div><div><br></div><div>Thanks,</div><div>Mark<br><div><pre class="gmail-code gmail-highlight" lang="c"><span lang="c" class="gmail-line"></span></pre><pre class="gmail-code gmail-highlight" lang="c"><span lang="c" class="gmail-line"><br></span></pre></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 12, 2022 at 11:26 AM Alfredo Jaramillo <<a href="mailto:ajaramillopalma@gmail.com">ajaramillopalma@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear developers,</div><div><br></div><div>I'm writing a sparse matrix into a file by doing <br></div><div><br></div><div> if (dump_mat) {<br> PetscViewer viewer;<br> PetscViewerASCIIOpen(PETSC_COMM_WORLD,"mat-par-aux.m",&viewer);<br> PetscViewerPushFormat(viewer, PETSC_VIEWER_ASCII_MATLAB);<br> MatView(A,viewer);<br> }</div><div><br></div><div>This works perfectly for small cases.<br></div><div>The program crashes for a case where the matrix A is of order 1 million but with only 4 million non-zero elements.</div><div><br></div><div>Maybe at some point petsc is full-sizing A?</div><div><br></div><div>Thank you,</div><div>Alfredo<br></div></div>
</blockquote></div>