<div dir="ltr">Yes, "

This function can be called BEFORE PetscInitialize()" confused me. Thanks for the clarification. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 28, 2022 at 4:38 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div><br></div>  You should be able to call PetscOptionsSetValue() anytime you want, as I said between different uses of MUMPS you can call it to use different directories.<div><br></div><div>  Perhaps this confused you?</div><div><br></div><div>     Note:<div>   This function can be called BEFORE PetscInitialize()</div><div><br></div><div>  It is one of the very few functions that can be called before PetscInitialize() but it does not NEED to be called before PetscInitialize().</div><div><br></div><div>  Barry</div><div><br></div><div><br><blockquote type="cite"><div>On Feb 28, 2022, at 7:34 PM, Sam Guo <<a href="mailto:sam.guo@cd-adapco.com" target="_blank">sam.guo@cd-adapco.com</a>> wrote:</div><br><div><div dir="ltr">Hi Barry,<div>   I can only call  PetscOptionsSetValue before PetscInitialize() but I call PetscInitialize only once at the beginning of my program. I want to change MUMPS OOC_TMPDIR dynamically on the fly.</div><div><br></div><div>Thanks,</div><div>Sam</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 28, 2022 at 1:34 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div>  You can call PetscOptionsSetValue(<span style="color:rgb(102,102,102)">"-mat_mumps_ooc_tmpdir","directory"); anytime before the KSP/PCSetUp() is called. If you have multiple uses of MUMPs solvers you can call this between each use so that a different directory is used for different MUMPS usage.</span><div><font color="#666666"><span><br></span></font></div><div><font color="#666666"><span>  Barry</span></font></div><div><font color="#666666"><span><br></span></font><div><font color="#666666"><span><br></span></font><div><br><blockquote type="cite"><div>On Feb 28, 2022, at 2:22 PM, Sam Guo <<a href="mailto:sam.guo@cd-adapco.com" target="_blank">sam.guo@cd-adapco.com</a>> wrote:</div><br><div><div dir="ltr">Dear PETSc dev team,<div>   I would like to set MUMPS OOC_TMPDIR programmatically on fly (instead of statically using <a href="https://petsc.org/main/docs/manualpages/Sys/PetscOptionsString.html#PetscOptionsString" target="_blank">PetscOptionsString</a><span>(</span><font color="#666666">"-mat_mumps_ooc_tmpdir"</font><span>, </span><font color="#666666">"out of core directory"</font><span>, </span><font color="#666666">"None"</font><span>, mumps->id.ooc_tmpdir, mumps->id.ooc_tmpdir, </span><font color="#4169E1">sizeof</font><span>(mumps->id.ooc_tmpdir), NULL);). It seems there is such an API, am I correct? </span></div><div><span><br></span></div><div><span>Thanks,<br>Sam</span></div></div>
</div></blockquote></div><br></div></div></div></blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>