<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div>   Are you using <span style="font-family: Aptos, sans-serif;">-pc_type ilu  at the command line in your test? Or just letting it default to using ILU?</span><div><font face="Aptos, sans-serif" size="3"><br></font></div><div><font face="Aptos, sans-serif" size="3">    </font><font face="Aptos, sans-serif">This could explain the difference, the decision of what preconditioner to default to has moved until later in code, not when the PC is created or the matrix supplied but when it starts to build the preconditioner. Hence when you call </font><span style="font-family: Aptos, sans-serif;">PCFactorSetMatOrderingType() in the code the PC may not yet be set to ILU (or anything) hence the </span><span style="font-family: Aptos, sans-serif;">PCFactorSetMatOrderingType() is ignored,</span></div><div><font face="Aptos, sans-serif" size="3"><br></font></div><div><font face="Aptos, sans-serif" size="3"><br></font><div><br><blockquote type="cite"><div>On Aug 17, 2024, at 3:44 PM, Zou, Ling <lzou@anl.gov> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">Barry, thanks.<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">I am accessing PETSc through MOOSE. I need to figure out if the versions are consistent and how to test it.<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">-Ling<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div><div id="mail-editor-reference-message-container"><div><div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; border-image: none; padding: 3pt 0in 0in;"><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: Aptos, sans-serif;"><b><span style="">From:<span class="Apple-converted-space"> </span></span></b><span style="">Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>><br><b>Date:<span class="Apple-converted-space"> </span></b>Saturday, August 17, 2024 at 12:08</span><span style="font-family: Arial, sans-serif;"> </span><span style="">PM<br><b>To:<span class="Apple-converted-space"> </span></b>Zou, Ling <<a href="mailto:lzou@anl.gov">lzou@anl.gov</a>><br><b>Cc:<span class="Apple-converted-space"> </span></b><a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><span class="Apple-converted-space"> </span><<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br><b>Subject:<span class="Apple-converted-space"> </span></b>Re: [petsc-users] PCFactorSetMatOrderingType not working with 3.21<o:p></o:p></span></p></div><div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 1pt; color: white;">I have attached src/snes/tutorials/ex5.</span><span style="font-size: 1pt; font-family: Arial, sans-serif; color: white;"> </span><span style="font-size: 1pt; color: white;">c in which I tried to reproduce your problem by inserting the code you've indicated. However I am not getting the problem you see, I am seeing, type: ilu out-of-place factorization 0 levels of fill tolerance<o:p></o:p></span></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 1pt; color: white;">ZjQcmQRYFpfptBannerStart<o:p></o:p></span></div></div><div id="x_pfptBannerzozd5uo" style="border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-right-style: none; border-bottom-style: none; border-left-style: none; border-right-color: currentcolor; border-bottom-color: currentcolor; border-left-color: currentcolor; border-image: none; display: block !important; text-align: left !important; margin: 0px !important; padding: 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: rgb(208, 216, 220) !important; border-top-width: medium !important; border-top-style: none !important; border-top-color: rgb(144, 164, 174) !important;"><div id="x_pfptBannerzozd5uo"><div id="x_pfptBannerzozd5uo"><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif; line-height: 13.5pt; background: rgb(208, 216, 220);"><b><span style="font-family: Arial, sans-serif;">This Message Is From an External Sender<o:p></o:p></span></b></div></div><div id="x_pfptBannerzozd5uo"><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif; line-height: 13.5pt; background: rgb(208, 216, 220);"><span style="font-family: Arial, sans-serif;">This message came from outside your organization.<o:p></o:p></span></div></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif; background: rgb(208, 216, 220);"><span style=""> </span><o:p></o:p></div></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 1pt; color: white;">ZjQcmQRYFpfptBannerEnd<o:p></o:p></span></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">   I have attached src/snes/tutorials/ex5.c in which I tried to reproduce your problem by inserting the code you've indicated.<o:p></o:p></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">   However I am not getting the problem you see, I am seeing,<o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-variant-caps: normal; font-stretch: normal; font-size-adjust: none; font-kerning: auto; font-variant-alternates: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-feature-settings: normal;"><span style="font-size: 10.5pt; font-family: Menlo;">    type: ilu<o:p></o:p></span></div><div style="margin: 0in; font-variant-caps: normal; font-stretch: normal; font-size-adjust: none; font-kerning: auto; font-variant-alternates: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-feature-settings: normal;"><span style="font-size: 10.5pt; font-family: Menlo;">      out-of-place factorization<o:p></o:p></span></div><div style="margin: 0in; font-variant-caps: normal; font-stretch: normal; font-size-adjust: none; font-kerning: auto; font-variant-alternates: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-feature-settings: normal;"><span style="font-size: 10.5pt; font-family: Menlo;">      0 levels of fill<o:p></o:p></span></div><div style="margin: 0in; font-variant-caps: normal; font-stretch: normal; font-size-adjust: none; font-kerning: auto; font-variant-alternates: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-feature-settings: normal;"><span style="font-size: 10.5pt; font-family: Menlo;">      tolerance for zero pivot 2.22045e-14<o:p></o:p></span></div><div style="margin: 0in; font-variant-caps: normal; font-stretch: normal; font-size-adjust: none; font-kerning: auto; font-variant-alternates: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-feature-settings: normal;"><span style="font-size: 10.5pt; font-family: Menlo;">      matrix ordering: rcm<o:p></o:p></span></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><br><br><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">when I run with -pc_type ilu -snes_view<o:p></o:p></div></div></div></div><div><div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"> Can you please confirm you get the same problem with the attached ex5.c ?  You could send your code to see if I can reproduce the problem.<o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">  I am using the release branch of PETSc <o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">  Barry<o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><br><br><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><br><br><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><br><br><o:p></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">On Aug 17, 2024, at 12:35<span style="font-family: Arial, sans-serif;"> </span>PM, Zou, Ling via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<o:p></o:p></div></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div><div><div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">Hi all,</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">The following codes are how I used to setup PC mat ordering:</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  // Setup KSP/PC (at this moment, user-input options and commandline options are available)</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  SNESGetKSP(snes, &ksp);</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  KSPSetFromOptions(ksp);</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  PC pc;</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  KSPGetPC(ksp, &pc);</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;"> <span class="xapple-converted-space"> </span><span style="background: yellow;">PCFactorSetMatOrderingType(pc, MATORDERINGRCM);</span></span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  // PCFactorSetLevels(pc, 5);</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  SNESSetFromOptions(snes);</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">After switching to PETSc 3.21, this no longer works, and can be confirmed from ‘-snes_view’ output:</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">  PC Object: 1 MPI process</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">    type: ilu</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">      out-of-place factorization</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">      0 levels of fill</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">      tolerance for zero pivot 2.22045e-14</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">      using diagonal shift to prevent zero pivot [NONZERO]</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 8pt; font-family: Monaco;">     <span class="xapple-converted-space"> </span><span style="background: yellow;">matrix ordering: natural</span></span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">The command line option still works, i.e., ‘-pc_factor_mat_ordering_type rcm’ gives me the correct behavior.</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">Questions:</span><o:p></o:p></div></div><ul type="disc" style="margin-bottom: 0in; margin-top: 0in;"><li class="xmsolistparagraph" style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">Is this a bug introduced in the new version, or</span><o:p></o:p></li><li class="xmsolistparagraph" style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">With the new version, I should call this function at a different time?</span><o:p></o:p></li></ul><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">Best,</span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> </span><o:p></o:p></div></div><div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">-Ling</span></div></div></div></div></blockquote></div></div></div></div></div></div></div></div></blockquote></div><br></div></body></html>