<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">Varun,</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">I believe Jose is correct. You
 may verify it by running your code with option '-log_view', then check the number of calls to MatLUFactorSym. </span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">I guess I can add a flag in <span style="background-color:rgb(255, 255, 255);display:inline !important">PCSetUp()
 to check if <span style="background-color:rgb(255, 255, 255);display:inline !important">user has already called MatLUFactorSymbolic() and wants to skip it. Normally, users simply allocate sufficient memory in the symbolic factorization. Why do you want to
 check it?</span></span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, "system-ui", Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color:rgb(255, 255, 255);display:inline !important"><span style="background-color:rgb(255, 255, 255);display:inline !important">Hong</span></span></span></div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Jose E. Roman <jroman@dsic.upv.es><br>
<b>Sent:</b> Sunday, January 16, 2022 5:11 AM<br>
<b>To:</b> Varun Hiremath <varunhiremath@gmail.com><br>
<b>Cc:</b> Zhang, Hong <hzhang@mcs.anl.gov>; Peder Jørgensgaard Olesen via petsc-users <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] PETSc MUMPS interface</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Hong may give a better answer, but if you look at PCSetUp_LU()
<a href="https://petsc.org/main/src/ksp/pc/impls/factor/lu/lu.c.html#PCSetUp_LU">
https://petsc.org/main/src/ksp/pc/impls/factor/lu/lu.c.html#PCSetUp_LU</a> you will see that MatLUFactorSymbolic() is called unconditionally during the first PCSetUp(). Currently there is no way to check if the user has already called MatLUFactorSymbolic().<br>
<br>
Jose<br>
<br>
<br>
> El 16 ene 2022, a las 10:40, Varun Hiremath <varunhiremath@gmail.com> escribió:<br>
> <br>
> Hi Hong,<br>
> <br>
> Thank you, this is very helpful! <br>
> <br>
> Using this method I am able to get the memory estimates before the actual solve, however, I think my code may be causing the symbolic factorization to be run twice. Attached is my code where I am using SLEPc to compute eigenvalues, and I use MUMPS for factorization.
 I have commented above the code that computes the memory estimates, could you please check and tell me if this would cause the symbolic factor to be computed twice (a second time inside EPSSolve?), as I am seeing a slight increase in the overall computation
 time?<br>
> <br>
> Regards,<br>
> Varun<br>
> <br>
> On Wed, Jan 12, 2022 at 7:58 AM Zhang, Hong <hzhang@mcs.anl.gov> wrote:<br>
> PCFactorSetMatSolverType(pc,MATSOLVERMUMPS);<br>
>   PCFactorSetUpMatSolverType(pc); <br>
>   PCFactorGetMatrix(pc,&F);<br>
> <br>
>   MatLUFactorSymbolic(F,A,...)<br>
>   You must provide row and column permutations etc,    petsc/src/mat/tests/ex125.c may give you a clue on how to get these inputs.<br>
> <br>
> Hong<br>
> <br>
> <br>
> From: petsc-users <petsc-users-bounces@mcs.anl.gov> on behalf of Junchao Zhang <junchao.zhang@gmail.com><br>
> Sent: Wednesday, January 12, 2022 9:03 AM<br>
> To: Varun Hiremath <varunhiremath@gmail.com><br>
> Cc: Peder Jørgensgaard Olesen via petsc-users <petsc-users@mcs.anl.gov><br>
> Subject: Re: [petsc-users] PETSc MUMPS interface<br>
>  <br>
> Calling PCSetUp() before KSPSetUp()?<br>
> <br>
> --Junchao Zhang<br>
> <br>
> <br>
> On Wed, Jan 12, 2022 at 3:00 AM Varun Hiremath <varunhiremath@gmail.com> wrote:<br>
> Hi All,<br>
> <br>
> I want to collect MUMPS memory estimates based on the initial symbolic factorization analysis before the actual numerical factorization starts to check if the estimated memory requirements fit the available memory.<br>
> <br>
> I am following the steps from <a href="https://petsc.org/main/src/ksp/ksp/tutorials/ex52.c.html">
https://petsc.org/main/src/ksp/ksp/tutorials/ex52.c.html</a><br>
> <br>
>   PCFactorSetMatSolverType(pc,MATSOLVERMUMPS);<br>
>   PCFactorSetUpMatSolverType(pc); <br>
>   PCFactorGetMatrix(pc,&F);<br>
> <br>
>   KSPSetUp(ksp);<br>
>   MatMumpsGetInfog(F,...)<br>
> <br>
> But it appears KSPSetUp calls both symbolic and numerical factorization. So is there some other way to get these statistics before the actual factorization starts?<br>
> <br>
> Thanks,<br>
> Varun<br>
> <slepc_eps_mumps_test.cpp><br>
<br>
</div>
</span></font></div>
</body>
</html>