[petsc-users] Is there a way to estimate total memory prior to solve

Barry Smith bsmith at petsc.dev
Thu Dec 10 19:17:12 CST 2020


  Randy

   This is a great question, I have made an issue based on it https://gitlab.com/petsc/petsc/-/issues/799 <https://gitlab.com/petsc/petsc/-/issues/799>

   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.

   "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.

   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.


  Barry


   



> On Dec 10, 2020, at 5:31 PM, Randall Mackie <rlmackie862 at gmail.com> wrote:
> 
> Dear PETSc users:
> 
> 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.
> 
> 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.
> For example, if these solves always use BCGS and ASM preconditioning with sub type ILU and 3 levels.
> 
> This is for runs on a PC so that too large a run won’t crash the PC.
> 
> 
> Thanks, Randy M

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20201210/086e05ba/attachment.html>


More information about the petsc-users mailing list