<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Randy<div class=""><br class=""></div><div class=""> This is a great question, I have made an issue based on it <a href="https://gitlab.com/petsc/petsc/-/issues/799" class="">https://gitlab.com/petsc/petsc/-/issues/799</a></div><div class=""><br class=""></div><div class=""> It is difficult, but not impossible to get some bounds on the memory required, but it would need to be done for each preconditioner and combination of preconditioners manually based on the algorithm and then coded up. The bounds would be a imprecise but still useful. More complicated situations such as PCFIELDSPLIT with complicated preconditioners inside it might require some partial computations to get the bounds.</div><div class=""><br class=""></div><div class=""> "BCGS and ASM preconditioning with sub type ILU and 3 levels." is a relatively easy case compared to others but still not trivial. BCGS has a fixed amount of work vectors. With ASM you would need to determine the number of dof for the overlapped subdomains and then ILU has its own uncertainty of how many values you get in the fill. But you have to partially construct the preconditioner to get the number.</div><div class=""><br class=""></div><div class=""> Perhaps an alternative would be to begin to construct the preconditioner with a fixed size limit and if the code realizes it will take too much memory it could back-off and cleanup the memory and return report it would require more memory than is available and then the code could try something else. PCFailedReasons WILL_RUN_OUT_OFF_MEMORY. But still a good amount of coding.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> </div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 10, 2020, at 5:31 PM, Randall Mackie <<a href="mailto:rlmackie862@gmail.com" class="">rlmackie862@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear PETSc users:<br class=""><br class="">While I can calculate the amount of memory any vector arrays I allocate inside my code (and probably get pretty close to any matrices), what I don’t know how to estimate is how much memory internal PETSc iterative solvers will take.<br class=""><br class="">Is there some way to get a reasonable estimate (in advance) of how much memory a PETSc solve will take given the size of the matrix and right hand side.<br class="">For example, if these solves always use BCGS and ASM preconditioning with sub type ILU and 3 levels.<br class=""><br class="">This is for runs on a PC so that too large a run won’t crash the PC.<br class=""><br class=""><br class="">Thanks, Randy M</div></div></blockquote></div><br class=""></div></body></html>