<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Seems there is a problem with the attachment. Here is the file :<br></div><div><br></div><div>>> more matExport.cpp <br>#include <petscmat.h><br>#include <petscsys.h><br><br>int main(int argc, char *argv[])<br>{<br> PetscInitialize(&argc, &argv, "", NULL);<br><br> Mat matrix;<br> MatCreate(PETSC_COMM_WORLD, &matrix);<br> const char* matType = (argc >= 2) ? argv[1] : MATMPIAIJ;<br> PetscPrintf(PETSC_COMM_WORLD, "mat type is %s \n", matType);<br> MatSetType(matrix, matType);<br> MatSetSizes(matrix, PETSC_DECIDE, PETSC_DECIDE, 10, 10);<br> MatSetUp(matrix);<br> for (int i = 0; i < 10; i++) MatSetValue(matrix, i, i, (double)(i+1.), ADD_VALUES);<br> MatAssemblyBegin(matrix, MAT_FINAL_ASSEMBLY);<br> MatAssemblyEnd(matrix, MAT_FINAL_ASSEMBLY);<br><br> PetscViewer viewer;<br> PetscViewerBinaryOpen(PETSC_COMM_WORLD, "matExport.bin", FILE_MODE_WRITE, &viewer);<br> MatView(matrix, viewer);<br> PetscViewerDestroy(&viewer);<br><br> PetscViewerASCIIOpen(PETSC_COMM_WORLD, "matExport.log", &viewer);<br> MatView(matrix, viewer);<br> PetscViewerDestroy(&viewer);<br><br> PetscViewerASCIIOpen(PETSC_COMM_WORLD, "matExport.mat", &viewer);<br> PetscViewerPushFormat(viewer, PETSC_VIEWER_ASCII_MATLAB);<br> MatView(matrix, viewer);<br> PetscViewerDestroy(&viewer);<br><br> MatDestroy(&matrix);<br> PetscFinalize();<br>}<br><br><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Franck Houssen" <franck.houssen@inria.fr><br><b>À: </b>petsc-dev@mcs.anl.gov<br><b>Envoyé: </b>Lundi 11 Décembre 2017 17:39:40<br><b>Objet: </b>[petsc-dev] MatIS export<br><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Reporting a small bug related to MatIS export (or is this not meant to be supported ?).<br></div><div><br></div><div>Franck<br></div><div><br></div><div>>> rm -f matExport.log matExport.mat matExport.bin; mpirun -n 2 ./matExport.exe <strong>is</strong>; more matExport.log matExport.mat matExport.bin<br>mat type is is <br>[0]PETSC ERROR: ------------------------------------------------------------------------<br>[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<br>[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br>[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind<br>[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors<br>[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run <br>[0]PETSC ERROR: to get more information on the crash.<br>[1]PETSC ERROR: ------------------------------------------------------------------------<br>[1]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<br>[1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br>[1]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind<br>[1]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors<br>[1]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run <br>[1]PETSC ERROR: to get more information on the crash.<br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br><div><br></div></div><div><br></div><div>>> rm -f matExport.log matExport.mat matExport.bin; mpirun -n 2 ./matExport.exe <strong>mpiaij</strong>; more matExport.log matExport.mat matExport.bin<br>mat type is mpiaij <br>::::::::::::::<br>matExport.log<br>::::::::::::::<br>Mat Object: 2 MPI processes<br> type: mpiaij<br>row 0: (0, 2.) <br>row 1: (1, 4.) <br>row 2: (2, 6.) <br>row 3: (3, 8.) <br>row 4: (4, 10.) <br>row 5: (5, 12.) <br>row 6: (6, 14.) <br>row 7: (7, 16.) <br>row 8: (8, 18.) <br>row 9: (9, 20.) <br>::::::::::::::<br>matExport.mat<br>::::::::::::::<br>%Mat Object: 2 MPI processes<br>% type: mpiaij<br>% Size = 10 10 <br>% Nonzeros = 10 <br>zzz = zeros(10,3);<br>zzz = [<br>1 1 2.0000000000000000e+00<br>2 2 4.0000000000000000e+00<br>3 3 6.0000000000000000e+00<br>4 4 8.0000000000000000e+00<br>5 5 1.0000000000000000e+01<br>6 6 1.2000000000000000e+01<br>7 7 1.4000000000000000e+01<br>8 8 1.6000000000000000e+01<br>9 9 1.8000000000000000e+01<br>10 10 2.0000000000000000e+01<br>];<br> Mat_0x557ffe276ba0_0 = spconvert(zzz);<br>::::::::::::::<br>matExport.bin<br>::::::::::::::<br><div><br></div><br><div><br></div><br><div><br></div></div><div></div><div></div></div></blockquote><div><br></div></div></body></html>