<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">When the preconditioned and non-preconditioner residual norms as so hugely different this usually indicates something is badly scaled or something "bad" is happening within the preconditioner. </div><div class=""><br class=""></div>0 KSP preconditioned resid norm 2.434689662304e-01 true resid norm 1.413757649058e+09 ||r(i)||/||b|| 1.442188243865e-04<div class="">....</div><div class=""><div class="">19 KSP preconditioned resid norm 4.505576228085e-15 true resid norm 1.810377537457e-02 ||r(i)||/||b|| 1.846784138157e-15</div><div class=""><br class=""></div><div class="">notice that at the end the true residual is not particularly small. Is your b really big and does the matrix have really large values in it?</div><div class=""><br class=""></div><div class="">What are the two runs? Left and right preconditioning with ibcgs or something else?</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 7, 2021, at 12:44 PM, Fischer, Greg A. <<a href="mailto:fischega@westinghouse.com" class="">fischega@westinghouse.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><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: normal; 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: 11pt; font-family: Calibri, sans-serif;" class="">Attached are outputs with these options.<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">What should I make of these?<span class="Apple-converted-space"> </span><o:p class=""></o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>Barry Smith <<a href="mailto:bsmith@petsc.dev" style="color: blue; text-decoration: underline;" class="">bsmith@petsc.dev</a>><span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, December 6, 2021 2:16 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Fischer, Greg A. via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" style="color: blue; text-decoration: underline;" class="">petsc-users@mcs.anl.gov</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Fischer, Greg A. <<a href="mailto:fischega@westinghouse.com" style="color: blue; text-decoration: underline;" class="">fischega@westinghouse.com</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [petsc-users] KSPBuildResidual and KSPType compatibility<o:p class=""></o:p></div></div></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="color: red;" class="">[External Email]</span><o:p class=""></o:p></div><div class=""><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">What do you get for <span style="font-size: 10.5pt; font-family: Menlo, serif;" class="">-ksp_type ibcgs -ksp_monitor -ksp_monitor_true_residual</span><o:p class=""></o:p></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt; font-family: Menlo, serif;" class="">with and without -ksp_pc_side right ?</span><o:p class=""></o:p></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class=""><br class=""><o:p class=""></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Dec 6, 2021, at 12:00 PM, Jed Brown <<a href="mailto:jed@jedbrown.org" style="color: blue; text-decoration: underline;" class="">jed@jedbrown.org</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">"Fischer, Greg A. via petsc-users" <<a href="mailto:petsc-users@mcs.anl.gov" style="color: blue; text-decoration: underline;" class="">petsc-users@mcs.anl.gov</a>> writes:<br class=""><br class=""><br class=""><o:p class=""></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hello petsc-users,<br class=""><br class="">I would like to check convergence against the infinity norm, so I defined my own convergence test routine with KSPSetConvergenceTest. (I understand that it may be computationally expensive.)<br class=""><br class="">I would like to do this with the "ibcgs" method. When I use KSPBuildResidual and calculate the NORM_2 against the output vector, I get a value that differs from the 2-norm that gets passed into the convergence test function. However, when I switch to the "gcr" method, the value I calculate matches the function input value.<o:p class=""></o:p></div></blockquote><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><br class="">IBCGS uses the preconditioned norm by default while GCR uses the unpreconditioned norm. You can use -ksp_norm_type unpreconditioned or KSPSetNormType() to make IBCGS use unpreconditioned.<br class=""><br class=""><br class=""><o:p class=""></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Is the KSPBuildResidual function only compatible with a subset of the KSPType methods? If I want to evaluate convergence against the infinity norm, do I need to set KSPSetInitialGuessNonzero and continually re-start the solver with a lower tolerance values until I get a satisfactory value of the infinity norm?<br class=""><br class="">Thanks,<br class="">Greg<br class=""><br class=""><br class="">________________________________<br class=""><br class="">This e-mail may contain proprietary information of the sending organization. Any unauthorized or improper disclosure, copying, distribution, or use of the contents of this e-mail and attached document(s) is prohibited. The information contained in this e-mail and attached document(s) is intended only for the personal and private use of the recipient(s) named above. If you have received this communication in error, please notify the sender immediately by email and delete the original e-mail and attached document(s).<o:p class=""></o:p></div></blockquote></div></div></blockquote></div><div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div></div></div></div><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><hr style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><font face="Arial" color="Gray" size="1" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">This e-mail may contain proprietary information of the sending organization. Any unauthorized or improper disclosure, copying, distribution, or use of the contents of this e-mail and attached document(s) is prohibited. The information contained in this e-mail and attached document(s) is intended only for the personal and private use of the recipient(s) named above. If you have received this communication in error, please notify the sender immediately by email and delete the original e-mail and attached document(s).<br class=""></font><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span><span id="cid:B49500BA-495B-4267-B217-F3A3C248657C"><ksp-monitor_output.txt></span><span id="cid:672A026F-2508-4DC3-B482-4D60064022A4"><ksp-monitor_output-pc_side_right.txt></span></div></blockquote></div><br class=""></div></div></body></html>