<div dir="ltr"><span style="color:rgb(80,0,80)">Florian:</span><div><font color="#500050">I pushed a fix in branch hzhang/fix_matview_mpisbaij (off petsc-maint)</font></div><div><font color="#500050"><a href="https://bitbucket.org/petsc/petsc/commits/d1654148bc9f02cde4d336bb9518a18cfb35148e">https://bitbucket.org/petsc/petsc/commits/d1654148bc9f02cde4d336bb9518a18cfb35148e</a></font></div><div><font color="#500050"><br></font></div><div><font color="#500050">After it is tested in our regression tests, it will be merged to petsc-maint and petsc-master.</font></div><div><span style="color:rgb(80,0,80)">Thanks for reporting it!</span><br></div><div><font color="#500050"><br></font></div><div><font color="#500050">Hong<br></font><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 23, 2016 at 10:37 AM, Hong <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>></span> wrote:<br><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 class="gmail_extra"><div class="gmail_quote">Florian:</div><div class="gmail_quote">I can reproduce this error.</div><div class="gmail_quote">This is a bug in PETSc library. I'll fix it and get back to you soon.</div><div class="gmail_quote"><span class="gmail-HOEnZb"><font color="#888888">Hong</font></span><div><div class="gmail-h5"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span><br>
Am 22.09.2016 um 18:34 schrieb Hong:<br>
> Florian:<br>
> Would it work if replacing MATSBAIJ to MATAIJ or MATMPISBAIJ?<br>
<br>
</span>MATAIJ works, but is not an option for my actual application.<br>
<br>
MATMPISBAIJ does not work. Not very suprisingly, since afaik setting it to MATSBAIJ and executing it on multiple MPI<br>
ranks actually results in MATMPISBAIJ.<br>
<br>
Best,<br>
Florian<br>
<div><div><br>
<br>
><br>
> Hong<br>
><br>
> Hey,<br>
><br>
> this code reproduces the error when run with 2 or more ranks.<br>
><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>
> MatSetType(matrix, MATSBAIJ);<br>
> MatSetSizes(matrix, 10, 10, PETSC_DETERMINE, PETSC_DETERMINE);<br>
> MatSetFromOptions(matrix);<br>
> MatSetUp(matrix);<br>
><br>
> MatAssemblyBegin(matrix, MAT_FINAL_ASSEMBLY);<br>
> MatAssemblyEnd(matrix, MAT_FINAL_ASSEMBLY);<br>
><br>
> PetscViewer viewer;<br>
> PetscViewerBinaryOpen(PETSC_C<wbr>OMM_WORLD, "test.mat", FILE_MODE_WRITE, &viewer);<br>
> MatView(matrix, viewer);<br>
> PetscViewerDestroy(&viewer);<br>
> MatDestroy(&matrix);<br>
><br>
> PetscFinalize();<br>
> }<br>
><br>
><br>
> The complete output is:<br>
><br>
><br>
> lindnefn@neon /data/scratch/lindnefn/aste (git)-[master] % mpic++ petsc.cpp -lpetsc && mpirun -n 2 ./a.out<br>
><br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [0]PETSC ERROR: No support for this operation for this object type<br>
> [0]PETSC ERROR: Cannot get subcomm viewer for binary files or sockets unless SubViewer contains the rank 0 process<br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/d<wbr>ocumentation/faq.html</a><br>
> <<a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/<wbr>petsc/documentation/faq.html</a>> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown<br>
> [0]PETSC ERROR: ./a.out on a arch-linux2-c-debug named neon by lindnefn Thu Sep 22 16:10:34 2016<br>
> [0]PETSC ERROR: Configure options --with-debugging=1 --download-petsc4py=yes --download-mpi4py=yes<br>
> --download-superlu_dist --download-parmetis --download-metis<br>
> [0]PETSC ERROR: #1 PetscViewerGetSubViewer_Binary<wbr>() line 46 in<br>
> /data/scratch/lindnefn/softwa<wbr>re/petsc/src/sys/classes/<wbr>viewer/impls/binary/binv.c<br>
> [0]PETSC ERROR: #2 PetscViewerGetSubViewer() line 43 in<br>
> /data/scratch/lindnefn/softwa<wbr>re/petsc/src/sys/classes/<wbr>viewer/interface/dupl.c<br>
> [0]PETSC ERROR: #3 MatView_MPISBAIJ_ASCIIorDrawor<wbr>Socket() line 900 in<br>
> /data/scratch/lindnefn/softwa<wbr>re/petsc/src/mat/impls/sbaij/<wbr>mpi/mpisbaij.c<br>
> [0]PETSC ERROR: #4 MatView_MPISBAIJ() line 926 in<br>
> /data/scratch/lindnefn/softwa<wbr>re/petsc/src/mat/impls/sbaij/<wbr>mpi/mpisbaij.c<br>
> [0]PETSC ERROR: #5 MatView() line 901 in /data/scratch/lindnefn/softwar<wbr>e/petsc/src/mat/interface/<wbr>matrix.c<br>
> WARNING! There are options you set that were not used!<br>
> WARNING! could be spelling mistake, etc!<br>
> Option left: name:-ksp_converged_reason (no value)<br>
> Option left: name:-ksp_final_residual (no value)<br>
> Option left: name:-ksp_view (no value)<br>
> [neon:113111] *** Process received signal ***<br>
> [neon:113111] Signal: Aborted (6)<br>
> [neon:113111] Signal code: (-6)<br>
> [neon:113111] [ 0] /lib/x86_64-linux-gnu/libc.so.<wbr>6(+0x36cb0) [0x7feed8958cb0]<br>
> [neon:113111] [ 1] /lib/x86_64-linux-gnu/libc.so.<wbr>6(gsignal+0x37) [0x7feed8958c37]<br>
> [neon:113111] [ 2] /lib/x86_64-linux-gnu/libc.so.<wbr>6(abort+0x148) [0x7feed895c028]<br>
> [neon:113111] [ 3]<br>
> /data/scratch/lindnefn/softwa<wbr>re/petsc/arch-linux2-c-debug/<wbr>lib/libpetsc.so.3.7(PetscTrace<wbr>BackErrorHandler+0x563)<br>
> [0x7feed8d8db31]<br>
> [neon:113111] [ 4] /data/scratch/lindnefn/softwar<wbr>e/petsc/arch-linux2-c-debug/<wbr>lib/libpetsc.so.3.7(PetscError<wbr>+0x374)<br>
> [0x7feed8d88750]<br>
> [neon:113111] [ 5] /data/scratch/lindnefn/softwar<wbr>e/petsc/arch-linux2-c-debug/<wbr>lib/libpetsc.so.3.7(+0x19b2f6)<br>
> [0x7feed8e822f6]<br>
> [neon:113111] [ 6]<br>
> /data/scratch/lindnefn/softwa<wbr>re/petsc/arch-linux2-c-debug/<wbr>lib/libpetsc.so.3.7(PetscViewe<wbr>rGetSubViewer+0x4f1)<br>
> [0x7feed8e803cb]<br>
> [neon:113111] [ 7] /data/scratch/lindnefn/softwar<wbr>e/petsc/arch-linux2-c-debug/<wbr>lib/libpetsc.so.3.7(+0x860c95)<br>
> [0x7feed9547c95]<br>
> [neon:113111] [ 8] /data/scratch/lindnefn/softwar<wbr>e/petsc/arch-linux2-c-debug/<wbr>lib/libpetsc.so.3.7(+0x861494)<br>
> [0x7feed9548494]<br>
> [neon:113111] [ 9] /data/scratch/lindnefn/softwar<wbr>e/petsc/arch-linux2-c-debug/<wbr>lib/libpetsc.so.3.7(MatView+<wbr>0x12b6)<br>
> [0x7feed971c08f]<br>
> [neon:113111] [10] ./a.out() [0x400b8b]<br>
> [neon:113111] [11] /lib/x86_64-linux-gnu/libc.so.<wbr>6(__libc_start_main+0xf5) [0x7feed8943f45]<br>
> [neon:113111] [12] ./a.out() [0x4009e9]<br>
> [neon:113111] *** End of error message ***<br>
> -----------------------------<wbr>------------------------------<wbr>---------------<br>
> mpirun noticed that process rank 1 with PID 113111 on node neon exited on signal 6 (Aborted).<br>
> -----------------------------<wbr>------------------------------<wbr>---------------<br>
><br>
> Thanks,<br>
> Florian<br>
><br>
><br>
><br>
> Am 22.09.2016 um 13:32 schrieb Matthew Knepley:<br>
> > On Thu, Sep 22, 2016 at 5:42 AM, Florian Lindner <<a href="mailto:mailinglists@xgm.de" target="_blank">mailinglists@xgm.de</a> <mailto:<a href="mailto:mailinglists@xgm.de" target="_blank">mailinglists@xgm.de</a>><br>
</div></div><div><div>> <mailto:<a href="mailto:mailinglists@xgm.de" target="_blank">mailinglists@xgm.de</a> <mailto:<a href="mailto:mailinglists@xgm.de" target="_blank">mailinglists@xgm.de</a>>>> wrote:<br>
> ><br>
> > Hello,<br>
> ><br>
> > I want to write a MATSBAIJ to a file in binary, so that I can load it later using MatLoad.<br>
> ><br>
> > However, I keep getting the error:<br>
> ><br>
> > [5]PETSC ERROR: No support for this operation for this object type!<br>
> > [5]PETSC ERROR: Cannot get subcomm viewer for binary files or sockets unless SubViewer contains the rank 0 process<br>
> > [6]PETSC ERROR: PetscViewerGetSubViewer_Binary<wbr>() line 46 in<br>
> > /data/scratch/lindnefn/softwa<wbr>re/petsc/src/sys/classes/<wbr>viewer/impls/binary/binv.c<br>
> ><br>
> ><br>
> > Do not truncate the stack.<br>
> ><br>
> > Run under valgrind.<br>
> ><br>
> > Thanks,<br>
> ><br>
> > Matt<br>
> ><br>
> ><br>
> > The rank 0 is included, as you can see below, I use PETSC_COMM_WORLD and the matrix is also created like that.<br>
> ><br>
> > The code looks like:<br>
> ><br>
> > PetscErrorCode ierr = 0;<br>
> > PetscViewer viewer;<br>
> > PetscViewerBinaryOpen(PETSC_C<wbr>OMM_WORLD, filename.c_str(), FILE_MODE_WRITE, &viewer); CHKERRV(ierr);<br>
> > MatView(matrix, viewer); CHKERRV(ierr);<br>
> > PetscViewerDestroy(&viewer);<br>
> ><br>
> > Thanks,<br>
> > Florian<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any<br>
> > results to which their experiments lead.<br>
> > -- Norbert Wiener<br>
><br>
><br>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div></div>