[petsc-users] MatView to file

Mark Adams mfadams at lbl.gov
Fri Aug 12 11:02:10 CDT 2022


You also want:

    PetscCall(PetscViewerPopFormat(viewer));
    PetscCall(PetscViewerDestroy(&viewer));

This should not be a problem.
If this is a segv and you configure it with   '--with-debugging=1', you
should get a stack trace, which would help immensely.
Or run in a debugger to get a stack trace.

Thanks,
Mark



On Fri, Aug 12, 2022 at 11:26 AM Alfredo Jaramillo <
ajaramillopalma at gmail.com> wrote:

> Dear developers,
>
> I'm writing a sparse matrix into a file by doing
>
>     if (dump_mat) {
>         PetscViewer viewer;
>         PetscViewerASCIIOpen(PETSC_COMM_WORLD,"mat-par-aux.m",&viewer);
>         PetscViewerPushFormat(viewer, PETSC_VIEWER_ASCII_MATLAB);
>         MatView(A,viewer);
>     }
>
> This works perfectly for small cases.
> The program crashes for a case where the matrix A is of order 1 million
> but with only 4 million non-zero elements.
>
> Maybe at some point petsc is full-sizing A?
>
> Thank you,
> Alfredo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220812/4615ba93/attachment.html>


More information about the petsc-users mailing list