<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">
<div dir="ltr">
<div>Eda,</div>
<div dir="ltr"> An update to ex72 is merged to PETSc master branch just now. It now can read matrices either symmetric or non-symmetric in Matrix Market format, and output a petsc binary matrix in MATSBAIJ format (for symmetric) or MATAIJ format (for non-symmetric).
See help in source code for usage.</div>
<div dir="ltr">
<div>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">--Junchao Zhang</div>
</div>
</div>
<br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Feb 12, 2019 at 1:50 AM Eda Oktay via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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 dir="ltr">Hello,
<div><br>
</div>
<div>I am trying to load matrix in Matrix Market format. I found an example on mat file (ex78) whih can be tested by using .dat file. Since .dat file and .mtx file are similar in structure (specially afiro_A.dat file is similar to amesos2_test_mat0.mtx since
they both have 3 columns and the columns represent the same properties), I tried to run ex78 by using amesos2_test_mat0.mtx instead of afiro_A.dat. However, I got the error "Badly formatted input file". Here is the full error message:</div>
<div><br>
</div>
<div>
<div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div>
<div>[0]PETSC ERROR: Badly formatted input file</div>
<div><br>
</div>
<div>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">
http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</div>
<div>[0]PETSC ERROR: Petsc Release Version 3.10.3, Dec, 18, 2018 </div>
<div>[0]PETSC ERROR: ./ex78 on a arch-linux2-c-debug named <a href="http://7330.wls.metu.edu.tr" target="_blank">
7330.wls.metu.edu.tr</a> by edaoktay Tue Feb 12 10:47:58 2019</div>
<div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-cxx-dialect=C++11 --download-openblas --download-metis --download-parmetis --download-superlu_dist --download-slepc --download-mpich</div>
<div>[0]PETSC ERROR: #1 main() line 73 in /home/edaoktay/petsc-3.10.3/src/mat/examples/tests/ex78.c</div>
<div>[0]PETSC ERROR: PETSc Option Table entries:</div>
<div>[0]PETSC ERROR: -Ain /home/edaoktay/petsc-3.10.3/share/petsc/datafiles/matrices/amesos2_test_mat0.mtx</div>
<div>[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint@mcs.anl.gov----------</div>
<div>application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0</div>
<div>[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=1</div>
<div>:</div>
<div>system msg for write_line failure : Bad file descriptor</div>
</div>
<div><br>
</div>
<div>I know there is also an example (ex72) for Matrix Market format but in description, it is only proper for symmmetric and lower triangle, so I decided to use ex78.</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Eda </div>
</div>
</div>
</blockquote>
</div>
</body>
</html>