<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 9, 2017 at 4:00 PM, Pierre Jolivet <span dir="ltr"><<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank">pierre.jolivet@enseeiht.fr</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 style="word-wrap:break-word">Oh my, this example also segfaults (at least on my Mac) when running:<div>mpirun -np 1 ./ex1 -pc_type gamg -mat_view</div></div></blockquote><div><br></div><div>Hong, in</div><div><br></div><div> MatTransposeMatMultSymbolic_SeqAIJ_SeqAIJ() on line 1015</div><div><br></div><div>you create a matrix without values, not surprising since this is the symbolic phase. However,</div><div>it calls MatAssemblyEnd(), which calls ViewFromOptions(), which gets an SEGV because</div><div>it does not think to check if a->a is NULL.</div><div><br></div><div>a) Should we make View robust to missing matrix values?</div><div><br></div><div>b) I don't think this internal matrix should really be viewed like this, so maybe change its prefix?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div>[0]PETSC ERROR: [0] MatView_SeqAIJ_ASCII line 560 /Volumes/Data/Repositories/<wbr>petsc/src/mat/impls/aij/seq/<wbr>aij.c</div><div>[0]PETSC ERROR: [0] MatView_SeqAIJ line 915 /Volumes/Data/Repositories/<wbr>petsc/src/mat/impls/aij/seq/<wbr>aij.c</div><div>[0]PETSC ERROR: [0] MatView line 920 /Volumes/Data/Repositories/<wbr>petsc/src/mat/interface/<wbr>matrix.c</div><div>[0]PETSC ERROR: [0] PetscObjectView line 92 /Volumes/Data/Repositories/<wbr>petsc/src/sys/objects/destroy.<wbr>c</div><div>[0]PETSC ERROR: [0] PetscObjectViewFromOptions line 2702 /Volumes/Data/Repositories/<wbr>petsc/src/sys/objects/options.<wbr>c</div><div>[0]PETSC ERROR: [0] MatAssemblyEnd line 5151 /Volumes/Data/Repositories/<wbr>petsc/src/mat/interface/<wbr>matrix.c</div><div>[0]PETSC ERROR: [0] MatCreateSeqAIJWithArrays line 4137 /Volumes/Data/Repositories/<wbr>petsc/src/mat/impls/aij/seq/<wbr>aij.c</div><div>[0]PETSC ERROR: [0] MatTransposeMatMultSymbolic_<wbr>SeqAIJ_SeqAIJ line 1012 /Volumes/Data/Repositories/<wbr>petsc/src/mat/impls/aij/seq/<wbr>matmatmult.c</div><div>[0]PETSC ERROR: [0] MatTransposeMatMult_SeqAIJ_<wbr>SeqAIJ line 994 /Volumes/Data/Repositories/<wbr>petsc/src/mat/impls/aij/seq/<wbr>matmatmult.c</div><div>[0]PETSC ERROR: [0] MatTransposeMatMult line 9607 /Volumes/Data/Repositories/<wbr>petsc/src/mat/interface/<wbr>matrix.c</div><div>[0]PETSC ERROR: [0] PCGAMGCoarsen_AGG line 914 /Volumes/Data/Repositories/<wbr>petsc/src/ksp/pc/impls/gamg/<wbr>agg.c</div><div>[0]PETSC ERROR: [0] PCSetUp_GAMG line 425 /Volumes/Data/Repositories/<wbr>petsc/src/ksp/pc/impls/gamg/<wbr>gamg.c</div><div>[0]PETSC ERROR: [0] PCSetUp line 886 /Volumes/Data/Repositories/<wbr>petsc/src/ksp/pc/interface/<wbr>precon.c</div><div>[0]PETSC ERROR: [0] KSPSetUp line 291 /Volumes/Data/Repositories/<wbr>petsc/src/ksp/ksp/interface/<wbr>itfunc.c</div></div><div><br></div><div>[0]PETSC ERROR: Petsc Development GIT revision: v3.7.5-3046-gde967d2 GIT Date: 2017-02-09 18:59:37 +0000</div><div>[0]PETSC ERROR: Configure options --LDFLAGS=-L/opt/intel/lib --download-hypre --download-metis --download-mumps --download-parmetis --download-pastix --download-ptscotch --with-blacs-include=/opt/<wbr>intel/mkl/include --with-blacs-lib=/opt/intel/<wbr>mkl/lib/libmkl_blacs_mpich_<wbr>lp64.so --with-blaslapack-dir=/opt/<wbr>intel/mkl --with-chtml=0 --with-mkl_pardiso-include=/<wbr>opt/intel/mkl/include --with-mkl_pardiso=1 --with-scalapack-include=/opt/<wbr>intel/mkl/include --with-scalapack-lib="[/opt/<wbr>intel/mkl/lib/libmkl_<wbr>scalapack_lp64.so,/opt/intel/<wbr>mkl/lib/libmkl_blacs_mpich_<wbr>lp64.so]" --with-shared-libraries=1 --with-x=1 PETSC_ARCH=arch-darwin-c-debug</div><div><br><div><blockquote type="cite"><div>On Feb 9, 2017, at 10:52 PM, Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank">pierre.jolivet@enseeiht.fr</a>> wrote:</div><br class="gmail-m_1025981198591314391Apple-interchange-newline"><div><div style="word-wrap:break-word">There, attached.<div><br></div><div>Thanks.</div><div><br></div><div>PS: here is the patch also, just in case</div><div><div>diff --git a/src/ksp/ksp/examples/<wbr>tutorials/ex1.c b/src/ksp/ksp/examples/<wbr>tutorials/ex1.c</div><div>index 6382c09..d9dc69a 100644</div><div>--- a/src/ksp/ksp/examples/<wbr>tutorials/ex1.c</div><div>+++ b/src/ksp/ksp/examples/<wbr>tutorials/ex1.c</div><div>@@ -123,6 +123,11 @@ int main(int argc,char **args)</div><div> routines.</div><div> */</div><div> ierr = KSPSetFromOptions(ksp);<wbr>CHKERRQ(ierr);</div><div>+ ierr = KSPSetUp(ksp);CHKERRQ(ierr);</div><div>+ char right_options[] = "-ksp_norm_type unpreconditioned -ksp_pc_side right";</div><div>+ PetscOptionsInsertString(<wbr>NULL,right_options);</div><div>+ ierr = KSPSetFromOptions(ksp);<wbr>CHKERRQ(ierr);</div><div>+ ierr = KSPSetUp(ksp);CHKERRQ(ierr);</div><div><br></div><div> if (nonzeroguess) {</div><div> PetscScalar p = .5;</div></div><div><br></div><div></div></div><span id="gmail-m_1025981198591314391cid:C3D49941-6879-4321-B8C0-035CC9BEE2E5"><ex1.c></span><div style="word-wrap:break-word"><div></div><div><br><div><blockquote type="cite"><div>On Feb 9, 2017, at 2:56 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br class="gmail-m_1025981198591314391Apple-interchange-newline"><div><div dir="ltr" style="font-family:helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 9, 2017 at 7:48 AM, Pierre Jolivet<span class="gmail-m_1025981198591314391Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank">pierre.jolivet@<wbr>enseeiht.fr</a>></span><span class="gmail-m_1025981198591314391Apple-converted-space"> </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 style="word-wrap:break-word"><div><blockquote type="cite"><div>On Feb 9, 2017, at 2:31 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br class="gmail-m_1025981198591314391m_9118270146108803878Apple-interchange-newline"><div><div dir="ltr" style="font-family:helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 9, 2017 at 7:29 AM, Pierre Jolivet<span class="gmail-m_1025981198591314391m_9118270146108803878Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank">pierre.jolivet@enseei<wbr>ht.fr</a>></span><span class="gmail-m_1025981198591314391m_9118270146108803878Apple-converted-space"> </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 style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Feb 9, 2017, at 2:17 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-interchange-newline"><div><div dir="ltr" style="font-family:helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 9, 2017 at 7:06 AM, Pierre Jolivet<span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank">pierre.jolivet@enseei<wbr>ht.fr</a>></span><span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-converted-space"> </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 style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Feb 9, 2017, at 1:37 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261gmail-m_-7129509824056556353Apple-interchange-newline"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 9, 2017 at 4:56 AM, Pierre Jolivet<span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:pierre.jolivet@enseeiht.fr" target="_blank">pierre.jolivet@enseei<wbr>ht.fr</a>></span><span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-converted-space"> </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">Hello,<br>I _might_ be doing something wrong when calling KSPSetFromOptions/KSPSetUp, but still, am I supposed to get this kind of error?<br>[0]PETSC ERROR: No support for this operation for this object type<br>[0]PETSC ERROR: KSP gmres does not support PRECONDITIONED with RIGHT<br><br>If not, I’ll try to send a MWE (it basically depends on where I set the option -ksp_pc_side right).<br></blockquote><div><br></div><div>I believe its telling you that it cannot display the preconditioned residual with right preconditioning, which is true.</div><div>Are you requesting both?</div></div></div></div></div></blockquote><div><br></div><div>No, I’m just using -ksp_view and -ksp_pc_side right. In the “standard” case, it obviously work.</div><div>However, the error is triggered if I set -ksp_pc_side right after a first call to KSPSetOperators()/KSPSetUp() without destroying the KSP.</div><div>Should I destroy my KSP before changing from left- (default) to right-preconditioning if KSPSetOperators()/KSPSetUp has already been called?</div></div></div></blockquote><div><br></div><div>Its likely you have to use</div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetNormType.html" target="_blank">http://www.mcs.anl.gov/petsc<wbr>/petsc-current/docs/manualpage<wbr>s/KSP/KSPSetNormType.html</a></div><div><br></div><div>or</div><div><br></div><div> <b style="font-family:times;font-size:inherit">-ksp_norm_type unpreconditioned</b></div></div></div></div></div></blockquote><div><br></div><div>If I use this after my first call to KSPSetUp, I now end up with:</div><div>[0]PETSC ERROR: KSP gmres does not support UNPRECONDITIONED with LEFT</div></div></div></blockquote><div><br></div><div>Yes, you would need to use it at the same time that you change the preconditioning side.</div></div></div></div></div></blockquote><div><br></div><div>Yes, I’m using PetscOptionsInsert, and whether I let PETSc parse "-ksp_pc_side right -ksp_norm_type unpreconditioned” or "-ksp_norm_type unpreconditioned -ksp_pc_side right” I end up with the same error afterwards.</div></div></div></blockquote><div><br></div><div>Can you make an example do it (SNES ex5)? Or can you send a small example that does it?</div><div><br></div><div> <span class="gmail-m_1025981198591314391Apple-converted-space"> </span>Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div>Thanks.</div><br><blockquote type="cite"><div><div dir="ltr" style="font-family:helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><div> Thanks,</div><div><br></div><div> Matt </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr" style="font-family:helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><div>since we would not have a chance to change it since its been set already.</div><div><br></div><div> <span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-converted-space"> </span>Thanks,</div><div><br></div><div> Matt</div><div><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 style="word-wrap:break-word"><div><div>Thanks.</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> <span class="gmail-m_1025981198591314391m_9118270146108803878Apple-converted-space"> </span>Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks,<br>Pierre</blockquote></div><br><br clear="all"><span class="gmail-m_1025981198591314391m_9118270146108803878HOEnZb"><font color="#888888"><span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261gmail-HOEnZb"><font color="#888888"><div><br></div>--<span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-converted-space"> </span><br><div class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261gmail-m_-7129509824056556353gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div></font></span></font></span></div></div></div></blockquote></div><span class="gmail-m_1025981198591314391m_9118270146108803878HOEnZb"><font color="#888888"><br></font></span></div></blockquote></div><span class="gmail-m_1025981198591314391m_9118270146108803878HOEnZb"><font color="#888888"><br><br clear="all"><span class="gmail-m_1025981198591314391HOEnZb"><font color="#888888"><div><br></div>--<span class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261Apple-converted-space"> </span><br><div class="gmail-m_1025981198591314391m_9118270146108803878m_8641040722046524261gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div></font></span></font></span></div></div></div></blockquote></div><span class="gmail-m_1025981198591314391HOEnZb"><font color="#888888"><br></font></span></div></blockquote></div><span class="gmail-m_1025981198591314391HOEnZb"><font color="#888888"><br><br clear="all"><span class="gmail-HOEnZb"><font color="#888888"><div><br></div>--<span class="gmail-m_1025981198591314391m_9118270146108803878Apple-converted-space"> </span><br><div class="gmail-m_1025981198591314391m_9118270146108803878gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div></font></span></font></span></div></div></div></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br></font></span></div></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>--<span class="gmail-m_1025981198591314391Apple-converted-space"> </span><br><div class="gmail-m_1025981198591314391gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div></font></span></div></div></div></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><br></font></span></div></div></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>