<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> 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 class=""><br class=""></div><div class=""> Perhaps this confused you?</div><div class=""><br class=""></div><div class=""> Note:<div class=""> This function can be called BEFORE PetscInitialize()</div><div class=""><br class=""></div><div class=""> 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 class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 28, 2022, at 7:34 PM, Sam Guo <<a href="mailto:sam.guo@cd-adapco.com" class="">sam.guo@cd-adapco.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Barry,<div class=""> 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 class=""><br class=""></div><div class="">Thanks,</div><div class="">Sam</div></div><br class=""><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" class="">bsmith@petsc.dev</a>> wrote:<br class=""></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;" class=""><div class=""><br class=""></div> You can call PetscOptionsSetValue(<span style="color:rgb(102,102,102)" class="">"-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 class=""><font color="#666666" class=""><span class=""><br class=""></span></font></div><div class=""><font color="#666666" class=""><span class=""> Barry</span></font></div><div class=""><font color="#666666" class=""><span class=""><br class=""></span></font><div class=""><font color="#666666" class=""><span class=""><br class=""></span></font><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Feb 28, 2022, at 2:22 PM, Sam Guo <<a href="mailto:sam.guo@cd-adapco.com" target="_blank" class="">sam.guo@cd-adapco.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Dear PETSc dev team,<div class=""> 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" class="">PetscOptionsString</a><span class="">(</span><font color="#666666" class="">"-mat_mumps_ooc_tmpdir"</font><span class="">, </span><font color="#666666" class="">"out of core directory"</font><span class="">, </span><font color="#666666" class="">"None"</font><span class="">, mumps->id.ooc_tmpdir, mumps->id.ooc_tmpdir, </span><font color="#4169E1" class="">sizeof</font><span class="">(mumps->id.ooc_tmpdir), NULL);). It seems there is such an API, am I correct? </span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">Thanks,<br class="">Sam</span></div></div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div>
</div></blockquote></div><br class=""></div></body></html>