<div dir="ltr"><div dir="ltr">On Wed, Nov 30, 2022 at 8:58 AM 김성익 <<a href="mailto:ksi2443@gmail.com">ksi2443@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><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">I'm working on FEM. <div>  When I used mumps alone, I fount it efficient to use mumps with metis.  <br>So my purpose is using MUMPSsolver with METIS.<div><br></div></div><div>I tried to set metis (by icntl_7 : 5) after global matrix assembly and just before kspsolve.</div><div>However there is error because of 'pcfactorgetmatrix' and 'matmumpsseticntl'.</div><div><br></div><div>How can I fix this?</div></div></blockquote><div><br></div><div>Give the Icntrl as an option.</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 dir="ltr"><div>Thanks,</div><div>Hyung Kim</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2022년 11월 30일 (수) 오후 10:44, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>>님이 작성:<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">On Wed, Nov 30, 2022 at 8:40 AM 김성익 <<a href="mailto:ksi2443@gmail.com" target="_blank">ksi2443@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><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">Following your comments,<div><br></div><div>After matrix assembly end, </div><div>PetscCall(KSPGetPC(ksp,&pc));<br>                                   PetscCall(KSPSetFromOptions(ksp));<br>                                    PetscCall(KSPSetUp(ksp));<br>                                     PetscCall(PCFactorGetMatrix(pc,&xGK));<br></div><div><br></div><div>However there is another error as below.</div><div>[0]PETSC ERROR: Object is in wrong state<br>[0]PETSC ERROR: Not for factored matrix<br></div></div></blockquote><div><br></div><div>The error message is telling you that you cannot alter values in the factored matrix. This is because</div><div>the direct solvers use their own internal storage formats which we cannot alter, and you should probably</div><div>not alter either.</div><div><br></div><div>What are you trying to do?</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 dir="ltr"><div>[0]PETSC ERROR: See <a href="https://petsc.org/release/faq/" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.18.1, unknown <br>[0]PETSC ERROR: ./app on a arch-linux-c-debug named ubuntu by ksi2443 Wed Nov 30 05:37:52 2022<br>[0]PETSC ERROR: Configure options -download-mumps -download-scalapack -download-parmetis -download-metis<br>[0]PETSC ERROR: #1 MatZeroEntries() at /home/ksi2443/petsc/src/mat/interface/matrix.c:6024<br>[0]PETSC ERROR: #2 main() at /home/ksi2443/Downloads/coding/a1.c:339<br>[0]PETSC ERROR: No PETSc Option Table entries<br></div><div><br></div><div>How can I fix this?</div><div><br></div><div><br></div><div>Thanks,</div><div>Hyung Kim</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2022년 11월 30일 (수) 오후 4:18, Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" target="_blank">jroman@dsic.upv.es</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You have to call PCFactorGetMatrix() first. See any of the examples that use MatMumpsSetIcntl(), for instance <a href="https://petsc.org/release/src/ksp/ksp/tutorials/ex52.c.html" rel="noreferrer" target="_blank">https://petsc.org/release/src/ksp/ksp/tutorials/ex52.c.html</a><br>
<br>
Jose<br>
<br>
<br>
> El 30 nov 2022, a las 6:52, 김성익 <<a href="mailto:ksi2443@gmail.com" target="_blank">ksi2443@gmail.com</a>> escribió:<br>
> <br>
> Hello,<br>
> <br>
> <br>
> I tried to adopt METIS option in MUMPS by using <br>
> ' PetscCall(MatMumpsSetIcntl(Mat, 7, 5));'<br>
> <br>
> However, there is an error as follows<br>
> <br>
> [0]PETSC ERROR: Object is in wrong state<br>
> [0]PETSC ERROR: Only for factored matrix<br>
> [0]PETSC ERROR: See <a href="https://petsc.org/release/faq/" rel="noreferrer" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.18.1, unknown <br>
> [0]PETSC ERROR: ./app on a arch-linux-c-debug named ubuntu by ksi2443 Tue Nov 29 21:12:41 2022<br>
> [0]PETSC ERROR: Configure options -download-mumps -download-scalapack -download-parmetis -download-metis<br>
> [0]PETSC ERROR: #1 MatMumpsSetIcntl() at /home/ksi2443/petsc/src/mat/impls/aij/mpi/mumps/mumps.c:2478<br>
> [0]PETSC ERROR: #2 main() at /home/ksi2443/Downloads/coding/a1.c:149<br>
> [0]PETSC ERROR: No PETSc Option Table entries<br>
> <br>
> How can I fix this error?<br>
> <br>
> Thank you for your help.<br>
> <br>
> <br>
> Hyung Kim<br>
<br>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>