[petsc-users] error related to 'valgrind' when using MatView
maitri ksh
maitri.ksh at gmail.com
Thu Aug 10 01:29:39 CDT 2023
I am unable to understand what possibly went wrong with my code, I could
load a matrix (large sparse matrix) into petsc, write it out and read it
back into Matlab but when I tried to use MatView to see the matrix-info, it
produces error of some 'corrupt argument, #valgrind'. Can anyone please
help?
Maitri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230810/4bbbd64f/attachment.html>
-------------- next part --------------
Mat Object: 1 MPI process
type: mpiaij
rows=480000, cols=480000
total: nonzeros=17795897, allocated nonzeros=17795897
total number of mallocs used during MatSetValues calls=0
not using I-node (on process 0) routines
after Loading A matrix... Memory: Total: 0.483803 Max: 0.483803 [0]
after MatDestroy... Memory: Total: 0.483803 Max: 0.483803 [0]
Done
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Corrupt argument: https://petsc.org/release/faq/#valgrind
[0]PETSC ERROR: Object already free: Parameter # 1
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision: v3.19.4-889-g617fea4 GIT Date: 2023-08-01 05:10:03 +0000
[0]PETSC ERROR: ./loadMat on a linux-gnu-c-debug named zeus.technion.ac.il by maitri.ksh Thu Aug 10 09:20:43 2023
[0]PETSC ERROR: Configure options --with-cc=/usr/local/gcc11/bin/gcc --with-cxx=/usr/local/gcc11/bin/g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-matlab --with-matlab-dir=/usr/local/matlab --download-superlu --with-superlu --download-superlu_dist --with-superlu_dist --download-hdf5 --with-hdf5=1 --download-mumps --with-mumps --download-scalapack --with-scalapack --download-parmetis --download-metis --download-ptscotch --download-bison --download-cmake
[0]PETSC ERROR: #1 PetscObjectDestroy() at /home/maitri.ksh/Maitri/petsc/src/sys/objects/destroy.c:50
[0]PETSC ERROR: #2 PetscObjectRegisterDestroyAll() at /home/maitri.ksh/Maitri/petsc/src/sys/objects/destroy.c:355
[0]PETSC ERROR: #3 PetscFinalize() at /home/maitri.ksh/Maitri/petsc/src/sys/objects/pinit.c:1452
-------------- next part --------------
/* Load unfactored matrix (A) */
PetscViewer viewerA;
ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD, "Jmat.dat", FILE_MODE_READ, &viewerA); CHKERRQ(ierr);
ierr = MatCreate(PETSC_COMM_WORLD, &A); CHKERRQ(ierr);
ierr = MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, N, N);
ierr = MatSetType(A, type);
ierr = MatSetFromOptions(A);
PetscPrintf(PETSC_COMM_WORLD, "Loading unfactored matrix\n");
ierr = MatLoad(A, viewerA); CHKERRQ(ierr);
PetscViewerDestroy(&viewerA);
PetscViewer viewer;
viewer = PETSC_VIEWER_STDOUT_WORLD;
ierr = PetscViewerPushFormat(viewer, PETSC_VIEWER_ASCII_INFO);
ierr = MatView(A, viewer);
PetscViewerPopFormat(viewer);
PetscViewerDestroy(&viewer);
More information about the petsc-users
mailing list