<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi, </div><div class=""><br class=""></div><div class="">I am trying to write a sparse matrix to file with MPIIO but failed. I got the same error on vesta (gpfs), my Macbook (local disk), and a linux machine (nfs). The followings are my code snippet and error output. Could anyone help me check the code? Thanks! </div><div class=""><br class=""></div><div class="">...</div><div class=""> MatCreate(PETSC_COMM_WORLD, &mat);<br class=""> MatSetType(mat, MATMPIAIJ);<br class=""> MatSetSizes(mat, PETSC_DECIDE, PETSC_DECIDE, n, n);<br class=""> MatSetUp(mat);</div><div class="">...</div><div class=""> // write matrix</div><div class="">...</div><div class=""> MatAssemblyBegin(mat, MAT_FINAL_ASSEMBLY);<br class=""> MatAssemblyEnd(mat, MAT_FINAL_ASSEMBLY);<br class=""><br class=""> PetscViewer viewer; <br class=""> PetscViewerCreate(PETSC_COMM_WORLD, &viewer); <br class=""> PetscViewerSetType(viewer, PETSCVIEWERBINARY);<br class=""> PetscViewerFileSetMode(viewer, FILE_MODE_WRITE);<br class=""> PetscViewerFileSetName(viewer, "sfm.mat");<br class=""> PetscViewerBinarySetUseMPIIO(viewer, PETSC_TRUE);<br class=""> MatView(mat, viewer);<br class=""> PetscViewerDestroy(&viewer);</div><div class="">...</div><div class=""><br class=""></div><div class=""><br class=""></div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[0]PETSC ERROR: Write to file failed<br class="">[0]PETSC ERROR: Error writing to file total size 4 err -1 wsize 16<br class="">[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" class="">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br class="">[0]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015 <br class="">[0]PETSC ERROR: Unknown Name on a arch-linux2-c-debug named compute001 by hguo Sat Feb 27 21:40:04 2016<br class="">[0]PETSC ERROR: Configure options —prefix=(hidden) --with-fc=0 --download-f2cblaslapack --with-mpi-dir=(hidden) --with-precision=single<br class="">[0]PETSC ERROR: #1 PetscBinaryWrite() line 405 in (hidden)/petsc-3.6.3/src/sys/fileio/sysio.c<br class="">[0]PETSC ERROR: #2 MatView_MPIAIJ_Binary() line 1219 in (hidden)/petsc-3.6.3/src/mat/impls/aij/mpi/mpiaij.c<br class="">[0]PETSC ERROR: #3 MatView_MPIAIJ_ASCIIorDraworSocket() line 1385 in (hidden)/petsc-3.6.3/src/mat/impls/aij/mpi/mpiaij.c<br class="">[0]PETSC ERROR: #4 MatView_MPIAIJ() line 1470 in (hidden)/petsc-3.6.3/src/mat/impls/aij/mpi/mpiaij.c<br class="">[0]PETSC ERROR: #5 MatView() line 886 in (hidden)/petsc-3.6.3/src/mat/interface/matrix.c<br class=""><br class=""><div class="">
<div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="Apple-interchange-newline">---------------</div><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hanqi Guo</div><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Postdoctoral Appointee<br class="">Mathematics and Computer Science Division<br class="">Argonne National Laboratory<br class="">9700 S. Cass Ave., Bldg 240<br class="">Argonne, IL 60439<br class=""></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">e-mail: <a href="mailto:hguo@anl.gov" class="">hguo@anl.gov</a></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">web: <a href="http://www.mcs.anl.gov/~hguo" class="">http://www.mcs.anl.gov/~hguo</a><br class=""></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">phone: 630-252-7225</div></div></div></div>
</div>
<br class=""></body></html>